本文整理汇总了Python中main_window.MainWindow.run方法的典型用法代码示例。如果您正苦于以下问题:Python MainWindow.run方法的具体用法?Python MainWindow.run怎么用?Python MainWindow.run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类main_window.MainWindow
的用法示例。
在下文中一共展示了MainWindow.run方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Client
# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import run [as 别名]
import gettext
import gtk.glade
import locale
import os
import sys
from client import Client
from main_window import MainWindow
import settings
import util
_ = gettext.gettext
if __name__ == "__main__":
locale.setlocale(locale.LC_ALL, "")
gettext.bindtextdomain(settings.gettext_domain, settings.localedir)
gettext.bind_textdomain_codeset(settings.gettext_domain, "utf-8")
gettext.textdomain(settings.gettext_domain)
gtk.glade.bindtextdomain(settings.gettext_domain, settings.localedir)
gtk.glade.textdomain(settings.gettext_domain)
try:
cl = Client()
except OSError, e:
util.modal_error_dialog(None, _("Error running " "system-config-audit-server: %s") % e.strerror)
sys.exit(1)
w = MainWindow()
w.run(cl)
示例2: int
# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import run [as 别名]
cr.rectangle(0, 0, int(event.area.width), int(event.area.height))
cr.fill()
w = event.area.width
h = event.area.height
scale = state.get_scale()
print "scale:", scale
grid = state.get_grid()
cr.set_source_rgb(0, 0, 0)
cr.set_line_width(0.1)
for y in range(0, h, scale*grid):
cr.move_to(0, y)
cr.line_to(w, y)
for x in range(0, w, scale*grid):
cr.move_to(x, 0)
cr.line_to(x, h)
cr.stroke()
cr_gdk.set_source_surface(cr_surf)
cr_gdk.paint()
mw = MainWindow(defaults.d_width, defaults.d_height, Screen)
# GTK mumbo-jumbo to show the widget in a window and quit when it's closed
if __name__ == "__main__":
mw.run()