[9341] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: Root & fullscreen windows

daemon@ATHENA.MIT.EDU (david)
Thu Oct 15 17:12:10 1998

Date: Fri, 16 Oct 1998 00:08:56 +0200
From: david <dramboz@imaginet.fr>
To: gtk-list@redhat.com
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

I've tried what you told me. This works to make 
a fullscreen window but then i can't restore 
the saved geometry  of the window.

Here's the code :

typedef struct _MyWidget {
	GtkWidget *w;
	gint ww, wh, wx, wy;
} MyWidget;

/* w->ww is always equal to 0 the first 
   time this function is called */
void
toggle_fullscreen( MyWidget *w) {
  GtkWidget *top;
	
  if ( !GTK_WIDGET_VISIBLE( w->w))
    return;

  top = gtk_widget_get_toplevel( w->w);

  if ( w->ww) {	
    /* restore the saved window geometry */
    gtk_widget_set_usize( top, w->ww, w->wh);
    gtk_widget_set_uposition( top, w->wx, w->wy);

    w->ww = 0;

  } else {
    /* make the window fullscreen */

    /* save the window geomtry */
    w->wx = top->allocation.x;
    w->wy = top->allocation.y;
    w->ww = top->allocation.width;
    w->wh = top->allocation.height;

    gtk_widget_set_uposition( top, 0, 0);
    gtk_widget_set_usize( top, gdk_screen_width(),
                          gdk_screen_height());

}

Any idea why this don't work ?

Thanks

david

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post