Re: Resizing events




On Jan 30, 2006, at 11:55 PM, Faqeer ALI wrote:

 Sir  Can u just give me some idea about resizing.

This list is for discussion of development of the gtk+ library. Your question is appropriate for gtk-app-devel-list gnome org, which is for discussion of development using gtk+.

Also, please do not start a new thread by responding to an old thread.


i want to resize my custom control as its parent window gets resized. my custom control consists of buttons arranged on gtkfix.
please tell the events that i have to catch, and resizing functions.

By using GtkFixed, you are bypassing pretty much all of the automatic resizing logic in gtk+. Since you use the term "control" instead of "widget", i presume you're coming from a Win32 background; Win32 primarily uses fixed layout, so reasonably that would be your first thought. However, gtk+ primarily uses "packing" schemes. The tutorial describes this: http://www.gtk.org/tutorial/c374.html#SEC- THEORYOFPACKINGBOXES

Boxes and tables will allocate space to their children on resizes, by emitting the size-allocate signal. Widgets may request a certain size by responding to the size-request signal.

Please read the admonitions about the use of GtkFixed in the description section of its page in the API reference: http:// developer.gnome.org/doc/API/2.0/gtk/GtkFixed.html#desc

If you insist on attaching your custom buttons to a GtkFixed, then you will have to connect to the GtkFixed's size-allocate signal, and in that handler recalculate all of your widgets' positions and call gtk_fixed_move() to relocate them, and gtk_widget_size_allocate() to resize them. That is, you'll be reinventing the wheel.



--
I think it worked on the Wiley Coyote model of project management - if
at any point you looked down and realised what you were doing was
impossible then you'd instantly fail.
  -- Simon Wistow




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