.comment-link {margin-left:.6em;}

David @ Tokyo

Perspective from Japan on whaling and whale meat, a spot of gourmet news, and monthly updates of whale meat stockpile statistics

10/16/2005

 

E17: Learnings (2) Restricting module size

Continuing my notes on e17 functions learnt before I forget them...

Issue: You want to restrict the size of a module on your e17 background canvas, because it will just look stupid and ugly at any other size.

E17's gadget manager enables modules to be moved and resized around your desktop. The module doesn't need to worry about this at all, other than to tell the gadman about itself when created.

In your module's .edc file you can define the maximum and minimum width and height for the module's interface. Say you have a group of parts called "main" like yay:

group
{
name: "main";
min: 10 10;
max: 256 256;
... (definition of the parts of the interface) ...
}

Here we are describing the interface's name and it's min and max dimensions, but that alone doesn't do anything useful. To actually get e17's gadget manager to honour these size restrictions you'll need to (gasp!) tell the gadman about it, in addition to the other setup.

The e_gadman_client_{min | max}_size_set functions are the ones you need to call to do this, and to extract the min and max values out of your edje (compiled from your .edc) you use the edje_object_size_{min | max}_get functions:

Evas_Coord w, h;

...

edje_object_size_min_get(face->edje_object, &w, &h);
e_gadman_client_min_size_set(face->gmc, w, h);
edje_object_size_max_get(face->edje_object, &w, &h);
e_gadman_client_max_size_set(face->gmc, w, h);

Now when you try to resize your module it'll be kept within the sane range of sizes that you defined for it.

Labels:


Comments: Post a Comment



<< Home

Archives

June 2004   July 2004   August 2004   September 2004   October 2004   November 2004   December 2004   January 2005   March 2005   April 2005   May 2005   June 2005   July 2005   August 2005   September 2005   October 2005   November 2005   December 2005   January 2006   February 2006   March 2006   April 2006   May 2006   June 2006   July 2006   August 2006   September 2006   October 2006   November 2006   December 2006   January 2007   February 2007   March 2007   April 2007   May 2007   June 2007   July 2007   August 2007   September 2007   October 2007   November 2007   December 2007   January 2008   February 2008   April 2008   May 2008   June 2008   July 2008   August 2008   September 2008   October 2008   November 2008   December 2008   January 2009   February 2009   March 2009   April 2009   May 2009   June 2009   July 2009   August 2009   September 2009   October 2009   November 2009   January 2010   February 2010   April 2010   May 2010   June 2010   July 2010   August 2010   September 2010   February 2011   March 2011   May 2013   June 2013  

This page is powered by Blogger. Isn't yours?