Very nice. My daughter liked it. She immediately asked whether it was
possible to print the drawings
I noticed two issues with the program: when using for loops to draw
there's a lot of flicker while drawing and there doesn't seem to be a
way to interrupt the drawing with Ctrl-C or something similar.
Cheers, Frank
···
2009/8/1 cool-RR <ram.rachum@gmail.com>:
Hey,
Just wanted to let you know, I released my little side project today,
PythonTurtle: http://pythonturtle.com
Thanks for giving feedback. I'm happy your daughter liked it.
I've added "saving/printing drawings" to the issues list.
The "Ctrl-C" issue is already on the issues list.
But the flicker thing is what is interesting me. What operating system do you use? Does the flicker happen only in "for" loops?
Windows is usually the culprit whenever flicker is mentioned, and it typically happens because of Clear()ing the dc before drawing on it. Since DCs are unbuffered by default on Windows then you can see some of the intermediate steps as a drawing is performed.
Take a look at the wiki for some samples of buffered drawing, but in a nutshell you'll want to intercept the EVT_ERASE_BACKGROUND event and do nothing in the handler, and also switch to drawing first to a bitmap and then drawing the bitmap to the screen in your paint event. There are some buffered DC classes to help with this.
(Please answer off-list, I don't think this is of interest to wxPython-users.)
Actually, it probably would be since it is a common problem that other wxPython users will encounter.
Thanks for giving feedback. I'm happy your daughter liked it.
I've added "saving/printing drawings" to the issues list.
The "Ctrl-C" issue is already on the issues list.
But the flicker thing is what is interesting me. What operating system do you use? Does the flicker happen only in "for" loops?
Windows is usually the culprit whenever flicker is mentioned, and it typically happens because of Clear()ing the dc before drawing on it. Since DCs are unbuffered by default on Windows then you can see some of the intermediate steps as a drawing is performed.
Take a look at the wiki for some samples of buffered drawing, but in a nutshell you'll want to intercept the EVT_ERASE_BACKGROUND event and do nothing in the handler, and also switch to drawing first to a bitmap and then drawing the bitmap to the screen in your paint event. There are some buffered DC classes to help with this.
(Please answer off-list, I don't think this is of interest to wxPython-users.)
Actually, it probably would be since it is a common problem that other wxPython users will encounter.
I found in my application that setting self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM) in my panel solved all flickering issues on Windows, just a simple one-liner you may want to try
I found in my application that setting self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM) in my panel solved all flickering issues on Windows, just a simple one-liner you may want to try
I keep forgetting about that. It's been there for a couple years now, but that still feels like a recent change to me.
BTW & FYI, there was just some work done on the trunk a few weeks ago to make setting the background style more consistent across platforms. That should be in 2.9.1+.
On Aug 7, 12:21 pm, Steven Sproat <spro...@gmail.com> wrote:
Robin Dunn wrote:
>cool-RRwrote:
>> Hey Frank,
>> Thanks for giving feedback. I'm happy your daughter liked it.
>> I've added "saving/printing drawings" to the issues list.
>> The "Ctrl-C" issue is already on the issues list.
>> But the flicker thing is what is interesting me. What operating system
>> do you use? Does the flicker happen only in "for" loops?
> Windows is usually the culprit whenever flicker is mentioned, and it
> typically happens because of Clear()ing the dc before drawing on it.
> Since DCs are unbuffered by default on Windows then you can see some of
> the intermediate steps as a drawing is performed.
> Take a look at the wiki for some samples of buffered drawing, but in a
> nutshell you'll want to intercept the EVT_ERASE_BACKGROUND event and do
> nothing in the handler, and also switch to drawing first to a bitmap and
> then drawing the bitmap to the screen in your paint event. There are
> some buffered DC classes to help with this.
>> (Please answer off-list, I don't think this is of interest to
>> wxPython-users.)
> Actually, it probably would be since it is a common problem that other
> wxPython users will encounter.
I found in my application that setting
self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM) in my panel solved all
flickering issues on Windows, just a simple one-liner you may want to try
Did it: Solved about 80% of the flicker problem, which is enough for
now. Thanks so much.
I found in my application that setting
self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM) in my panel solved all
flickering issues on Windows, just a simple one-liner you may want to try
Did it: Solved about 80% of the flicker problem, which is enough for
now. Thanks so much.
Ram.
great to hear! I might edit the wiki to add this since it's quite important and I tried many different solutions to solve the flicker
···
On Aug 7, 12:21 pm, Steven Sproat <spro...@gmail.com> wrote: