【发布时间】:2018-12-13 19:41:18
【问题描述】:
GTK ComboBox 具有样式属性“箭头大小”(link)。我想将其设置为 0。
不幸的是,下一个 sn-p 不起作用。未报告错误消息并且箭头显示为默认大小 (=15)
import pygtk
pygtk.require('2.0')
import gtk
def the_dialog():
dialog = gtk.Dialog("Title", None, gtk.DIALOG_MODAL)
liststore = gtk.ListStore(str)
for a in ["one","two","three"]:
liststore.append([a])
rc_str = """
style 'no_arrow_style' {
GtkComboBox::arrow-size = 0
}
widget_class '*' style 'no_arrow_style'
"""
gtk.rc_parse_string(rc_str)
combo_box = gtk.ComboBox()
cell = gtk.CellRendererText()
combo_box.pack_start(cell)
combo_box.add_attribute(cell, 'text', 0)
combo_box.set_model(liststore)
combo_box.get_cells()
dialog.vbox.pack_start(combo_box)
dialog.show_all()
dialog.run()
the_dialog()
带有默认“v”形箭头的组合框:
【问题讨论】: