Delivered-To: lablgtk at yquem.inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject:message-id:x-mailer:mime-version:content-type:content-transfer-encoding; bh=KyUMQnpiH1wc3cRr6bbyOVM78ysANUK1hz9pFk1iq1Q=; b=j++mgG9QGlbP/2rOso4hdxacZpEhM1VkvOgWldksP2Ks2PqyAEg2YLJr10itBT6axERcDBMG3UkepTSFWzsNO/v9coVzpK01sCpc3PyPMpxhG/LyBy/LcPXfzKxjrgg7Y43pHF2yn5Bqq/v9HzhW0W5h/vilyJHtVq2XlbIsdf8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:x-mailer:mime-version:content-type:content-transfer-encoding; b=Gjsjp+SXY4ddyT8BIGRr7R/bdJyLH9oVblOtkWIznw2JV2BvYkD214YSjBmYd3x9HzpJBXUzbNOx8fyJJMlx2Frh8h4Y8sIM4fQDno6+6I3Ll/mQ+esr5yJWDi0bnyTo1K/2tEX7csGobg3a6DWHobsqaqUpEq49uL3+UVaE3R0= Date: Thu, 1 May 2008 01:24:17 -0500 From: Peter Groves To: lablgtk at yquem.inria.fr Message-Id: <20080501012417.59a99d33.pdgroves at gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Lablgtk] Strange firing of Configure and Expose events with EventBox Content-Type: text/plain; charset=US-ASCII Content-Length: 2695 Hi, I'm having trouble getting a custom widget to respond properly to gtk events. I'm using an EventBox to handle all of the signals, but it doesn't fire when I expect it to. As an attempt at brevity, here is the somewhat complex situation as a list: 1) At this point, I have turned on all events just to make sure that isn't the issue with: eventBox#event#add [`ALL_EVENTS]; 2) Mouse events (MOTION_NOTIFY, LEAVE_NOTIFY, ENTER_NOTIFY) work as expected. My application draws to the screen in response to mouse events, and the correct image appears when I move the mouse around. I'm accessing these like this: eventBox#event#connect#enter_notify enterCallback eventBox#event#connect#leave_notify exitCallback eventBox#event#connect#motion_notify motionCallback 3) My callback to expose: eventBox#event#connect#expose exposeCallback does not fire when the window is displayed at program startup, nor when the window is minimized and maximized. 4) The expose callback does fire when the window is resized. 5) The actual drawing I do in response to exposure events seems to complete when the window is resized, but the widget remains blank (or perhaps it is immediately cleared). This is the same drawing function I call in response to mouse events, so I know the drawing code is more or less correct. (I start up the app, it's blank. I move the mouse over it, it draws the image and my cursor tracking animation. I resize the window, it is again blank.) 6) I never was able to receive configure events when the window is resized (or initialized) using: eventBox#event#connect#after#configure resizeCallback 7) Because of (6) i switched to size_allocation events: eventBox#misc#connect#size_allocate resizeCallback which fire when expected at startup and when the window is resized, but are not sufficient because I cannot draw in response to them at program startup (it seems to be called before the screen resources are allocated - i can therefore initialize my image buffers and such but cannot display them without an Expose event, which never comes). /end list I would be ok if I could get expose events (or some other event) to fire at the normal times of, well, the window being "exposed". Also the issue in (5) above is a show stopper. I would also be interested, though, in any insights as to why I would be unable to receive Configure events when the window is resized. I should say that I am porting this application from ruby-gtk, and what I'm attempting to do worked there. Peter http://petergroves.com _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk