SpinButton does not fill expanded space on Raspbian

I have a SpinButton which I want to be larger than its default size; on Windows 10, the following code works to do this:

        control_button_size = wx.Size(100, 50)
        self.buttons['spin'] = wx.SpinButton(self, wx.ID_ANY, style=wx.SP_HORIZONTAL, size=control_button_size)
        self.Bind(wx.EVT_SPIN, self._on_spin_button, self.buttons['spin'])

        effect_label = wx.StaticText(self, label="Pick a value\n to increase\n or decrease")
        control_button_sizer = wx.BoxSizer(wx.HORIZONTAL)
        control_button_sizer.Add(self.buttons['spin'])
        control_button_sizer.AddSpacer(5)
        control_button_sizer.Add(effect_label, 1, wx.ALIGN_CENTER_VERTICAL)
        return control_button_sizer

The up and down button on the SpinControl fill the Size set. However, on a Raspberry Pi 3 running Raspbian, the buttons appear to be their default size and have a text field next to them; the text box contains the SpinButton value that I set in the code, changing as it changes.

Does anyone know how to get the up/down controls to expand to a larger space?

EDIT: If I cannot get this control to expand to its space, is it possible to extend the control and override its painting methods? I tried that (class DrawnSpinButton(wx.SpinButton)), but the OnPaint() function of my subclass does not get called.

When using native widgets (those that are just wrappers around widgets provided by the platform) then we are at the mercy of what they allow us to do with them. We can call the standard native methods to manipulate the widget, but it is up to the widget how it will respond, if at all. For example, on OSX you can set the height of a button to however tall you want, but it will only draw the button at the stock height leaving the rest of the space blank.

To complicate this specific case, the gtk3 widget used to implement wx.SpinButton includes the text portion and wx just sizes the components such that it isn’t visible. (There apparently isn’t a gtk3 widget that is just the spin buttons.) When you change the size then you expose that text part of the widget again.

Again, not for native widgets (usually). In some cases, on some platforms, we’re able to intercept the EVT_PAINT or other events, but you can’t depend on that. Basically, it’s easy to use the native widgets how they were intended to be used, but you’re out of luck when trying to do something with it that falls outside of what it was designed for. (And that can vary by platform.)

Probably your best option for a large spinbutton-like thing would be to use a couple normal buttons, or to create a custom spinbutton widget.