RadioBox text is "clipped" on OSX (wxpy 3.0.2)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

RadioBox text is "clipped" on OSX (wxpy 3.0.2)

Brendan Simon (eTRIX)
I have a radiobox selection control, that is placed on a SizedControl.Panel, and the end of the text is clipped (not rendered properly).

The text was ok with wxpy-2.8.12.1 (Carbon), but is corrupted with wxpy-3.0.2 (Cocoa).

If I had 4 extra spaces to the end of the text, then I can get it to display the text properly (but the control is a little wider).

See the image at this link.

https://drive.google.com/file/d/0B1t5vV7Go1zbOTA5TjVyRkZ4bGs/view?usp=sharing

Any idea how to fix this?
What has changed in wxpy-3.0.2?  Or is it a Cocoa issue?

#-----------------------------------------------------------------------------

import wx
import wx.lib.sized_controls as wxSC

#-----------------------------------------------------------------------------

class MyRadioBoxSelection(wxSC.SizedPanel):

    def __init__(self, *args, **kwargs):

        choices = kwargs.pop('choices', None)

        wxSC.SizedPanel.__init__(self, *args, **kwargs)

        rb = wx.RadioBox(self, label='Choices', choices=choices, majorDimension=1)
        rb.SetSizerProps(halign='left')

#-----------------------------------------------------------------------------

class MyDialog(wxSC.SizedDialog):

    def __init__(self, *args, **kwargs):
        """My Dialog constructor."""

        wxSC.SizedDialog.__init__(self, *args, **kwargs)

        pane = self.GetContentsPane()
        pane.SetSizerType(type='vertical')

        choices1 = [
                'This is choice number one',
                'Choice two',
                'Three    ',
                'and Four',
                ]

        choices2 = [
                'This is choice number one    ',
                'Choice two    ',
                'Three    ',
                'and Four    ',
                ]

        rb1 = MyRadioBoxSelection(parent=pane, choices=choices1)
        rb2 = MyRadioBoxSelection(parent=pane, choices=choices2)
        self.Fit()

#-----------------------------------------------------------------------------

def main_test():
    app = wx.App(redirect=False)

    sty = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
    dlg = MyDialog(parent=None, style=sty)
    dlg.Centre()
    dlg.ShowModal()
    dlg.Destroy()

    app.MainLoop()

#-----------------------------------------------------------------------------
if __name__ == '__main__':
    main_test()
#-----------------------------------------------------------------------------


Thanks, Brendan.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.