绘制区域并公开事件
我有一个包含绘图区域的对话。如果对话被放大或缩小或隐藏和暴露,我希望重新绘制绘图区域的内容,这对于绘图区域来说是正常和自然的。为此,我
bool on_expose_event (GdkEventExpose *event);
在类中创建了一个方法。但是此事件的存在会阻止对话框中的所有其他小部件正确绘制;想必当它们被暴露时它也会被调用。如何创建一个函数来仅刷新绘图区域,而让所有其他小部件自行处理?
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 create a function to refresh the drawing area only, and leave all the other widgets to take care of themselves?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您确实应该对 Gtk::DrawingArea 类进行子类化,并从该类实现 on_expose_event() 函数。
You should really sub-class the Gtk::DrawingArea class and implement the on_expose_event() function from that class.