Skip to content

Instantly share code, notes, and snippets.

@chadcooper
Created April 26, 2013 14:24
Show Gist options
  • Select an option

  • Save chadcooper/5467716 to your computer and use it in GitHub Desktop.

Select an option

Save chadcooper/5467716 to your computer and use it in GitHub Desktop.
A little template to use when dorking around with wxpython and needing to test some functionality.
import wx
class MyPanel(wx.Panel):
def __init__(self, parent, _id):
wx.Panel.__init__(self, parent, _id)
self.SetBackgroundColour("white")
default_font = wx.Font(9, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
self.SetFont(default_font)
# Content goes here
# Test static textbox
self.nw_label = wx.StaticText(self, -1, "N of W", pos=(100, 100),
size=wx.DefaultSize)
app = wx.PySimpleApp()
frame = wx.Frame(None, -1, "Template frame...", size=(300, 300))
MyPanel(frame, -1)
frame.Show(True)
app.MainLoop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment