Re: About Creating New Packages/Widgets & Other Dev Help

Kevin Ollivier <[email protected]>
Newsgroups gmane.comp.python.wxpython.devel
Message-ID <[email protected]>

> On Dec 28, 2015, at 6:54 PM, Metallicow <[email protected]> wrote:
> 
> 
> 
> On Saturday, December 26, 2015 at 11:33:06 AM UTC-6, [email protected] wrote:
> 
> Are you using a series of controls with sizers to do the layout for a custom-drawn button? 
> 
> Regards,
> 
> Kevin
> 
> 
> Nope. ShapedBitmapButton is just a hand-built wx.Control Subclass.
> So 1 Button instance is just like 1 Button instance when created. This way it is a dropin replacement basically.
> ShapedBitmapButtonAdv is a subclass of ShapedBitmapButton
> With the advanced techniques the button instances "talk" or "discuss" with each other about what event is really going on and how to draw. Then process the event 
> which in turn `not really` "walks back down the tree" and redraws the original button correctly as if that instance is the actual instance.
> I have tested the basic class with absolute positioning and have tests for all the different sizers, so the basic class is pretty solidly tested.
> I guess it could be explained like this also... ummm
> The event has to be recreated exactly(signed by the lead) and passed around like a charter to sign basically...

Gotcha. This just seems a fairly complex system to draw some buttons, and I'm wondering what issue exactly this system was built to resolve. Is this the overlap thing you mentioned earlier? wx.DC uses very dated APIs on Windows that don't support a lot of modern drawing operations, and so sometimes very simple drawing tasks become a huge hassle to implement. Multi-control transparency particularly can be a huge headache because the Win implementation of wx.DC uses APIs that really pre-date transparency support entirely. (MS bolted on some transparency support later, but it only works in certain circumstances.) Often, you can get better results simply by using wx.GraphicsContext or, as Chris mentioned in another thread, wx.GCDC if you want to get the good stuff but keep your code as-is.

Regards,

Kevin

> -- 
> You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.