Mono, Gtk.FileChooserWidget [Gtk#]

These days I ‘m in blog post mood :) so here is another small code snippet…

Code:


using System.Collections.Generic;
using System.Text;
using Gtk;
using GtkSharp;
using GLib;
namespace test
{
class  printTest : Window
{
private Gtk.Fixed fixed1;
private Gtk.ScrolledWindow GtkScrolledWindow;
private Button exit;
>private Gtk.FileChooserWidget filechooserwidget1;
public  printTest()
: base("test")
{
// Widget MainWindow
this.Name = "MainWindow";
this.WindowPosition = ((Gtk.WindowPosition)(4));
// Container child MainWindow.Gtk.Container+ContainerChild
this.fixed1 = new Gtk.Fixed();
this.fixed1.Name = "fixed1";
this.fixed1.HasWindow = false;
// Container child fixed1.Gtk.Fixed+FixedChild
this.GtkScrolledWindow = new Gtk.ScrolledWindow();
this.GtkScrolledWindow.WidthRequest = 240;
this.GtkScrolledWindow.HeightRequest = 300;
this.GtkScrolledWindow.Name = "GtkScrolledWindow";
this.GtkScrolledWindow.ShadowType = ((Gtk.ShadowType)(2));
// Container child GtkScrolledWindow.Gtk.Container+ContainerChild
Gtk.Viewport w1 = new Gtk.Viewport();
w1.ShadowType = ((Gtk.ShadowType)(2));
// Container child GtkViewport.Gtk.Container+ContainerChild
this.filechooserwidget1 = new Gtk.FileChooserWidget(((Gtk.FileChooserAction)(4)));
this.filechooserwidget1.WidthRequest = 350;
this.filechooserwidget1.HeightRequest = 116;
this.filechooserwidget1.Name = "filechooserwidget1";
w1.Add(this.filechooserwidget1);
this.GtkScrolledWindow.Add(w1);
exit=new Button();
exit.Label="bye bye love...";
exit.SetSizeRequest(240,20);
exit.Clicked+= new EventHandler(exit_Clicked);
this.fixed1.Put(exit,0,0);
this.fixed1.Add(this.GtkScrolledWindow);
Gtk.Fixed.FixedChild w4 = ((Gtk.Fixed.FixedChild)(this.fixed1[this.GtkScrolledWindow]));
w4.X = 0;
w4.Y = 20;
this.Add(this.fixed1);
if ((this.Child != null)) {
this.Child.ShowAll();
}
this.DefaultWidth = 240;
this.DefaultHeight = 320;
this.Show();
}
void exit_Clicked(object sender, EventArgs e)
{
this.Destroy();
}
public static void Main()
{
Application.Init();
new printTest();
Application.Run();
}
}
}

Output:

filebrowser
Become a Friend of GNOME

kick it on DotNetKicks.com


About these ads