Jump to content
  • 0
llnathanll

Example Code: Background Does Not Maximize

Question

I'm getting some strange behavior with the Elementary example code.  The program compiles and runs, but when I click to maximize the window, the background doesn't maximize along with the rest of the window.  Here's the code:

//Compile with: gcc -o bg_example_01 bg_example_01.c -g `pkg-config --cflags --libs elementary`

#include <Elementary.h>

EAPI_MAIN int elm_main(int argc, char **argv)
{
   Evas_Object *win;
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
   win = elm_win_util_standard_add("bg-plain", "Bg Plain");
   elm_win_autodel_set(win, EINA_TRUE);
   evas_object_resize(win, 320, 320);
   evas_object_show(win);
   elm_run(); 
   return 0;
}
ELM_MAIN()

This is the most basic example, but I get the same behavior with the other examples as well.

 

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0

What about if you use a standard window object instead of creating a basic window and manually adding a background to it? 

Share this post


Link to post
Share on other sites
  • 0

That's what I'm doing - as far as I can tell.

win = elm_win_util_standard_add(const char *name, const char *title);

Evas_Object* elm_win_util_standard_add ( const char *  name,     const char *  title    )    

Adds a window object with standard setup.

Parameters: 

name - The name of the window

title - The title for the window

This creates a window like elm_win_add() but also puts in a standard background with elm_bg_add(), as well as setting the window title to title. 

The window type created is of type ELM_WIN_BASIC, with NULL as the parent widget.

Returns: The created object, or NULL on failure

Share this post


Link to post
Share on other sites
  • 0

Ah - missed that. I rarely work in C, so skimming the code doesn't always translate well for me.

 

What version of Elementary are you using and what E/Elementary theme do you have in use? A standard window should have an auto resizing background by default.

Share this post


Link to post
Share on other sites
  • 0

I have E19, Bodhi 3.0.0 - the default theme is 'DARK'.  I've made a few changes to font sizes, but that's about it.

The strange thing is that the background *does* resize when I just grab the corner of the window and resize it.  It's only when I click the max button that it stays the same.  Also, this only happens with the example code.  Apps like efl-volume-control or file-manager don't have this problem.

Share this post


Link to post
Share on other sites
  • 0

This sounds like a bug in elementary then. Might be worth filing a ticket with the upstream folks about it.

Share this post


Link to post
Share on other sites
  • 0
conr2d added a subscriber: conr2d.Via Web · Wed, Mar 25, 11:35 PM

Bodhi linux seems to use outdated version of libraries. (Key binding fix which I wrote long time ago still isn't applied to the latest bodhi.)
You should check bodhi's efl or elementary version. On my machine (with latest efl & elementary), the issue that you report doesn't occur.

 

 

This from the the ticket I posted on maniphest.  I'm not sure how to find the versions of efl and elementary - if I look them up in synaptic they both have a version number of 20150220-1.  My version of bodhi is 3.0.0 with enlightenment 0.19.3.

Share this post


Link to post
Share on other sites
  • 0

Thanks Jeff - That sounds scary, so I'll hold off for now, but thank you for the suggestion.  I'm going to let the elementary guys look at it for a bit longer to see if there is another plan of attack.  Someone on the thread suggested I try a different WM so I was also thinking of trying another bodhi or enlightenment installation on a different machine to see if it makes a difference.

 

I know this is not a mission-critical issue, because my system is working great on bodhi, but I really think the pathway for new developers to get started on enlightenment/efl should be well documented and working.  I'll be happy to contribute as much as I can. 

Share this post


Link to post
Share on other sites
  • 0

I tried running the same examples on a virtual machine with a fresh installation of bodhi 3.0.0 - no issues.  Has my current system somehow become corrupted?  At this point I'm thinking I'll re-install bodhi.  Is it best to wipe it clean and start fresh?

Share this post


Link to post
Share on other sites
  • 0

I tried running the same examples on a virtual machine with a fresh installation of bodhi 3.0.0 - no issues.  Has my current system somehow become corrupted?  At this point I'm thinking I'll re-install bodhi.  Is it best to wipe it clean and start fresh?

 

If you are thinking about wiping out your system anyways - take a second and upgrade to the packages in the gitcha branch. Software often has regressions (and E/EFL release tars are notoriously bad) so there is a very real chance that the most update to date version of elementary in the Bodhi main repo right now has a bug in it.

 

Really wish someone would fix the theme change segfault issue so we could upgrade elementary versions in the main repo

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×