From the pages of "Don't Try This at Home" I bring you this:
This '**almost**' works. :( The problem appears to be that programs are allowed only one main window. The above uses 'None' to specify the parent window and is basically telling the engine to create a 'main ' window to which others will be attached. Only one problem, Mushclient already has a main and the result is a nasty and spectacular crash. :p
So any ideas how to solve this problem Nick? Like giving us a GetWorldFrameHandle command? lol Probably not, but the above was an iteresting try.
NOTE: The above requires installation of the wxPython and wxWindows libraries. But since it doesn't work yet, don't try it anyway. lol
<alias
name="test"
script="runTest"
match="test"
enabled="y"
sequence="100"
>
</alias>
from wxPython.wx import *
#---------------------------------------------------------------------------
class MyFrame(wxFrame):
def __init__(self, parent, ID, title, pos=wxDefaultPosition,
size=wxDefaultSize, style=wxDEFAULT_FRAME_STYLE):
wxFrame.__init__(self, parent, ID, title, pos, size, style)
panel = wxPanel(self, -1)
button = wxButton(panel, 1003, "Close Me")
button.SetPosition(wxPoint(15, 15))
EVT_BUTTON(self, 1003, self.OnCloseMe)
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseMe(self, event):
self.Close(True)
def OnCloseWindow(self, event):
self.Destroy()
#---------------------------------------------------------------------------
def runTest(name, output, wilds):
win = MyFrame(None, -1, "This is a wxFrame", size=(350, 200),
style = wxDEFAULT_FRAME_STYLE)# | wxFRAME_TOOL_WINDOW )
win.Show(True)
This '**almost**' works. :( The problem appears to be that programs are allowed only one main window. The above uses 'None' to specify the parent window and is basically telling the engine to create a 'main ' window to which others will be attached. Only one problem, Mushclient already has a main and the result is a nasty and spectacular crash. :p
So any ideas how to solve this problem Nick? Like giving us a GetWorldFrameHandle command? lol Probably not, but the above was an iteresting try.
NOTE: The above requires installation of the wxPython and wxWindows libraries. But since it doesn't work yet, don't try it anyway. lol