On Linux, it seems that any float that is passed in the tuple is silently ignored and the default value is used.
import wx
class MyFrame(wx.Frame):
def __init__(self, *args, **kwds):
wx.Frame.__init__(self, *args, **kwds)
self.SetSize((400, 200))
self.SetTitle("SetMinSize() Test")
self.panel_1 = wx.Panel(self, wx.ID_ANY)
sizer_1 = wx.BoxSizer(wx.HORIZONTAL)
self.button_1 = wx.Button(self.panel_1, wx.ID_ANY, "button_1")
# If you pass two ints in a tuple they will both be used:
self.button_1.SetMinSize((150, 150))
sizer_1.Add(self.button_1, 0, wx.RIGHT, 8)
self.button_2 = wx.Button(self.panel_1, wx.ID_ANY, "button_2")
# If you pass one int and one float, the int will
# be used, but the float will be silently ignored
self.button_2.SetMinSize((150.5, 150))
sizer_1.Add(self.button_2, 0, wx.RIGHT, 8)
self.button_3 = wx.Button(self.panel_1, wx.ID_ANY, "button_3")
# If you pass two floats in a tuple they will both be silently ignored:
self.button_3.SetMinSize((150.5, 150.5))
sizer_1.Add(self.button_3, 0, 0, 0)
self.panel_1.SetSizer(sizer_1)
self.Layout()
for b in self.button_1, self.button_2, self.button_3:
print(b.GetSize())
app = wx.App()
frame = MyFrame(None, wx.ID_ANY, "")
frame.Show()
app.MainLoop()
Edit: program output:
(150, 150)
(85, 150)
(85, 30)