Python gi.repository.Gdk 模块,threads_leave() 实例源码

我们从Python开源项目中,提取了以下13个代码示例,用于说明如何使用gi.repository.Gdk.threads_leave()

项目:KTV    作者:RainMark    | 项目源码 | 文件源码
def play_list_move(self):
        Gdk.threads_enter()
        path, column = self.play_view.get_cursor()
        Gdk.threads_leave()
        if None == path:
            return None

        store = self.play_store
        Gdk.threads_enter()
        it = store.get_iter(path)
        Gdk.threads_leave()
        logging.debug("Selected row: " % (store[it][0:]))
        Gdk.threads_enter()
        sid = store[it][2]
        Gdk.threads_leave()
        retval = self.req.play_list_move(sid)
        logging.debug(retval)
        if 'Success' == retval:
            self.play_list_update()
项目:KTV    作者:RainMark    | 项目源码 | 文件源码
def play_list_remove(self):
        Gdk.threads_enter()
        path, column = self.play_view.get_cursor()
        Gdk.threads_leave()
        if None == path:
            return None

        store = self.play_store
        Gdk.threads_enter()
        it = store.get_iter(path)
        Gdk.threads_leave()
        logging.debug("Selected row: " % (store[it][0:]))
        Gdk.threads_enter()
        sid = store[it][2]
        Gdk.threads_leave()
        retval = self.req.play_list_remove(sid)
        logging.debug(retval)
        if 'Success' == retval:
            self.play_list_update()
项目:Ebook-Viewer    作者:michaldaniel    | 项目源码 | 文件源码
def on_quit(self, action, param):
        Gdk.threads_leave()
        Gtk.main_quit()
        self.quit()
项目:ubuntu-cleaner    作者:gerardpuig    | 项目源码 | 文件源码
def _on_finished(self, transaction, status, close, show_error):
        if close:
            self.hide()
            if status == EXIT_FAILED and show_error:
                Gdk.threads_enter()
                err_dia = AptErrorDialog(self._transaction.error, self)
                err_dia.run()
                err_dia.hide()
                Gdk.threads_leave()
        self.emit("finished")
项目:ubuntu-cleaner    作者:gerardpuig    | 项目源码 | 文件源码
def post_ui(func):
    def func_wrapper(*args, **kwargs):
        Gdk.threads_enter()
        func(*args, **kwargs)
        Gdk.threads_leave()

    return func_wrapper
项目:dell-recovery    作者:dell    | 项目源码 | 文件源码
def set_text(self, text, fraction):
        Gdk.threads_enter()
        self.progressbar.set_text(text)
        if fraction is None:
            self.pulse = True
        else:
            self.pulse = False
            self.fraction = fraction
        self.show_all()
        Gdk.threads_leave()
项目:dell-recovery    作者:dell    | 项目源码 | 文件源码
def terminate(self):
        self._running = False
        Gdk.threads_enter()
        self._prompt.destroy()
        Gdk.threads_leave()
        Gtk.main_quit();
项目:dell-recovery    作者:dell    | 项目源码 | 文件源码
def question(self, message, text):
        self.hide()
        Gdk.threads_enter()
        dialog = Gtk.MessageDialog(None, 0, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, message)
        dialog.format_secondary_text(text)
        response = dialog.run()
        dialog.destroy()
        Gdk.threads_leave()
        if response == Gtk.ResponseType.YES:
            return True
        else:
            return False
项目:dell-recovery    作者:dell    | 项目源码 | 文件源码
def hide(self):
        Gdk.threads_enter()
        self._prompt.hide()
        Gdk.threads_leave()
项目:KTV    作者:RainMark    | 项目源码 | 文件源码
def play_list_first_row_id(self):
        store = self.play_store
        Gdk.threads_enter()
        it = store.get_iter_first()
        Gdk.threads_leave()
        if None == it:
            return None

        return store[it][2]
项目:KTV    作者:RainMark    | 项目源码 | 文件源码
def __3list_insert_row__(self, store, data):
        Gdk.threads_enter()
        if None != data:
            store.clear()
            for idx, meta in enumerate(data):
                store.append([idx + 1, meta[1], meta[0]])
        Gdk.threads_leave()
项目:x-mario-center    作者:fossasia    | 项目源码 | 文件源码
def on_sync_message(self, bus, message):
        print("sync: %s" % bus, message)
        if message is None or message.structure is None:
            return
        message_name = message.structure.get_name()
        if message_name == "prepare-xwindow-id":
            imagesink = message.src
            imagesink.set_property("force-aspect-ratio", True)
            Gdk.threads_enter()
            # FIXME: this is the way to do it, *but* get_xid() is not
            #        exported in the GIR
            xid = self.player.movie_window.get_window().get_xid()
            imagesink.set_xwindow_id(xid)
            Gdk.threads_leave()
项目:x-mario-center    作者:fossasia    | 项目源码 | 文件源码
def on_sync_message(self, bus, message):
        print("sync: %s" % bus, message)
        if message is None or message.structure is None:
            return
        message_name = message.structure.get_name()
        if message_name == "prepare-xwindow-id":
            imagesink = message.src
            imagesink.set_property("force-aspect-ratio", True)
            Gdk.threads_enter()
            # FIXME: this is the way to do it, *but* get_xid() is not
            #        exported in the GIR
            xid = self.player.movie_window.get_window().get_xid()
            imagesink.set_xwindow_id(xid)
            Gdk.threads_leave()