Convert GtkWindow to GdkDrawable



My window object is a GtkWidget so how to convert GtkWidget to GdkWindow?
What is the link between GTK library and GDK library?
See my code:

GtkWidget *window;
        
gtk_init (&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL); 
gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER); 
gtk_window_set_default_size(GTK_WINDOW(window),500,300);
        
HWND hwnd = GDK_WINDOW_HWND(GDK_DRAWABLE(window));

gtk_widget_show_all(window);

I have a message: invalid cast from 'GtkWindow' to 'GdkDrawable'




-----Message d'origine-----
De : Tor Lillqvist [mailto:tml iki fi]
Envoye : dimanche 28 septembre 2003 04:10
A : Laurent Houdusse
Objet : Re: GTK interface with DirectX


Laurent Houdusse writes:
With windows API,it is enough to pass window handle to Direct3D object

You can get the window handle of a GdkWindow with

#include <gdk/gdkwin32.h>

  ...
  GdkWindow *window;
  ...
  HWND hwnd = GDK_WINDOW_HWND (window);

--tml








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