當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。