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


Python GUI.Window类代码示例

本文整理汇总了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()
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:7,代码来源:36-no-cursor.py

示例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"),
           ]),
           ]
开发者ID:georgevdd,项目名称:bank-account-reporting,代码行数:29,代码来源:UI.py

示例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()
开发者ID:rceballos98,项目名称:hapticJacket,代码行数:7,代码来源:blobedit.py

示例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()
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:7,代码来源:25-password.py

示例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()
开发者ID:ucsbdeepspace,项目名称:cofe-fts-ground-code-archive,代码行数:7,代码来源:psgui.py

示例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()
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:8,代码来源:26-targeting.py

示例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
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:9,代码来源:39-text_editor.py

示例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)
开发者ID:rceballos98,项目名称:hapticJacket,代码行数:11,代码来源:GDialogs.py

示例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()
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:13,代码来源:43-scroll-embedded.py

示例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()
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:14,代码来源:90-glview.py

示例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()
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:11,代码来源:13-cursor.py

示例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()
开发者ID:rceballos98,项目名称:hapticJacket,代码行数:13,代码来源:37-image-cursor.py

示例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()
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:27,代码来源:32-default-heights.py

示例14: main

def main():
    win = Window()
    view = PolyView(width=120, height=120)
    win.add(view)
    win.shrink_wrap()
    win.show()
    application().run()
开发者ID:rceballos98,项目名称:hapticJacket,代码行数:7,代码来源:27-poly.py

示例15: test

def test():
    view = TestView(size = (300, 200))
    win = Window(title = "Coloured Text")
    win.add(view)
    win.shrink_wrap()
    win.show()
    run()
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:7,代码来源:34-coloured-text.py


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