Re: re drawing question
"'Chris Barker' via wxPython-users" <[email protected]> Wed, 4 Nov 2020 14:43:18 -0800
| Newsgroups | gmane.comp.python.wxpython |
|---|---|
| Message-ID | <CALGmxEJ6Rc=Z48VFqBj_RwMt4jQxQ9hP-QekcTNc+7LBYJNH4w@mail.gmail.com> |
you may want to look at Double Buffering But if your squares need to be a different size if teh window is resized, then you need to re-draw them. can't you store the "random" colors used? -CHB On Sun, Nov 1, 2020 at 12:22 AM Phil <[email protected]> wrote: > On 1/11/20 4:50 pm, Tim Roberts wrote: > > What’s the point of one-time-only drawing? If your app gets covered by > > another application or a menu or a system dialog, how do you think > > that part of your window will get redrawn? Your onPaint handler needs > > to be able to recreate the entire window to reflect your current state. > > As a general rule, your mainline code should update variables and lists, > and then call Refresh to trigger a call to onPaint to do the drawing. > > OK Tim, I see your point. I'll have to rethink the logic of what I'm > trying to achieve. > > Fill_Board() creates a grid of randomly coloured squares. As it stands, > resizing the window will recreate the board but with a different set of > randomly coloured squares which is not what I want. The creation of the > randomly coloured squares should be a one-time action and that's where a > boolean one-time variable should take control. It seems clumsy to me at > the moment, maybe the idea just needs some refining. > > -- > > Regards, > Phil > > -- > You received this message because you are subscribed to the Google Groups > "wxPython-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/wxpython-users/c5ecbd9a-57bb-90d2-a2d6-3e7aad74144a%40gmail.com > . > -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [email protected] -- You received this message because you are subscribed to the Google Groups "wxPython-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/CALGmxEJ6Rc%3DZ48VFqBj_RwMt4jQxQ9hP-QekcTNc%2B7LBYJNH4w%40mail.gmail.com.