From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,be5526549df2be5c X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!feeder.erje.net!feeder.news-service.com!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: gtkada and redrawing Date: Tue, 23 Aug 2011 19:49:05 +0200 Organization: cbb software GmbH Message-ID: References: <42c567ad-1afe-4632-9b89-ae02d6055313@h4g2000vbw.googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: XaLNJh0tAwivsQnokF6M3A.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news2.google.com comp.lang.ada:21676 Date: 2011-08-23T19:49:05+02:00 List-Id: 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