[Gtk-sharp-list] Setting the parent Gtk.Window of a FileChooserDialog inserted in a Gtk.Bin

Peter Johanson peter at peterjohanson.com
Fri Aug 22 12:40:50 EDT 2008


On Fri, Aug 22, 2008 at 03:30:39PM +0200, Andoni Morales Alastruey wrote:
> Hi!
> 
> 
> As this is called from the Gtk:bin I cannot set the the parent window
> doing:
> FileChooserDialog fChooser = new FileChooserDialog ( "", this,...

You can do something like:

FileChooserDialog fChooser = new FileChooserDialog ("", base.TopLevel as
Gtk.Window,...

See:

http://library.gnome.org/devel/gtk/stable/GtkWidget.html#gtk-widget-get-toplevel


Alternately, you could use Gtk.Widget.GetAncestor (Gtk.Window.GType) to
get the widget's parent Gtk.Window.

-pete



More information about the Gtk-sharp-list mailing list