Re: Strange firing of Configure and Expose events withEventBox
"MONATE Benjamin 205998" <[email protected]>
| Newsgroups | gmane.comp.lang.ocaml.lib.gtk |
|---|---|
| Message-ID | <[email protected]> |
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: [email protected] de la part de Peter Groves Date: jeu. 01/05/2008 08:24 À: [email protected] Objet : [Lablgtk] Strange firing of Configure and Expose events withEventBox 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 [email protected] http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk _______________________________________________ Lablgtk mailing list [email protected] http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk
eventbox.ml
(application/octet-stream, 2.5 KB) - not displayed