Gtk 绘图区上的 Gtk 按钮 [英] Gtk buttons over a Gtk drawing area
本文介绍了Gtk 绘图区上的 Gtk 按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在与 Gtk 合作开发一些应用程序.我必须在地图上放一些按钮.我正在 GtkDrawingarea 上绘制地图,但我无法在其上放置按钮.有什么建议吗?谢谢
i' working with Gtk developing some app. I must put some buttons over a map. I'm drawing the map on a GtkDrawingarea, but i'm not able to put buttons over it. Any suggestion? Thanks
推荐答案
建议:
- 将绘图区域和按钮放在
GtkFixed
容器中.可能不是最好的解决方案,因为GtkFixed
无法控制 z 顺序(除了添加小部件的顺序?) - 不要使用
GtkDrawingArea
,而是使用可以包含其他小部件的画布小部件,例如GooCanvas
.
- Put both the drawing area and the buttons inside a
GtkFixed
container. Probably not the best solution, becauseGtkFixed
has no way of controlling the z-ordering (other than the order in which you add the widgets to it?) - Instead of using
GtkDrawingArea
, use a canvas widget that can include other widgets, such asGooCanvas
.
这篇关于Gtk 绘图区上的 Gtk 按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文