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


C# Gtk.PackStart方法代码示例

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


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

示例1: BuildFileNameGroup

        private void BuildFileNameGroup(Gtk.HBox hbFileName)
        {
            this.btOpen = new Gtk.Button( Gtk.Stock.Open );
            this.edFileName = new Gtk.Entry();

            this.edFileName.IsEditable = false;
            this.btOpen.Clicked += (sender, e) => this.OnOpen();

            hbFileName.PackStart( this.edFileName, true, true, 5 );
            hbFileName.PackStart( this.btOpen, false, false, 5 );
        }
开发者ID:Baltasarq,项目名称:Tacto,代码行数:11,代码来源:ChooseConversionFormatView.cs

示例2: FillVbox

 public void FillVbox(Gtk.VBox vbox, IList people) {
     foreach (Person p in people)
     {
         vbox.PackStart (new PersonAndJobRow(p, null));
     }
     vbox.ShowAll ();
 }
开发者ID:monsterlabs,项目名称:HumanRightsTracker,代码行数:7,代码来源:PeoplePerCase.cs

示例3: MakeButton

		private Gtk.Button MakeButton (Gtk.HBox header, string icon, EventHandler handler)
		{
			Gtk.Button button = new Gtk.Button ();
			Gtk.Image img = new Gtk.Image (icon, Gtk.IconSize.Button);
			button.Add (img);
			button.Relief = Gtk.ReliefStyle.None;
			button.Clicked += handler;

			header.PackStart (button, false, false, 0);
			button.ShowAll ();

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

示例4: FillTestComboBox

    private void FillTestComboBox(Gtk.ComboBox cb)
    {
        cb.Clear();
        CellRendererText cell = new CellRendererText();
        cb.PackStart(cell, false);
        cb.AddAttribute(cell, "text", 0);
        ListStore store = new ListStore(typeof (string));
        cb.Model = store;

        store.AppendValues("BitBlt");
        store.AppendValues("Ellipse");
        store.AppendValues("Polygon");
        store.AppendValues("LineTo");
        store.AppendValues("PolylineTo");
    }
开发者ID:FreeRDP,项目名称:GdiTest,代码行数:15,代码来源:MainWindow.cs

示例5: fill_themes_combo

        private void fill_themes_combo(Gtk.ComboBox box)
        {
            box.Clear();
            CellRendererText cell = new CellRendererText();
            box.PackStart(cell, false);
            box.AddAttribute(cell, "text", 0);
            ListStore store = new ListStore(typeof(string));
            box.Model = store;

            TreeIter iter;
            string cur_theme = Conf.Get(Preference.THEME, Defines.DEFAULT_THEME);
            cur_theme = cur_theme.Substring(cur_theme.LastIndexOf("/") + 1);
            IList themes = Application.TheApp.ThemeManager.GetThemeList();

            foreach(Theme t in themes){
                iter = store.AppendValues(t.Name);

                if(t.Name == cur_theme){
                    box.SetActiveIter(iter);
                }
            }
        }
开发者ID:GNOME,项目名称:blam,代码行数:22,代码来源:PreferencesDialog.cs

示例6: AddBoolItem

        /// Add new checkbox to the dialog with label and default value
        /// <param name="page">An object that represents dialog (a container of items on the dialog)</param>
        /// <param name="propertyLabel">Label that will be shown before the checkbox</param>
        /// <param name="propertyValue">Default value that will be preset to the checkbox (should be one of True or False)</param>
        /// <param name="propertyHint">Hint that will be shown when mouse goes over a checkbox</param>
        /// <param name="wayInXml">A XPath path to the element, whose checkbox is created</param> 
        protected void AddBoolItem(Gtk.Box page, string propertyLabel, string propertyValue, string propertyHint, string wayInXml)
        {
            // create one entry to property dialog
              HBox hbox = new HBox(false, 3);
              Label vypln = new Label(); vypln.WidthRequest = 18; hbox.PackStart(vypln, false, false, 1);
              CheckButton checkButton = CheckButton.NewWithLabel(propertyLabel);
              hbox.PackStart(checkButton, false, false, 1);
              checkButton.Active = (propertyValue.ToUpper() == "TRUE");
              // add hints to created items
              tooltips.SetTip(checkButton, propertyHint, "");
              page.PackStart(hbox, false, false, 1);

              // add checkbox to list of properies (useful during saving)
              checkButton.Name = "item" + (lastItemNumber++).ToString();
              StoreToProperties(checkButton.Name, wayInXml);
        }
开发者ID:BackupTheBerlios,项目名称:beline-svn,代码行数:22,代码来源:PropertyDialog.cs

示例7: AddIntItem

        /// Add new spinbutton to the dialog with label and default value
        /// <param name="page">An object that represents dialog (a container of items on the dialog)</param>
        /// <param name="propertyLabel">Label that will be shown before the spinbutton</param>
        /// <param name="propertyValue">Default value that will be preset to the spinbutton (should be one of True or False)</param>
        /// <param name="propertyHint">Hint that will be shown when mouse goes over a spinbutton</param>
        /// <param name="wayInXml">A XPath path to the element, whose spinbutton is created</param>
        protected void AddIntItem(Gtk.Box page, string propertyLabel, string propertyValue, string propertyHint, string minimum, string maximum, string step, string wayInXml)
        {
            double dMinimum = Convert.ToDouble(minimum);
              double dMaximum = Convert.ToDouble(maximum);
              double dStep = Convert.ToDouble(step);
              double hodnota = (propertyValue != string.Empty) ? Convert.ToDouble(propertyValue) : 1f;
              if (hodnota < dMinimum) hodnota=dMinimum;
              if (hodnota > dMaximum) hodnota=dMaximum;

              // create spinbutton to represent value
              HBox hbox = new HBox(false, 3);
              Label vypln = new Label(); vypln.WidthRequest = 18; hbox.PackStart(vypln, false, false, 1);
              SpinButton spinner = new SpinButton(dMinimum, dMaximum, dStep);
              spinner.Value = hodnota;
              Label labelInt = new Label(propertyLabel);

              hbox.PackStart(labelInt, false, false, 1);
              hbox.PackStart(spinner, false, false, 1);
              page.PackStart(hbox, false, false, 1);

              // store the way in Xml to this element
              spinner.Name = "item" + (lastItemNumber++).ToString();
              StoreToProperties(spinner.Name, wayInXml);
        }
开发者ID:BackupTheBerlios,项目名称:beline-svn,代码行数:30,代码来源:PropertyDialog.cs

示例8: AddStringItem

        /// Add new editable entry to the dialog with label and default value
        /// <param name="page">An object that represents dialog (a container of items on the dialog)</param>
        /// <param name="propertyLabel">Label that will be shown before the entry</param>
        /// <param name="propertyValue">Default value that will be preset to the entry</param>
        /// <param name="wayInXml">A XPath path to the element, whose entry is created</param>
        protected void AddStringItem(Gtk.Box page, string propertyLabel, string propertyValue, string toolTip, string wayInXml)
        {
            // create one entry to property dialog
              HBox hbox = new HBox(false, 3);
              Label vypln = new Label(); vypln.WidthRequest = 18; hbox.PackStart(vypln, false, false, 1);
              Label label = new Label(propertyLabel);
              Entry entry = new Entry(propertyValue);
              entry.IsEditable = true; entry.Visible = true;
              hbox.PackStart(label, false, false, 1);
              hbox.PackEnd(entry, true, true, 1);
              page.PackStart(hbox, false, false, 1);

              // add entry to list of properies (useful during saving)
              entry.Name = "item" + (lastItemNumber++).ToString();
              StoreToProperties(entry.Name, wayInXml);
        }
开发者ID:BackupTheBerlios,项目名称:beline-svn,代码行数:21,代码来源:PropertyDialog.cs

示例9: AttachMainToolbar

		internal virtual void AttachMainToolbar (Gtk.VBox parent, IMainToolbarView toolbar)
		{
			var toolbarBox = new Gtk.HBox ();
			parent.PackStart (toolbarBox, false, false, 0);
			toolbarBox.PackStart ((MainToolbar)toolbar, true, true, 0);
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:6,代码来源:PlatformService.cs

示例10: AddComboItem

        /// Add new combobox to the dialog with label, filled item and default value
        /// <param name="page">An object that represents dialog (a container of items on the dialog)</param>
        /// <param name="propertyLabel">Label that will be shown before the combobox</param>
        /// <param name="propertySelected">Default value that will be preset to the combobox (should be one of True or False)</param>
        /// <param name="propertyHint">Hint that will be shown when mouse goes over a combobox</param>
        /// <param name="options">An array of strings that represents options of combobox</param>
        /// <param name="wayInXml">A XPath path to the element, whose combobox is created</param>
        protected void AddComboItem(Gtk.Box page, string propertyLabel, string propertySelected, string propertyHint, ArrayList options, string wayInXml)
        {
            int selected = Convert.ToInt32(propertySelected);
              HBox hbox = new HBox(false, 3);
              Label vypln = new Label(); vypln.WidthRequest = 18; hbox.PackStart(vypln, false, false, 1);
              Gtk.Label labelSelect = new Label(propertyLabel);
              Gtk.ComboBox combo = ComboBox.NewText();
              foreach (String option in options)
              {
            combo.AppendText(option);
              }
              // preselect proper item
              if (selected < options.Count && selected >= 0) combo.Active = selected;
              hbox.PackStart(labelSelect, false, false, 1);
              hbox.PackStart(combo, false, false, 1);
              page.PackStart(hbox, false, false, 1);

              // store the way in Xml to this element
              combo.Name = "item" + (lastItemNumber++).ToString();
              StoreToProperties(combo.Name, wayInXml);
        }
开发者ID:BackupTheBerlios,项目名称:beline-svn,代码行数:28,代码来源:PropertyDialog.cs

示例11: AttachMainToolbar

        internal override void AttachMainToolbar (Gtk.VBox parent, Components.MainToolbar.IMainToolbarView toolbar)
		{
			titleBar = new TitleBar ();
			var topMenu = new GtkWPFWidget (titleBar) {
				HeightRequest = System.Windows.Forms.SystemInformation.CaptionHeight,
			};
			//commandManager.IncompleteKeyPressed += (sender, e) => {
			//	if (e.Key == Gdk.Key.Alt_L) {
			//		Keyboard.Focus(titleBar.DockTitle.Children[0]);
			//	}
			//};
			parent.PackStart (topMenu, false, true, 0);
			SetupMenu ();

			parent.PackStart ((WPFToolbar)toolbar, false, true, 0);
		}
开发者ID:ArsenShnurkov,项目名称:monodevelop,代码行数:16,代码来源:WindowsPlatform.cs

示例12: SetupGuiServerRelated

        /// <summary>
        /// server gui stuff:
        /// server path
        /// server username + password
        /// check server ssl certificate yes/no
        /// </summary>
        /// <param name="insertTo"></param>
        /// <param name="defaultSpacing"></param>
        void SetupGuiServerRelated(Gtk.Box insertTo, int defaultSpacing)
        {
            Gtk.Table customBox = new Gtk.Table(3, 2, false);

            // somehow you can't change the default spacing or set it for all rows
            for (int i = 0; i < 3; i++)
                customBox.SetRowSpacing((uint)i, (uint)defaultSpacing);

            // insert the labels
            customBox.Attach(new Gtk.Label(Catalog.GetString("Server path:")), 0, 1, 0, 1);
            customBox.Attach(new Gtk.Label(Catalog.GetString("Username:")), 0, 1, 1, 2);
            customBox.Attach(new Gtk.Label(Catalog.GetString("Password:")), 0, 1, 2, 3);

            insertTo.PackStart(customBox);
            server_path = new Gtk.Entry();
            customBox.Attach(server_path, 1, 2, 0, 1);
            string serverPath = Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_SERVERPATH) as String;
            server_path.Text = serverPath;
            // NO EDITOR! because we only save when "SaveConfiguration" is called
            //IPropertyEditor serverEditor = Services.Factory.CreatePropertyEditorEntry(
            //	AddinPreferences.SYNC_PRIVATENOTES_SERVERPATH, server_path);
            //serverEditor.Setup();

            server_user = new Gtk.Entry();
            customBox.Attach(server_user, 1, 2, 1, 2);
            string serverUser = Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_SERVERUSER) as String;
            server_user.Text = serverUser;
            // NO EDITOR! because we only save when "SaveConfiguration" is called
            //IPropertyEditor userEditor = Services.Factory.CreatePropertyEditorEntry(
            // AddinPreferences.SYNC_PRIVATENOTES_SERVERUSER, server_user);
            //userEditor.Setup();

            server_pass = new Gtk.Entry();
            server_pass.InvisibleChar = '*';
            server_pass.Visibility = false;
            customBox.Attach(server_pass, 1, 2, 2, 3);
            string serverpass = Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_SERVERPASS) as String;
            server_pass.Text = serverpass;
            // NO EDITOR! because we only save when "SaveConfiguration" is called
            //IPropertyEditor passEditor = Services.Factory.CreatePropertyEditorEntry(
            // AddinPreferences.SYNC_PRIVATENOTES_SERVERPASS, server_pass);
            //passEditor.Setup();

            check_ssl = new Gtk.CheckButton(Catalog.GetString("Check servers SSL certificate"));
            insertTo.PackStart(check_ssl);

            // set up check-ssl certificate stuff
            object value = Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_SERVERCHECKSSLCERT);
            if (value == null || value.Equals(true))
                check_ssl.Active = true;
        }
开发者ID:NoUsername,项目名称:PrivateNotes,代码行数:59,代码来源:EncryptedWebdavSyncServiceAddin.cs

示例13: add_page_link

        private void add_page_link(string text, Gtk.HBox page_navigation, int offset, int current_page)
        {
            Gtk.EventBox link_wrapper = new Gtk.EventBox();
            Gtk.Label link = new Gtk.Label();
            link.Markup = "<u><small>" + text + "</small></u>";

            GtkCommon.show_hand_and_tooltip(link_wrapper, text);

            System.Console.WriteLine("adding a page link: {0} with offset on click {1}", text, offset);

            link_wrapper.Add(link);
            link_wrapper.ButtonPressEvent += delegate {
                if (current_page != -1) { // next
                    sizes_of_last_pages.Push(current_page);
                    this.offset = offset + current_page;
                } else {
                    int last_page = sizes_of_last_pages.Pop();
                    this.offset = offset - last_page;
                }
                add_elements();
            };

            GtkCommon.set_background_color(link_wrapper, "white");
            page_navigation.PackStart(link_wrapper, false, false, 5);
        }
开发者ID:GNOME,项目名称:nemo,代码行数:25,代码来源:SearchPopup.cs

示例14: InitWebKit

 public void InitWebKit(Gtk.Box w)
 {
     if (!appInited)
     {
         MonoMac.AppKit.NSApplication.Init();
         appInited = true;
     }
     wb = new MonoMac.WebKit.WebView(new System.Drawing.RectangleF(10, 10, 200, 200), "foo", "bar");
     scrollWindow.AddWithViewport(NSViewToGtkWidget(wb));
     w.PackStart(scrollWindow, true, true, 0);
     w.ShowAll();
     wb.ShouldCloseWithWindow = true;
 }
开发者ID:hol353,项目名称:ApsimX,代码行数:13,代码来源:HTMLView.cs

示例15: add_link

        private void add_link(string text, CalendarDriver.View view, System.DateTime item_modified_date, Gtk.HBox links)
        {
            Gtk.EventBox link_wrapper = new Gtk.EventBox();
            Gtk.Label link = new Gtk.Label();
            link.Markup = "<u><small>" + text + "</small></u>";

            GtkCommon.show_hand_and_tooltip(link_wrapper, text);

            link_wrapper.Add(link);
            link_wrapper.ButtonPressEvent += delegate(object sender, Gtk.ButtonPressEventArgs args) {
                set_view_callback(view, item_modified_date);
            };

            GtkCommon.set_background_color(link_wrapper, "white");
            links.PackStart(link_wrapper, false, false, 5);
        }
开发者ID:GNOME,项目名称:nemo,代码行数:16,代码来源:SearchPopup.cs


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