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


C# ComboBox.SetAttributes方法代码示例

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


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

示例1: InitializeExtraWidget

        protected void InitializeExtraWidget()
        {
            PlaylistFormatDescription [] formats = PlaylistFileUtil.ExportFormats;
            int default_export_index = PlaylistFileUtil.GetFormatIndex(formats, playlist);

            // Build custom widget used to select the export format.
            store = new ListStore(typeof(string), typeof(PlaylistFormatDescription));
            foreach (PlaylistFormatDescription format in formats) {
                store.AppendValues(format.FormatName, format);
            }

            HBox hBox = new HBox(false, 2);

            combobox = new ComboBox(store);
            CellRendererText crt = new CellRendererText();
            combobox.PackStart(crt, true);
            combobox.SetAttributes(crt, "text", 0);
            combobox.Active = default_export_index;
            combobox.Changed += OnComboBoxChange;

            hBox.PackStart(new Label(Catalog.GetString("Select Format: ")), false, false, 0);
            hBox.PackStart(combobox, true, true, 0);

            combobox.ShowAll();
            hBox.ShowAll();
            ExtraWidget = hBox;
        }
开发者ID:haugjan,项目名称:banshee-hacks,代码行数:27,代码来源:PlaylistExportDialog.cs

示例2: FilterComboBox

		private Gtk.ComboBox FilterComboBox ()
		{
			filter_data = new Gtk.ListStore (new Type[] { typeof (string), typeof (string) });
			
			Gtk.TreeIter iter;

			iter = filter_data.Append ();
			filter_data.SetValue (iter, 0, Catalog.GetString ("Anywhere"));
			filter_data.SetValue (iter, 1, null);

			iter = filter_data.Append ();
			filter_data.SetValue (iter, 0, Catalog.GetString ("in Files"));
			filter_data.SetValue (iter, 1, "File");

			iter = filter_data.Append ();
			filter_data.SetValue (iter, 0, Catalog.GetString ("in Addressbook"));
			filter_data.SetValue (iter, 1, "Contact");

			iter = filter_data.Append ();
			filter_data.SetValue (iter, 0, Catalog.GetString ("in Mail"));
			filter_data.SetValue (iter, 1, "MailMessage");

			iter = filter_data.Append ();
			filter_data.SetValue (iter, 0, Catalog.GetString ("in Web Pages"));
			filter_data.SetValue (iter, 1, "WebHistory");

			iter = filter_data.Append ();
			filter_data.SetValue (iter, 0, Catalog.GetString ("in Chats"));
			filter_data.SetValue (iter, 1, "IMLog");

			Gtk.ComboBox combo = new Gtk.ComboBox (filter_data);
			combo.Active = 0;

			Gtk.CellRendererText renderer = new Gtk.CellRendererText ();
			combo.PackStart (renderer, false);
			combo.SetAttributes (renderer, new object[] { "text", 0 });

			return combo;
		}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:39,代码来源:BestWindow.cs

示例3: BuildLayout

        void BuildLayout ()
        {
            var primary_vbox = new VBox () {
                Spacing = 6
            };

            // Source selector
            var combo_align = new Alignment (0, .5f, 0, 0);
            var combo_hbox = new HBox (false, 6);
            combo_hbox.Add (new Label (Catalog.GetString ("Import from:")));
            sources_combo = new ComboBox (sources_model);
            var render = new CellRendererText ();
            sources_combo.PackStart (render, true);
            sources_combo.SetAttributes (render, "text", 1);
            combo_hbox.Add (sources_combo);
            combo_align.Add (combo_hbox);
            combo_align.ShowAll ();
            primary_vbox.Add (combo_align);

            // Button row near the top
            var align = new Alignment (1, .5f, 0, 0);
            var button_box = new HButtonBox () {
                Spacing = 6
            };
            button_box.Add (cancel_button = new Button (Stock.Cancel));
            button_box.Add (import_button = new Button (Stock.Add));
            align.Add (button_box);
            align.ShowAll ();

            primary_vbox.Add (align);
            primary_vbox.Show ();

            Add (primary_vbox);
        }
开发者ID:rubenv,项目名称:tripod,代码行数:34,代码来源:ImportWindow.cs


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