Re: Window size



Did you try this :

gdk_window_resize               (GdkWindow *window,
                                             gint width,
                                             gint height);

To get the GdkWindow object of your Widget, just do it that way :
GTK_WIDGET(MyWindow)->window

(N.B. if MyWindow is a GtkWidget* then you don't need to cast it with
GTK_WIDGET, simply write : MyWindow->window)


Best regards,
---
Jean-Christophe Berthon

Cap Gemini -- Ernst & Young
France
Skill IS -- Image Quality
Email: Jean-Christophe Berthon cgey com
Tel: (+33) 561 31 6671


----- Original Message -----
From: "Jean-Yves Lamoureux" <jylam lnxscene org>
To: <gtk-list gnome org>
Sent: Tuesday, March 26, 2002 12:10 PM
Subject: Window size


> Hi all,
> I'm walking through gtk 1.2 doc since 1 or 2 hours and I can find a
working
> way to set the size of a window.
> gtk_window_set_geometry_hints don't works, gtk_window_set_default_size
too.
> Have I misunderstanding something ?
> (note the window is opened, but in something like 10x10)
> Thanks a lot
>
> Jylam
>
>
>
> Here is my code :
>
>
> void OpenWindow(int width, int height, unsigned char *title)
> {
>   MyWindow = (LnxWindow*) malloc(sizeof(LnxWindow));
>
> MyWindow->MyGeometry.base_width = width;
>         MyWindow->MyGeometry.base_height = height;
>
>         gtk_init(NULL, NULL);
>         MyWindow->window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
>         gtk_window_set_default_size (GTK_WINDOW(MyWindow->window),
>         MyWindow->MyGeometry.base_width,
MyWindow->MyGeometry.base_height);
>         gtk_window_set_geometry_hints (GTK_WINDOW(MyWindow->window), NULL,
>
&MyWindow->MyGeometry,
>
GDK_HINT_BASE_SIZE);
>         gtk_window_set_title(GTK_WINDOW(MyWindow->window), title);
>         gtk_signal_connect(GTK_OBJECT(MyWindow->window),  "destroy",
>         GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
>         gtk_window_set_policy (GTK_WINDOW(MyWindow->window), FALSE, FALSE,
>                                            FALSE);
>         gtk_widget_show((GtkWidget*)MyWindow->window);
>         gdk_flush();
>
> }
>
>
>
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list




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