Skip to content

Instantly share code, notes, and snippets.

View driscollis's full-sized avatar

Mike Driscoll driscollis

View GitHub Profile
@driscollis
driscollis / list_ctrl_multi_events.py
Created May 6, 2015 19:51
wxPython Listctrl with multiple events
import wx
########################################################################
class MyForm(wx.Frame):
#----------------------------------------------------------------------
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY, "List Control Tutorial")
# Add a panel so it looks the correct on all platforms
import wx
########################################################################
class MyPanel(wx.Panel):
""""""
#----------------------------------------------------------------------
def __init__(self, parent, bg=None):
"""Constructor"""
wx.Panel.__init__(self, parent)
import wx
import wx.html
HTML_WINDOW_SIZE = (100, 200)
TEXT1 = "TEXT number 1 2 3 4 5 6 7 8 9 "
TEXT2 = "TEXT nember 2 3 4 5 6 7 8 9 "
class MyFrame(wx.Frame):
@driscollis
driscollis / progger.py
Last active September 25, 2015 13:46
Progress test
import wx
class TestPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a ProgressDialog", (50,50))
self.Bind(wx.EVT_BUTTON, self.OnButton, b)
@driscollis
driscollis / wxcustom_event.py
Created April 1, 2016 14:00
Custom event with wxPython
import wx
import wx.lib.newevent
BbClickEvent, EVT_BB_CLICK = wx.lib.newevent.NewCommandEvent()
BbClickEvent = wx.NewEventType()
EVT_BB_CLICK = wx.PyEventBinder(BbClickEvent, 0)
########################################################################
@driscollis
driscollis / combo_events.py
Last active August 11, 2016 20:10
Combo event example
import wx
########################################################################
class MyFrame(wx.Frame):
""""""
#----------------------------------------------------------------------
def __init__(self):
"""Constructor"""
wx.Frame.__init__(self, None, title='combo')
import wx
import time
class MyForm(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY, "Timer Tutorial 1",
size=(500,500))
import sys
import wx
class MyForm(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, title="Screenshot Tutorial")
panel = wx.Panel(self)
import wx
from wx.adv import Wizard, WizardPage
class MyWizardPage(WizardPage):
def __init__(self, parent, title):
WizardPage.__init__(self)
self.next = None
self.prev = None
self.initializeUI(title)
import wx
class MyFileDropTarget(wx.FileDropTarget):
""""""
def __init__(self, window):
"""Constructor"""
wx.FileDropTarget.__init__(self)
self.window = window