Re: implementing a container??






If you want to do anything at all complex, generally implementing a new container is right; if you use a GtkFixed, it's going to be
inefficient, and it's pretty much impossible to get positioning
that depends on the size of the children widgets right.

Implementing a container isn't that hard ... the only virtual methods
you need to implement are, I think, size_request(), size_allocate(), forall(), and remove().
(child_type() and add() are theoretically needed as well, but as your
widget is just being used in your framework, I doubt you'll need them.)
Are there any good examples to look at?
Also is there anything you need to do to prevent the the main window from being locked ot a minimum size?
I noticed that when a re-positioned a child widget with

gtk_fixed_move or gtk_widget_set_size_request() that the minimum width/height of the main window would be affected, preventing the user from resizing it less than the child current pos.

When implementing the methods for the container how do you move the widget (other than the above mentioned gtk_fixed_move or gtk_widget_set_size_request )?

Thanks

Jim





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