本文整理汇总了Python中scal3.ui_gtk.mywidgets.multi_spin.date.DateButton.set_sensitive方法的典型用法代码示例。如果您正苦于以下问题:Python DateButton.set_sensitive方法的具体用法?Python DateButton.set_sensitive怎么用?Python DateButton.set_sensitive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scal3.ui_gtk.mywidgets.multi_spin.date.DateButton
的用法示例。
在下文中一共展示了DateButton.set_sensitive方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AdjusterDialog
# 需要导入模块: from scal3.ui_gtk.mywidgets.multi_spin.date import DateButton [as 别名]
# 或者: from scal3.ui_gtk.mywidgets.multi_spin.date.DateButton import set_sensitive [as 别名]
class AdjusterDialog(gtk.Dialog):
xpad = 15
def __init__(self, **kwargs):
gtk.Dialog.__init__(self, **kwargs)
self.set_title(_("Adjust System Date & Time")) ##????????
self.set_icon(self.render_icon(gtk.STOCK_PREFERENCES, gtk.IconSize.BUTTON))
#########
self.buttonCancel = self.add_button(gtk.STOCK_CANCEL, 0)
# self.buttonCancel.connect('clicked', lambda w: sys.exit(0))
self.buttonSet = self.add_button(_("Set System Time"), 1)
# self.buttonSet.connect('clicked', self.setSysTimeClicked)
#########
hbox = gtk.HBox()
self.label_cur = gtk.Label(_("Current:"))
pack(hbox, self.label_cur)
pack(self.vbox, hbox)
#########
hbox = gtk.HBox()
self.radioMan = gtk.RadioButton(None, _("Set _Manully:"), True)
self.radioMan.connect("clicked", self.radioManClicked)
pack(hbox, self.radioMan)
pack(self.vbox, hbox)
######
vb = gtk.VBox()
sg = gtk.SizeGroup(gtk.SizeGroupMode.HORIZONTAL)
###
hbox = gtk.HBox()
##
l = gtk.Label("")
l.set_property("width-request", self.xpad)
pack(hbox, l)
##
self.ckeckbEditTime = gtk.CheckButton(_("Edit Time"))
self.editTime = False
self.ckeckbEditTime.connect("clicked", self.ckeckbEditTimeClicked)
pack(hbox, self.ckeckbEditTime)
sg.add_widget(self.ckeckbEditTime)
self.timeInput = TimeButton() ## ??????? options
pack(hbox, self.timeInput)
pack(vb, hbox)
###
hbox = gtk.HBox()
##
l = gtk.Label("")
l.set_property("width-request", self.xpad)
pack(hbox, l)
##
self.ckeckbEditDate = gtk.CheckButton(_("Edit Date"))
self.editDate = False
self.ckeckbEditDate.connect("clicked", self.ckeckbEditDateClicked)
pack(hbox, self.ckeckbEditDate)
sg.add_widget(self.ckeckbEditDate)
self.dateInput = DateButton() ## ??????? options
pack(hbox, self.dateInput)
pack(vb, hbox)
###
pack(self.vbox, vb, 0, 0, 10) # ?????
self.vboxMan = vb
######
hbox = gtk.HBox()
self.radioNtp = gtk.RadioButton(group=self.radioMan, label=_("Set from NTP:"))
self.radioNtp.connect("clicked", self.radioNtpClicked)
pack(hbox, self.radioNtp)
pack(self.vbox, hbox)
###
hbox = gtk.HBox()
##
l = gtk.Label("")
l.set_property("width-request", self.xpad)
pack(hbox, l)
##
pack(hbox, gtk.Label(_("Server:") + " "))
combo = gtk.ComboBoxText.new_with_entry()
combo.get_child().connect("changed", self.updateSetButtonSensitive)
pack(hbox, combo, 1, 1)
self.ntpServerEntry = combo.get_child()
for s in ui.ntpServers:
combo.append_text(s)
combo.set_active(0)
self.hboxNtp = hbox
pack(self.vbox, hbox)
######
self.radioManClicked()
# self.radioNtpClicked()
self.ckeckbEditTimeClicked()
self.ckeckbEditDateClicked()
######
self.updateTimes()
self.vbox.show_all()
def radioManClicked(self, radio=None):
if self.radioMan.get_active():
self.vboxMan.set_sensitive(True)
self.hboxNtp.set_sensitive(False)
else:
self.vboxMan.set_sensitive(False)
self.hboxNtp.set_sensitive(True)
self.updateSetButtonSensitive()
#.........这里部分代码省略.........