Re: Strange firing of Configure and Expose events withEventBox

Peter Groves <[email protected]>
Newsgroups gmane.comp.lang.ocaml.lib.gtk
Message-ID <[email protected]>
Just as an update: I got rid of the drawing_area inside of the
event_box configuration and most of the problems have gone away. I am
getting expose and size_allocation events when I expect them.

There are still some issues with the display, but for now I should be
ok.

Thanks,
Peter

On Thu, 1 May 2008 19:03:05 -0500
Peter Groves <[email protected]> wrote:

> Thanks for the response.
> 
> The example did not run (no window was displayed). I have attached the
> error messages output to standard err.
> 
> I am using the version of lablgtk in ubuntu 7.10 Gutsy Gibbons.
> The debian package calls it version 2.6.0-7. 
> 
> If upgrading is the simplest solution, what version is currently
> considered most stable?  Preferably one that works with ocaml 3.09, as
> I try to stay in sync with the Debian/Ubuntu packages as much as
> possible.
> 
> As for specifics, I currently have only a drawing_area in the
> eventbox. I was originally going to use the events of the
> drawing_area but I now need to start capturing events of other
> widgets (as soon as I get this problem sorted out). At one point I
> tried putting the drawing area in a Frame and then the Frame in the
> eventbox, but it didn't seem to make any difference (I saw the frame,
> but still no events).
> 
> If the drawing area might be interfering by capturing the events
> before they get to the eventbox, I could switch to drawing on a
> pixmap and displaying that, I think. I'm not sure if that will be
> difficult, so I'm hoping someone can give me some optimism that it
> might solve my problem before I undertake the change.
> 
> Peter 
> 
> 
> 
> On Fri, 2 May 2008 00:15:50 +0200
> "MONATE Benjamin 205998" <[email protected]> wrote:
> 
> > 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
> > 
> > 
> >
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.