If all you want to do is get NUMERIC characters from a user then just use a validator on the TextCtrl, by using the wxFILTER_NUMERIC you will get your 0-9 and your - and . oh and an e
Here`s a dirty way of getting rid of the frame too and center the dialog ;-)
coords_val = ""
coordsObj = wxlua.wxLuaObject(coords_val)
mainFrame = wx.wxFrame( wx.NULL, wx.wxID_ANY, "Dummy Frame", wx.wxDefaultPosition, wx.wxSize(0,0), wx.wxFRAME_TOOL_WINDOW)
dialog = wx.wxDialog(mainFrame, wx.wxID_ANY, "Enter Coords")
dialog:Center()
coords = wx.wxTextCtrl(dialog, wx.wxID_ANY, "", wx.wxPoint( 10,12 ), wx.wxDefaultSize, 0, wx.wxTextValidator(wx.wxFILTER_NUMERIC, coordsObj))
ok = wx.wxButton( dialog, wx.wxID_OK, "OK", wx.wxPoint( 10,40 ), wx.wxDefaultSize, 0 )
cancel = wx.wxButton( dialog, wx.wxID_CANCEL, "Cancel", wx.wxPoint( 100,40 ), wx.wxDefaultSize, 0 )
if dialog:ShowModal() == wx.wxID_OK then
wx.wxMessageBox(tostring(coords:GetValue()))
else
wx.wxMessageBox('User Canx')
end
Most of these "convenience functions" are just that ;-)
DazTheGas