本文整理汇总了C#中Gtk.ListStore.EmitRowChanged方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.ListStore.EmitRowChanged方法的具体用法?C# Gtk.ListStore.EmitRowChanged怎么用?C# Gtk.ListStore.EmitRowChanged使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.ListStore
的用法示例。
在下文中一共展示了Gtk.ListStore.EmitRowChanged方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
void Init()
{
f_ProtocolListStore = new Gtk.ListStore(typeof(string));
f_ListStore = new Gtk.ListStore(
typeof(FilterModel),
typeof(int), // filter key
typeof(string) // tool tip
);
f_TreeView.Model = f_ListStore;
int i = 1;
Gtk.TreeViewColumn column;
Gtk.CellRendererText textCellr;
Gtk.CellRendererCombo comboCellr;
Gtk.CellRendererToggle toggleCellr;
comboCellr = new Gtk.CellRendererCombo();
comboCellr.Model = f_ProtocolListStore;
comboCellr.TextColumn = 0;
comboCellr.HasEntry = false;
comboCellr.Editable = true;
comboCellr.Edited += OnProtocolEdited;
column = f_TreeView.AppendColumn(_("Protocol"), comboCellr);
column.SetCellDataFunc(comboCellr, RenderProtocol);
f_ChatTypeListStore = new Gtk.ListStore(typeof(string),
typeof(ChatType?));
f_ChatTypeListStore.AppendValues(String.Empty, null);
f_ChatTypeListStore.AppendValues(_("Person / Private"), ChatType.Person);
f_ChatTypeListStore.AppendValues(_("Group / Public"), ChatType.Group);
f_ChatTypeListStore.AppendValues(_("Protocol / Server"), ChatType.Protocol);
comboCellr = new Gtk.CellRendererCombo();
comboCellr.Model = f_ChatTypeListStore;
comboCellr.TextColumn = 0;
comboCellr.HasEntry = false;
comboCellr.Editable = true;
comboCellr.Edited += OnChatTypeEdited;
column = f_TreeView.AppendColumn(_("Chat Type"), comboCellr);
column.Resizable = true;
column.Sizing = Gtk.TreeViewColumnSizing.GrowOnly;
column.SetCellDataFunc(comboCellr, RenderChatType);
textCellr = new Gtk.CellRendererText();
textCellr.Editable = true;
textCellr.Edited += delegate(object sender, Gtk.EditedArgs e) {
Gtk.TreeIter iter;
if (!f_ListStore.GetIterFromString(out iter, e.Path)) {
return;
}
FilterModel filter = (FilterModel) f_ListStore.GetValue(iter, 0);
int key = (int) f_ListStore.GetValue(iter, 1);
filter.ChatID = e.NewText;
f_ListStore.EmitRowChanged(new Gtk.TreePath(e.Path), iter);
OnChanged(EventArgs.Empty);
};
column = f_TreeView.AppendColumn(_("Name"), textCellr);
column.MinWidth = 80;
column.Resizable = true;
column.Sizing = Gtk.TreeViewColumnSizing.GrowOnly;
column.SetCellDataFunc(textCellr,
delegate(Gtk.TreeViewColumn col,
Gtk.CellRenderer cellr,
Gtk.TreeModel model, Gtk.TreeIter iter ) {
FilterModel filter = (FilterModel) model.GetValue(iter, 0);
(cellr as Gtk.CellRendererText).Text = filter.ChatID;
}
);
f_MessageTypeListStore = new Gtk.ListStore(typeof(string),
typeof(MessageType?));
f_MessageTypeListStore.AppendValues(String.Empty, null);
f_MessageTypeListStore.AppendValues(_("Normal"), MessageType.Normal);
f_MessageTypeListStore.AppendValues(_("Event"), MessageType.Event);
comboCellr = new Gtk.CellRendererCombo();
comboCellr.Model = f_MessageTypeListStore;
comboCellr.TextColumn = 0;
comboCellr.HasEntry = false;
comboCellr.Editable = true;
comboCellr.Edited += OnMessageTypeEdited;
column = f_TreeView.AppendColumn(_("Type"), comboCellr);
column.Resizable = true;
column.Sizing = Gtk.TreeViewColumnSizing.GrowOnly;
column.SetCellDataFunc(comboCellr, RenderMessageType);
/*
f_TreeView.HasTooltip = true;
f_TreeView.QueryTooltip += delegate(object sender, Gtk.QueryTooltipArgs e) {
e.Tooltip.Text = "Message Type";
f_TreeView.SetTooltipCell(e.Tooltip, null, column, null);
e.RetVal = true;
};
*/
textCellr = new Gtk.CellRendererText();
textCellr.Editable = true;
textCellr.Edited += delegate(object sender, Gtk.EditedArgs e) {
Gtk.TreeIter iter;
if (!f_ListStore.GetIterFromString(out iter, e.Path)) {
return;
}
FilterModel filter = (FilterModel) f_ListStore.GetValue(iter, 0);
//.........这里部分代码省略.........