当前位置: 首页>>代码示例>>C#>>正文


C# Gtk.TreeStore类代码示例

本文整理汇总了C#中Gtk.TreeStore的典型用法代码示例。如果您正苦于以下问题:C# TreeStore类的具体用法?C# TreeStore怎么用?C# TreeStore使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TreeStore类属于Gtk命名空间,在下文中一共展示了TreeStore类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitTreeViewCollapsibleRowsWithIcon

    private TreeView InitTreeViewCollapsibleRowsWithIcon()
    {
        // Model:
        Gtk.TreeStore musicListStore = new Gtk.TreeStore (typeof(Gdk.Pixbuf), typeof(string), typeof(string));
        Gtk.TreeIter iter;

        // View:
        Gtk.TreeView tree = new Gtk.TreeView ();
        tree.AppendColumn ("Icon", new Gtk.CellRendererPixbuf (), "pixbuf", 0);
        tree.AppendColumn ("Artist", new Gtk.CellRendererText (), "text", 1);
        tree.AppendColumn ("Song", new Gtk.CellRendererText (), "text", 2);

        // Controller:
        iter = musicListStore.AppendValues (defaultIcon, "Country");
        musicListStore.AppendValues (iter, "Johnny Cash", "Ring of fire");

        iter = musicListStore.AppendValues ("Punk Rock"); // <- 'Punk Rock' will not be displayed, because column 0 is of type "pixbuf"
        musicListStore.AppendValues (iter, defaultIcon, "Iggy Pop", "The passenger");

        iter = musicListStore.AppendValues ("", defaultIcon, "BLA"); // <- 'defaultIcon' will not be displayed, because column 1 is of type "text"
        musicListStore.AppendValues (iter, defaultIcon, "Stooges", "Dog food");

        // --> MVP:
        tree.Model = musicListStore;
        return tree;
    }
开发者ID:draptik,项目名称:GtkSharpTreeViewDemo,代码行数:26,代码来源:MainWindow.cs

示例2: CombineEntryConfigurationsPanelWidget

		public CombineEntryConfigurationsPanelWidget (MultiConfigItemOptionsDialog dlg)
		{
			Build ();
			
			configData = dlg.ConfigurationData;
			
			store = new TreeStore (typeof(object), typeof(string));
			configsList.Model = store;
			configsList.HeadersVisible = true;
			store.SetSortColumnId (1, SortType.Ascending);
			
			TreeViewColumn col = new TreeViewColumn ();
			CellRendererText sr = new CellRendererText ();
			col.PackStart (sr, true);
			col.AddAttribute (sr, "text", 1);
			col.Title = GettextCatalog.GetString ("Configuration");
			col.SortColumnId = 1;
			configsList.AppendColumn (col);

			foreach (ItemConfiguration cc in configData.Configurations)
				store.AppendValues (cc, cc.Id);

			addButton.Clicked += new EventHandler (OnAddConfiguration);
			removeButton.Clicked += new EventHandler (OnRemoveConfiguration);
			renameButton.Clicked += new EventHandler (OnRenameConfiguration);
			copyButton.Clicked += new EventHandler (OnCopyConfiguration);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:27,代码来源:SolutionItemConfigurationsPanel.cs

示例3: HelpTree

		public HelpTree () : base (GettextCatalog.GetString ("Help"), Gtk.Stock.Help)
		{
			tree_view = new MonoDevelop.Ide.Gui.Components.PadTreeView ();

			tree_view.AppendColumn ("name_col", tree_view.TextRenderer, "text", 0);
			tree_view.RowExpanded += new Gtk.RowExpandedHandler (RowExpanded);
			tree_view.Selection.Changed += new EventHandler (RowActivated);
			
			store = new TreeStore (typeof (string), typeof (Node));
			tree_view.Model = store;
			tree_view.HeadersVisible = false;
			
			scroller = new MonoDevelop.Components.CompactScrolledWindow ();
			scroller.ShadowType = Gtk.ShadowType.None;
			scroller.Add (tree_view);
			
			if (HelpService.HelpTree != null) {
				root_iter = store.AppendValues (GettextCatalog.GetString ("Mono Documentation"), HelpService.HelpTree);
				PopulateNode (root_iter);
	
				tree_view.ExpandRow (new TreePath ("0"), false);
				TreeIter child_iter;
			start:
				if (store.IterChildren (out child_iter, root_iter)) {
					do {
						if (!store.IterHasChild (child_iter)) {
							store.Remove (ref child_iter);
							goto start;
						}
					} while (store.IterNext (ref child_iter));
				}
			}
			Control.ShowAll ();
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:34,代码来源:MonodocTreePad.cs

示例4: CombineConfigurationPanelWidget

            public CombineConfigurationPanelWidget(IProperties CustomizationObject)
                : base("Base.glade", "CombineConfigurationsPanel")
            {
                configuration = (CombineConfiguration)((IProperties)CustomizationObject).GetProperty("Config");

                store = new TreeStore (typeof(object), typeof(string), typeof(bool), typeof(string));
                configsList.Model = store;
                configsList.HeadersVisible = true;

                TreeViewColumn col = new TreeViewColumn ();
                CellRendererText sr = new CellRendererText ();
                col.PackStart (sr, true);
                col.Expand = true;
                col.AddAttribute (sr, "text", 1);
                col.Title = "Solution Item";
                configsList.AppendColumn (col);

                CellRendererToggle tt = new CellRendererToggle ();
                tt.Activatable = true;
                tt.Toggled += new ToggledHandler (OnBuildToggled);
                configsList.AppendColumn ("Build", tt, "active", 2);
                configsList.AppendColumn ("Configuration", new CellRendererText (), "text", 3);

                foreach (CombineConfigurationEntry ce in configuration.Entries)
                    store.AppendValues (ce, ce.Entry.Name, ce.Build, ce.ConfigurationName);
            }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:26,代码来源:CombineConfigurationPanel.cs

示例5: StackTracePad

        public StackTracePad()
        {
            this.ShadowType = ShadowType.In;

            store = new TreeStore (typeof (string));

            tree = new TreeView (store);
            tree.RulesHint = true;
            tree.HeadersVisible = true;

            TreeViewColumn FrameCol = new TreeViewColumn ();
            CellRenderer FrameRenderer = new CellRendererText ();
            FrameCol.Title = "Frame";
            FrameCol.PackStart (FrameRenderer, true);
            FrameCol.AddAttribute (FrameRenderer, "text", 0);
            FrameCol.Resizable = true;
            FrameCol.Alignment = 0.0f;
            tree.AppendColumn (FrameCol);

            Add (tree);
            ShowAll ();

            Runtime.DebuggingService.PausedEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (OnPausedEvent));
            Runtime.DebuggingService.ResumedEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (OnResumedEvent));
            Runtime.DebuggingService.StoppedEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (OnStoppedEvent));
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:26,代码来源:StackTracePad.cs

示例6: PeopleTreeView

        public PeopleTreeView()
        {
            Selection.Mode = SelectionMode.Single;
            HeadersVisible = false;

            peopleTreeStore = new TreeStore(typeof(uint),typeof(string),typeof(Tag));
            this.Model = peopleTreeStore;

            TagStore.ItemsAdded += TagStoreItemsAdded;
            TagStore.ItemsChanged += TagStoreItemsChanged;
            TagStore.ItemsRemoved += TagStoreItemsRemoved;

            complete_column = new TreeViewColumn();

            pix_render = new CellRendererPixbuf();
            complete_column.PackStart(pix_render,false);
            complete_column.SetCellDataFunc(pix_render, new TreeCellDataFunc(IconDataFunc));

            text_render = new CellRendererText();
            complete_column.PackStart( text_render, true);
            complete_column.SetCellDataFunc( text_render, new TreeCellDataFunc( NameDataFunc));

            AppendColumn(complete_column);

            RefreshPeopleTreeStore ();

            //TODO If have time - add people search.
        }
开发者ID:kanitw,项目名称:facespot,代码行数:28,代码来源:PeopleTreeView.cs

示例7: ExceptionCaughtWidget

		public ExceptionCaughtWidget (ExceptionInfo exception)
		{
			this.Build ();

			stackStore = new TreeStore (typeof(string), typeof(string), typeof(int), typeof(int));
			treeStack.Model = stackStore;
			var crt = new CellRendererText ();
			crt.WrapWidth = 200;
			crt.WrapMode = Pango.WrapMode.WordChar;
			treeStack.AppendColumn ("", crt, "markup", 0);
			treeStack.ShowExpanders = false;
			
			valueView.AllowExpanding = true;
			valueView.Frame = DebuggingService.CurrentFrame;
			this.exception = exception;
			
			exception.Changed += HandleExceptionChanged;
			treeStack.SizeAllocated += delegate(object o, SizeAllocatedArgs args) {
				if (crt.WrapWidth != args.Allocation.Width)
					crt.WrapWidth = args.Allocation.Width;
			};
			
			Fill ();
			treeStack.RowActivated += HandleRowActivated;
		}
开发者ID:segaman,项目名称:monodevelop,代码行数:25,代码来源:ExceptionCaughtDialog.cs

示例8: ProjectView

        public ProjectView ()
        {
            Build();
            basename = "base";

            var column = new TreeViewColumn ();

            var iconCell = new CellRendererPixbuf ();
            var textCell = new CellRendererText ();
            var idCell = new CellRendererText ();

            idCell.Visible = false;

            column.PackStart (iconCell, false);
            column.PackStart (textCell, false);
            column.PackStart (idCell, false);

            treeview1.AppendColumn (column);

            column.AddAttribute (iconCell,  "pixbuf", 0);
            column.AddAttribute (textCell, "text", 1);
            column.AddAttribute (idCell, "text", 2);

            listStore = new TreeStore (typeof (Gdk.Pixbuf), typeof (string), typeof (string));

            treeview1.Model = listStore;
            treeview1.Selection.Mode = SelectionMode.Multiple;

            treeview1.ButtonPressEvent += OnTreeview1ButtonPressEvent;
            treeview1.KeyReleaseEvent += HandleKeyReleaseEvent;
            treeview1.ButtonReleaseEvent += OnTreeview1ButtonReleaseEvent;
            treeview1.CursorChanged += OnTreeview1CursorChanged;
        }
开发者ID:KennethYap,项目名称:MonoGame,代码行数:33,代码来源:ProjectView.cs

示例9: ExceptionCaughtWidget

		public ExceptionCaughtWidget (ExceptionInfo exception)
		{
			this.Build ();

			vboxExceptionInfo.Remove (labelMessage);
			var frame = new InfoFrame (labelMessage);
			frame.Show ();
			vboxExceptionInfo.PackStart (frame, false, true, 0);

			stackStore = new TreeStore (typeof(string), typeof(string), typeof(int), typeof(int));
			treeStack.Model = stackStore;
			var crt = new CellRendererText ();
			crt.Ellipsize = Pango.EllipsizeMode.End;
			crt.WrapWidth = -1;
			treeStack.AppendColumn ("", crt, "markup", 0);
			treeStack.ShowExpanders = false;
			treeStack.RulesHint = true;
			
			valueView.AllowExpanding = true;
			valueView.Frame = DebuggingService.CurrentFrame;
			this.exception = exception;
			
			exception.Changed += HandleExceptionChanged;
			treeStack.SizeAllocated += (object o, SizeAllocatedArgs args) => crt.WrapWidth = args.Allocation.Width;
			
			Fill ();
			treeStack.RowActivated += HandleRowActivated;
		}
开发者ID:kjnilsson,项目名称:monodevelop,代码行数:28,代码来源:ExceptionCaughtDialog.cs

示例10: AddinLoadErrorDialog

        public AddinLoadErrorDialog(AddinError[] errors)
        {
            XML glade = new XML (null, "MonoDevelop.Startup.glade", "addinLoadErrorDialog", null);
            glade.Autoconnect (this);

            TreeStore store = new TreeStore (typeof(string));
            errorTree.AppendColumn ("Addin", new CellRendererText (), "text", 0);
            errorTree.Model = store;

            bool fatal = false;

            foreach (AddinError err in errors) {
                string name = Path.GetFileNameWithoutExtension (err.AddinFile);
                if (err.Fatal) name += " (Fatal error)";
                TreeIter it = store.AppendValues (name);
                store.AppendValues (it, "Full Path: " + err.AddinFile);
                store.AppendValues (it, "Error: " + err.Exception.Message);
                it = store.AppendValues (it, "Exception: " + err.Exception.GetType ());
                store.AppendValues (it, err.Exception.StackTrace.ToString ());
                if (err.Fatal) fatal = true;
            }

            //			addinLoadErrorDialog.ShowAll ();

            if (fatal) {
                noButton.Hide ();
                yesButton.Hide ();
                labelContinue.Hide ();
                closeButton.Show ();
                labelFatal.Show ();
            }
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:32,代码来源:AddinLoadErrorDialog.cs

示例11: ProjectViewBackendNodeView

		public ProjectViewBackendNodeView (ProjectViewFrontend frontend)
		{
			this.frontend = frontend;
			HeadersVisible = false;
			
			store = new TreeStore (typeof(Gdk.Pixbuf), typeof(string), typeof(ObjectWrapper), typeof(bool));
			Model = store;
			
			TreeViewColumn col;
			CellRenderer renderer;

			col = new TreeViewColumn ();

			renderer = new CellRendererPixbuf ();
			col.PackStart (renderer, false);
			col.AddAttribute (renderer, "pixbuf", 0);

			renderer = new CellRendererText ();
			col.PackStart (renderer, true);
			col.AddAttribute (renderer, "text", 1);

			AppendColumn (col);

			Selection.Mode = SelectionMode.Single;
			Selection.Changed += RowSelected;
			TestExpandRow += OnTestExpandRow;
			ShowAll ();
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:28,代码来源:ProjectViewBackend.cs

示例12: ServiceScpdInfo

 public ServiceScpdInfo (ServiceController service)
 {
     this.Build ();
     
     this.service = service;
     
     actionModel = new TreeStore (typeof (string));
     stateVariableModel = new TreeStore (typeof (string));
     
     foreach (var action in service.Actions) {
         var iter = actionModel.AppendValues (action.Key);
         
         foreach (var argument in action.Value.Arguments) {
             var argument_iter = actionModel.AppendValues (iter, argument.Key);
             
             actionModel.AppendValues (argument_iter, Catalog.GetString ("Direction: ") +
                 (argument.Value.Direction == ArgumentDirection.In ? "In" : "Out"));
             actionModel.AppendValues (argument_iter, Catalog.GetString ("Is Return Value: ") + argument.Value.IsReturnValue);
             actionModel.AppendValues (argument_iter, Catalog.GetString ("Related State Variable: ") + argument.Value.RelatedStateVariable);
         }
     }
     
     foreach (var stateVariable in service.StateVariables) {
         var iter = stateVariableModel.AppendValues (stateVariable.Key);
         
         stateVariableModel.AppendValues (iter, Catalog.GetString ("Data Type: ") + stateVariable.Value.DataType);
         stateVariableModel.AppendValues (iter, Catalog.GetString ("Sends Events: ") + stateVariable.Value.SendsEvents);
         stateVariableModel.AppendValues (iter, Catalog.GetString ("Is Multicast: ") + stateVariable.Value.IsMulticast);
         
         if (stateVariable.Value.DefaultValue != null) {
             stateVariableModel.AppendValues (iter, Catalog.GetString ("Default Value: ") + stateVariable.Value.DefaultValue);
         }
         
         if (stateVariable.Value.AllowedValues != null) {
             var allowed_values_iter = stateVariableModel.AppendValues (iter, Catalog.GetString ("Allowed Values"));
             foreach (var value in stateVariable.Value.AllowedValues) {
                 stateVariableModel.AppendValues (allowed_values_iter, value);
             }
         }
         
         if (stateVariable.Value.AllowedValueRange != null) {
             var allowed_value_range_iter = stateVariableModel.AppendValues (iter, Catalog.GetString ("Allowed Value Range"));
             stateVariableModel.AppendValues (allowed_value_range_iter,
                 "Minimum: " + stateVariable.Value.AllowedValueRange.Minimum);
             stateVariableModel.AppendValues (allowed_value_range_iter,
                 "Maximum: " + stateVariable.Value.AllowedValueRange.Maximum);
             if (stateVariable.Value.AllowedValueRange.Step != null) {
                 stateVariableModel.AppendValues (allowed_value_range_iter,
                     "Step: " + stateVariable.Value.AllowedValueRange.Step);
             }
         }
     }
     
     actions.AppendColumn (Catalog.GetString ("Actions"), new CellRendererText (), "text", 0);
     actions.Model = actionModel;
     actions.Selection.Changed += ActionsSelectionChanged;
     
     stateVariables.AppendColumn (Catalog.GetString ("State Variables"), new CellRendererText (), "text", 0);
     stateVariables.Model = stateVariableModel;
 }
开发者ID:pacificIT,项目名称:mono-upnp,代码行数:60,代码来源:ServiceScpdInfo.cs

示例13: NewTemplateDialog

        public NewTemplateDialog (IEnumerator<ContentItemTemplate> enums)
        {
            Build();

            Title = "New Item";
            var column = new TreeViewColumn ();

            var iconCell = new CellRendererPixbuf ();
            var textCell = new CellRendererText ();
            var textCell2 = new CellRendererText ();

            column.PackStart (iconCell, false);
            column.PackStart (textCell, false);
            column.PackStart (textCell2, false);

            treeview1.AppendColumn (column);

            column.AddAttribute (iconCell,  "pixbuf", 0);
            column.AddAttribute (textCell, "text", 1);
            column.AddAttribute (textCell, "text", 2);

            listStore = new TreeStore (typeof (Gdk.Pixbuf), typeof (string), typeof (string));
            treeview1.Model = listStore;

            items = new List<ContentItemTemplate> ();
            int i = 0;

            while (enums.MoveNext ()) {
                listStore.AppendValues (new Gdk.Pixbuf (System.IO.Path.GetDirectoryName (enums.Current.TemplateFile) + "/" + enums.Current.Icon), enums.Current.Label, i.ToString());
                items.Add (enums.Current);
                i++;
            }
        }
开发者ID:KennethYap,项目名称:MonoGame,代码行数:33,代码来源:NewTemplateDialog.cs

示例14: CounterSelectorDialog

		public CounterSelectorDialog ()
		{
			this.Build ();
			
			HasSeparator = false;
			store = new TreeStore (typeof(bool), typeof(string), typeof(CounterCategory), typeof(Counter), typeof(bool));
			treeCounters.Model = store;
			
			TreeViewColumn col = new TreeViewColumn ();
			CellRendererToggle crt = new CellRendererToggle ();
			col.PackStart (crt, false);
			col.AddAttribute (crt, "active", 0);
			col.AddAttribute (crt, "visible", 4);
			
			CellRendererText crx = new CellRendererText ();
			col.PackStart (crx, true);
			col.AddAttribute (crx, "text", 1);
			treeCounters.AppendColumn (col);
			
			foreach (CounterCategory cat in App.Service.GetCategories ())
				AppendCategory (TreeIter.Zero, cat);
			
			UpdateSelectedCounters ();
			treeCounters.ExpandAll ();
			
			crt.Toggled += CrtToggled;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:27,代码来源:CounterSelectorDialog.cs

示例15: build

        private void build()
        {
            this.vbox1 = new VBox();

            this.toolbar1 = new Toolbar();
            this.aboutbtn1 = new ToolButton(Stock.About);
            this.aboutbtn1.Label = "About";
            this.aboutbtn1.IsImportant = true;
            this.toolbar1.ToolbarStyle = ToolbarStyle.BothHoriz;
            this.toolbar1.Add(this.aboutbtn1);
            this.vbox1.PackStart(this.toolbar1, false, true, 0);

            this.treestore1 = this.populateTreeStoreFromSession();
            this.scrollw1 = new ScrolledWindow();
            this.hpaned1 = new HPaned();
            this.treeview1 = new TreeView(this.treestore1);
            this.treeview1.HeadersVisible = true;
            this.treeview1.AppendColumn("Session", new CellRendererText(), "text", 0);
            this.treeview1.AppendColumn("Name", new CellRendererText(), "text", 1);
            this.treeview1.ExpandAll();
            this.scrollw1.Add(this.treeview1);
            this.iconview1 = new IconView();
            this.hpaned1.Add1(this.scrollw1);
            this.hpaned1.Add2(this.iconview1);
            this.hpaned1.Position = 254;
            this.vbox1.PackStart(this.hpaned1, true, true, 0);

            this.statusbar1 = new Statusbar();
            this.vbox1.PackEnd(this.statusbar1, false, true, 0);

            this.Add(this.vbox1);
            this.SetSizeRequest(800,600);

            this.DeleteEvent += HandleDeleteEvent;
        }
开发者ID:sgtnasty,项目名称:battle,代码行数:35,代码来源:MainWindow.cs


注:本文中的Gtk.TreeStore类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。