[Pythonmac-SIG] Adding Apps - Pycrust too?

gandreas at gandreas.com gandreas at gandreas.com
Wed Apr 26 00:51:59 CEST 2006


>
>> -bob
>
> Just tried, and neither the IDLE nor PyCrust
> interactive shells supports wx (or any other gui
> framework) out of the box.  IDLE complains about
> needing to use Pythonw, and PyCrust just hangs
> (probably due to the issue Bob mentioned).
>
> If the interactive shell in IDLE can be made to
> interact with gui's, then it will do I suppose.  (It's
> not as nice as PyCrust, but that's a killer feature).

I just tried this with ScrIDE <http://projects.gandreas.com/scride/ 
download.php> (using the Pythonw Rich Shell interactive window):

 >>> from wxPython.wx import *
 >>> class main_window(wxFrame):
... 	def __init__(self, parent, id, title):
... 		wxFrame.__init__(self, parent, -1, title, size = (200, 100),
... 			style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
... 		self.control = wxTextCtrl(self, -1, style=wxTE_MULTILINE)
... 		self.Show(true)
... 		
 >>> class App(wxApp):
... 	def OnInit(self):
... 		frame = main_window(None, -1, "wxPython: (A Demonstration)")
... 		self.SetTopWindow(frame)
... 		return true
... 		
 >>> app = App(0)
 >>> app.MainLoop()


Seems to work, complete with things like completion, doc strings and  
the like (but having not done any wx work in a decade, it's hard to  
tell if there are problems)




Glenn Andreas                      gandreas at gandreas.com
  <http://www.gandreas.com/> wicked fun!
Mad, Bad, and Dangerous to Know



More information about the Pythonmac-SIG mailing list