本文整理汇总了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()));
}
示例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");
}
示例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);
}
}
}
示例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 ();
}
示例5: updateSymbolTable
protected void updateSymbolTable(Hashtable symbolTable, Gtk.ListStore symbolTree)
{
symbolTree.Clear ();
foreach(DictionaryEntry pair in symbolTable) {
symbolTree.AppendValues (pair.Key, pair.Value);
}
}
示例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 ();
}