comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: gtkada and redrawing
Date: Tue, 23 Aug 2011 19:49:05 +0200
Date: 2011-08-23T19:49:05+02:00	[thread overview]
Message-ID: <pb4tbe8zv6o7.pf1h9wcwrg8d$.dlg@40tude.net> (raw)
In-Reply-To: 42c567ad-1afe-4632-9b89-ae02d6055313@h4g2000vbw.googlegroups.com

On Tue, 23 Aug 2011 07:12:31 -0700 (PDT), tonyg wrote:

> I have a toggle button and a Gentry in a Hbox. However I only want the
> Gentry to appear when the toggle button is toggled and I want the
> toggle button to fill the hbox when it is untoggled. If I use hide
> then the toggle button stays the same size!

Remove it from the container (Hbox) using Remove (see Gtk.Container). Add
it back when needed. Do not forget to use Pack_Start/End for the button
with Fill and Expand set to true.

If you don't want to create the entry anew each time you need it, you can
Ref it. But do not forget to call Unref when Hbox or its container finally
disappear. There are many ways to do this. You can connect to Gtk_Box's
"destroy", you can derive from it your own type and place a hard reference
to the entry into it upon Initialize etc.

P.S. Actually it is always a good idea to derive new widgets from Gtk
containers. It looks as an overkill, but in a long run it pays off.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2011-08-23 17:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-23 14:12 gtkada and redrawing tonyg
2011-08-23 17:49 ` Dmitry A. Kazakov [this message]
2011-08-23 19:03   ` tonyg
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox