8

I would need to make a

slider = wx.Slider(self, 100, 25, 1, 100, (30, 60), (250, -1), wx.SL_HORIZONTAL)

enter image description here

have a transparent background (because it appears on a panel which has a non-uniform background).

More generally, how is it possible possible to change its look to something like this ?

enter image description here

(I am open to use .png files for the widget elements, if needed.)

Basj
  • 41,386
  • 99
  • 383
  • 673

1 Answers1

4

No, wxWidgets uses native look and feel and native controls under Windows look like your top screenshot, not the bottom one. If you want to have a custom look, you really need to use a custom control.

VZ.
  • 21,740
  • 3
  • 39
  • 42
  • Ok so I need to create my own control by subclassing `wx.PyControl` (or another one? which one?) and do the binding myself for moving the slider image ? But the problem will be the same : how to have transparency for `wx.PyControl` ? – Basj Feb 10 '14 at 08:22
  • Look at `samples/erase/erase.cpp` in wxWidgets distribution. Be warned that child window transparency is unfortunately not supporte under all platforms. – VZ. Feb 10 '14 at 13:35
  • So what is the good solution (working on all platform) to have a `wx.PyControl` widget which will not have a rectangle black or white background, but rather will be blended into its parent window ? – Basj Feb 21 '14 at 09:12
  • I'm okay for building a custom widget : 1 `wx.StaticBitmap` for the horizontal line + 1 Bitmap for the circle moving part (what kind of `wx` object for that ? Not a `StaticBitmap` I imagine...)... How to make that this circle moving part is circle and not rectangular ? – Basj Feb 21 '14 at 23:11