[9379] 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 (Marsel Osipov)
Sun Oct 18 00:31:25 1998

Date: Sat, 17 Oct 1998 21:31:11 -0700
From: Marsel Osipov <virtuoso@jps.net>
To: gtk-list@redhat.com
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

david wrote:

> 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());
>
> }
>

Hm.. Strange...looks fine to me

> Any idea why this don't work ?
>
> Thanks
>
> david
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



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


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