开发者

Drawing areas and expose events

开发者 https://www.devze.com 2023-01-14 20:19 出处:网络
I have a dialogue which contains a drawing area. I wish to redraw the contents of the drawing area if the dialogue is enlarged or shrunk or buried and exposed, as is normal and natural with drawing ar

I have a dialogue which contains a drawing area. I wish to redraw the contents of the drawing area if the dialogue is enlarged or shrunk or buried and exposed, as is normal and natural with drawing areas. To this end, I created a method

bool on_expose_event (GdkEventExpose *event);

in the class. But the presence of this event stops all the other widgets on the dialogue from being drawn correctly; presumably it is also being invoked when they are exposed. How do I开发者_StackOverflow中文版 create a function to refresh the drawing area only, and leave all the other widgets to take care of themselves?


You should really sub-class the Gtk::DrawingArea class and implement the on_expose_event() function from that class.

0

精彩评论

暂无评论...
验证码 换一张
取 消