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