[gtkada] Hide before Show?

Marc A. Criley m.criley at earthlink.net
Tue Jan 20 14:48:10 CET 2004


Stephen Leake writes:

> 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?
>
> Well, try using "show" only where you need it, rather than "show_all".

Well, I hardly want to invoke Show 50 times when I can do a single Show_All
on the containing window that Glade has generated for me!

>
> What would be more elegant, in your opinion?

----------
procedure Set_Visible
  (Widget             : access Gtk_Widget_Record;
   Visible            :        Boolean := True);

Controls the displayability of the widget.

If the widget has not yet been mapped to the screen, setting Visible to
False prevents it from being displayed by a call to Show or Show_All (which
also prevents its children from being displayed); if Visible is true it will
be displayed as normal by a call to Show or Show_All.

If the widget is being displayed, setting Visible to False is equivalent to
invoking Hide and subsequently prevents the widget from being displayed
until Set_Visible has been invoked with Visible set to True; calling this
routine while the widget is displayed and with Visible set to True has no
effect.
----------

Obviously this is a Gtk, and not GtkAda, issue.

Marc A. Criley
McKae Technologies






More information about the gtkada mailing list