[gtkada] Hide before Show?

Stephen Leake stephen_leake at acm.org
Tue Jan 20 02:23:59 CET 2004


"Marc A. Criley" <m.criley at earthlink.net> writes:

> So in my app I called Gtk_New for the dialog window, then called Hide on the
> Label widget, then did a Show_All.  The label was visible in the window.  

Hmm. Here is the comment for Show_All from gtk-widget.ads:

   --  Show Widget and all its children recursively.

So what did you expect?

Apparently you had not done a "show". The default state after Gtk_New
is hidden, so you need to call "show" on all the widgets that needed
to be shown. I guess that's why you did Show_All?

> It was only after moving the Hide invocation after the Show_All call that it
> became invisible.

Yep, that's what the documentation says will work.

> Like I said, this works, but it seems inelegant.

Well, try using "show" only where you need it, rather than "show_all".

What would be more elegant, in your opinion?

-- 
-- Stephe




More information about the gtkada mailing list