comboboxcalendar.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:google-tasks-indicator 作者: atareao 项目源码 文件源码
def on_button(self, button):
        win_position = self._window.get_position()
        x_win = win_position[0] + self.entry.get_allocation().x + 3
        y_win = win_position[1] + self.entry.get_allocation().y + 2*self.entry.get_allocation().height + 3
        self.dialog = Gtk.Dialog()#None, None, Gtk.DialogFlags.MODAL)
        self.dialog.set_modal(True)
        self.dialog.set_decorated(False)
        self.dialog.move(x_win, y_win)

        self.calendar = Gtk.Calendar()
        #
        self.calendar.select_month(self.date.month-1,self.date.year)
        self.calendar.select_day(self.date.day)
        #
        self.calendar.show()
        self.dialog.vbox.pack_start(self.calendar, 0, 0, 0)
        self.dialog.connect('focus-out-event',self.on_focus_out)
        self.calendar.connect('day-selected', self.on_select)
        self.calendar.connect('month-changed', self.on_month_select)
        #
        self.dialog.run()
        value = self.calendar.get_date()
        value = datetime.date(value[0],value[1]+1,value[2])
        self.set_date(value)
        self.dialog.destroy()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号