Hi,
I'm trying to use GTK & GDK-API at the same time and can't seem to even move a window. What am I doing wrong?
gtk_init_(0,0)
gdk_init_(0,0)
window = gtk_window_new_(#GTK_WINDOW_TOPLEVEL)
gtk_window_set_position_(window,#GTK_WIN_POS_CENTER)
gtk_window_set_title_(window, @"MyWindow")
gtk_widget_show_(window)
;gdk_window_move_(window,200,200) ; <- This does not work...
gtk_main_()
End
Using GTK & GDK-API
A GtkWindow is not the same as a GdkWindow. They are different handles.
You can't just use the 'window' variable in a gdk call.
The GtkWidget structure (which is inside the GtkWindow one) contains a field
that stores the gtk window identifyer for that widget.
first do his:
*window.GtkWidget = gtk_window_new_(#GTK_WINDOW_TOPLEVEL)
(and of course use *window instead of window for the gtk calls)
then for the gdk call, use this:
gdk_window_move_(*window\window,200,200)
(there is also *window\parent which is the gdk identifyer of the widgets parent)
You can't just use the 'window' variable in a gdk call.
The GtkWidget structure (which is inside the GtkWindow one) contains a field
that stores the gtk window identifyer for that widget.
first do his:
*window.GtkWidget = gtk_window_new_(#GTK_WINDOW_TOPLEVEL)
(and of course use *window instead of window for the gtk calls)
then for the gdk call, use this:
gdk_window_move_(*window\window,200,200)
(there is also *window\parent which is the gdk identifyer of the widgets parent)
quidquid Latine dictum sit altum videtur

