我已经在我的 MacOS catalina 10.15 上安装了 KiCad Mac OSDN 版本:kicad-unified-5.1.9-0-10_14.dmg。我在 windows 和 mac 上测试我的代码。默认情况下,第一个单选按钮用于在 windows 上被选中。但是在 mac catalina 10.15 上测试时,单选按钮没有被选中。你能帮忙在两台机器上如何实现这一点吗?
我正在使用 '3.0.2.0 msw (classic)' wx 版本。
示例代码
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()