Re: wxpython application ( problem ? )

2008-01-02 Thread kyosohma
On Jan 2, 5:24 am, [EMAIL PROTECTED] wrote:
> Hello,
>
> Here is sample of my simple script with wxpython and modules:
> subprocess,threading, directpython...
>
> Code sample:
>
> import wx
> import wx.aui
> app=wx.App()
> frame=wx.Frame(None,title="New project")
>
> #There is also part with wx.aui
>
> frame.Show()
> app.MainLoop()
>
> After a few minutes wx application does destroy. Any ides why?

I highly recommend reading this wxPython wiki entry about using
threads in wxPython:

http://wiki.wxpython.org/LongRunningTasks

I've found it quite helpful in my own programming.

Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: wxpython application ( problem ? )

2008-01-02 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote:

> yes, so what's the problem?

http://wxwidgets.org/manuals/stable/wx_wxthreadoverview.html
| If you do decide to use threads in your application, it is
| strongly recommended that no more than one thread calls GUI
| functions. The thread sample shows that it is possible for many
| different threads to call GUI functions at once (all the threads
| created in the sample access GUI), but it is a very poor design
| choice for anything except an example. The design which uses one
| GUI thread and several worker threads which communicate with the
| main one using events is much more robust and will undoubtedly
| save you countless problems (example: under Win32 a thread can
| only access GDI objects such as pens, brushes, &c created by
| itself and not by the other threads).

Regards,


Björn

-- 
BOFH excuse #241:

_Rosin_ core solder? But...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: wxpython application ( problem ? )

2008-01-02 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote:

> On 2 sij, 12:29, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>> On Wed, 02 Jan 2008 03:24:56 -0800, vedrandekovic wrote:
>> > Here is sample of my simple script with wxpython and modules:
>> > subprocess,threading, directpython...
>>
>> Are you accessing the GUI from threads?
>>
>> Ciao,
>> Marc 'BlackJack' Rintsch
> 
> 
> Hi again,
> 
> yes, so what's the problem?

It is the problem. It is usually not allowed to manipulate GUI-objects from
any thread except the main-thread that runs the event-loop. All
GUI-toolkits have guidelines how to cope with that, e.g. custom events in
Qt3, or timers.

This message indicates that WX has similar means:

http://osdir.com/ml/python.matplotlib.general/2005-03/msg00208.html


Diez
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: wxpython application ( problem ? )

2008-01-02 Thread vedrandekovic
On 2 sij, 12:29, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Wed, 02 Jan 2008 03:24:56 -0800, vedrandekovic wrote:
> > Here is sample of my simple script with wxpython and modules:
> > subprocess,threading, directpython...
>
> Are you accessing the GUI from threads?
>
> Ciao,
> Marc 'BlackJack' Rintsch


Hi again,

yes, so what's the problem?


Regards,
Vedran
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: wxpython application ( problem ? )

2008-01-02 Thread Marc 'BlackJack' Rintsch
On Wed, 02 Jan 2008 03:24:56 -0800, vedrandekovic wrote:

> Here is sample of my simple script with wxpython and modules:
> subprocess,threading, directpython...

Are you accessing the GUI from threads?

Ciao,
Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list


wxpython application ( problem ? )

2008-01-02 Thread vedrandekovic
Hello,

Here is sample of my simple script with wxpython and modules:
subprocess,threading, directpython...

Code sample:

import wx
import wx.aui
app=wx.App()
frame=wx.Frame(None,title="New project")

#There is also part with wx.aui

frame.Show()
app.MainLoop()


After a few minutes wx application does destroy. Any ides why?
-- 
http://mail.python.org/mailman/listinfo/python-list