当前位置: 首页>>代码示例>>Python>>正文


Python Gdk.threads_leave方法代码示例

本文整理汇总了Python中gi.repository.Gdk.threads_leave方法的典型用法代码示例。如果您正苦于以下问题:Python Gdk.threads_leave方法的具体用法?Python Gdk.threads_leave怎么用?Python Gdk.threads_leave使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gi.repository.Gdk的用法示例。


在下文中一共展示了Gdk.threads_leave方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: set_key

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import threads_leave [as 别名]
def set_key(self, key, modifiers: list=None):
        if modifiers is None:
            modifiers = []
        Gdk.threads_enter()
        if key in self.KEY_MAP:
            key = self.KEY_MAP[key]
        self._setKeyLabel(key)
        self.key = key
        self.controlButton.set_active(Key.CONTROL in modifiers)
        self.altButton.set_active(Key.ALT in modifiers)
        self.shiftButton.set_active(Key.SHIFT in modifiers)
        self.superButton.set_active(Key.SUPER in modifiers)
        self.hyperButton.set_active(Key.HYPER in modifiers)
        self.metaButton.set_active(Key.META in modifiers)

        self.setButton.set_sensitive(True)
        Gdk.threads_leave() 
开发者ID:autokey,项目名称:autokey,代码行数:19,代码来源:dialogs.py

示例2: get_selection

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import threads_leave [as 别名]
def get_selection(self):
        """
        Read text from the X selection
        
        Usage: C{clipboard.get_selection()}

        @return: text contents of the mouse selection
        @rtype: C{str}
        @raise Exception: if no text was found in the selection
        """
        Gdk.threads_enter()
        text = self.selection.wait_for_text()
        Gdk.threads_leave()
        if text is not None:
            return text
        else:
            raise Exception("No text found in X selection") 
开发者ID:autokey,项目名称:autokey,代码行数:19,代码来源:scripting.py

示例3: flush_events

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import threads_leave [as 别名]
def flush_events(self):
        Gdk.threads_enter()
        while Gtk.events_pending():
            Gtk.main_iteration(True)
        Gdk.flush()
        Gdk.threads_leave() 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:8,代码来源:backend_gtk3.py

示例4: flush_events

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import threads_leave [as 别名]
def flush_events(self):
        # docstring inherited
        Gdk.threads_enter()
        while Gtk.events_pending():
            Gtk.main_iteration()
        Gdk.flush()
        Gdk.threads_leave() 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:9,代码来源:backend_gtk3.py

示例5: main

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import threads_leave [as 别名]
def main():
    if not check_root_access():
        sys.exit("\nOnly root can run this script :(\n")

    win = AppWindow()
    win.show_all()

    Gdk.threads_enter()
    GObject.threads_init()
    Gtk.main()
    Gdk.threads_leave() 
开发者ID:Mati365,项目名称:pyWinUSB,代码行数:13,代码来源:__main__.py

示例6: _on_finished

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import threads_leave [as 别名]
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") 
开发者ID:gerardpuig,项目名称:ubuntu-cleaner,代码行数:12,代码来源:package.py

示例7: post_ui

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import threads_leave [as 别名]
def post_ui(func):
    def func_wrapper(*args, **kwargs):
        Gdk.threads_enter()
        func(*args, **kwargs)
        Gdk.threads_leave()

    return func_wrapper 
开发者ID:gerardpuig,项目名称:ubuntu-cleaner,代码行数:9,代码来源:gtk.py

示例8: show_notify

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import threads_leave [as 别名]
def show_notify(self, message, iconName):
        Gdk.threads_enter()
        n = Notify.Notification.new("AutoKey", message, iconName)
        n.set_urgency(Notify.Urgency.LOW)
        n.show()
        Gdk.threads_leave() 
开发者ID:autokey,项目名称:autokey,代码行数:8,代码来源:notifier.py

示例9: config_modified

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import threads_leave [as 别名]
def config_modified(self):
        if not self.__warnedOfChanges:
            Gdk.threads_enter()
            msg = _("Changes made in other programs will not be displayed until you\
close and reopen the AutoKey window.\nThis message is only shown once per session.")
            dlg = Gtk.MessageDialog(self.ui, type=Gtk.MessageType.QUESTION, buttons=Gtk.ButtonsType.OK,
                                   message_format= _("Configuration has been changed on disk."))
            dlg.format_secondary_text(msg)

            dlg.run()
            dlg.destroy()
            Gdk.threads_leave()
            self.__warnedOfChanges = True 
开发者ID:autokey,项目名称:autokey,代码行数:15,代码来源:configwindow.py

示例10: cancel_grab

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import threads_leave [as 别名]
def cancel_grab(self):
        Gdk.threads_enter()
        self.setButton.set_sensitive(True)
        self._setKeyLabel(self.key)
        Gdk.threads_leave() 
开发者ID:autokey,项目名称:autokey,代码行数:7,代码来源:dialogs.py

示例11: receive_window_info

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import threads_leave [as 别名]
def receive_window_info(self, info):
        Gdk.threads_enter()
        dlg = DetectDialog(self.ui)
        dlg.populate(info)
        response = dlg.run()

        if response == Gtk.ResponseType.OK:
            self.triggerRegexEntry.set_text(dlg.get_choice())

        self.detectButton.set_sensitive(True)
        Gdk.threads_leave() 
开发者ID:autokey,项目名称:autokey,代码行数:13,代码来源:dialogs.py

示例12: remove_from_desktop

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import threads_leave [as 别名]
def remove_from_desktop(self):
        Gdk.threads_enter()
        self.popdown()
        Gdk.threads_leave() 
开发者ID:autokey,项目名称:autokey,代码行数:6,代码来源:popupmenu.py

示例13: text

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import threads_leave [as 别名]
def text(self):
            Gdk.threads_enter()
            text = self._clipboard.wait_for_text()
            Gdk.threads_leave()
            return text 
开发者ID:autokey,项目名称:autokey,代码行数:7,代码来源:interface.py

示例14: selection

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import threads_leave [as 别名]
def selection(self):
            Gdk.threads_enter()
            text = self._selection.wait_for_text()
            Gdk.threads_leave()
            return text 
开发者ID:autokey,项目名称:autokey,代码行数:7,代码来源:interface.py

示例15: show_configure_async

# 需要导入模块: from gi.repository import Gdk [as 别名]
# 或者: from gi.repository.Gdk import threads_leave [as 别名]
def show_configure_async(self):
        Gdk.threads_enter()
        self.show_configure()
        Gdk.threads_leave() 
开发者ID:autokey,项目名称:autokey,代码行数:6,代码来源:gtkapp.py


注:本文中的gi.repository.Gdk.threads_leave方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。