Created
July 31, 2017 05:40
-
-
Save Leon0824/5279a21a2fc4133bc696e0164c72d8c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import wx | |
class Example(wx.Frame): | |
def __init__(self, *args, **kw): | |
super().__init__(*args, **kw) | |
self.init_ui() | |
def init_ui(self): | |
pnl = wx.Panel(self) | |
grid = wx.GridSizer(2, 3, 0) | |
grid.AddMany([ | |
(wx.Button(pnl, wx.ID_CANCEL), 0, wx.TOP | wx.LEFT, 9), | |
(wx.Button(pnl, wx.ID_DELETE), 0, wx.TOP, 9), | |
(wx.Button(pnl, wx.ID_SAVE), 0, wx.LEFT, 9), | |
(wx.Button(pnl, wx.ID_EXIT)), | |
(wx.Button(pnl, wx.ID_STOP), 0, wx.LEFT, 9), | |
(wx.Button(pnl, wx.ID_NEW)) | |
]) | |
self.Bind(wx.EVT_BUTTON, self.on_quit_app, id=wx.ID_EXIT) | |
pnl.SetSizer(grid) | |
self.SetSize((220, 180)) | |
self.SetTitle('Standard ids') | |
self.Centre() | |
self.Show(True) | |
def on_quit_app(self, event): | |
self.Close() | |
def main(): | |
ex = wx.App() | |
Example(None) | |
ex.MainLoop() | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment