having trouble with Toolbook

Patrick J. Anderson pat.j.anderson at gmail.com
Fri Oct 19 09:04:52 PDT 2007


I'm having trouble with Toolbook. I can't see the image list, below is my 
code:


ID_PLANNER_DAY_MODE = wx.NewId()
ID_PLANNER_WEEK_MODE = wx.NewId()
ID_PLANNER_MONTH_MODE = wx.NewId()

images = (
	'gnome-day.png', 
	'gnome-week.png', 
	'gnome-month.png'
)

class PlannerToolbook(wx.Toolbook):

    def __init__(self, *args, **kwargs):
        wx.Toolbook.__init__(self, *args, **kwargs)

        il = wx.ImageList(22, 22)
        for i in images:
            try:
                il.AddIcon(wx.Image(i, wx.BITMAP_TYPE_PNG))
            except:
                print "Error adding image to the ImageList"

        self.AssignImageList(il)

        self.day_mode = DayModePanel(self, wx.GROW)
        self.week_mode = WeekModePanel(self, wx.GROW)
        self.month_mode = MonthModePanel(self, wx.GROW)

        self.AddPage(self.day_mode, "Daily", ID_PLANNER_DAY_MODE)
        self.AddPage(self.week_mode, "Weekly", ID_PLANNER_WEEK_MODE)
        self.AddPage(self.month_mode, "Monthly", ID_PLANNER_MONTH_MODE)



What am I doing wrong?





More information about the wxpython-users mailing list