mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-04 19:10:09 +01:00
workaround bad default size of wx.SearchCtrl on gtk3
(cherry picked from commit 1d1f4f712a)
This commit is contained in:
@@ -1493,6 +1493,14 @@ class wxPythonDemo(wx.Frame):
|
||||
lambda e: self.filter.SetValue(''))
|
||||
self.filter.Bind(wx.EVT_TEXT_ENTER, self.OnSearch)
|
||||
|
||||
if 'gtk3' in wx.PlatformInfo:
|
||||
# Something is wrong with the bestsize of the SearchCtrl, so for now
|
||||
# let's set it based on the size of a TextCtrl.
|
||||
txt = wx.TextCtrl(leftPanel)
|
||||
bs = txt.GetBestSize()
|
||||
txt.DestroyLater()
|
||||
self.filter.SetMinSize((-1, bs.height+4))
|
||||
|
||||
searchMenu = wx.Menu()
|
||||
item = searchMenu.AppendRadioItem(-1, "Sample Name")
|
||||
self.Bind(wx.EVT_MENU, self.OnSearchMenu, item)
|
||||
|
||||
Reference in New Issue
Block a user