From: Masao Mutoh Date: 2007-02-13T21:59:07+09:00 Subject: Re: GtkDialog with GdkWindow as parent Hi, On Tue, 13 Feb 2007 06:15:09 +0900 "Christian Madsen" wrote: > I am trying to create a Gtk::MessageDialog with a win32 window as its > parent (the reason comes in the end). Now, it is possible to make a > Gdk::Window wrapper using > require 'gtk2' > > win = Gdk::Window.foreign_new ARGV[0].to_i > > But I cannot create a Gtk::MessageDialog with the Gdk::Window as > parent > > Gtk::MessageDialog.new(win, > Gtk::MessageDialog::MODAL, > Gtk::MessageDialog::INFO, > Gtk::MessageDialog::BUTTONS_OK, > "foreign_test") > > gives me the warning > > GLib-GObject-WARNING **:invalid cast from `GdkWindow' to `GtkWindow' > > which is fair enough and the failed assertion The error message means "Use Gtk::Window instead of Gdk::Window". You need to use Gtk::Window as the parent.