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


C# Gtk.ListStore类代码示例

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


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

示例1: SelectGroupsDialog

        public SelectGroupsDialog(string[] allGroups)
        {
            ui = new Glade.XML (null, "lat.glade", "selectGroupsDialog", null);
            ui.Autoconnect (this);

            groups = new List<string> ();

            TreeViewColumn col;

            store = new ListStore (typeof (string));
            allGroupsTreeview.Model = store;
            allGroupsTreeview.Selection.Mode = SelectionMode.Multiple;

            col = allGroupsTreeview.AppendColumn ("Name", new CellRendererText (), "text", 0);
            col.SortColumnId = 0;

            store.SetSortColumnId (0, SortType.Ascending);

            foreach (string s in allGroups)
                store.AppendValues (s);

            selectGroupsDialog.Icon = Global.latIcon;
            selectGroupsDialog.Resize (320, 200);
            selectGroupsDialog.Run ();
            selectGroupsDialog.Destroy ();
        }
开发者ID:MrJoe,项目名称:lat,代码行数:26,代码来源:SelectGroupsDialog.cs

示例2: ExceptionsDialog

		public ExceptionsDialog()
		{
			this.Build();

			storeExceptions = new ListStore (typeof(String));
			treeExceptions.Selection.Mode = SelectionMode.Multiple;
			treeExceptions.Model = storeExceptions;
			treeExceptions.AppendColumn ("", new CellRendererText (), "text", 0);
			tstateExc = new TreeViewState (treeExceptions, 0);
			storeExceptions.SetSortColumnId (0, SortType.Ascending);

			storeSelection = new ListStore (typeof(String));
			treeSelected.Selection.Mode = SelectionMode.Multiple;
			treeSelected.Model = storeSelection;
			treeSelected.AppendColumn ("", new CellRendererText (), "text", 0);
			tstateSel = new TreeViewState (treeSelected, 0);
			storeSelection.SetSortColumnId (0, SortType.Ascending);
			
			foreach (Catchpoint cp in DebuggingService.Breakpoints.GetCatchpoints ())
				selectedClasses.Add (cp.ExceptionName);
			
			LoadExceptions ();

			FillSelection ();
			FillExceptions ();
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:26,代码来源:ExceptionsDialog.cs

示例3: fillComboBox

    private void fillComboBox()
    {
        CellRenderer cellRenderer = new CellRendererText();
        comboBox.PackStart(cellRenderer, false); //expand=false
        comboBox.AddAttribute (cellRenderer, "text", 1);

        ListStore listStore = new ListStore(typeof(string), typeof(string));

        comboBox.Model = listStore;

        string connectionString = "Server=localhost;Database=PruebaBD;User Id=ximo;Password=admin";
        IDbConnection dbConnection = new NpgsqlConnection(connectionString);
        dbConnection.Open ();

        IDbCommand dbCommand = dbConnection.CreateCommand();
        dbCommand.CommandText = "select id, nombre from categoria";

        IDataReader dataReader = dbCommand.ExecuteReader();

        while (dataReader.Read ())
            listStore.AppendValues (dataReader["id"].ToString (), dataReader["nombre"].ToString () );

        dataReader.Close ();

        dbConnection.Close ();
    }
开发者ID:omixcrac,项目名称:AD,代码行数:26,代码来源:MainWindow.cs

示例4: GitConfigurationDialog

		public GitConfigurationDialog (GitRepository repo)
		{
			this.Build ();
			this.repo = repo;
			this.HasSeparator = false;
			
			// Branches list
			
			storeBranches = new ListStore (typeof(Branch), typeof(string), typeof(string), typeof(string));
			listBranches.Model = storeBranches;
			listBranches.HeadersVisible = true;
			
			listBranches.AppendColumn (GettextCatalog.GetString ("Branch"), new CellRendererText (), "markup", 1);
			listBranches.AppendColumn (GettextCatalog.GetString ("Tracking"), new CellRendererText (), "text", 2);
			
			// Sources tree
			
			storeRemotes = new TreeStore (typeof(RemoteSource), typeof(string), typeof(string), typeof(string), typeof(string));
			treeRemotes.Model = storeRemotes;
			treeRemotes.HeadersVisible = true;
			
			treeRemotes.AppendColumn ("Remote Source / Branch", new CellRendererText (), "markup", 1);
			treeRemotes.AppendColumn ("Url", new CellRendererText (), "text", 2);
			
			// Fill data
			
			FillBranches ();
			FillRemotes ();
		}
开发者ID:jrhtcg,项目名称:monodevelop,代码行数:29,代码来源:GitConfigurationDialog.cs

示例5: MonoRuntimePanelWidget

		public MonoRuntimePanelWidget()
		{
			this.Build();
			
			labelRunning.Markup = GettextCatalog.GetString ("MonoDevelop is currently running on <b>{0}</b>.", Runtime.SystemAssemblyService.CurrentRuntime.DisplayName);
			store = new ListStore (typeof(string), typeof(object));
			tree.Model = store;
			
			CellRendererText crt = new CellRendererText ();
			tree.AppendColumn ("Runtime", crt, "markup", 0);
			TargetRuntime defRuntime = IdeApp.Preferences.DefaultTargetRuntime;
			
			foreach (TargetRuntime tr in Runtime.SystemAssemblyService.GetTargetRuntimes ()) {
				string name = tr.DisplayName;
				TreeIter it;
				if (tr == defRuntime) {
					name = "<b>" + name + " (Default)</b>";
					defaultIter = it = store.AppendValues (name, tr);
				} else
					it = store.AppendValues (name, tr);
				if (tr.IsRunning)
					runningIter = it;
			}
			
			tree.Selection.Changed += HandleChanged;
			UpdateButtons ();
		}
开发者ID:raufbutt,项目名称:monodevelop-old,代码行数:27,代码来源:MonoRuntimePanel.cs

示例6: SessionDisplayWidget

        public SessionDisplayWidget()
        {
            this.Build ();

            TreeViewColumn startColumn = new TreeViewColumn ();
            CellRendererText startRenderer = new CellRendererText ();
            startColumn.Title = "Start";
            startColumn.PackStart (startRenderer, true);

            TreeViewColumn stopColumn = new TreeViewColumn ();
            CellRendererText stopRenderer = new CellRendererText ();
            stopColumn.Title = "Stop";
            stopColumn.PackStart (stopRenderer, true);

            TreeViewColumn durationColumn = new TreeViewColumn ();
            CellRenderer durationRenderer = new CellRendererText ();
            durationColumn.Title = "Duration";
            durationColumn.PackStart (durationRenderer, true);

            this.sessionView1.AppendColumn (startColumn);
            this.sessionView1.AppendColumn (stopColumn);
            this.sessionView1.AppendColumn (durationColumn);

            startColumn.AddAttribute (startRenderer, "text", 0);
            stopColumn.AddAttribute (stopRenderer, "text", 1);
            durationColumn.AddAttribute (durationRenderer, "text", 2);

            sessionStore = new Gtk.ListStore (typeof(string), typeof(string), typeof(string));
            sessionView1.Model = sessionStore;
        }
开发者ID:skyronic,项目名称:TFAddin,代码行数:30,代码来源:SessionDisplayWidget.cs

示例7: BebidasCalientesView

        public BebidasCalientesView(Label labelTotalMainWindow,Button botonNP)
            : base(Gtk.WindowType.Toplevel)
        {
            this.Build ();

            labelBebidasCalientes.Markup = "<span size='xx-large' weight='bold'>Bebidas Calientes</span>";
            botonNuevoPedidoMainWindow = botonNP;
            totalMainWindow = labelTotalMainWindow;

            dbConnection = ApplicationContext.Instance.DbConnection;

            //hacer la consulta bd
            IDbCommand dbCommand = dbConnection.CreateCommand ();
            dbCommand.CommandText =
                "select * from bebidascalientes ";

            IDataReader dataReader = dbCommand.ExecuteReader ();

            //Aquí creamos un objeto de la clase RellenarTreeView y le pasamos a la clase el treeView y el dataReader
            RellenarTreeView rellenar =new RellenarTreeView();
            rellenar.llenarTreeView(treeView, dataReader);

            //recogemos el listStore que usamos en la clase RellenarTreeView, para ser usada en los los métodos en esa clase
            listStore = rellenar.get_ListStore();

            dataReader.Close ();
        }
开发者ID:JulianaCFS,项目名称:Proyecto,代码行数:27,代码来源:BebidasCalientesView.cs

示例8: MultiChooserDialog

        public MultiChooserDialog(IList options, IList banned)
        {
            base.Modal = true;
            base.HeightRequest = 400;
            base.WidthRequest = 250;
            //TODO: i18n
            base.Title = GettextCatalog.GetString ("Choose elements");
            base.AddButton(GettextCatalog.GetString ("_Cancel"), Gtk.ResponseType.Cancel);
            base.AddButton(GettextCatalog.GetString ("_Accept"), Gtk.ResponseType.Accept);
            base.Response += new Gtk.ResponseHandler(OnResponse);

            TreeView treeView = new TreeView();
            treeView.HeadersVisible = false;
            _store = new ListStore(typeof(bool), typeof(string));
            treeView.Model = _store;
            CellRendererToggle crtgl = new CellRendererToggle();
            crtgl.Activatable = true;
            crtgl.Toggled += new ToggledHandler(CheckboxToggledHandler);
            TreeViewColumn column = new TreeViewColumn ();
            column.PackStart(crtgl, false);
            column.AddAttribute(crtgl, "active", 0);
            treeView.AppendColumn(column);
            CellRendererText crtxt = new CellRendererText ();
            column = new TreeViewColumn ();
            column.PackStart(crtxt, false);
            column.AddAttribute(crtxt, "text", 1);
            treeView.AppendColumn(column);
            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            sw.ShadowType = Gtk.ShadowType.In;
            sw.Add(treeView);
            treeView.Show();
            base.VBox.Add(sw);
            ShowList(options, banned);
            sw.Show();
        }
开发者ID:MonoBrasil,项目名称:historico,代码行数:35,代码来源:MultiChooserDialog.cs

示例9: UniqueConstraintEditorWidget

		public UniqueConstraintEditorWidget (ISchemaProvider schemaProvider, SchemaActions action)
		{
			if (schemaProvider == null)
				throw new ArgumentNullException ("schemaProvider");
			
			this.schemaProvider = schemaProvider;
			this.action = action;
			
			this.Build();
			
			store = new ListStore (typeof (string), typeof (bool), typeof (string), typeof (object));
			listUnique.Model = store;
			listUnique.Selection.Changed += new EventHandler (SelectionChanged);
			columnSelecter.ColumnToggled += new EventHandler (ColumnToggled);
			
			TreeViewColumn colName = new TreeViewColumn ();

			colName.Title = AddinCatalog.GetString ("Name");
			
			CellRendererText nameRenderer = new CellRendererText ();
			
			nameRenderer.Editable = true;
			nameRenderer.Edited += new EditedHandler (NameEdited);
			
			colName.PackStart (nameRenderer, true);
			colName.AddAttribute (nameRenderer, "text", colNameIndex);
			
			listUnique.AppendColumn (colName);
			
			ShowAll ();
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:31,代码来源:UniqueConstraintEditorWidget.cs

示例10: PythonOptionsWidget

		public PythonOptionsWidget ()
		{
			this.Build();
			
			// Python paths
			m_PathsListStore = new ListStore (typeof (string));
			m_PathsTreeView.Model = this.m_PathsListStore;
			m_PathsTreeView.HeadersVisible = false;
			TreeViewColumn column = new TreeViewColumn ();
			CellRendererText ctext = new CellRendererText ();
			column.PackStart (ctext, true);
			column.AddAttribute (ctext, "text", 0);
			m_PathsTreeView.AppendColumn (column);
			m_PathsTreeView.Selection.Changed += delegate {
				this.m_RemovePathButton.Sensitive = m_PathsTreeView.Selection.CountSelectedRows () == 1;
			};
			
			// Setup Python Runtime Version
			m_RuntimeListStore = new ListStore (typeof (string), typeof (Type));
			m_RuntimeCombo.Model = this.m_RuntimeListStore;
			m_RuntimeListStore.AppendValues ("Python 2.5", typeof (Python25Runtime));
			m_RuntimeListStore.AppendValues ("Python 2.6", typeof (Python26Runtime));
			m_RuntimeListStore.AppendValues ("Python 2.7", typeof (Python27Runtime));
			m_RuntimeListStore.AppendValues ("IronPython", typeof (IronPythonRuntime));
			
			m_RuntimeCombo.Changed += delegate {
				m_RuntimeFileEntry.Path = String.Empty;
			};
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:29,代码来源:PythonOptionsWidget.cs

示例11: RegexLibraryWindow

		public RegexLibraryWindow () : base(Gtk.WindowType.Toplevel)
		{
			this.Build ();
			this.TransientFor = IdeApp.Workbench.RootWindow;
			
			this.buttonCancel.Clicked += delegate {
				Destroy ();
			};
			this.buttonUpdate.Clicked += delegate {
				if (updateThread != null && updateThread.IsAlive) {
					updateThread.Abort ();
					updateThread.Join ();
					SetButtonUpdate (GettextCatalog.GetString ("Update Library"), "gtk-refresh");
					updateThread = null;
					return;
				}
				SetButtonUpdate (GettextCatalog.GetString ("_Abort update"), "gtk-media-stop");
				SynchronizeExpressions ();
			};
			
			store = new ListStore (typeof (string), typeof (string), typeof (Expression));
			expressionsTreeview.Model = store;
			
			this.expressionsTreeview.AppendColumn (GettextCatalog.GetString ("Title"), new CellRendererText (), "text", 0);
			this.expressionsTreeview.AppendColumn (GettextCatalog.GetString ("Rating"), new CellRendererText (), "text", 1);
			
			this.expressionsTreeview.Selection.Changed += delegate {
				ShowSelectedEntry ();
			};
			this.searchEntry.Changed += delegate {
				FilterItems (searchEntry.Text);
			};
			LoadRegexes ();
			UpdateExpressions ();
		}
开发者ID:nickname100,项目名称:monodevelop,代码行数:35,代码来源:RegexLibraryWindow.cs

示例12: ComboBoxDialog

		public ComboBoxDialog()
		{
			Title = "Gtk Combo Box Dialog";
			WidthRequest = 500;
			HeightRequest = 400;

			var vbox = new VBox ();
			this.VBox.PackStart (vbox);

			comboBox = new ComboBox ();
			vbox.PackStart (comboBox, false, false, 0);

			listStore = new ListStore (typeof(string), typeof(ComboBoxItem));
			comboBox.Model = listStore;

			var cell = new CellRendererText ();
			comboBox.PackStart (cell, true);
			comboBox.AddAttribute (cell, "text", 0);

			AddItems ();

			Child.ShowAll ();

			Show ();
		}
开发者ID:mrward,项目名称:test-xwt-memory-leak,代码行数:25,代码来源:ComboBoxDialog.cs

示例13: CombineConfigurationPanelWidget

		public CombineConfigurationPanelWidget (MultiConfigItemOptionsDialog parentDialog)
		{
			Build ();
			
			this.parentDialog = parentDialog;
			store = new ListStore (typeof(object), typeof(string), typeof(bool));
			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 = GettextCatalog.GetString ("Solution Item");
			configsList.AppendColumn (col);
			col.SortColumnId = 1;
			
			CellRendererToggle tt = new CellRendererToggle ();
			tt.Activatable = true;
			tt.Toggled += new ToggledHandler (OnBuildToggled);
			configsList.AppendColumn (GettextCatalog.GetString ("Build"), tt, "active", 2);
			
			CellRendererComboBox comboCell = new CellRendererComboBox ();
			comboCell.Changed += new ComboSelectionChangedHandler (OnConfigSelectionChanged);
			configsList.AppendColumn (GettextCatalog.GetString ("Configuration"), comboCell, new TreeCellDataFunc (OnSetConfigurationsData));
			store.SetSortColumnId (1, SortType.Ascending);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:28,代码来源:CombineConfigurationPanel.cs

示例14: UpdateCaceheInfo

 public void UpdateCaceheInfo()
 {
     m_model = new ListStore(typeof(Pixbuf), typeof(string), typeof(string));
     if (m_monitor.SelectedCache == null)
     {
         this.Sensitive = false;
         return;
     }
     this.Sensitive = true;
     string imagesFolder = GetImagesFolder ();
     fileLabel.Text = String.Format(Catalog.GetString("Images Folder: {0}"), imagesFolder);
     if(Directory.Exists(imagesFolder))
     {
         string[] files = Directory.GetFiles(imagesFolder);
         foreach(string file in files)
         {
             Pixbuf buf = new Pixbuf(file,256, 256);
             string[] filePath = file.Split('/');
             m_model.AppendValues(buf, filePath[filePath.Length -1],file);
         }
     }
     imagesView.Model = m_model;
     imagesView.PixbufColumn = 0;
     imagesView.TextColumn = 1;
     imagesView.SelectionMode = SelectionMode.Single;
 }
开发者ID:TweetyHH,项目名称:Open-Cache-Manager,代码行数:26,代码来源:ImagesWidget.cs

示例15: CreateInterface

		private void CreateInterface ()
		{
			this.CreateDialog ("camera_file_selection_dialog");
			
			file_tree.Selection.Mode = SelectionMode.Multiple;
			file_tree.AppendColumn (Catalog.GetString ("Preview"), 
						new CellRendererPixbuf (), "pixbuf", PreviewColumn);
			file_tree.AppendColumn (Catalog.GetString ("Path"), 
						new CellRendererText (), "text", DirectoryColumn);
			file_tree.AppendColumn (Catalog.GetString ("File"), 
						new CellRendererText (), "text", FileColumn);
			file_tree.AppendColumn (Catalog.GetString ("Index"),
						new CellRendererText (), "text", IndexColumn).Visible = false;
			
			preview_list_store = new ListStore (typeof (string), typeof (string), 
							    typeof (Pixbuf), typeof (int));
			
			file_tree.Model = preview_list_store;

			CreateTagMenu ();
			attach_check.Toggled += HandleTagToggled;
			HandleTagToggled (null, null);
			
			GetPreviews ();
		}
开发者ID:guadalinex-archive,项目名称:guadalinex-v6,代码行数:25,代码来源:CameraFileSelectionDialog.cs


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