I am just starting to work through the modules.
The below code opens 2 windows:
I now want to ask a question if the parent closes with the code below:
but it complains about "unable to convert from wxFrame to MyFrame"
What am i doing wrong?
Cheers
Glenn
The below code opens 2 windows:
SuperStrict Framework wx.wxApp Import wx.wxFrame Type MyApp Extends wxApp Field ParentFrame:wxFrame Field ChildFrame:wxFrame Method OnInit:Int() ' Method Create:wxFrame(parent:wxWindow = Null, id:Int = -1, title:String = "", x:Int = -1, y:Int = -1, w:Int = -1, h:Int = -1, style:Int = wxDEFAULT_FRAME_STYLE) ParentFrame = wxFrame.CreateFrame(,,"Parent Frame", 100, 100) ParentFrame.show() ChildFrame = wxFrame.createframe(ParentFrame,,"Child Frame",150,150) ChildFrame.show() Return True End Method End Type New MyApp.run() ' Closing the Child Frame has no effect on the Parent Frame ' Closing the Parent Frame CLOSES the Child Frame too
I now want to ask a question if the parent closes with the code below:
SuperStrict Framework wx.wxApp Import wx.wxFrame Type MyApp Extends wxApp ' Field ParentFrame:wxFrame Field ParentFrame:MyFrame Field ChildFrame:wxFrame Method OnInit:Int() ' Method Create:wxFrame(parent:wxWindow = Null, id:Int = -1, title:String = "", x:Int = -1, y:Int = -1, w:Int = -1, h:Int = -1, style:Int = wxDEFAULT_FRAME_STYLE) ' ParentFrame = wxFrame.CreateFrame(,,"Parent Frame", 100, 100) ParentFrame = MyFrame.CreateFrame(,,"Parent Frame", 100, 100) ParentFrame.show() ChildFrame = wxFrame.createframe(ParentFrame,,"Child Frame",150,150) ChildFrame.show() Return True End Method End Type New MyApp.run() ' Closing the Parent Frame ASKS for confirmation before closing Type MyFrame Extends wxFrame Function OnCloseWindow(_event:wxEvent) Local Result:Int = Confirm("Are you sure you want to Close BOTH Windows?") If Result = False Then Exit End Function End Type
but it complains about "unable to convert from wxFrame to MyFrame"
What am i doing wrong?
Cheers
Glenn