Opened 6 years ago

Closed 3 years ago

#2028 closed defect (fixed)

SetVirtualSizeHints is deprecated in wxWidgets 2.9

Reported by: marisn Owned by: grass-dev@…
Priority: minor Milestone: 7.0.5
Component: wxGUI Version: svn-trunk
Keywords: wxPython 3, FitInside Cc:
CPU: Unspecified Platform: Unspecified

Description

"This is exactly the same as FitInside?() in wxWidgets 2.9 and later, please replace calls to it with FitInside?()." http://docs.wxwidgets.org/trunk/deprecated.html#_deprecated000046

Current code just generates warnings when running with wxPython 2.9.4.1

Change History (3)

comment:1 Changed 5 years ago by wenzeslaus

Keywords: wxPython 3 FitInside added

The only occurrences of this warning in trunk r64634 are:

dbmgr/base.py:2895:        layerSizer.SetVirtualSizeHints(self.addPanel)
gui_core/goutput.py:231:                self.outputSizer.SetVirtualSizeHints)(self.panelOutput)

where only the first one is an issue causing following output when dbmgr is started:

.../gui/wxpython/dbmgr/base.py:2895: wxPyDeprecationWarning:
Call to deprecated item 'SetVirtualSizeHints'.
  layerSizer.SetVirtualSizeHints(self.addPanel)

Using the following code from gui_core/goutput.py:

        # eliminate gtk_widget_size_allocate() warnings
        # avoid to use a deprecated method in wxPython >= 2.9
        getattr(self.outputSizer, 'FitInside',
                self.outputSizer.SetVirtualSizeHints)(self.panelOutput)

fixed in r64635 for trunk. This is very safe, but anyway I would backport it between 7.0.0 and 7.0.1 just to be sure. Close afterwards.

No warning generated when starting dbmgr. Tested with wxPython 3.0 (Lubuntu):

GRASS version: 7.1.svn                                                          
GRASS SVN revision: 64565M                                                      
Build date: 2015-01-11                                                          
Build platform: x86_64-unknown-linux-gnu                                        
GDAL: 1.10.1                                                                    
PROJ.4: 4.8.0                                                                   
GEOS: 3.4.2                                                                     
SQLite: 3.8.6                                                                   
Python: 2.7.8                                                                   
wxPython: 3.0.0.0                                                               
Platform: Linux-3.16.0-30-generic-x86_64-with-Ubuntu-14.10-utopic               

comment:2 Changed 3 years ago by martinl

Milestone: 7.0.07.0.5

comment:3 Changed 3 years ago by martinl

Resolution: fixed
Status: newclosed

Already backported to relbr70, closing.

Note: See TracTickets for help on using tickets.