Setting Button Positions : Button « wxPython « Python Tutorial






Setting Button Positions
import wx

app = wx.App()
win = wx.Frame(None, title="Editor", size=(410, 335))
win.Show()

loadButton = wx.Button(win, label='Open',pos=(225, 5), size=(80, 25))
saveButton = wx.Button(win, label='Save',pos=(315, 5), size=(80, 25))
filename = wx.TextCtrl(win, pos=(5, 5), size=(210, 25))
contents = wx.TextCtrl(win, pos=(5, 35), size=(390, 260),style=wx.TE_MULTILINE | wx.HSCROLL)
app.MainLoop()








19.2.Button
19.2.1.Adding a Button to a FrameAdding a Button to a Frame
19.2.2.Setting Button PositionsSetting Button Positions
19.2.3.Add action to buttonAdd action to button
19.2.4.Set label in button actionSet label in button action
19.2.5.Bind event to button (Mouse enter and leave, button clicked)Bind event to button (Mouse enter and leave, button clicked)