1
votes

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!

1

1 Answers

3
votes

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.