The below example demonstrates that wxImageList.GetIcon() returns NULL:
The example works fine when loading the icon directly using
SuperStrict Framework wx.wxApp Import wx.wxFrame Import wx.wxImage Import wx.wxIcon Import wx.wxImageList Type MyApp Extends wxApp Field Frame:wxFrame Method OnInit:Int() Frame = wxFrame.CreateFrame(,, "Icon test", 100, 100) wxImage.AddHandler(New wxXPMHandler) Local imageList:wxImageList = New wxImageList.Create(15, 15, True) imageList.AddIcon(wxIcon.CreateFromFile("icon.xpm")) Local icon:wxIcon = New wxIcon.Create() icon = imageList.GetIcon(0) If Not icon Then RuntimeError("No icon!") Frame.SetIcon(icon) Frame.show() Return True End Method End Type New MyApp.Run()
The example works fine when loading the icon directly using
Icon.LoadFile("icon.xpm", wxBITMAP_TYPE_XPM)