jop
jop

Reputation: 121

draw to gtk window

I have a gtk drawing area embedded in a gtk frame, in a gtk window. I have a callback function responding to "draw" signal that draws something to drawing area initially. Now I have another function that responds to the "click" signal emitted by a few buttons. Each time a button is clicked, i would like to draw something additionally to the drawing area. How can this be accomplished? I have tried making a new cairo surface with the drawing area being the target, but nothing drawn by the cairo stroke is showing up. thanks!

Upvotes: 1

Views: 1267

Answers (1)

asveikau
asveikau

Reputation: 40226

It's been a while since I've done anything with Gtk+, but I believe what you want to do is call gtk_widget_queue_draw_area() inside the "click" handler, then do the drawing in response to the "draw" signal that will eventually be raised.

Upvotes: 3

Related Questions