Re: Question about windows in gtk+

Oliver Buecker wrote:

I'm a studen from Germany.

I programmed a user-interface with the GtkWindow struct.
Now I have to change the icon and the backgroundcolor of
my user-interface.

I looked for it, and found the funktion "gdk_window_set_icon" and
"gdk_window_set_background", but therefore I need the
GdkWindow struct. But after I implemented it I could not add a
table anymore "gtk_container_add (GTK_CONTAINER (Window), table);"

Can you tell me either how I can set the icon of the window, or how to
add a gtk-table on a GdkWindow.

I am not quite shure if I fully understand the problem. But it seems you already had a working implementation 
based on a GtkWindow (which is a GtkWidget). Now you need a GdkWindow? From the GtkWidget you can access the 
component "window" which points to a GdkWindow. See the definition of GtkWidget in gtkwidget.h:
struct _GtkWidget
  /* The widgets window or its parent window if it does
   *  not have a window. (Which will be indicated by the
   *  GTK_NO_WINDOW flag being set).
  GdkWindow *window;

so for example:

GtkWidget* window;
window->window; /* gives a GdkWindow which can be used in gdk calls such as:/*
pixmap = gdk_pixmap_create_from_xpm( window->window,
                                     "test.xpm" );

Did I get your question at all?

    _/_/_/ _/  _/        Jan Boehm  Dipl.-Inform. M.Sc.
   _/_/_/    _/   _/_/   Institut fuer Photogrammetrie
  _/_/_/ _/ _/_/ _/ _/   Universitaet Stuttgart
 _/_/_/ _/ _/   _/_/     Geschwister-Scholl-Str. 24
          _/   _/        D-70174 Stuttgart
Tel : +49-711-121-4110   Email : jan boehm ifp uni-stuttgart de 
Fax : +49-711-121-3297   WWW   :

Attachment: jan.boehm.vcf
Description: Card for Jan Böhm

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