本文整理汇总了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
示例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()
示例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()
示例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()
示例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()
示例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)
示例7: main
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def main(self, argv):
self.app.run(argv)
示例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()
示例9: main
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def main():
import sys
app = Login()
Gtk.main()
示例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()
示例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()
示例12: main
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import main [as 别名]
def main():
import sys
app = GUI()
Gtk.main()
示例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()
示例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()
示例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)