本文整理汇总了Python中higwidgets.higboxes.HIGHBox.set_sensitive方法的典型用法代码示例。如果您正苦于以下问题:Python HIGHBox.set_sensitive方法的具体用法?Python HIGHBox.set_sensitive怎么用?Python HIGHBox.set_sensitive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类higwidgets.higboxes.HIGHBox
的用法示例。
在下文中一共展示了HIGHBox.set_sensitive方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ChoosePage
# 需要导入模块: from higwidgets.higboxes import HIGHBox [as 别名]
# 或者: from higwidgets.higboxes.HIGHBox import set_sensitive [as 别名]
class ChoosePage(HIGVBox):
def __init__(self):
HIGVBox.__init__(self)
self.set_spacing(12)
table = HIGTable()
self.hbox = HIGHBox()
self.description = HIGEntryLabel(_("""You wish to create a new profile,\
or just want to quickly create a command and run it once?"""))
self.profile_radio = gtk.RadioButton(None, _('Profile'))
self.command_radio = gtk.RadioButton(self.profile_radio, _('Command'))
self.command_radio.connect('toggled', self.enable_target)
self.profile_radio.connect('toggled', self.disable_target)
self.target_label = HIGEntryLabel(_("Target"))
self.target_entry = gtk.Entry()
self.set_completion()
self.hbox._pack_noexpand_nofill(hig_box_space_holder())
self.hbox._pack_noexpand_nofill(self.target_label)
self.hbox._pack_expand_fill(self.target_entry)
self.bar = ForwardBar()
self._pack_noexpand_nofill(self.description)
self._pack_expand_fill(table)
self._pack_noexpand_nofill(self.bar)
table.attach(self.profile_radio,0,1,0,1, yoptions=0)
table.attach(self.command_radio,0,1,1,2, yoptions=0)
table.attach(self.hbox,0,1,2,3, yoptions=0)
self.disable_target()
def set_completion(self):
self.completion = gtk.EntryCompletion()
self.target_list = gtk.ListStore(str)
self.completion.set_model(self.target_list)
self.completion.set_text_column(0)
self.target_entry.set_completion(self.completion)
for target in target_list.get_target_list()[:15]:
self.target_list.append([target.replace('\n','')])
def add_new_target(self, target):
target_list.add_target(target)
def enable_target(self, widget=None):
self.hbox.set_sensitive(True)
def disable_target(self, widget=None):
self.hbox.set_sensitive(False)