[pygtk] loading a glade window with user-preferred size and location

John Pye john.pye at student.unsw.edu.au
Fri Feb 10 11:49:45 WST 2006


Hi all

The following doesn't seem to work for me unless I switch the
'set_default_size' to 'resize'. Is this because of something I'm doing
with Glade?


        self.window = glade.get_widget("browserwin")

        _display = self.window.get_screen().get_display().get_name()

        # my own routine for the previously saved window position....
        _geom=self.prefs.getGeometrySizePosition(_display,"browserwin")

        if _geom:
            self.window.set_default_size(_geom[0],_geom[1])
            #self.window.resize(_geom[0],_geom[1])
            self.window.move(_geom[2],_geom[3])


The problem with this approach is that the window first shows up at the
Glade-specified size, then is resized later to the user-preferenced
default size. So somehow I'm failing to 'set_default_size' before the
window is first drawn.

Does this mean I can't use Glade to create a user-preference-sized
window? Is there a better way of doing all this?

Cheers
JP

-- 
John Pye
School of Mechanical and Manufacturing Engineering
The University of New South Wales
Sydney  NSW 2052  Australia
t +61 2 9385 5127
f +61 2 9663 1222
mailto:john.pye_AT_student_DOT_unsw.edu.au
http://pye.dyndns.org/



More information about the pygtk mailing list