Re: Move window event?



Hi,

Lars Clausen wrote:
> On request of Windows users and others, I'm trying to add persistent
window
> place and size.  For that, I need to get an event when a window is moved
or
> resized.  Is there such an event available?  The docs don't seem to list
> one (but then, they're very quiet about the uses of events).

I have an ungly hack in my app to do this. On popdown I do:

        window_width = GTK_WIDGET( iv )->allocation.width;
        window_height = GTK_WIDGET( iv )->allocation.height;
        gdk_window_get_root_origin( 
                gtk_widget_get_toplevel( GTK_WIDGET( iv ) )->window,
                &window_x, &window_y );

and on build I do:

        gtk_widget_set_uposition( GTK_WIDGET( iv ),
                window_x, window_y );
        gtk_window_set_default_size( GTK_WINDOW( iv ),
                window_width, window_height );

This is gtk+-1.2, not sure if the get_root_origin() stuff is different in
2.x.

John



========================================================== 

Current Exhibition: 

T I T I A N 

Until 18 May 2003 

Advance Booking Recommended 
Open every day 
Wed-Sat late opening until 9pm 

For information and tickets: 
http://www.nationalgallery.org.uk/exhibitions/titian



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]