Re: the right way to draw in a drawingarea



Paul Davis wrote:

Paul Davis wrote:

Paul Davis wrote:

On Wed, 2005-10-12 at 00:17 -0500, the other Paul Davis wrote:
The complexities abound. Insert apropriate quote here. I can't explain the gtk drawing system because I don't entirely understand it. I'm glad hings are working.



there is really nothing mysterious is you remember one simple rule:

    draw on your widget's window ONLY in an expose event handler.

the point of queue_draw() is to request that the GTK event loop
schedules an "artificial" expose event at an appropriate time.
otherwise, you don't have an expose event available to make whatever
change it is that you want to make. drawing on widgets' windows from
anywhere else is wrong, and will lead to unpredictable results.

--p (the other other Paul Davis)



Wow. I was getting really confused for a second wondering how it is that I'm writing emails I don't remember.

Anyway, I agree exactly with what Other Paul is saying. I just don't know why it's so. Other than its the way things were intended.

I'll take a look at adding to an example.

Paul


_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list

And its early.  Forgot to send that to the list.

I'm looking at adding some drawing code to the rulers example unless someone has a beter example in mind. Question is, has anyone noticed the funky behavior in that example when the window is resized? I think adding a handler for the size allocate handler and resettiing the size of the rulers should do the trick.

Paul






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