Delivered-To: lablgtk at yquem.inria.fr Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: Re: [Lablgtk] Strange firing of Configure and Expose events withEventBox Date: Fri, 2 May 2008 00:15:50 +0200 Message-ID: <5EFD4D7AC6265F4D9D3A849CEA92191901415C at LAXA.intra.cea.fr> Thread-Topic: [Lablgtk] Strange firing of Configure and Expose events withEventBox Thread-Index: AcirU/VucjB36elISNyOWZgd5m5fiwAhPRFW References: <20080501012417.59a99d33.pdgroves at gmail.com> From: "MONATE Benjamin 205998" To: "Peter Groves" , Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C8ABD9.932E9AA5" Content-Length: 7520 This is a multi-part message in MIME format. ------_=_NextPart_001_01C8ABD9.932E9AA5 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, According to the attached example, expose does fire on an eventbox at = startup and maximization. Can you confirm this with your Gtk version ? If you do confirm, what is your exact situation ? The event has probably = been caught by other widgets in your GUI. Hope this helps, Benjamin Monate -------- Message d'origine-------- De: lablgtk-bounces@yquem.inria.fr de la part de Peter Groves Date: jeu. 01/05/2008 08:24 =C0: lablgtk@yquem.inria.fr Objet : [Lablgtk] Strange firing of Configure and Expose events = withEventBox =20 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.=20 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).=20 /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 =20 _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk ------_=_NextPart_001_01C8ABD9.932E9AA5 Content-Type: application/octet-stream; name="eventbox.ml" Content-Transfer-Encoding: base64 Content-Description: eventbox.ml Content-Disposition: attachment; filename="eventbox.ml" KCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKQooKiAgICBMYWJsZ3RrIC0gRXhhbXBsZXMgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopCigqICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KikKKCogICAgVGhlcmUgaXMgbm8gc3BlY2lmaWMgbGljZW5zaW5nIHBvbGljeSwgYnV0IHlvdSBt YXkgZnJlZWx5ICAgICAgICAgICAqKQooKiAgICB0YWtlIGluc3BpcmF0aW9uIGZyb20gdGhlIGNv ZGUsIGFuZCBjb3B5IHBhcnRzIG9mIGl0IGluIHlvdXIgICAgICAgICopCigqICAgIGFwcGxpY2F0 aW9uLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKikKKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAqKQooKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopCgooKiAkSWQ6IGV2 ZW50cy5tbCAxMzQ3IDIwMDctMDYtMjAgMDc6NDA6MzRaIGd1ZXNkb24gJCAqKQoKbGV0IHN0cmlu Z19vZl9ldmVudCB4ID0gCiBtYXRjaCBHZGtFdmVudC5nZXRfdHlwZSB4IHdpdGggCiAgfCBgTk9U SElORyAtPiAibm90aGluZyIKICB8IGBERUxFVEUgLT4gImRlbGV0ZSIKICB8IGBERVNUUk9ZIC0+ ICJkZXN0cm95IgogIHwgYEVYUE9TRSAtPiAiZXhwb3NlIgogIHwgYE1PVElPTl9OT1RJRlkgLT4g Im1vdGlvbi1ub3RpZnkiCiAgfCBgQlVUVE9OX1BSRVNTIC0+ICJidXR0b24tcHJlc3MiCiAgfCBg VFdPX0JVVFRPTl9QUkVTUyAtPiAiMiBidXR0b24tcHJlc3MiCiAgfCBgVEhSRUVfQlVUVE9OX1BS RVNTIC0+ICIzIGJ1dHRvbi1wcmVzcyIKICB8IGBCVVRUT05fUkVMRUFTRSAtPiAiYnV0dG9uLXJl bGVhc2UiCiAgfCBgS0VZX1BSRVNTIC0+ICJrZXktcHJlc3MiCiAgfCBgS0VZX1JFTEVBU0UgIC0+ ICJrZXktcmVsZWFzZSIKICB8IGBFTlRFUl9OT1RJRlkgIC0+ICJlbnRlci1ub3RmaXkiCiAgfCBg TEVBVkVfTk9USUZZIC0+ICJsZWF2ZS1ub3RpZnkiCiAgfCBgRk9DVVNfQ0hBTkdFICAtPiAiZm9j dXMtY2hhbmdlIgogIHwg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6R01haW4ucXVpdCA7CgogIGxldCBlYiA9IEdCaW4uZXZlbnRf Ym94IH5wYWNraW5nOncjYWRkICgpIGluCiAgZWIjZXZlbnQjYWRkIFtgQUxMX0VWRU5UU107CiAg ZWIjZXZlbnQjY29ubmVjdCNhbnkgCiAgIChmdW4geCAtPiAKCXByZXJyX3N0cmluZyAiYmVmb3Jl ICI7IAoJcHJlcnJfZW5kbGluZSAoc3RyaW5nX29mX2V2ZW50IHgpOwoJZmFsc2UpOwogIGViI2V2 ZW50I2Nvbm5lY3QjYWZ0ZXIjYW55IAogICAoZnVuIHggLT4gCglwcmVycl9zdHJpbmcgImFmdGVy ICI7IAoJcHJlcnJfZW5kbGluZSAoc3RyaW5nX29mX2V2ZW50IHgpOwoJZmFsc2UpOwogIGViI2V2 ZW50I2Nvbm5lY3QjZXhwb3NlCiAgIChmdW4geCAtPiAKCXByZXJyX3N0cmluZyAiQkVGT1JFIEVY UE9TRSAiOyAKCXByZXJyX2VuZGxpbmUgKHN0cmluZ19vZl9ldmVudCB4KTsKCWZhbHNlKTsgIAog IGViI2V2ZW50I2Nvbm5lY3QjYWZ0ZXIjZXhwb3NlIAogICAoZnVuIHggLT4KCXByZXJyX3N0cmlu ZyAiQUZURVIgRVhQT1NFICI7IAoJcHJlcnJfZW5kbGluZSAoc3RyaW5nX29mX2V2ZW50IHgpOwoJ ZmFsc2UpOwoKICB3I3Nob3cgKCk7CiAgR01haW4ubWFpbiAoKQo= ------_=_NextPart_001_01C8ABD9.932E9AA5 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk ------_=_NextPart_001_01C8ABD9.932E9AA5--