Glade/Python - positioning main window at startup

mbg1708 at planetmail.com mbg1708 at planetmail.com
Tue Dec 30 08:34:24 EST 2014


Environment: Fedora 21, Linux 3.17.6, XFCE4 (with one workspace)
Python: 2.7.8
Glade: 3.18.3

Background: the application window developed in Glade is (deliberately) somewhat smaller than the desktop.  When the application starts, it starts offset from the center of the desktop.  It looks as though the top left corner of the application window is centered in the desktop.

Problem: Can anyone help me find settings (either in Glade or elsewhere) which will start the application window with the application window center aligned with the desktop center?

Code Fragment:

from gi.repository import Gtk
import string
import subprocess

class AddressApp(object):       
    def __init__(self):
        builder = Gtk.Builder()
        builder.add_from_file("mainwin.xml")
        builder.connect_signals(self)
        self.window        = builder.get_object("window")
        self.lookup_name   = builder.get_object("entry1")
        self.search_result = builder.get_object("treeview1")
        ....



More information about the Python-list mailing list