[Glade-devel] Glade and Custom widgets



On Tue, 2004-08-31 at 16:45, Todd Fisher wrote:
Damon Chaplin wrote:

If your widget is something like a GtkTreeView, where the width & height
is set by the application, you set the Width/Height on the Common tab to
a reasonable *minimum* width/height, and then set the dialog's default
width/height properties to a reasonable default size for the entire
dialog. That way the user can resize the dialog as appropriate.
 

Right so my widget is like a GtkTreeView; and the problem is when I set 
a specific width/height in the
common tab in glade my widget does not recieve a size_request with the 
values from the common tab.  Perhaps,
a better question is how are the width/height values from the common tab 
propagated to the custom widget?  I
was under the impression a custom widget would recieve a size_request.  
But, when I trace my widget it does not
recieve a size_request with the values in the commn tab.  So, for now 
i've resorted to using the parameters passed
to the widget constructor, int1 and int2.

It should be handled automatically, by the container your widget is in.
libglade will set the width_request/height_request properties of the
widget. When the container calculates the positions & sizes of the
children it calls gtk_widget_size_request() to get the preferred sizes
of each widget, and that uses the width_request/height_request values if
they have been set.

What container is your widget in? Note that it may allocate more space
to the widget according to how it has been configured.

Damon





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]