[Gtk-sharp-list] Redraw window

martin (OpenGeoMap) martin at opengeomap.org
Mon May 19 21:08:47 EDT 2008


Hi:

I don't understand well the exceptions here, but perhaps it was well.  I 
use  more simple code.

I see in gtkmm, ruby/gnome and obvioulsy in the C API:

GTK# sample:
http://www.go-mono.com/docs/index.aspx?link=T%3aGtk.FileFilter
Ruby sample:
http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3AFileChooserDialog
GTKMM sample:
http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/sec-dialogs-filechooserdialog.html

ruby and c++ have exceptions like c# but they don't use it here.


For me the C API is always my reference:
http://library.gnome.org/devel/gtk/2.11/GtkFileChooserDialog.html


I test this simple code to solve your problem i think:



    protected virtual void OnButton1Clicked (object sender, 
System.EventArgs e)
    {
       
        FileChooserDialog fc=new FileChooserDialog("hola mundo",this,
                                                   
FileChooserAction.Open, "Abort", ResponseType.Cancel, "Open",
                                                   ResponseType.Accept);
       
        Gtk.FileFilter filter=new Gtk.FileFilter();
        filter.Name="C/C++ files";
        filter.AddPattern("*.cc");       
        fc.AddFilter(filter);
       

        if (fc.Run()==(int)ResponseType.Accept) {
            System.Console.Write("filename is {0} \n",fc.Filename);

        }
        fc.Destroy();
       
        fc=new FileChooserDialog("hola mundo",this,
                                                   
FileChooserAction.Open, "Abort", ResponseType.Cancel, "Open",
                                                   ResponseType.Accept);
       
        if (fc.Run() ==(int)ResponseType.Accept) {
            System.Console.Write("filename is {0} \n",fc.Filename);

        }
        fc.Destroy();
       
       
   
    }


can this help you?


Regards.






More information about the Gtk-sharp-list mailing list