From: Olivier Andrieu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16234.9043.451350.678876 at karryall.dnsalias.org> Date: Thu, 18 Sep 2003 23:27:47 +0200 To: Richard Jones Cc: lablgtk at kaba.or.jp Subject: Re: unmap event never sent to widgets? In-Reply-To: <20030905162656.GA18479 at redhat.com> References: <20030905162656.GA18479 at redhat.com> Hi again, Richard Jones [Friday 5 September 2003] : > Below is a much shortened version of the large Gtk program I'm working > on. There are two problems with this program: > > (a) I can never get Gtk to send an "unmap" event to my custom > widget. I need this, because my widget needs to unregister itself from > something when it is removed from the screen. Hum, I'm not sure you're connecting the right signal. I think realize/unrealize would work better. Unfortunately, unrealize is not wrapped (it's a single line to add though). > (b) In the particular program below, clicking the "red" or "green" > buttons once works, but subsequently no widget appears. The widget > appears to have died in some way. Why? It's the X window that changes. Removing a widget unrealizes it. Re-adding it creates a new window. So you have to replace : val drawable = lazy (new GDraw.drawable da#misc#window) method private drawable = Lazy.force drawable by : method private drawable = new GDraw.drawable da#misc#window (or smthg smarter) -- Olivier