Click here to Skip to main content
15,886,652 members
Articles / Programming Languages / C#

Custom controls with MonoDevelop and GTK#

Rate me:
Please Sign up or sign in to vote.
4.40/5 (9 votes)
18 May 2008GPL35 min read 112.3K   1.7K   32  
Movable controls with customized rendering on Linux with Mono.
// ------------------------------------------------------------------------------
//  <autogenerated>
//      This code was generated by a tool.
//      Mono Runtime Version: 2.0.50727.42
// 
//      Changes to this file may cause incorrect behavior and will be lost if 
//      the code is regenerated.
//  </autogenerated>
// ------------------------------------------------------------------------------



public partial class MainWindow {
    
    private Gtk.HPaned hpaned1;
    
    private Gtk.VPaned vpaned2;
    
    private Gtk.Label label1;
    
    private GtkControl.MVPanel mvpanel1;
    
    private Gtk.VPaned vpaned1;
    
    private Gtk.Label label2;
    
    private Gtk.ScrolledWindow GtkScrolledWindow;
    
    private Gtk.TextView textview1;
    
    protected virtual void Build() {
        Stetic.Gui.Initialize(this);
        // Widget MainWindow
        this.Name = "MainWindow";
        this.Title = Mono.Unix.Catalog.GetString("MainWindow");
        this.WindowPosition = ((Gtk.WindowPosition)(4));
        // Container child MainWindow.Gtk.Container+ContainerChild
        this.hpaned1 = new Gtk.HPaned();
        this.hpaned1.CanFocus = true;
        this.hpaned1.Name = "hpaned1";
        this.hpaned1.Position = 170;
        // Container child hpaned1.Gtk.Paned+PanedChild
        this.vpaned2 = new Gtk.VPaned();
        this.vpaned2.CanFocus = true;
        this.vpaned2.Name = "vpaned2";
        this.vpaned2.Position = 28;
        // Container child vpaned2.Gtk.Paned+PanedChild
        this.label1 = new Gtk.Label();
        this.label1.Name = "label1";
        this.label1.LabelProp = Mono.Unix.Catalog.GetString("label1");
        this.vpaned2.Add(this.label1);
        Gtk.Paned.PanedChild w1 = ((Gtk.Paned.PanedChild)(this.vpaned2[this.label1]));
        w1.Resize = false;
        // Container child vpaned2.Gtk.Paned+PanedChild
        this.mvpanel1 = new GtkControl.MVPanel();
        this.mvpanel1.Events = ((Gdk.EventMask)(768));
        this.mvpanel1.Name = "mvpanel1";
        this.vpaned2.Add(this.mvpanel1);
        this.hpaned1.Add(this.vpaned2);
        Gtk.Paned.PanedChild w3 = ((Gtk.Paned.PanedChild)(this.hpaned1[this.vpaned2]));
        w3.Resize = false;
        // Container child hpaned1.Gtk.Paned+PanedChild
        this.vpaned1 = new Gtk.VPaned();
        this.vpaned1.CanFocus = true;
        this.vpaned1.Name = "vpaned1";
        this.vpaned1.Position = 49;
        // Container child vpaned1.Gtk.Paned+PanedChild
        this.label2 = new Gtk.Label();
        this.label2.Name = "label2";
        this.label2.LabelProp = Mono.Unix.Catalog.GetString("label2");
        this.vpaned1.Add(this.label2);
        Gtk.Paned.PanedChild w4 = ((Gtk.Paned.PanedChild)(this.vpaned1[this.label2]));
        w4.Resize = false;
        // Container child vpaned1.Gtk.Paned+PanedChild
        this.GtkScrolledWindow = new Gtk.ScrolledWindow();
        this.GtkScrolledWindow.Name = "GtkScrolledWindow";
        this.GtkScrolledWindow.ShadowType = ((Gtk.ShadowType)(1));
        // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
        this.textview1 = new Gtk.TextView();
        this.textview1.CanFocus = true;
        this.textview1.Name = "textview1";
        this.GtkScrolledWindow.Add(this.textview1);
        this.vpaned1.Add(this.GtkScrolledWindow);
        this.hpaned1.Add(this.vpaned1);
        this.Add(this.hpaned1);
        if ((this.Child != null)) {
            this.Child.ShowAll();
        }
        this.DefaultWidth = 675;
        this.DefaultHeight = 464;
        this.Show();
        this.DeleteEvent += new Gtk.DeleteEventHandler(this.OnDeleteEvent);
        this.mvpanel1.KeyPressEvent += new Gtk.KeyPressEventHandler(this.OnMvpanel1KeyPressEvent);
        this.mvpanel1.KeyReleaseEvent += new Gtk.KeyReleaseEventHandler(this.OnMvpanel1KeyReleaseEvent);
        this.mvpanel1.ButtonPressEvent += new Gtk.ButtonPressEventHandler(this.OnMvpanel1ButtonPressEvent);
        this.mvpanel1.ButtonReleaseEvent += new Gtk.ButtonReleaseEventHandler(this.OnMvpanel1ButtonReleaseEvent);
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions