【发布时间】:2023-03-10 06:30:01
【问题描述】:
我正在使用 C++ 和 gtkmm 编写应用程序。我在里面做了一个 Gtk 堆栈。现在我想在 stackswitcher 的按钮上添加图像而不是文本。我认为这是可能的,因为类似的东西是在 gtk3-demo 中制作的:
不幸的是,该示例是使用 UI 文件制作的,我想在没有 UI 设计器的情况下进行。现在我找到了this answer:
但这对我不是很有帮助。答案是使用stack.child_set_property,但我检查了 gtkmm 文档中的堆栈,而 C++ 没有这样的东西。最接近的匹配是Gtk::Stack::child_property_name,并带有注释它返回A ChildPropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes。我想这可能是我正在寻找的东西,但由于缺乏示例,我不知道如何使用它。
总结一下:有人能告诉我如何将图像设置为 StackSwitcher 的标签吗?
【问题讨论】: