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


C# Gtk.Clear方法代码示例

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


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

示例1: CargarListaCafeteria

    public static void CargarListaCafeteria(ref Gtk.ListStore listaStore)
    {
        listaStore.Clear();
        MySQL.consultar("SELECT `ID_articulo`, `descripcion`, `precio` FROM cafeteria_articulos");
        /*
        // Miremos primero si no han agregado este articulo a la lista
        TreeIter iter = new TreeIter();
        Boolean Encontrado = false;
        if (MySQL.Reader.Read() && tvLista.Model.GetIterFirst(ref iter)) {
        do {
            if (tvLista.Model.GetValue(iter,0).ToString() == MySQL.Reader["ID_articulo"].ToString())
            {
                int CantidadActual = int.Parse(tvLista.Model.GetValue (iter, 1).ToString());
                tvLista.Model.SetValue(iter,1,++CantidadActual);
                Encontrado = true;
            }
        } while(tvLista.Model.IterNext(ref iter));

        }

        if (!Encontrado && MySQL.Reader.HasRows)
            listaStore.AppendValues (MySQL.Reader["ID_articulo"].ToString(),MySQL.Reader["codigo_barra"].ToString(), 0, MySQL.Reader["descripcion"].ToString(),double.Parse(MySQL.Reader["precio"].ToString()));
        */

        while (MySQL.Reader.Read())
        listaStore.AppendValues (MySQL.Reader["ID_articulo"].ToString(), 0, MySQL.Reader["descripcion"].ToString(),double.Parse(MySQL.Reader["precio"].ToString()));
    }
开发者ID:vlad88sv,项目名称:RIFT,代码行数:27,代码来源:cafeteria.cs

示例2: 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

示例3: 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

示例4: PerformCopy

 public void PerformCopy(Gtk.Clipboard clipboard)
 {
     if (selectionRelativeIndex > 0) {
         clipboard.Text = GetText (linePos, textPos, selectionRelativeIndex);
     } else if (selectionRelativeIndex < 0) {
         Position p = IndexToPosition (PositionToIndex (new Position (linePos, textPos)) + selectionRelativeIndex);
         clipboard.Text = GetText (p.Line, p.Offset, -selectionRelativeIndex);
     }
     else
         clipboard.Clear ();
 }
开发者ID:Kharevich,项目名称:Pinta,代码行数:11,代码来源:TextEngine.cs

示例5: updateSymbolTable

 protected void updateSymbolTable(Hashtable symbolTable, Gtk.ListStore symbolTree)
 {
     symbolTree.Clear ();
     foreach(DictionaryEntry pair in symbolTable) {
         symbolTree.AppendValues (pair.Key, pair.Value);
     }
 }
开发者ID:matthewmarcos94,项目名称:CMSC124,代码行数:7,代码来源:EvalClass.cs

示例6: PerformCopy

		public void PerformCopy (Gtk.Clipboard clipboard)
		{
            if (HasSelection ())
            {
                StringBuilder strbld = new StringBuilder ();

                TextPosition start = TextPosition.Min (currentPos, selectionStart);
                TextPosition end = TextPosition.Max (currentPos, selectionStart);
                ForeachLine (start, end, (currentLinePos, strpos, endpos) =>{
                    if (endpos - strpos > 0)
                        strbld.AppendLine (lines[currentLinePos].Substring (strpos, endpos - strpos));
                    else if (endpos == strpos)
                        strbld.AppendLine ();
                });
                strbld.Remove (strbld.Length - Environment.NewLine.Length, Environment.NewLine.Length);

                clipboard.Text = strbld.ToString ();
            }
			else
				clipboard.Clear ();
		}
开发者ID:msiyer,项目名称:Pinta,代码行数:21,代码来源:TextEngine.cs


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