File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -87,15 +87,23 @@ def __init__(self):
8787# is available (Issue #347).
8888if LINUX :
8989self .Show ()
90- self .embed_browser ()
90+ # In wxPython 3.0 and wxPython 4.0 handle is still
91+ # not yet available, must delay embedding browser
92+ # (Issue #349).
93+ if wx .version ().startswith ("3." ) or wx .version ().startswith ("4." ):
94+ wx .CallLater (20 , self .embed_browser )
95+ else :
96+ # This works fine in wxPython 2.8
97+ self .embed_browser ()
9198else :
9299self .embed_browser ()
93100self .Show ()
94101
95102def setup_icon (self ):
96103icon_file = os .path .join (os .path .abspath (os .path .dirname (__file__ )),
97104"resources" , "wxpython.png" )
98- if os .path .exists (icon_file ):
105+ # wx.IconFromBitmap is not available on Linux in wxPython 3.0/4.0
106+ if os .path .exists (icon_file ) and hasattr (wx , "IconFromBitmap" ):
99107icon = wx .IconFromBitmap (wx .Bitmap (icon_file , wx .BITMAP_TYPE_PNG ))
100108self .SetIcon (icon )
101109
@@ -132,7 +140,7 @@ def OnSize(self, _):
1321400 , 0 , 0 )
133141elif LINUX :
134142 (x , y ) = (0 , 0 )
135- (width , height ) = self .browser_panel .GetSizeTuple ()
143+ (width , height ) = self .browser_panel .GetSize (). Get ()
136144self .browser .SetBounds (x , y , width , height )
137145self .browser .NotifyMoveOrResizeStarted ()
138146
You can’t perform that action at this time.
0 commit comments