本文整理汇总了Python中GUI.Window类的典型用法代码示例。如果您正苦于以下问题:Python Window类的具体用法?Python Window怎么用?Python Window使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Window类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
def test():
cursor = StdCursors.empty_cursor()
win = Window(title = "No Cursor", width = 500, height = 400)
view = TestDrawing(position = (20, 20), size = (300, 200),
cursor = cursor)
win.add(view)
win.show()
示例2: __init__
def __init__(self):
columns = [Column(*t) for t in [
("Day", lambda t: t.date.day),
("i?", invoiceableSymbol),
("p?", paymentSymbol),
("Amount", lambda t: float(t.amount)),
("Memo", lambda t: str(t.memo)),
]]
self.transactions_tbl = Table(columns=columns, scrolling='hv',
multi_select=True)
columns = [
Column("Month", lambda (y, m): date(y, m, 1).strftime("%Y %b")),
]
rows = D.withSession(Q.allTransactionMonths)
self.months_tbl = Table(rows=rows, columns=columns, scrolling='v',
selection_changed_action=self.month_changed)
Window.__init__(self, title="Statements", size=(1000, 500))
self.place(self.months_tbl, left=0, right=100, top=0, bottom=0, sticky='nsw')
self.place(self.transactions_tbl,
left=self.months_tbl, right=0, top=0, bottom=0, sticky='nesw')
self.menus = [
Menu("Statements", [
("Select likely invoiceables/L", "select_likely_invoiceables"),
("Mark selection as invoiceable/I", "mark_selection_as_invoiceable"),
("Mark selection as payment/P", "mark_selection_as_payment"),
]),
]
示例3: make_window
def make_window(self, document):
win = Window(size = (400, 400), document = document)
view = AppView(model = document, extent = (1000, 1000), scrolling = 'hv', #menu_width = 50
#cursor = self.app_cursor
)
win.place(view, left = 0, top = 0, right = 0, bottom = 0, sticky = 'nsew')
win.show()
示例4: make_window
def make_window():
win = Window(size = (240, 100), title = "Password")
tf = TextField(position = (20, 20), width = 200, password = True)
ok = Button("OK", position = (20, 60), action = (show, tf))
win.add(tf)
win.add(ok)
win.show()
示例5: __init__
def __init__( self ):
Window.__init__( self, title='File/channel selection',
resizable=False )
self.selection_frames = []
self.last_selected_directory = DirRef('.')
self.enter_button = Button(title='Plot',action=self.plot,width=200)
self.add_frame()
示例6: test
def test():
win = Window(title = "Targeting", size = (180, 100))
patch1 = TestPatch("Red patch", red, position = (20, 20))
patch2 = TestPatch("Green patch", green, position = (100, 20))
win.add(patch1)
win.add(patch2)
win.show()
application().run()
示例7: setup_menus
def setup_menus(self, m):
Window.setup_menus(self, m)
m.show_selection_cmd.enabled = True
m.set_selection_cmd.enabled = True
m.show_text_cmd.enabled = True
m.set_text_cmd.enabled = True
m.mono_cmd.enabled = True
m.sans_cmd.enabled = True
m.show_tab_spacing_cmd.enabled = True
示例8: key_down
def key_down(self, event):
# print "GDialog.key_down:", repr(event.char) ###
c = event.char
if c:
if c in self._default_keys:
self.do_default_action()
return
elif c in self._cancel_keys:
self.do_cancel_action()
return
Window.key_down(self, event)
示例9: __init__
def __init__(self, **kwds):
Window.__init__(self, **kwds)
view = TestScrollableView(container = self,
size = (300, 300),
extent = (1000, 1000),
scrolling = 'hv',
anchor = 'ltrb')
button = Button("Embedded", action = self.click)
off = (300, 300)
view.scroll_offset = off
button.position = off
view.add(button)
self.shrink_wrap()
示例10: make_view
def make_view(db, options):
pf = GLConfig(double_buffer = db)
pf.alpha = "a" in options
pf.depth_buffer = "d" in options
pf.stencil_buffer = "s" in options
pf.aux_buffers = "x" in options
pf.accum_buffer = "A" in options
view = TriangleView(pf, size = (200, 200))
win = Window(
title = "%s Buffered GLView" % ["Single", "Double"][db],
size = (240, 240))
win.place(view, left = 20, top = 20, sticky = "nsew")
view.become_target()
win.show()
示例11: test
def test():
cursor = StdCursors.finger
win = Window(title = "Cursor", width = 500, height = 400)
view1 = TestDrawing(position = (20, 20), size = (100, 70), cursor = cursor)
view2 = TestScrollableView(position = (140, 20), size = (200, 200),
scrolling = 'hv')
view2.cursor = cursor
win.add(view1)
win.place(view2, sticky = 'nsew')
win.shrink_wrap((20, 20))
win.show()
示例12: test
def test():
file = "grail_masked.tiff"
# file = "spam_masked.tiff"
image = Image(os.path.join(sys.path[0], file))
cursor = Cursor(image)
win = Window(title="Image Cursor", width=500, height=400)
view1 = TestDrawing(position=(20, 20), size=(100, 70), cursor=cursor)
view2 = TestScrollableView(position=(140, 20), size=(200, 200), scrolling="hv")
view2.cursor = cursor
win.add(view1)
win.place(view2, sticky="nsew")
win.shrink_wrap((20, 20))
win.show()
示例13: main
def main():
f = None
args = sys.argv[1:]
if args:
fontsize = int(args[0])
sf = StdFonts.system_font
f = Font(sf.family, fontsize, sf.style)
#showfont("Using font", f)
win = Window(title = "Heights")
if f:
kwds = {'font': f}
else:
kwds = {}
controls = [
Label(text = "Label", **kwds),
TextField(text = "Text", **kwds),
CheckBox(title = "Check", **kwds),
RadioButton(title = "Radio", **kwds),
Slider(orient = 'h', width = 50),
#Button(title = "Button", **kwds),
]
#for ctl in controls:
# say("Height of %r is %s" % (ctl, ctl.height))
win.place_row(controls, left = 10, top = 10)
win.shrink_wrap(padding = (10, 10))
win.show()
run()
示例14: main
def main():
win = Window()
view = PolyView(width=120, height=120)
win.add(view)
win.shrink_wrap()
win.show()
application().run()
示例15: test
def test():
view = TestView(size = (300, 200))
win = Window(title = "Coloured Text")
win.add(view)
win.shrink_wrap()
win.show()
run()