Advertisement
Guest User

wxGUI

a guest
Dec 11th, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.04 KB | None | 0 0
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3.  
  4.  
  5. import wx
  6.  
  7. class Example(wx.Frame):
  8.  
  9.     def __init__(self, parent, title):    
  10.         super(Example, self).__init__(parent, title=title,
  11.             size=(450, 350))
  12.  
  13.         self.InitUI()
  14.         self.Centre()
  15.         self.Show()    
  16.  
  17.     def InitUI(self):
  18.      
  19.         panel = wx.Panel(self)
  20.        
  21.         sizer = wx.GridBagSizer(5, 5)
  22.  
  23.         sb = wx.StaticBox(panel, label="Template")
  24.  
  25.         boxsizer = wx.StaticBoxSizer(sb, wx.VERTICAL)
  26.  
  27.         boxsizer.Add(wx.StaticText(panel,-1,"First Name: "), 0, wx.ALL, 8)
  28.         boxsizer.Add(wx.StaticText(panel,-1,"Surname: "), 0, wx.ALL^wx.TOP, 8)
  29.         boxsizer.Add(wx.StaticText(panel,-1,"Username: "), 0, wx.ALL^wx.TOP, 8)
  30.  
  31.         sizer.Add(boxsizer, pos=(0, 0), span=(1, 5), flag=wx.EXPAND|wx.TOP|wx.LEFT|wx.RIGHT , border=10)
  32.  
  33.         sizer.AddGrowableCol(2)
  34.        
  35.         panel.SetSizer(sizer)
  36.  
  37.  
  38. if __name__ == '__main__':
  39.  
  40.     app = wx.App()
  41.     Example(None, title="Create Java Class")
  42.     app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement