Re: [gtk-list] How to correctly show() a widget (Gtk--)




On Mon, 11 Oct 1999, RNG wrote:
> 
> class DA : public DrawingArea
> 	{
> 	Gtk_Window	w;
> 	Gtk_Menu	m;
> 
> 	void show_impl ();
> 	void hide_impl (); 
> 	}
> 
> void DA::hide_impl ()
> {
>         w.hide ();
> }
> 
> void DA::show_impl ()
> {
> 	this->realize ();
> }
> 

OK, there are some conceptual issues you need to be clearer about.

You are implementing a widget here; the show_impl() and hide_impl()
have certain responsiblities. My book at
http://developer.gnome.org/doc/GGAD might help you out - see chapter 3,
and then chapters 9, 10, and the one about writing widgets.

Anyway, there are lots of concepts so I won't rewrite the book in this
mail. But some thoughts:

 - show and realize are distinct concepts. realizing in the show method
   is nonsensical.

 - it doesn't make any sense to have a Gtk_Window as a member of 
   a drawing area widget; and the drawing area's hide method should 
   affect the drawing area, not the window, in any case

 - the default show_impl and hide_impl for drawing area should work fine,
   I would not override them

That should get you started...

Havoc




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