質問

I have a FlexGridSizer that I add a bunch of TextCtrl to, some of which are for users to enter a path, so I have a Button in the adjacent column to the right of those TextCtrl boxes. The label text is ... and I only call AddGrowableCol on the columns with TextCtrl in them... here is how I'm adding the Button in my for loop (I don't use addmany):

widgetItem = wx.Button(parent, -1, "...")
widgetItem.row=rowNum
widgetItem.col=colNum
widgetItem.target = lastTextBox
self.Bind(wx.EVT_BUTTON, self.getFile, widgetItem)
currentSizer.AddF(widgetItem, wx.SizerFlags(0).Border(wx.ALL, 5))
役に立ちましたか?

解決

Ah, what I was thinking would be called shrink-wrapped or shrink-to-fit, is called exactfit by wxPython: wxPython docs on Button class, style section

wx.BU_EXACTFIT

here is how I had to instantiate the Button:

widgetItem = wx.Button(parent, -1, "...", style=wx.BU_EXACTFIT)
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top