[MonoDevelop] Docking Library Help
Ganesh Sutar
sutarganesh.mail at gmail.com
Fri Jun 12 20:14:58 UTC 2015
Hi,
I am trying to use Docking library to create simple Docking Library Sample.
Here is the code but I am unable to display simple tabs in it.
public class MainWindow : Window
{
private DockNotebook book;
private DockFrame dock;
private DockItem docs;
private VBox fullBox;
public MainWindow () : base(Gtk.WindowType.Toplevel)
{
Title = "Main Window";
fullBox = new VBox ();
dock = new DockFrame ();
fullBox.Add (dock);
dock.CompactGuiLevel = 1;
docs = dock.AddItem ("Documents");
book = new DockNotebook ();
book.InitSize (this);
docs.Behavior = DockItemBehavior.Locked;
docs.DefaultVisible = true;
docs.DrawFrame = false;
docs.Expand = true;
docs.Content = book;
AddTab ("One");
DockItem item = dock.AddItem ("__left");
item.DefaultLocation = "Documents/Left";
item.Behavior = DockItemBehavior.Locked;
item.DefaultVisible = true;
Notebook nb = new Notebook ();
item.Content = nb;
DockVisualStyle style = new DockVisualStyle ();
dock.DefaultVisualStyle = style;
nb.AppendPage (new Label ("Hello"), new Label ("Hello"));
fullBox.ShowAll ();
Add (fullBox);
}
private void AddTab( string title )
{
TextDocument doc = new TextDocument();
TextEditorOptions options = new TextEditorOptions(){ HighlightCaretLine =
true };
TextEditor editor = new TextEditor(doc,options);
ScrolledWindow sw = new ScrolledWindow();
sw.Add( editor );
var tab = book.InsertTab(-1);
tab.Text = title;
tab.Content = sw;
doc.Text = "" + title;
Console.WriteLine ("Adding {0}", title);
editor.ShowAll ();
sw.ShowAll ();
}
protected override bool OnDeleteEvent (Gdk.Event evnt)
{
Xwt.Application.Exit ();
return base.OnDeleteEvent (evnt);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/monodevelop-list/attachments/20150613/fc56dcab/attachment.html>
More information about the Monodevelop-list
mailing list