Re: How do I draw a semicircle?
"'Chris Barker' via wxPython-users" <[email protected]> Sat, 3 Jul 2021 09:45:35 -0700
| Newsgroups | gmane.comp.python.wxpython |
|---|---|
| Message-ID | <CALGmxE+TuG2B8HyZvKNkm6gTgLycbm1Y+cHPuvOO25tt-mpYuA@mail.gmail.com> |
On Thu, May 13, 2021 at 2:55 PM Phil <[email protected]> wrote: > Speedometer is rather complex plus the demo will not run because of an > invalid encoding error. an issue on gitHub might be good for that. -- but looking at the code may be helpful nonetheless. > I now have my meter working and now have to sort out how to incorporate > it into it's own class. I have no idea how to do this, at the moment. > look at the wiki and various demos, but in short: create a subclass of wxPanel Create a method to draw the dial. Call that method from The OnPaint handler to a method that draws your dial. When the data changes, call Refesh() on your panel -- that will trigger a Paint event, which will re-draw the dial. You may want to have the dial itself be pre-saved to a bitmap, and then you can just re-draw the needle on top of it when things change. These are a bit old, but may help: https://github.com/PythonCHB/wxPythonDemos -CHB -- 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/CALGmxE%2BTuG2B8HyZvKNkm6gTgLycbm1Y%2BcHPuvOO25tt-mpYuA%40mail.gmail.com.