In my application text is entered in an scintilla editor,
this text is transfered to a buffer,
and with a timer a procedure is called,
that renders this buffer on a special graphic screen (bitmap).
This rendering takes a rather long time.
As Python is a scipting language,
I don't have to be afraid of reentrance (at least I think),
because the rendering code will be completely finished before a new event can occure.
Is that true ?
Suppose it's true,
and I want to increase the speed,
how can I do that ?
I could only render what has changed,
but due to the nature of that bitmap device that's quit difficult
( it simulate a graphical LCD device, with hardware pointer actions).
So is there another way to stop rendering,
in case a new change has taken place ?
Use of the Scintilla event perhaps ?
In my application text is entered in an scintilla editor,
this text is transfered to a buffer,
and with a timer a procedure is called,
that renders this buffer on a special graphic screen (bitmap).
This rendering takes a rather long time.
As Python is a scipting language,
I don't have to be afraid of reentrance (at least I think),
because the rendering code will be completely finished before a new event can occure.
Is that true ?
If it's all running in the same thread, and if you don't do something while the rendering is running that allows events to be sent, like calling wx.Yield(), then yes, your statement is true.
Suppose it's true,
and I want to increase the speed,
how can I do that ?
I could only render what has changed,
but due to the nature of that bitmap device that's quit difficult
( it simulate a graphical LCD device, with hardware pointer actions).
So is there another way to stop rendering,
in case a new change has taken place ?
Use of the Scintilla event perhaps ?
As long as the long running task is in the same thread as the gui, and you are not allowing events to be delivered in some way, then you are stuck, there is no easy way to interrupt the long running task from the UI. Your options are to break the long running task into small chunks and run each chunk from an idle handler, periodically have the long running task call wx.Yield, or to move it to another thread.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
On Tue, Jun 12, 2007 at 02:03:35AM +0200, Stef Mientki wrote:
So is there another way to stop rendering,
in case a new change has taken place ?
Use of the Scintilla event perhaps ?
wx.lib.pubsub
fire from stc change handler
catch in bitmap device renderer
This has the same problem. If the long running task is blocking events then it is also blocking anything else in the same thread that could send a pubsub message to it.
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!