python 2.7 – wx.RadioButton not working on macOS 10.15 Catalina

mac version

I have installed KiCad Mac OSDN version : kicad-unified-5.1.9-0-10_14.dmg on my MacOS catalina 10.15.
Iam testing my code on both windows and mac.Bydefault the first radio button used to get selected on windows.But when testing on mac catalina 10.15,the radio button is not been selected.Can you help how this can be achieved on both machines.

Iam using ‘3.0.2.0 msw (classic)’ wx version .

Sample code

bSizer1311 = wx.BoxSizer( wx.HORIZONTAL )

    self.m_qty11 = wx.RadioButton( self, wx.ID_ANY, u"$50/ea", wx.DefaultPosition, wx.DefaultSize, wx.RB_GROUP )

    bSizer1311.Add( self.m_qty11, 1, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )

    self.m_qty12 = wx.RadioButton( self, wx.ID_ANY, u"$40/ea", wx.DefaultPosition, wx.DefaultSize, 0 )
    bSizer1311.Add( self.m_qty12, 1, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )



    bSizer68.Add( bSizer1311, 1, wx.EXPAND, 5 )

    bSizer13112 = wx.BoxSizer( wx.HORIZONTAL )

    self.m_qty21 = wx.RadioButton( self, wx.ID_ANY, u"$50/ea", wx.DefaultPosition, wx.DefaultSize, 0 )

    bSizer13112.Add( self.m_qty21, 1, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )

    self.m_qty22 = wx.RadioButton( self, wx.ID_ANY, u"$40/ea", wx.DefaultPosition, wx.DefaultSize, 0 )
    bSizer13112.Add( self.m_qty22, 1, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )

  

    self.Bind( wx.EVT_UPDATE_UI, self.onUpdateUI )
    self.m_qty11.Bind( wx.EVT_RADIOBUTTON, self.onSelect11 )
    self.m_qty12.Bind( wx.EVT_RADIOBUTTON, self.onSelect12 )
    self.m_qty21.Bind( wx.EVT_RADIOBUTTON, self.onSelect21 )
    self.m_qty22.Bind( wx.EVT_RADIOBUTTON, self.onSelect22 )

def onSelect11( self, event ):
    event.Skip()

def onSelect12( self, event ):
    event.Skip()


def onSelect21( self, event ):
    event.Skip()

def onSelect22( self, event ):
    event.Skip()



def onSelect11(self, event):
    self.unit_select = 11
    self.m_qty11.SetValue(True)
def onSelect12(self, event):
    self.unit_select = 21
    self.m_qty12.SetValue(True)

def onSelect21(self, event):
    self.unit_select = 12
    self.m_qty21.SetValue(True)
def onSelect22(self, event):
    self.unit_select = 22
    self.m_qty22.SetValue(True)

def onUpdateUI(self, event):
    **code**[enter image description here][2] 
    event.Skip()

windows version

Product of the Month September 2016

Source link

Leave a Comment

Your email address will not be published. Required fields are marked *