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


Python Gtk.main方法代码示例

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


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

示例1: ask

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def ask(self, callback, preview_callback=None):
        with warnings.catch_warnings():
            warnings.filterwarnings("ignore", module="asktext")
            warnings.filterwarnings("ignore", category=DeprecationWarning)
            self.callback = callback
            self._preview_callback = preview_callback

            # create first window
            with SuppressStream():  # suppress GTK Warings printed directly to stderr in C++
                window = self.create_window()
            window.set_default_size(500, 500)
            # Until commit 802d295e46877fd58842b61dbea4276372a2505d we called own normalize_ui_row_heights here with
            # bad hide/show/hide hack, see issue #114
            window.show()
            self._window = window
            self._window.set_focus(self._source_view)

            # main loop
            Gtk.main()
            return self._gui_config 
开发者ID:textext,项目名称:textext,代码行数:22,代码来源:asktext.py

示例2: main

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def main():
    """Run the module from the command line."""
    if len(sys.argv) <= 1 or len(sys.argv) > 5:
        print(_("Usage: {} text [title] [markup] [icon_name]").format(
            os.path.basename(__file__)), file=sys.stderr)
        exit(1)
    text = sys.argv[1]
    if len(sys.argv) > 2 and sys.argv[2]:
        title = sys.argv[2]
    else:
        title = "Epoptes"
    if len(sys.argv) > 3 and sys.argv[3]:
        markup = sys.argv[3].lower() == "true"
    else:
        markup = True
    if len(sys.argv) > 4:
        icon_name = sys.argv[4]
    else:
        icon_name = "dialog-information"

    window = MessageWindow(text, title, markup, icon_name)
    window.connect("destroy", Gtk.main_quit)
    window.show_all()
    Gtk.main() 
开发者ID:epoptes,项目名称:epoptes,代码行数:26,代码来源:message.py

示例3: run

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def run(self):
        """Run the event loop until Gtk.main_quit is called.

        May be called multiple times to recursively start it again. This
        is useful for implementing asynchronous-like dialogs in code that
        is otherwise not asynchronous, for example modal dialogs.
        """
        if self.is_running():
            with self._recurselock:
                self._recursive += 1
            try:
                Gtk.main()
            finally:
                with self._recurselock:
                    self._recursive -= 1
        else:
            super().run() 
开发者ID:pychess,项目名称:pychess,代码行数:19,代码来源:gtk.py

示例4: main

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def main():
    """TODO: Docstring for main.
    :returns: TODO

    """
    APP_ID = 'es.atareao.daily_wallpaper'

    activated = activate_if_already_running(APP_ID)
    if activated:
        sys.exit(0)

    dww = DWW()
    listen_for_activation(APP_ID, dww)
    Gtk.main() 
开发者ID:atareao,项目名称:daily-wallpaper,代码行数:16,代码来源:main.py

示例5: run

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def run(self):
        self.win.show_all()
        # Thread running the long process
        if self.activity_mode:
            wt = WorkerThread(self.work, self)
            wt.start()
        Gtk.main() 
开发者ID:KanoComputing,项目名称:kano-toolset,代码行数:9,代码来源:kano_progress.py

示例6: get_window_content

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def get_window_content(self):
        """Fill main window with content"""
        self.show_workdir()
        self.load_dircontent()
        self.find_sd()
        self.discspace_info()
        self.obj("act_othloc").set_text(_("(none)"))
        self.obj("import_other").set_sensitive(False)

        # set Kdenlive support menu item inactive when disabled
        self.obj("kd_supp_switch").set_state(cli.kd_supp) 
开发者ID:encarsia,项目名称:gpt,代码行数:13,代码来源:modules.py

示例7: main

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def main(self, argv):
        self.app.run(argv) 
开发者ID:encarsia,项目名称:gpt,代码行数:4,代码来源:modules.py

示例8: standalone

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def standalone(self):
        window = app.obj("tl_calc_win")
        window.connect("delete-event", Gtk.main_quit)
        app.builder.connect_signals(Handler())
        window.show_all()
        Gtk.main() 
开发者ID:encarsia,项目名称:gpt,代码行数:8,代码来源:modules.py

示例9: main

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def main():
    import sys
    app = Login()
    Gtk.main() 
开发者ID:yancharkin,项目名称:games_nebula,代码行数:6,代码来源:pygogauth.py

示例10: main

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def main():
    import sys
    app = GUI(sys.argv[1], sys.argv[2])
    Gtk.main() 
开发者ID:yancharkin,项目名称:games_nebula,代码行数:6,代码来源:launcher_wine.py

示例11: main

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def main():
    import sys
    app = GUI(sys.argv[1])
    Gtk.main() 
开发者ID:yancharkin,项目名称:games_nebula,代码行数:6,代码来源:launcher_dosbox.py

示例12: main

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def main():
    import sys
    app = GUI()
    Gtk.main() 
开发者ID:yancharkin,项目名称:games_nebula,代码行数:6,代码来源:winetricks_cache_backup.py

示例13: main

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def main():
    import sys
    app = GUI(sys.argv[1], sys.argv[2], sys.argv[3])
    Gtk.main() 
开发者ID:yancharkin,项目名称:games_nebula,代码行数:6,代码来源:settings_dosbox.py

示例14: main

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def main():
    import sys
    app = GUI(sys.argv[1], sys.argv[2])

    Gtk.main() 
开发者ID:yancharkin,项目名称:games_nebula,代码行数:7,代码来源:dialogs.py

示例15: recv_it

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def recv_it(self):
        data = []
        while True:
            char = self.client.recv(1)
            if not char:  # socket close signal
                self.is_connected = False
                self.readlist.remove(self.client)
                print(rep_time(), 'main disconnected')
                return ''

            elif char == b'\n':
                return b''.join(data).decode()

            else:
                data.append(char) 
开发者ID:Dragon2fly,项目名称:vpngate-with-proxy,代码行数:17,代码来源:vpn_indicator.py


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