Hello,
Thanks to PyGTK, my popup application is developing quickly. I just added 
code so that remote commands can be sent from local sockets. FAQ entry 
20.1. could mention that INPUT_READ includes new socket connections, and 
that the connection handler must return gtk.TRUE if it wants to get 
further connections. 

Now, my problem is that the client window opens in the right place only 
for the first time. I would love to hear suggestions to improve the 
following code:
def window_show(window):
    """Displays the popup window under the mouse pointer"""
    #window = create_window() # if this is uncommented, positioning works
    window.present() # XXX should be moved before showing
    def position():
        (x,y) = window.get_pointer()
        x = x - 90 # XXX (border +width/2)
        y = y - 60 # XXX (border +title +entry +item/2)
        if x<0: x=0
        if y<0: y=0
        window.move(x, y)
        window.show_all()
        
    position()
    #gtk.timeout_add(0, position) # doesn't help anything

One side of the problem must be that window.hide_all() hasn't brought the 
window to the state where it was right after create_window(). The other 
side is that something in the positioning code causes the window to switch 
between two wrong places after the initial right place.

Debian package versions:
python2.3-gtk2 2.0.0-2
libgtk2.0-0    2.2.1-6
sawfish        1.3-4


Best regards,
Tuukka Hastrup

-- 
-- Trying to catch me? Just follow up my Electric Fingerprints
-- To help you: [EMAIL PROTECTED]
                http://www.iki.fi/Tuukka.Hastrup/
                IRCNet: Stugge/tuukkah @#pii,#fenfire,#ynna
                Jabber ID: [EMAIL PROTECTED], ICQ #11321669

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to