當前位置: 首頁>>代碼示例>>Python>>正文


Python DateButton.set_sensitive方法代碼示例

本文整理匯總了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)
#.........這裏部分代碼省略.........
開發者ID:ErfanBagheri,項目名稱:starcal,代碼行數:103,代碼來源:adjust_dtime.py


注:本文中的scal2.ui_gtk.mywidgets.multi_spin_button.DateButton.set_sensitive方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。