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


C# TreeViewColumn.PackEnd方法代码示例

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


在下文中一共展示了TreeViewColumn.PackEnd方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PopulateForm

		public void PopulateForm ()
		{
			Gtk.TreeViewColumn serialColumn = new Gtk.TreeViewColumn ();
			serialColumn.Title = "Serial";
			Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn ();
			nameColumn.Title = "Name";

			Gtk.CellRendererText serialCell = new Gtk.CellRendererText ();
			Gtk.CellRendererText nameCell = new Gtk.CellRendererText ();

			serialColumn.PackStart (serialCell, false);
			serialColumn.SetCellDataFunc (serialCell, new Gtk.TreeCellDataFunc (RenderSerial));

			nameColumn.PackEnd (nameCell, true);
			nameColumn.SetCellDataFunc (nameCell, new Gtk.TreeCellDataFunc (RenderName));

			treeviewDevices.Model = DeviceListStore;

			treeviewDevices.AppendColumn (serialColumn);
			treeviewDevices.AppendColumn (nameColumn);

			List<String> deviceNames = new List<string> ();
			foreach (LedController controller in Manager.Controllers) {
				deviceNames.Add (controller.DeviceVisibleName);
			}
			deviceNames.Sort ();

			foreach (String name in deviceNames) {
				DeviceListStore.AppendValues(Manager.FindControllerBySerialNumber(name));
			}

			UpdateFormComponents();
		}
开发者ID:pipermatt,项目名称:blinkstick-client,代码行数:33,代码来源:BlinkStickManageForm.cs

示例2: HighlightingPanel

		public HighlightingPanel ()
		{
			this.Build ();
			var col = new TreeViewColumn ();
			var crpixbuf = new CellRendererPixbuf ();
			col.PackStart (crpixbuf, false);
			col.SetCellDataFunc (crpixbuf, ImageDataFunc);
			var crtext = new CellRendererText ();
			col.PackEnd (crtext, true);
			col.SetAttributes (crtext, "markup", 0);
			styleTreeview.AppendColumn (col);
			styleTreeview.Model = styleStore;
			styleTreeview.SearchColumn = -1; // disable the interactive search
			schemeName = DefaultSourceEditorOptions.Instance.ColorScheme;
			MonoDevelop.Ide.Gui.Styles.Changed += HandleThemeChanged;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:16,代码来源:HighlightingPanel.cs

示例3: HighlightingPanel

		public HighlightingPanel ()
		{
			this.Build ();
			var col = new TreeViewColumn ();
			var crpixbuf = new CellRendererPixbuf ();
			col.PackStart (crpixbuf, false);
			col.SetCellDataFunc (crpixbuf, (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) => {
				var isError = (bool)styleStore.GetValue (iter, 2);
				crpixbuf.Visible = isError;
				crpixbuf.Pixbuf = isError ? errorPixbuf.Value : null;
			});
			var crtext = new CellRendererText ();
			col.PackEnd (crtext, true);
			col.SetAttributes (crtext, "markup", 0);
			styleTreeview.AppendColumn (col);
			styleTreeview.Model = styleStore;
			schemeName = DefaultSourceEditorOptions.Instance.ColorScheme;
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:18,代码来源:HighlightingPanel.cs

示例4: ListTreeViewBase

        public ListTreeViewBase()
        {
            Selection.Mode = SelectionMode.Multiple;
            Selection.SelectFunction = SelectFunction;
            RowActivated += new RowActivatedHandler(OnTreeviewRowActivated);
            HeadersVisible = false;

            SetMenu();
            ProjectIsLive = false;
            PlayListLoaded = false;

            nameColumn = new Gtk.TreeViewColumn();
            nameColumn.Title = "Name";
            nameCell = new Gtk.CellRendererText();
            nameCell.Edited += OnNameCellEdited;
            Gtk.CellRendererPixbuf miniatureCell = new Gtk.CellRendererPixbuf();
            nameColumn.PackStart(nameCell, true);
            nameColumn.PackEnd(miniatureCell, true);

            nameColumn.SetCellDataFunc(miniatureCell, new Gtk.TreeCellDataFunc(RenderMiniature));
            nameColumn.SetCellDataFunc(nameCell, new Gtk.TreeCellDataFunc(RenderName));

            AppendColumn(nameColumn);
        }
开发者ID:dineshkummarc,项目名称:longomatch,代码行数:24,代码来源:ListTreeViewBase.cs

示例5: CustomPropertiesWidget

		public CustomPropertiesWidget (PListScheme scheme)
		{
			this.scheme = scheme = scheme ?? PListScheme.Empty;
			treeview = new PopupTreeView  (this);
			treeview.HeadersClickable = true;
			this.PackStart (treeview, true, true, 0);
			ShowAll ();
			
			var keyRenderer = new CellRendererCombo ();
			keyRenderer.Editable = true;
			keyRenderer.Model = keyStore;
			keyRenderer.Mode = CellRendererMode.Editable;
			keyRenderer.TextColumn = 0;
			keyRenderer.Edited += delegate(object o, EditedArgs args) {
				TreeIter selIter;
				if (!treeStore.GetIterFromString (out selIter, args.Path)) 
					return;
				if (args.NewText == (string)treeStore.GetValue (selIter, 0))
					return;
				
				var obj = (PObject)treeStore.GetValue (selIter, 1);
				
				var dict = obj.Parent as PDictionary;
				if (dict == null)
					return;
				
				var key = scheme.Keys.FirstOrDefault (k => k.Identifier == args.NewText || k.Description == args.NewText);
				var newKey = key != null ? key.Identifier : args.NewText;
				
				dict.ChangeKey (obj, newKey, key == null || obj.TypeString == key.Type ? null : CreateNewObject (key.Type));
			};
			var col = new TreeViewColumn ();
			col.Resizable = true;
			col.Title = GettextCatalog.GetString ("Property");
			col.PackStart (keyRenderer, true);
			col.SetCellDataFunc (keyRenderer, delegate(TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) {
				var renderer = (CellRendererCombo)cell;
				string id = (string)tree_model.GetValue (iter, 0) ?? "";
				var obj = (PObject)tree_model.GetValue (iter, 1);
				if (obj == null) {
					renderer.Text = id;
					renderer.Editable = false;
					renderer.Sensitive = false;
					return;
				}
				
				var key = scheme.GetKey (id);
				renderer.Editable = !(obj.Parent is PArray);
				renderer.Sensitive = true;
				renderer.Text = key != null && ShowDescriptions ? GettextCatalog.GetString (key.Description) : id;
			});
			treeview.AppendColumn (col);
			
			var iconSize = IconSize.Menu;
			col = new TreeViewColumn { MinWidth = 25, Resizable = true, Sizing = Gtk.TreeViewColumnSizing.Autosize };
			
			var removeRenderer = new CellRendererButton (ImageService.GetPixbuf ("gtk-remove", IconSize.Menu));
			removeRenderer.Clicked += delegate {
				TreeIter iter;
				bool hasSelection = treeview.Selection.GetSelected (out iter);
				PObject obj = null;
				if (hasSelection) {
					obj = (PObject)treeStore.GetValue (iter, 1);
					obj.Remove ();
				}
			};
			col.PackEnd (removeRenderer, false);
			col.SetCellDataFunc (removeRenderer, delegate(TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) {
				removeRenderer.Visible = treeview.Selection.IterIsSelected (iter) && !AddKeyNode.Equals (treeStore.GetValue (iter, 0));
			});
			
			var addRenderer = new CellRendererButton (ImageService.GetPixbuf ("gtk-add", IconSize.Menu));
			addRenderer.Clicked += delegate {
				Gtk.TreeIter iter = Gtk.TreeIter.Zero;
				if (!treeview.Selection.GetSelected (out iter))
					return;
				
				PObject obj = null;
				if (treeStore.IterParent (out iter, iter))
					obj = (PObject) treeStore.GetValue (iter, 1);
				obj = obj ?? nsDictionary;

				var newObj = new PString ("");
				if (obj is PArray) {
					var arr = (PArray) obj;
					arr.Add (newObj);
				} else if (obj is PDictionary) {
					string name = "newNode";
					var dict = (PDictionary) obj;
					while (dict.ContainsKey (name))
						name += "_";
					dict.Add (name ,newObj);
				} else {
					return;
				}
			};
			
			col.PackEnd (addRenderer, false);
			col.SetCellDataFunc (addRenderer, delegate(TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) {
				addRenderer.Visible = treeview.Selection.IterIsSelected (iter) && AddKeyNode.Equals (treeStore.GetValue (iter, 0));
//.........这里部分代码省略.........
开发者ID:nieve,项目名称:monodevelop,代码行数:101,代码来源:CustomPropertiesWidget.cs

示例6: Toolbox

        public Toolbox(ServiceContainer parentServices)
        {
            this.parentServices = parentServices;

            //we need this service, so create it if not present
            toolboxService = parentServices.GetService (typeof (IToolboxService)) as ToolboxService;
            if (toolboxService == null) {
                toolboxService = new ToolboxService ();
                parentServices.AddService (typeof (IToolboxService), toolboxService);
            }

            #region Toolbar
            toolbar = new Toolbar ();
            toolbar.ToolbarStyle = ToolbarStyle.Icons;
            toolbar.IconSize = IconSize.SmallToolbar;
            base.PackStart (toolbar, false, false, 0);

            filterToggleButton = new ToggleToolButton ();
            filterToggleButton.IconWidget = new Image (Stock.MissingImage, IconSize.SmallToolbar);
            filterToggleButton.Toggled += new EventHandler (toggleFiltering);
            toolbar.Insert (filterToggleButton, 0);

            catToggleButton = new ToggleToolButton ();
            catToggleButton.IconWidget = new Image (Stock.MissingImage, IconSize.SmallToolbar);
            catToggleButton.Toggled += new EventHandler (toggleCategorisation);
            toolbar.Insert (catToggleButton, 1);

            SeparatorToolItem sep = new SeparatorToolItem();
            toolbar.Insert (sep, 2);

            filterEntry = new Entry();
            filterEntry.WidthRequest = 150;
            filterEntry.Changed += new EventHandler (filterTextChanged);

            #endregion

            scrolledWindow = new ScrolledWindow ();
            base.PackEnd (scrolledWindow, true, true, 0);

            //Initialise model

            store = new ToolboxStore ();

            //initialise view
            nodeView = new NodeView (store);
            nodeView.Selection.Mode = SelectionMode.Single;
            nodeView.HeadersVisible = false;

            //cell renderers
            CellRendererPixbuf pixbufRenderer = new CellRendererPixbuf ();
            CellRendererText textRenderer = new CellRendererText ();
            textRenderer.Ellipsize = Pango.EllipsizeMode.End;

            //Main column with text, icons
            TreeViewColumn col = new TreeViewColumn ();

            col.PackStart (pixbufRenderer, false);
            col.SetAttributes (pixbufRenderer,
                                  "pixbuf", ToolboxStore.Columns.Icon,
                                  "visible", ToolboxStore.Columns.IconVisible,
                                  "cell-background-gdk", ToolboxStore.Columns.BackgroundColour);

            col.PackEnd (textRenderer, true);
            col.SetAttributes (textRenderer,
                                  "text", ToolboxStore.Columns.Label,
                                  "weight", ToolboxStore.Columns.FontWeight,
                                  "cell-background-gdk", ToolboxStore.Columns.BackgroundColour);

            nodeView.AppendColumn (col);

            //Initialise self
            scrolledWindow.VscrollbarPolicy = PolicyType.Automatic;
            scrolledWindow.HscrollbarPolicy = PolicyType.Never;
            scrolledWindow.WidthRequest = 150;
            scrolledWindow.AddWithViewport (nodeView);

            //selection events
            nodeView.NodeSelection.Changed += OnSelectionChanged;
            nodeView.RowActivated  += OnRowActivated;

            //update view when toolbox service updated
            toolboxService.ToolboxChanged += new EventHandler (tbsChanged);
            Refresh ();

            //track expanded state of nodes
            nodeView.RowCollapsed += new RowCollapsedHandler (whenRowCollapsed);
            nodeView.RowExpanded += new RowExpandedHandler (whenRowExpanded);

            //set initial state
            filterToggleButton.Active = false;
            catToggleButton.Active = true;
        }
开发者ID:mono,项目名称:aspeditor,代码行数:92,代码来源:Toolbox.cs

示例7: MainWindow

	public MainWindow (): base (Gtk.WindowType.Toplevel)
	{
		if (!BlinkstickDeviceFinder.IsUnix())
		{
			SetupSingleInstanceEvent();
		}

		Build ();

		this.Title = "BlinkStick " + ApplicationVersion;

		log.Debug("Setting up controls");

		Gtk.TreeViewColumn eventTitleColumn = new Gtk.TreeViewColumn ();
		eventTitleColumn.Title = "Name";

		Gtk.TreeViewColumn eventTypeColumn = new Gtk.TreeViewColumn ();
		eventTypeColumn.Title = "Type";

		Gtk.TreeViewColumn eventColorColumn = new Gtk.TreeViewColumn ();
		eventColorColumn.Title = "Color";

		// Create the text cell that will display the artist name
		Gtk.CellRendererText eventTitleCell = new Gtk.CellRendererText ();
		Gtk.CellRendererText eventTypeCell = new Gtk.CellRendererText ();
		Gtk.CellRendererPixbuf eventColorCell = new Gtk.CellRendererPixbuf ();

		log.Debug ("Loading main form icon");
		this.Icon = new global::Gdk.Pixbuf (global::System.IO.Path.Combine (global::System.AppDomain.CurrentDomain.BaseDirectory, "icon.png"));
			 
		log.Debug( "Setting up treeview");
		// Add the cell to the column
		eventColorColumn.PackStart (eventColorCell, false);
		eventTypeColumn.PackEnd (eventTypeCell, true);
		eventTitleColumn.PackEnd (eventTitleCell, true);
	 
		// Tell the Cell Renderers which items in the model to display
		//eventTitleColumn.AddAttribute (eventTitleCell, "name", 0);
		eventTitleColumn.SetCellDataFunc (eventTitleCell, new Gtk.TreeCellDataFunc (RenderEventName));
		eventTypeColumn.SetCellDataFunc (eventTypeCell, new Gtk.TreeCellDataFunc (RenderEventType));
		eventColorColumn.SetCellDataFunc (eventColorCell, new Gtk.TreeCellDataFunc (RenderEventColor));

		treeviewEvents.Model = EventListStore;

		treeviewEvents.AppendColumn (eventColorColumn);
		treeviewEvents.AppendColumn (eventTypeColumn);
		treeviewEvents.AppendColumn (eventTitleColumn);

		log.Debug("Updating buttons");
		UpdateButtons ();

		log.Debug("Setting up notification manager");
		Manager = new NotificationManager ();
		Manager.NotificationUpdated += HandleNotificationUpdated;
		Manager.Load ();
		Manager.UpdateControllers();

		DeviceMonitor = new UsbMonitor(this.GdkWindow.Handle);
		DeviceMonitor.UsbDeviceAdded += (object sender, EventArgs e) => {
			Gtk.Application.Invoke (delegate {
				Manager.UpdateControllers();

				if (testForm != null)
				{
					testForm.PopulateForm();
				}
			});
		};
		DeviceMonitor.Start ();

		log.Debug("Adding notifications to the tree");
		//Gtk.TreeIter customEventRoot = EventListStore.AppendValues(new TriggeredEvent("Custom"));
		foreach (CustomNotification e in Manager.Notifications) {
			//EventListStore.AppendValues(customEventRoot, e);
			EventListStore.AppendValues (e);
		}

		log.Debug("Starting notification manager");
		Manager.Start ();

		log.Debug ("Building popup menu");
		//Build Popup Menu for TrayIcon
		popupMenu = new Menu ();

		//Settings menu item
		ImageMenuItem menuItemSettings = new ImageMenuItem ("Settings");
		menuItemSettings.Image = new Gtk.Image(Stock.Preferences, IconSize.Menu);
		menuItemSettings.Activated += ToggleMainWindow;
		popupMenu.Append(menuItemSettings);

		popupMenu.Append(new SeparatorMenuItem());

		//Quit menu item
		ImageMenuItem menuItemQuit = new ImageMenuItem ("Quit");
		menuItemQuit.Image = new Gtk.Image (Stock.Quit, IconSize.Menu);
		menuItemQuit.Activated += OnQuitActionActivated;
		popupMenu.Append (menuItemQuit);

		log.Debug("Showing popup menu");
		popupMenu.ShowAll();
//.........这里部分代码省略.........
开发者ID:pipermatt,项目名称:blinkstick-client,代码行数:101,代码来源:MainWindow.cs

示例8: CustomPropertiesWidget

		public CustomPropertiesWidget (PListScheme scheme)
		{
			Scheme = scheme ?? PListScheme.Empty;
			CurrentTree = new Dictionary<PObject, PListScheme.SchemaItem> ();
			treeview = new PopupTreeView  (this) { DoubleBuffered = true };
			treeview.HeadersClickable = true;
			
			RefreshKeyStore ();
			PackStart (treeview, true, true, 0);
			FindOrAddNewEntry (TreeIter.Zero);
			ShowAll ();

			var keyRenderer = new CellRendererCombo ();
			keyRenderer.Editable = true;
			keyRenderer.Model = keyStore;
			keyRenderer.Mode = CellRendererMode.Editable;
			keyRenderer.TextColumn = 0;
			keyRenderer.EditingStarted += KeyRendererEditingStarted;
			keyRenderer.Edited += KeyRendererEditingFinished;
			var col = new TreeViewColumn ();
			col.Resizable = true;
			col.Title = GettextCatalog.GetString ("Property");
			col.PackStart (keyRenderer, true);
			col.SetCellDataFunc (keyRenderer, delegate(TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) {
				var renderer = (CellRendererCombo)cell;
				string id = (string)tree_model.GetValue (iter, 0) ?? "";
				var obj = (PObject)tree_model.GetValue (iter, 1);
				if (obj == null) {
					renderer.Text = id;
					renderer.Editable = false;
					renderer.Sensitive = false;
					return;
				}
				
				var key = (PListScheme.SchemaItem) tree_model.GetValue (iter, 2);
				var parentPArray = obj.Parent is PArray;
				renderer.Editable = !parentPArray;
				renderer.Sensitive = !parentPArray;
				if (parentPArray)
					renderer.Text = "";
				else
					renderer.Text = key != null && ShowDescriptions ? key.Description : id;
			});
			treeview.AppendColumn (col);
			
			col = new TreeViewColumn { MinWidth = 25, Resizable = false, Sizing = Gtk.TreeViewColumnSizing.Fixed };
				
			var removeRenderer = new CellRendererButton (ImageService.GetPixbuf ("gtk-remove", IconSize.Menu));
			removeRenderer.Clicked += RemoveElement;
			col.PackEnd (removeRenderer, false);
			col.SetCellDataFunc (removeRenderer, delegate(TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) {
				removeRenderer.Visible = treeview.Selection.IterIsSelected (iter) && !AddKeyNode.Equals (treeStore.GetValue (iter, 0));
			});
			
			var addRenderer = new CellRendererButton (ImageService.GetPixbuf ("gtk-add", IconSize.Menu));
			addRenderer.Clicked += AddElement;
			col.PackEnd (addRenderer, false);
			col.SetCellDataFunc (addRenderer, delegate(TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) {
				addRenderer.Visible = treeview.Selection.IterIsSelected (iter) && AddKeyNode.Equals (treeStore.GetValue (iter, 0));
			});
			treeview.AppendColumn (col);
			
			treeview.RowActivated += delegate(object o, RowActivatedArgs args) {
				TreeIter iter;
				if (treeStore.GetIter (out iter, args.Path) && AddKeyNode.Equals (treeStore.GetValue (iter, 0)))
					AddElement (o, EventArgs.Empty);
			};

			var comboRenderer = new CellRendererCombo ();
			
			var typeModel = new ListStore (typeof (string));
			typeModel.AppendValues (PArray.Type);
			typeModel.AppendValues (PDictionary.Type);
			typeModel.AppendValues (PBoolean.Type);
			typeModel.AppendValues (PData.Type);
			typeModel.AppendValues (PData.Type);
			typeModel.AppendValues (PNumber.Type);
			typeModel.AppendValues (PString.Type);
			comboRenderer.Model = typeModel;
			comboRenderer.Mode = CellRendererMode.Editable;
			comboRenderer.HasEntry = false;
			comboRenderer.TextColumn = 0;
			comboRenderer.Edited += delegate(object o, EditedArgs args) {
				TreeIter selIter;
				if (!treeStore.GetIterFromString (out selIter, args.Path)) 
					return;
				
				PObject oldObj = (PObject)treeStore.GetValue (selIter, 1);
				if (oldObj != null && oldObj.TypeString != args.NewText)
					oldObj.Replace (PObject.Create (args.NewText));
			};
			
			treeview.AppendColumn (GettextCatalog.GetString ("Type"), comboRenderer, delegate(TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) {
				var renderer = (CellRendererCombo)cell;
				var value = (string) tree_model.GetValue (iter, 0);
				var obj   = (PObject)tree_model.GetValue (iter, 1);
				var key   = (PListScheme.SchemaItem)tree_model.GetValue (iter, 2);
				renderer.Editable = key == null && !AddKeyNode.Equals (value);
				renderer.ForegroundGdk = Style.Text (renderer.Editable ? StateType.Normal : StateType.Insensitive);
				renderer.Text = obj == null ? "" : obj.TypeString;
//.........这里部分代码省略.........
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:101,代码来源:CustomPropertiesWidget.cs

示例9: CreateWorkspaceView

        private Gtk.Widget CreateWorkspaceView() 
        {
            ScrolledWindow sw = new ScrolledWindow();
            m_treeView = new Gtk.TreeView();

            //first column has workspaceUnit but presents its friendly name, 2nd column displays type and 3rd displays value
            m_workspaceStore = new Gtk.ListStore(typeof(WorkspaceUnit), typeof(WorkspaceUnit), typeof(WorkspaceUnit));
            m_treeView.Model = m_workspaceStore;

            //create columns with associated cell renderings
            CellRendererText nameRenderer = new CellRendererText();
            TreeViewColumn nameColumn = m_treeView.AppendColumn("Name", nameRenderer);
            nameColumn.SetCellDataFunc(nameRenderer, new TreeCellDataFunc(RenderName));            

            CellRendererText typeRenderer = new CellRendererText();
            TreeViewColumn typeColumn = m_treeView.AppendColumn("Type", typeRenderer);
            typeColumn.SetCellDataFunc(typeRenderer, new TreeCellDataFunc(RenderType));            

            TreeViewColumn valueColumn = new TreeViewColumn();
            valueColumn.Title = "Value";
            CellRendererPixbuf valueViewerIconCellRenderer = new CellRendererPixbuf();
            CellRendererText valueTextRenderer = new CellRendererText();
            valueViewerIconCellRenderer.Xalign = 0.0f;
            valueColumn.PackEnd(valueTextRenderer, true);
            valueColumn.PackStart(valueViewerIconCellRenderer, false);
            valueColumn.SetCellDataFunc(valueViewerIconCellRenderer, new TreeCellDataFunc(RenderViewerIcon));
            valueColumn.SetCellDataFunc(valueTextRenderer, new TreeCellDataFunc(RenderValue));
            m_treeView.AppendColumn(valueColumn);

            m_treeView.RowActivated += HandleRowActivated;

            sw.Add(m_treeView);
            sw.ShowAll();
            return sw;
        }
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:35,代码来源:WorkspaceWindowPad.cs

示例10: CreateWorkspaceView

        private Gtk.Widget CreateWorkspaceView() 
        {
            ScrolledWindow sw = new ScrolledWindow();
            m_treeView = new Gtk.TreeView();

            //first column has workspaceUnit but presents its friendly name, 2nd column displays type and 3rd displays value
            m_workspaceStore = new Gtk.ListStore(typeof(WorkspaceUnit), typeof(WorkspaceUnit), typeof(WorkspaceUnit));
            m_treeView.Model = m_workspaceStore;

            //create columns with associated cell renderings
            CellRendererText nameRenderer = new CellRendererText();
            TreeViewColumn nameColumn = m_treeView.AppendColumn("Name", nameRenderer);
            nameColumn.SetCellDataFunc(nameRenderer, new TreeCellDataFunc(RenderName));            

            CellRendererText typeRenderer = new CellRendererText();
            TreeViewColumn typeColumn = m_treeView.AppendColumn("Type", typeRenderer);
            typeColumn.SetCellDataFunc(typeRenderer, new TreeCellDataFunc(RenderType));            

            TreeViewColumn valueColumn = new TreeViewColumn();
            valueColumn.Title = "Value";
            CellRendererPixbuf valueViewerIconCellRenderer = new CellRendererPixbuf();
            CellRendererText valueTextRenderer = new CellRendererText();
            valueViewerIconCellRenderer.Xalign = 0.0f;
            valueColumn.PackEnd(valueTextRenderer, true);
            valueColumn.PackStart(valueViewerIconCellRenderer, false);
            valueColumn.SetCellDataFunc(valueViewerIconCellRenderer, new TreeCellDataFunc(RenderViewerIcon));
            valueColumn.SetCellDataFunc(valueTextRenderer, new TreeCellDataFunc(RenderValue));
            m_treeView.AppendColumn(valueColumn);

            m_treeView.RowActivated += HandleRowActivated;

            // HERZUM SPRINT 3: TLAB-86
            VBox vbox1 = new VBox();
            sw.Add(m_treeView);
            vbox1.Add (sw);
            Box.BoxChild w1 = ((Box.BoxChild)(vbox1 [sw]));
            w1.Position = 0;

            baseline.CanFocus = false;

            Box.BoxChild w2 = ((Box.BoxChild)(vbox1 [baseline]));
            vbox1.Add (baseline);
            w2.Position = 2;
            w2.Expand = false;
            w2.Fill = false;


            vbox1.ShowAll ();
            return vbox1;

            //sw.Add(m_treeView);
            //sw.ShowAll();
            //return sw;

            // END HERZUM SPRINT 3: TLAB-86
        }
开发者ID:CoEST,项目名称:TraceLab,代码行数:56,代码来源:WorkspaceWindowPad.cs


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