Re: Saving window position



On 11/03/2008, Gorshkov <listsubscriptions oghma on ca> wrote:
 to set the window position/size:

            gtk_window_move(window, x, y);
            gtk_window_set_default_size(window, width, height);

I thought of another point to bear in mind: some window managers
become unhappy if you set a size larger than the screen. It's a good
idea to clip the size against the known scrren size:

        GdkScreen *screen = gtk_widget_get_screen( GTK_WIDGET( iwnd ) );

                gtk_window_set_default_size( GTK_WINDOW( iwnd ),
                        IM_MIN( width, gdk_screen_get_width( screen ) ),
                        IM_MIN( height, gdk_screen_get_height( screen ) ) );

John



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