NewFolderDialog.py 文件源码

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

项目:bcloud 作者: wangYanJava 项目源码 文件源码
def __init__(self, parent, app, path):
        super().__init__(_('New Folder'), app.window, Gtk.DialogFlags.MODAL,
                         (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
                         Gtk.STOCK_OK, Gtk.ResponseType.OK))
        self.set_default_response(Gtk.ResponseType.OK)
        self.connect('show', self.on_show)
        self.set_default_size(550, 200)

        self.app = app
        self.path = path

        self.set_border_width(10)
        box = self.get_content_area()

        folder_name = _('New Folder')
        abspath = os.path.join(path, folder_name)
        self.entry = Gtk.Entry()
        self.entry.set_text(abspath)
        self.entry.connect('changed', self.on_entry_changed)
        self.entry.connect('activate', self.on_entry_activated)
        box.pack_start(self.entry, True, True, 10)

        self.infobar = Gtk.InfoBar()
        self.infobar.timestamp = 0
        self.infobar.set_message_type(Gtk.MessageType.ERROR)
        box.pack_start(self.infobar, False, False, 0)
        self.info_label= Gtk.Label()
        self.infobar.get_content_area().pack_start(self.info_label, False,
                                                   False, 0)

        box.show_all()
        self.infobar.hide()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号