wx.slider custom image

If anyone is familiar with any online poker client, I am looking to do the
same thing for a program I am making. I have everything working
functionally, however the slider is super ugly. A couple questions...

Is it possible to make a custom graphic to be used instead of the one
wxpython displays?

How hard would this be to do? I would say I'm advanced begginer in wxpython
and python in general. Is it something I could tackle?

If it is possible, and isn't Herculean, where would I start to look to
figure out how to do it?

Thank you very much!

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/wx-slider-custom-image-tp5717688.html
Sent from the wxPython-users mailing list archive at Nabble.com.

Is it possible to make a custom graphic to be used instead of the one

wxpython displays?

Absolutely! I suspect it will take quite a bit of painstaking testing and adjusting to get it to look exactly like you want, however, especially if you care about cross-platform consistency. It’s not a bad idea though; the native slider is pretty lousy on wxOSX-Cocoa (and possibly any non-Windows system).

How hard would this be to do? I would say I’m advanced begginer in wxpython

and python in general. Is it something I could tackle?

Maybe, if you’re good at learning on the fly from examples (which I suspect is the only way anyone picks up this knowledge). I’m going to estimate that it would end up being anywhere between 500 and 1000 lines of code. An experienced programmer could probably implement a working prototype within a day, given enough coffee and no interruptions. Then add a couple of weeks of intermittent but intensive testing, at least one request for help on the list, and so on. (That’s what always happens to me, anyay.) This may vary if there are already examples that do most of what you need (and/or you only need your app to look good on one OS).

I would say that in general there’s nothing about the coding style that would be particularly difficult to pick up; I found the various custom controls remarkably easy to understand, but it took me much longer to figure out the quirks and limitations of the drawing and event APIs.

If it is possible, and isn’t Herculean, where would I start to look to

figure out how to do it?

I would start by looking at some of the custom controls in the wxPython demo to get a feel for what is possible and how you might manage the various events and effects. I think they’ll mostly be in the wx.lib submodule (especially wx.lib.agw).

-Nat

···

On Mon, Jun 10, 2013 at 8:58 AM, Justin Merrell justin@toxicshock.biz wrote:

If anyone is familiar with any online poker client, I am looking to do the
same thing for a program I am making. I have everything working
functionally, however the slider is super ugly. A couple questions...

Is it possible to make a custom graphic to be used instead of the one
wxpython displays?

Sure. If it can be drawn on the screen (and what can't?), you can
make pretty much whatever you want.

How hard would this be to do? I would say I'm advanced begginer in wxpython
and python in general. Is it something I could tackle?

I don't think it would be very hard, but not trivial, either, for
someone at your level.

If it is possible, and isn't Herculean, where would I start to look to
figure out how to do it?

Have you seen this page?:
http://wiki.wxpython.org/CreatingCustomControls

Another way that's maybe kind of hacky but might be OK for your
purpose is to sort of cobble something together with other controls
and some event handling, put it all on its own panel, and then import
that panel whenever you need the custom slider. So for example, if
you want a slider with an image of a glazed donut moving along the
line instead of a little grey wedged shaped thing, you could probably
use a drawn-on line, a wxBitmapCtrl (both of these put on a panel
along with staticText for the readout numerals) the various
right_down, mouse move, and right up events, and update its position
accordingly to and move the image around, constraining it to the y
position of the line, then read out its x position where it lands up
and convert it to the quantity the user is selecting with the slider,
update the numerals text, and you're done.

Che

I've done the second

···

On Sun, Jun 9, 2013 at 6:58 PM, Justin Merrell <justin@toxicshock.biz> wrote: