Not sure if this is a pygtk or gnome-shell bug, will post here first.

If set_has_frame(True) is called, then the window position is never updated 
when you move it, only the initial position of the window is reported.

Test program below:



#!/usr/bin/python

import gtk

class app(gtk.Window):

  def __init__(self):
    super(app, self).__init__()

    self.set_position(gtk.WIN_POS_CENTER)
    self.set_title("Window Position Test")
    #self.set_decorated(True)
    self.set_has_frame(True)
    self.set_resizable(True)
    #self.set_default_size(320, 50)
    self.connect("destroy", gtk.main_quit)
    self.connect("configure-event", self.update_pos)
    
    vbox = gtk.VBox(spacing=4)
    hbox = gtk.HBox(spacing=4)

    self.pos_label = gtk.Label()
    self.pos_label.set_label('Test')
    vbox.add(self.pos_label)

    self.add(vbox)

    self.update_pos()
    self.show_all()



  def update_pos(self, *args):
    ''' Get window position, display + log '''
    pos = str( self.get_position() )
    print( pos )
    self.pos_label.set_label( pos )


app()
gtk.main()
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to