Re: re drawing question
Tim Roberts <[email protected]>
| Newsgroups | gmane.comp.python.wxpython |
|---|---|
| Message-ID | <[email protected]> |
On Oct 31, 2020, at 9:05 PM, Phil <[email protected]> wrote: > > I only want Fill_board() called once and if I call it from OnPaint then Fill_board() will be called and the board will be filled with a different fill pattern every time the window is resized, for instance. What I could do I suppose is set up a boolean variable that tests if the Fill_board function has already been called or not. Is that the way a call-once function should be handled? 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. — Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- 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/1A5C6834-EAA1-4BB7-BEAD-06A97BB45EF9%40probo.com.