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
Gtk-CRITICAL **:gtk_message_dialog_new: assertion `parent == NULL ||
GTK_IS_WINDOW (parent)’ failed
So: is there a way that I can create a Gtk::MessageDialog or other Gtk
window with a Gdk window as parent?
For the curious minds: what I am trying to do is to make a ruby
screensaver wrapper for win32. It consists of a .c executable that
functions as a windows screensaver and invokes a ruby script that
shall be the actual screensaver. When the windows “display properties”
app wants to call the configuration dialog, it calls the executable
with its own window handle as argument. This of cause works for
windows apps, but shouldn’t it be possible to make this work with Gtk?