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


C# Gtk.ListStore.GetIterFirst方法代码示例

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


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

示例1: AttachToProcessDialog

		public AttachToProcessDialog()
		{
			this.Build();

			store = new Gtk.ListStore (typeof(ProcessInfo), typeof(string), typeof(string));
			tree.Model = store;
			tree.AppendColumn ("PID", new Gtk.CellRendererText (), "text", 1);
			tree.AppendColumn (GettextCatalog.GetString ("Process Name"), new Gtk.CellRendererText (), "text", 2);
			tree.RowActivated += OnRowActivated;

			state = new TreeViewState (tree, 1);

			Refresh ();

			comboDebs.Sensitive = false;
			buttonOk.Sensitive = false;
			tree.Selection.UnselectAll ();
			tree.Selection.Changed += OnSelectionChanged;

			Gtk.TreeIter it;
			if (store.GetIterFirst (out it))
				tree.Selection.SelectIter (it);

			timeoutHandler = GLib.Timeout.Add (3000, Refresh);
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:25,代码来源:AttachToProcessDialog.cs

示例2: AttachToProcessDialog

		public AttachToProcessDialog()
		{
			this.Build();
			
			store = new Gtk.ListStore (typeof(ProcessInfo), typeof(string), typeof(string));
			tree.Model = store;
			tree.AppendColumn ("PID", new Gtk.CellRendererText (), "text", 1);
			tree.AppendColumn ("Process Name", new Gtk.CellRendererText (), "text", 2);
			
			DebuggerEngine[] debEngines = DebuggingService.GetDebuggerEngines ();
			foreach (DebuggerEngine de in debEngines) {
				if ((de.SupportedFeatures & DebuggerFeatures.Attaching) == 0)
					continue;
				try {
					foreach (ProcessInfo pi in de.GetAttachableProcesses ()) {
						List<DebuggerEngine> engs;
						if (!procEngines.TryGetValue (pi.Id, out engs)) {
							engs = new List<DebuggerEngine> ();
							procEngines [pi.Id] = engs;
							procs.Add (pi);
						}
						engs.Add (de);
					}
				} catch (Exception ex) {
					LoggingService.LogError ("Could not get attachablbe processes.", ex);
				}
				comboDebs.AppendText (de.Name);
			}
			
			state = new TreeViewState (tree, 1);
			
			FillList ();
			
			comboDebs.Sensitive = false;
			buttonOk.Sensitive = false;
			tree.Selection.Changed += OnSelectionChanged;
			
			Gtk.TreeIter it;
			if (store.GetIterFirst (out it))
				tree.Selection.SelectIter (it);

			OnSelectionChanged (null, null);
		}
开发者ID:segaman,项目名称:monodevelop,代码行数:43,代码来源:AttachToProcessDialog.cs

示例3: InsertTimestampPreferences

		public InsertTimestampPreferences () : base (false, 12)
		{	
			// Get current values
			String dateFormat = (string) Preferences.Get (
				Preferences.INSERT_TIMESTAMP_FORMAT);

			DateTime now = DateTime.Now;

			// Label
			Gtk.Label label = new Gtk.Label (Catalog.GetString (
				"Choose one of the predefined formats " +
				"or use your own."));
			label.Wrap = true;
			label.Xalign = 0;
			PackStart (label);

			// Use Selected Format
			selected_radio = new Gtk.RadioButton (Catalog.GetString (
				"Use _Selected Format"));
			PackStart (selected_radio);

			// 1st column (visible): formatted date
			// 2nd column (not visible): date format
			store = new Gtk.ListStore (typeof (string),
				typeof (string));
			foreach (String format in formats)
				store.AppendValues (now.ToString (format), format);

			scroll = new Gtk.ScrolledWindow();
			scroll.ShadowType = Gtk.ShadowType.In;
			PackStart (scroll);

			tv = new Gtk.TreeView (store);
			tv.HeadersVisible = false;
			tv.AppendColumn ("Format", new Gtk.CellRendererText (),
				"text", 0);
			scroll.Add (tv);

			// Use Custom Format
			Gtk.HBox customBox = new Gtk.HBox (false, 12);
			PackStart (customBox);

			custom_radio = new Gtk.RadioButton (
				selected_radio, Catalog.GetString ("_Use Custom Format"));
			customBox.PackStart (custom_radio);

			custom_entry = new Gtk.Entry ();
			customBox.PackStart (custom_entry);

			IPropertyEditor entryEditor = Services.Factory.CreatePropertyEditorEntry (
				Preferences.INSERT_TIMESTAMP_FORMAT, custom_entry);
			entryEditor.Setup ();

			// Activate/deactivate widgets
			bool useCustom = true;
			Gtk.TreeIter iter;
			store.GetIterFirst (out iter);

			foreach (object[] row in store) {
				if (dateFormat.Equals (row[1])) {
					// Found format in list
					useCustom = false;
					break;
				}	
				store.IterNext (ref iter);
			}

			if (useCustom) {
				custom_radio.Active = true;
				scroll.Sensitive = false;
			} else {
				selected_radio.Active = true;
				custom_entry.Sensitive = false;
				tv.Selection.SelectIter (iter);
				Gtk.TreePath path = store.GetPath (iter);				
				tv.ScrollToCell (path, null, false, 0, 0);
			}

			// Register Toggled event for one radio button only
			selected_radio.Toggled += OnSelectedRadioToggled;
			tv.Selection.Changed += OnSelectionChanged;

			ShowAll ();
		}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:84,代码来源:InsertTimestampPreferences.cs

示例4: PreferencesDialog

        public PreferencesDialog(Gtk.Window parent)
        {
            Trace.Call(parent);

            if (parent == null) {
                throw new ArgumentNullException("parent");
            }

            _Glade = new Glade.XML(null, Frontend.GladeFilename, "PreferencesDialog", null);
            //_Glade.BindFields(this);
            // changed signal is used in all settings, so use glade for now
            _Glade.Autoconnect(this);
            _Dialog = (Gtk.Dialog)_Glade["PreferencesDialog"];
            _Dialog.TransientFor = parent;

            ((Gtk.Button)_Glade["OKButton"]).Clicked += new EventHandler(_OnOKButtonClicked);
            ((Gtk.Button)_Glade["ApplyButton"]).Clicked += new EventHandler(_OnApplyButtonClicked);
            ((Gtk.Button)_Glade["CancelButton"]).Clicked += new EventHandler(_OnCancelButtonClicked);

            ((Gtk.TextView)_Glade["OnConnectCommandsTextView"]).Buffer.Changed += new EventHandler(_OnChanged);
            ((Gtk.TextView)_Glade["OnStartupCommandsTextView"]).Buffer.Changed += new EventHandler(_OnChanged);

            ((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Toggled += OnNotificationAreaIconCheckButtonToggled;
            ((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Toggled += _OnChanged;
            ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonAlways"]).Toggled += _OnChanged;
            ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonMinimized"]).Toggled += _OnChanged;
            ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonClosed"]).Toggled += _OnChanged;

            ((Gtk.CheckButton)_Glade["OverrideForegroundColorCheckButton"]).Toggled += OnOverrideForegroundColorCheckButtonToggled;
            ((Gtk.CheckButton)_Glade["OverrideBackgroundColorCheckButton"]).Toggled += OnOverrideBackgroundColorCheckButtonToggled;
            ((Gtk.CheckButton)_Glade["OverrideFontCheckButton"]).Toggled += OnOverrideFontCheckButtonToggled;

            Gtk.ComboBox wrapModeComboBox = (Gtk.ComboBox)_Glade["WrapModeComboBox"];
            // initialize wrap modes
            // glade might initialize it already!
            wrapModeComboBox.Clear();
            wrapModeComboBox.Changed += _OnChanged;
            Gtk.CellRendererText cell = new Gtk.CellRendererText();
            wrapModeComboBox.PackStart(cell, false);
            wrapModeComboBox.AddAttribute(cell, "text", 1);
            Gtk.ListStore store = new Gtk.ListStore(typeof(Gtk.WrapMode), typeof(string));
            // fill ListStore
            store.AppendValues(Gtk.WrapMode.Char,     _("Character"));
            store.AppendValues(Gtk.WrapMode.WordChar, _("Word"));
            wrapModeComboBox.Model = store;
            wrapModeComboBox.Active = 0;

            _Notebook.ShowTabs = false;

            Gtk.ListStore ls = new Gtk.ListStore(typeof(Page), typeof(Gdk.Pixbuf), typeof(string));
            ls.AppendValues(Page.Connection, _Dialog.RenderIcon(
                                                Gtk.Stock.Connect,
                                                Gtk.IconSize.SmallToolbar, null),
                            _("Connection"));
            ls.AppendValues(Page.Interface, _Dialog.RenderIcon(
                                                Gtk.Stock.SelectFont,
                                                Gtk.IconSize.SmallToolbar, null),
                            _("Interface"));
            ls.AppendValues(Page.Servers, _Dialog.RenderIcon(
                                                Gtk.Stock.Network,
                                                Gtk.IconSize.SmallToolbar, null),
                            _("Servers"));
            /*
            ls.AppendValues(Page.Filters, _Dialog.RenderIcon(
                                                Gtk.Stock.Delete,
                                                Gtk.IconSize.SmallToolbar, null),
                            _("Filters"));
            */

            int i = 1;
            _MenuTreeView.AppendColumn(null, new Gtk.CellRendererPixbuf(), "pixbuf",i++);
            _MenuTreeView.AppendColumn(null, new Gtk.CellRendererText(), "text", i++);
            _MenuTreeView.Selection.Changed += new EventHandler(_MenuTreeViewSelectionChanged);
            _MenuTreeView.Selection.Mode = Gtk.SelectionMode.Browse;
            _MenuTreeView.Model = ls;

            // select the first item
            Gtk.TreeIter iter;
            ls.GetIterFirst(out iter);
            _MenuTreeView.Selection.SelectIter(iter);

            _ChannelFilterListView = new ChannelFilterListView(_Glade);
            _ServerListView = new ServerListView(parent, _Glade);

            _Load();
        }
开发者ID:RoninBG,项目名称:smuxi,代码行数:86,代码来源:PreferencesDialog.cs

示例5: PreferencesDialog


//.........这里部分代码省略.........
            store.AppendValues(Gtk.WrapMode.WordChar, _("Word"));
            wrapModeComboBox.Model = store;
            wrapModeComboBox.Active = 0;

            Gtk.ComboBox persistencyTypeComboBox =
                (Gtk.ComboBox) _Glade["PersistencyTypeComboBox"];
            // glade might initialize it already!
            persistencyTypeComboBox.Clear();
            persistencyTypeComboBox.Changed += _OnChanged;
            cell = new Gtk.CellRendererText();
            persistencyTypeComboBox.PackStart(cell, false);
            persistencyTypeComboBox.AddAttribute(cell, "text", 1);
            store = new Gtk.ListStore(
                typeof(MessageBufferPersistencyType), typeof(string)
            );
            // fill ListStore
            store.AppendValues(MessageBufferPersistencyType.Volatile,
                               _("Volatile"));
            store.AppendValues(MessageBufferPersistencyType.Persistent,
                               _("Persistent"));
            persistencyTypeComboBox.Model = store;
            persistencyTypeComboBox.Active = 0;
            if (Frontend.EngineVersion < new Version("0.8.1")) {
                persistencyTypeComboBox.Sensitive = false;
                ((Gtk.SpinButton) _Glade["VolatileMaxCapacitySpinButton"]).Sensitive = false;
                ((Gtk.SpinButton) _Glade["PersistentMaxCapacitySpinButton"]).Sensitive = false;
            }

            Gtk.ComboBox proxyTypeComboBox = (Gtk.ComboBox)_Glade["ProxyTypeComboBox"];
            // initialize wrap modes
            // glade might initialize it already!
            proxyTypeComboBox.Clear();
            proxyTypeComboBox.Changed += _OnChanged;
            proxyTypeComboBox.Changed += delegate {
                CheckProxyTypeComBoBox();
            };
            cell = new Gtk.CellRendererText();
            proxyTypeComboBox.PackStart(cell, false);
            proxyTypeComboBox.AddAttribute(cell, "text", 1);
            store = new Gtk.ListStore(typeof(ProxyType), typeof(string));
            // fill ListStore
            store.AppendValues(ProxyType.None,    String.Format("<{0}>",
                                                                _("No Proxy")));
            store.AppendValues(ProxyType.System,  String.Format("<{0}>",
                                                                _("System Default")));
            store.AppendValues(ProxyType.Http,    "HTTP");
            store.AppendValues(ProxyType.Socks4,  "SOCK 4");
            store.AppendValues(ProxyType.Socks4a, "SOCK 4a");
            store.AppendValues(ProxyType.Socks5,  "SOCK 5");
            proxyTypeComboBox.Model = store;
            proxyTypeComboBox.Active = 0;

            _Notebook.ShowTabs = false;

            Gtk.ListStore ls = new Gtk.ListStore(typeof(Page), typeof(Gdk.Pixbuf), typeof(string));
            ls.AppendValues(Page.Connection, _Dialog.RenderIcon(
                                                Gtk.Stock.Connect,
                                                Gtk.IconSize.SmallToolbar, null),
                            _("Connection"));
            ls.AppendValues(Page.Interface, _Dialog.RenderIcon(
                                                Gtk.Stock.SelectFont,
                                                Gtk.IconSize.SmallToolbar, null),
                            _("Interface"));
            ls.AppendValues(Page.Servers, _Dialog.RenderIcon(
                                                Gtk.Stock.Network,
                                                Gtk.IconSize.SmallToolbar, null),
                            _("Servers"));

            if (Frontend.EngineVersion >= new Version("0.7.2")) {
                // features introduced in >= 0.7.2
                ls.AppendValues(Page.Filters, _Dialog.RenderIcon(
                                                    Gtk.Stock.Delete,
                                                    Gtk.IconSize.SmallToolbar, null),
                                _("Filters"));
                ls.AppendValues(Page.Logging, _Dialog.RenderIcon(
                                                    Gtk.Stock.JustifyLeft,
                                                    Gtk.IconSize.SmallToolbar, null),
                                _("Logging"));
            }

            int i = 1;
            _MenuTreeView.AppendColumn(null, new Gtk.CellRendererPixbuf(), "pixbuf",i++);
            _MenuTreeView.AppendColumn(null, new Gtk.CellRendererText(), "text", i++);
            _MenuTreeView.Selection.Changed += new EventHandler(_MenuTreeViewSelectionChanged);
            _MenuTreeView.Selection.Mode = Gtk.SelectionMode.Browse;
            _MenuTreeView.Model = ls;

            // select the first item
            Gtk.TreeIter iter;
            ls.GetIterFirst(out iter);
            _MenuTreeView.Selection.SelectIter(iter);

            _ServerListView = new ServerListView(_Dialog, _Glade);
            _FilterListWidget = new FilterListWidget(_Dialog, Frontend.UserConfig);
            _FilterListWidget.Changed += _OnChanged;
            _FilterListEventBox.Add(_FilterListWidget);
            _FilterListEventBox.ShowAll();

            _Load();
        }
开发者ID:grendello,项目名称:smuxi,代码行数:101,代码来源:PreferencesDialog.cs

示例6: MakeSyncPane

		public Gtk.Widget MakeSyncPane ()
		{
			Gtk.VBox vbox = new Gtk.VBox (false, 0);
			vbox.Spacing = 4;
			vbox.BorderWidth = 8;

			Gtk.HBox hbox = new Gtk.HBox (false, 4);

			Gtk.Label label = new Gtk.Label (Catalog.GetString ("Ser_vice:"));
			label.Xalign = 0;
			label.Show ();
			hbox.PackStart (label, false, false, 0);

			// Populate the store with all the available SyncServiceAddins
			syncAddinStore = new Gtk.ListStore (typeof (SyncServiceAddin));
			syncAddinIters = new Dictionary<string,Gtk.TreeIter> ();
			SyncServiceAddin [] addins = Tomboy.DefaultNoteManager.AddinManager.GetSyncServiceAddins ();
			Array.Sort (addins, CompareSyncAddinsByName);
			foreach (SyncServiceAddin addin in addins) {
				Gtk.TreeIter iter = syncAddinStore.Append ();
				syncAddinStore.SetValue (iter, 0, addin);
				syncAddinIters [addin.Id] = iter;
			}

			syncAddinCombo = new Gtk.ComboBox (syncAddinStore);
			label.MnemonicWidget = syncAddinCombo;
			Gtk.CellRendererText crt = new Gtk.CellRendererText ();
			syncAddinCombo.PackStart (crt, true);
			syncAddinCombo.SetCellDataFunc (crt,
			                                new Gtk.CellLayoutDataFunc (ComboBoxTextDataFunc));

			// Read from Preferences which service is configured and select it
			// by default.  Otherwise, just select the first one in the list.
			string addin_id = Preferences.Get (
			                          Preferences.SYNC_SELECTED_SERVICE_ADDIN) as String;

			Gtk.TreeIter active_iter;
			if (addin_id != null && syncAddinIters.ContainsKey (addin_id)) {
				active_iter = syncAddinIters [addin_id];
				syncAddinCombo.SetActiveIter (active_iter);
			} else {
				if (syncAddinStore.GetIterFirst (out active_iter) == true) {
					syncAddinCombo.SetActiveIter (active_iter);
				}
			}

			syncAddinCombo.Changed += OnSyncAddinComboChanged;

			syncAddinCombo.Show ();
			hbox.PackStart (syncAddinCombo, true, true, 0);

			hbox.Show ();
			vbox.PackStart (hbox, false, false, 0);

			// Get the preferences GUI for the Sync Addin
			if (active_iter.Stamp != Gtk.TreeIter.Zero.Stamp)
				selectedSyncAddin = syncAddinStore.GetValue (active_iter, 0) as SyncServiceAddin;

			if (selectedSyncAddin != null)
				syncAddinPrefsWidget = selectedSyncAddin.CreatePreferencesControl (OnSyncAddinPrefsChanged);
			if (syncAddinPrefsWidget == null) {
				Gtk.Label l = new Gtk.Label (Catalog.GetString ("Not configurable"));
				l.Yalign = 0.5f;
				l.Yalign = 0.5f;
				syncAddinPrefsWidget = l;
			}
			if (syncAddinPrefsWidget != null && addin_id != null &&
			                syncAddinIters.ContainsKey (addin_id) && selectedSyncAddin.IsConfigured)
				syncAddinPrefsWidget.Sensitive = false;

			syncAddinPrefsWidget.Show ();
			syncAddinPrefsContainer = new Gtk.VBox (false, 0);
			syncAddinPrefsContainer.PackStart (syncAddinPrefsWidget, false, false, 0);
			syncAddinPrefsContainer.Show ();
			vbox.PackStart (syncAddinPrefsContainer, true, true, 10);

			// Autosync preference
			int timeout = (int) Preferences.Get (Preferences.SYNC_AUTOSYNC_TIMEOUT);
			if (timeout > 0 && timeout < 5) {
				timeout = 5;
				Preferences.Set (Preferences.SYNC_AUTOSYNC_TIMEOUT, 5);
			}
			Gtk.HBox autosyncBox = new Gtk.HBox (false, 5);
			// Translators: This is and the next string go together.
			// Together they look like "Automatically Sync in Background Every [_] Minutes",
			// where "[_]" is a GtkSpinButton.
			autosyncCheck =
				new Gtk.CheckButton (Catalog.GetString ("Automaticall_y Sync in Background Every"));
			autosyncSpinner = new Gtk.SpinButton (5, 1000, 1);
			autosyncSpinner.Value = timeout >= 5 ? timeout : 10;
			Gtk.Label autosyncExtraText =
				// Translators: See above comment for details on
				// this string.
				new Gtk.Label (Catalog.GetString ("Minutes"));
			autosyncCheck.Active = autosyncSpinner.Sensitive = timeout >= 5;
			EventHandler updateTimeoutPref = (o, e) => {
				Preferences.Set (Preferences.SYNC_AUTOSYNC_TIMEOUT,
				                 autosyncCheck.Active ? (int) autosyncSpinner.Value : -1);
			};
			autosyncCheck.Toggled += (o, e) => {
//.........这里部分代码省略.........
开发者ID:oluc,项目名称:tomboy,代码行数:101,代码来源:PreferencesDialog.cs


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