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


Python Window.place方法代码示例

本文整理汇总了Python中GUI.Window.place方法的典型用法代码示例。如果您正苦于以下问题:Python Window.place方法的具体用法?Python Window.place怎么用?Python Window.place使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GUI.Window的用法示例。


在下文中一共展示了Window.place方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: make_window

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place [as 别名]
 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,代码行数:9,代码来源:blobedit.py

示例2: test

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place [as 别名]
def test():
    view = GearsView(size = (300, 300))
    win = Window(title = "Gears")
    win.place(view, sticky = "nsew")
    view.become_target()
    win.shrink_wrap()
    win.show()
    application().run()
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:10,代码来源:91-glview-task.py

示例3: test

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place [as 别名]
def test():
    win = Window(title = "Frame")
    frm = Frame()
    frm.place_column([
        Label("This is"),
        Label("A frame")],
        left = 0, top = 0)
    frm.shrink_wrap()
    win.place(frm, left = 30, top = 30)
    win.shrink_wrap(padding = (30, 30))
    win.show()
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:13,代码来源:30-frame.py

示例4: test

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place [as 别名]
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,代码行数:13,代码来源:13-cursor.py

示例5: test

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place [as 别名]
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,代码行数:15,代码来源:37-image-cursor.py

示例6: test

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place [as 别名]
def test():
    def bing():
        say("Bing!")
        #fld._win_dump_flags()
    win = Window(title = "Shrink Wrap", resizable = 0)
    but = Button("Bing!", action = bing)
    cbx = CheckBox("Spam")
    fld = TextField(width = 100)
    win.place(but, left = 20, top = 20)
    win.place(cbx, left = but + 20, top = 20)
    win.place(fld, left = 20, top = but + 20)
    win.shrink_wrap()
    win.show()
    application().run()
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:16,代码来源:23-shrink_wrap.py

示例7: make_view

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place [as 别名]
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,代码行数:16,代码来源:90-glview.py

示例8: test

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place [as 别名]
def test():
    def select():
        i = group.value
        name = cursor_names[i]
        say("Selecting cursor no. %d (%s)" % (i, name))
        cursor = getattr(StdCursors, name)
        say("...", cursor)
        view.cursor = cursor
    win = Window(title = "Std Cursors")
    view = TestArea(size = (100, 100))
    win.place(view, left = 20, top = 20)
    group = RadioGroup(action = select)
    for i, name in enumerate(cursor_names):
        group.add_item(RadioButton(title = name, value = i))
    win.place_column(group, left = view + 20, top = 20, spacing = 0)
    win.shrink_wrap((20, 20))
    win.show()
    application().run()
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:20,代码来源:28-std-cursors.py

示例9: make_window

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place [as 别名]
 def make_window(self, document):
     
     window_width = 800
     window_height = 600
     
     #create a Window object and associate it with our document 
     #so when the window is closed the doc can ask the user if
     #he wants to save
     app_window = Window(size = (window_width, window_height), document = document)
     
     #make a view for the window
     app_view = LineView(model = document, extent = (window_width, window_height), printable = False, cursor = self.line_cursor)
     
     #place the view in the window, make it resizeable
     app_window.place(app_view, left = 0, top = 0, right = 0, bottom = 0, sticky = 'nsew')
     
     #display the window when we are done initializing
     app_window.show()
开发者ID:bfbachmann,项目名称:Drawer,代码行数:20,代码来源:line_drawer.py

示例10: open_soldier_chooser

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place [as 别名]
    def open_soldier_chooser(self, blob, defender, x, y):
        win = Window(size=(220, 100), style='nonmodal_dialog')
        button = Button('Attack')
        text_field = TextField()
        button.style = 'normal'
        slider = Slider('h')

        def set_textfield():
            text_field.set_text(str(int(slider.get_value())))

        def start_conquering():
            winner = war(blob, defender, int(slider.get_value()))
            looser = blob if winner != blob else defender
            soldiers_left = int(slider.get_value() - (slider.max_value+1 - blob.get_soldiers()))
            conquer_territory(winner, looser, soldiers_left)
            self.model.set_blob_position(blob, x, y)
            print "Winner is: " + winner.territory.get_owner() + "!"
            win.destroy()

        if blob.get_soldiers() - 1 != 1:
            slider.max_value = blob.get_soldiers() - 1
            slider.min_value = 1
            slider.ticks = blob.get_soldiers() - 1
            slider.discrete = True
            slider.action = set_textfield
            button.action = start_conquering
            win.place(slider, left=0, top=10, right=220, bottom=50)
            win.place(button, left=15, top=50, right=55, bottom=90)
            win.place(text_field, left=170, top=50, right=210, bottom=70)
            win.show()
        else:
            winner = war(blob, defender, 1)
            looser = blob if winner != blob else defender
            soldiers_left = int(slider.get_value()) - (int(slider.max_value) - blob.get_soldiers())
            conquer_territory(winner, looser, soldiers_left)
            self.model.set_blob_position(blob, x, y)
            print "Winner is: " + winner.territory.get_owner() + "!"
开发者ID:Rikkemannen,项目名称:riskbot2k,代码行数:39,代码来源:blobapp.py

示例11: make_window

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place [as 别名]
 def make_window(self, document):
     win = Window(size = (400, 400), document = document)
     view = BlobView(model = document, extent = (1000, 1000), scrolling = 'hv')
     win.place(view, left = 0, top = 0, right = 0, bottom = 0, sticky = 'nsew')
     win.show()
开发者ID:mevans86,项目名称:blob-edit,代码行数:7,代码来源:blobEdit.py

示例12: make_window

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place [as 别名]
 def make_window(self, document):
     win = Window(size = (500, 500), document = document)
     view = BlobView(model = document, extent = (200, 200), scrolling = 'hv',cursor = self.blob_cursor)
     win.place(view, left = 0, top = 0, right = 0, bottom = 0, sticky = 'nsew')
     win.show()
开发者ID:rohandavidg,项目名称:Couch-Lab-Databse,代码行数:7,代码来源:pygui_test.py

示例13: Tool

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place [as 别名]
class Tool(Application):
    def __init__(self):
        Application.__init__(self, title = "Log Analysis Tool")
        print >>sys.stderr, "app init'd"

        self.window = Window(size = (1200, 750), title = "Log Analysis Tool")
        print >>sys.stderr, "made window"

        # Create db cursor
        db = get_conn(dbname = 'reduced_log')
        self.cur = db.cursor()
        print >>sys.stderr, "made db cursor"

        self.current_table_suffix = None
        
        # Load the dummy image for now
        self.image = GraphView(size = (640, 460), position = (10, 10))
        self.graph_panel = Frame()
        self.graph_panel.add(self.image)
        print >>sys.stderr, "loaded dummy image"

        # Declare other image lists
        self.full_ = None
        self.peruser_alltime_ = None
        self.peruser_divided_total_ = None
        self.peruser_divided_ = None

        # Create the display selection radio
        self.display_select_radiogroup = RadioGroup(action = 
                                                    self.change_images)
        height, startx = 495, 20
        sp = 10
        r1 = RadioButton("All users",
                         group = self.display_select_radiogroup,
                         value = 'all_users')
        r2 = RadioButton("Per user, query type",
                         group = self.display_select_radiogroup,
                         value = 'peruser_querytype')
        r3 = RadioButton("Per user, time",
                         group = self.display_select_radiogroup,
                         value = 'peruser_time')
        r4 = RadioButton("Per user, query type and time",
                         group = self.display_select_radiogroup,
                         value = 'peruser_querytype_time')
        
        self.graph_panel.place(r1, top = self.image + 10, left = sp)
        self.graph_panel.place(r2, top = self.image + 10, left = r1 + sp)
        self.graph_panel.place(r3, top = self.image + 10, left = r2 + sp)
        self.graph_panel.place(r4, top = self.image + 10, left = r3 + sp)
        self.window.place(self.graph_panel, top=0, left=0)
        self.display_select_radiogroup.value = 'all_users'
        
        # Create the top queries textbox
        self.topqueries = TopqueryPanel(size = (500, 460),
                                        extent = (500, 1000))
        self.topqueries.panels = [[TopqueryLabel("This is a placeholder until you select a filter",
                                                ["This is where", "the values", "will go"])]]
        self.window.place(self.topqueries, top=10, left=680)

        topqueries_next_button = Button("Next", action = self.topqueries.next)
        topqueries_prev_button = Button("Prev", action = self.topqueries.prev)
        self.window.place(topqueries_next_button, left = 930, top = top - 50)
        self.window.place(topqueries_prev_button, left = 830, top = top - 50)
        print >>sys.stderr, "made top queries text box"

        # Declare the filter and last updated filter pointers
        self.fil = None
        self.last_used_fil = None
        
        #
        # *************************
        # FILTER PANEL
        # *************************
        #

        # **CREATE DATE PANEL**
        field_width = 140
        self.date_panel = Frame()
        self.begin_date_field = TextField(size = (field_width, 30),
                                          position = (0, 5),
                                          text = DEFAULT_BEGIN_DATE_TEXT)
        self.end_date_field = TextField(size = (field_width, 30),
                                        position = (0, 35),
                                        text = DEFAULT_END_DATE_TEXT)
        self.date_panel.size = (field_width, 0)

        # Time division radios
        self.time_division_radiogroup = RadioGroup()
        left, right = 5, 70
        row1, rowspace = 95, 25

        group_by_label = Label("Group by:",
                               position = (5, 70))
        hour = RadioButton("Hour",
                           position = (left, row1),
                           group = self.time_division_radiogroup,
                           value = 'hour')
        day = RadioButton("Day",
                          position = (right, row1),
                          group = self.time_division_radiogroup,
#.........这里部分代码省略.........
开发者ID:VBaratham,项目名称:lsst_log_analysis_tool,代码行数:103,代码来源:tool.py

示例14: make_window

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place [as 别名]
    def make_window(self, document):
        win = Window(size=(700, 500), document=document)

        panel = Frame(width=170)

        def crop_action():
            if view.selection is None:
                view.setselection(shrink_rect(view.viewrect, 0.8))
                return

            croprect = view.pdfcoord(view.selection)
            #print 'view: %s, crop: %s' % (view.selection, croprect)
            view.model.crop(view.pagenum, croprect)
            view.selection = None
            view.set_status(selection=None)
            hide(view.crop_button)

        crop_button = Button(title='Crop', visible=True, action=crop_action)
        status = Label(text='\n\n\n\n')

        view = PDFView(pagenum=0, model=document, scrolling='hv',
                       status=status, cursor=crosshair, crop_button=crop_button)
        #view = PDFView(... extent=(1000, 1000), cursor = self.blob_cursor)

        def page_changer(delta):

            def change():
                np = win.document.numpages
                view.pagenum += delta

                if view.pagenum <= 0:
                    view.pagenum = 0
                    prevpage.enabled = False
                else:
                    prevpage.enabled = True

                if view.pagenum >= np - 1:
                    view.pagenum = np - 1
                    nextpage.enabled = False
                else:
                    nextpage.enabled = True

                page.text = '%s / %s' % (view.pagenum+1, np)
                view.invalidate()

            return change

        prevpage = Button(title='<', action=page_changer(-1))
        nextpage = Button(title='>', action=page_changer(+1))
        page = Label(just='center', anchor='b')
        page_changer(0)()

        panel.place(prevpage, top=5, left=5, sticky='w')
        panel.place(nextpage, top=5, right=-5, sticky='e')
        panel.place(page, bottom=prevpage.bottom, 
                    left=prevpage, right=nextpage, sticky='ew')

        panel.place(status, left=5, top=prevpage+5, right=0, sticky='ew')
        panel.place(crop_button, left=5, top=status, right=-5, sticky='ew')

        win.place(panel, left=0, top=0, bottom=0, sticky='nsw')
        win.place(view, left=panel, top=0, right=0, bottom=0, sticky='nsew')
        win.shrink_wrap()
        win.show()
开发者ID:shamrin,项目名称:PDFchomp,代码行数:66,代码来源:pdfedit.py

示例15: TextField

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place [as 别名]
    dlog.place(Label(text = "Surprise!!!"), left = 20, top = 20)
    field = TextField()
    dlog.place(field, left = 20, top = 60, right = -20)
    field.become_target()
    dlog.default_button = DefaultButton()
    dlog.cancel_button = CancelButton()
    dlog.place(dlog.default_button, right = -20, bottom = -20)
    dlog.place(dlog.cancel_button, left = 20, bottom = -20)
    dlog.center()
    result = dlog.present()
    say("Result =", result)
    dlog.destroy()

win = Window(title = "Modal Dialogs", size = (200, 60))
dialog_button = Button(title = "Give Me A Dialog", action = modal_dialog)
win.place(dialog_button, left = 20, top = 20)
win.show()

instructions = """
Clicking the "Give Me A Dialog" button should pop up a modal
dialog centered on the screen, containing a label, a text
field, an OK button and a Cancel button.

While the dialog is up:
* Interaction with the main window should be prevented.
* Edit menu commands should be enabled as appropriate for the
  text field; other menu commands should be disabled.

Clicking the OK button or pressing Return or Enter should
dismiss the dialog and report "Result = True".
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:32,代码来源:16-modal_dialog.py


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