How to properly handle events on DrawingArea

Hi all,

I have a DrawingArea which has to react on keypress, mouse moves an mouse clicks. Each event will have a graphical effect on the widget.

So far, the mouse move is synced with the rendering -- meaning, what I expected to be graphically present is drawn in DrawingArea.

Keypresses however is kind of not working. Assuming graphicsXYZ should be drawn when a keypress happens, the DrawingArea doesn't display it. I first have to mouse-over on the DrawingArea where the mousemove handler finally renders graphicsXYZ.

Second, how do force render DrawingArea... when I click a Button which is programmed to draw graphicsABC on a DrawingArea, same case as above, it won't render graphicsABC when I don't mouse-over on it.

Third, how do I remove the flickering? When I mousemove on DrawingArea (as if drawing a line or something), it flickers like crazy.

Btw, all the drawing I do is done with Cairo Context via get_window()->create_cairo_context().


Mj Mendoza IV,
Developer, KonsolScript

Developer, Clash

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]