[IronPython] Problem Closing Application

Lukas Cenovsky cenovsky at bakalari.cz
Mon Jun 14 13:00:43 CEST 2010


Anthony wrote:
> Hi Michael
>
> Sorry for the late reply - only got back to my email this morning :-)
> I tried to close the form - but when doing that - the whole 
> application closed - I think this was mainly due to the fact that that 
> form was seen as the "main form"?? Sorry about this real noob question 
> - but I'm just starting out - and this is very frustrating for me, I 
> know it's probably something stupid that I'm doing! Let me post my 
> code here - and see what you can see!
> Here is my code
>
> #form = MainForm.Log_In()
> form = Log_In.Log_In()
> Application.Run(form)

If you run the above code, the main form of the application is Log_In 
form. You have to run application with hidden main form, display log in 
form and after successful log in, display the main form.

By default, the application is closed when the main form of the 
application is closed. If you want different bahavior, see 
ApplicationContext class: 
http://msdn.microsoft.com/en-us/library/07d698ye(v=VS.100).aspx 
<http://msdn.microsoft.com/en-us/library/07d698ye%28v=VS.100%29.aspx>

--
-- Lukáš




More information about the Ironpython-users mailing list