Python 2.7 我如何设置Glade中GTKlingButton的标签?
我知道如何在Python或C中实现这一点,但我无法在Glade中实现这一点:Python 2.7 我如何设置Glade中GTKlingButton的标签?,python-2.7,gtk3,glade,msys2,gtkbuilder,Python 2.7,Gtk3,Glade,Msys2,Gtkbuilder,我知道如何在Python或C中实现这一点,但我无法在Glade中实现这一点: self.reclamaTaAiciLinkButton =\ self.get_object("reclamaTaAiciLinkButton") self.reclamaTaAiciLinkButton.set_label("RECLAMA TA AICI") 这是一个屏幕截图,其中包含Glade中GTKlingButton类型的所有可用特定属性: self.reclamaTaAiciLinkButton
self.reclamaTaAiciLinkButton =\
self.get_object("reclamaTaAiciLinkButton")
self.reclamaTaAiciLinkButton.set_label("RECLAMA TA AICI")
这是一个屏幕截图,其中包含Glade中GTKlingButton类型的所有可用特定属性:
self.reclamaTaAiciLinkButton =\
self.get_object("reclamaTaAiciLinkButton")
self.reclamaTaAiciLinkButton.set_label("RECLAMA TA AICI")
如果可以使用“动作名称”字段,请给我一个例子。如果可以使用文本编辑器编辑Glade.ui文件,那总比什么都没有好。我在Glade项目的官方问题跟踪程序中发现了这一点
在用文本编辑器打开的.ui文件中,您可能有一个类似于此的片段,其中声明并定义了GTKlingButton:
<object class="GtkLinkButton" id="reclamaTaAiciLinkButton">
<property name="label" translatable="yes">button</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="uri">https://www.patreon.com/SilviuBogan</property>
<style>
<class name="reclamaTaAiciLinkButton"/>
</style>
</object>
按钮
真的
真的
真的
没有一个
https://www.patreon.com/SilviuBogan
重要的是:
<property name="label" translatable="yes">button</property>
按钮
如果在Glade中关闭.ui文件,在文本编辑器(最好是XML文件编辑器)中打开.ui文件,然后将此
元素的内容从“button”替换为其他内容,然后保存文件并在Glade中重新打开,您会看到在Glade设计器中,新标签是可见的。如果启动加载此.ui文件的程序,您将看到更改正在运行