本文整理汇总了C#中Gtk.ListStore.AppendValues方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.ListStore.AppendValues方法的具体用法?C# Gtk.ListStore.AppendValues怎么用?C# Gtk.ListStore.AppendValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.ListStore
的用法示例。
在下文中一共展示了Gtk.ListStore.AppendValues方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NoteEditor
public NoteEditor()
{
this.Build();
var store = new Gtk.ListStore(typeof(string), typeof(string));
store.AppendValues("gtk-edit", "no, you are the fuel");
var column = new Gtk.TreeViewColumn();
var iconRenderer = new Gtk.CellRendererPixbuf();
column.PackStart(iconRenderer, false);
column.AddAttribute(iconRenderer, "stock-id", 0);
var textRenderer = new Gtk.CellRendererText();
column.PackStart(textRenderer, true);
column.AddAttribute(textRenderer, "text", 1);
NoteChildrenTreeView.Model = store;
NoteChildrenTreeView.AppendColumn(column);
// http://www.mono-project.com/GtkSharp_TreeView_Tutorial
// http://afaikblog.files.wordpress.com/2012/05/edit-item1.png
// http://james.newtonking.com/projects/json/help/
// http://mono.1490590.n4.nabble.com/NodeView-TreeView-Image-and-Text-into-the-same-column-td1546566.html
// OKAY, I NEED TO DECIDE HOW I AM GOING TO BIND THINGS
// I definitely want a ViewModel.
}
示例2: FlagsSelectorDialog
public FlagsSelectorDialog(Gtk.Window parent, EnumDescriptor enumDesc, uint flags, string title)
{
this.flags = flags;
this.parent = parent;
Glade.XML xml = new Glade.XML (null, "stetic.glade", "FlagsSelectorDialog", null);
xml.Autoconnect (this);
store = new Gtk.ListStore (typeof(bool), typeof(string), typeof(uint));
treeView.Model = store;
Gtk.TreeViewColumn col = new Gtk.TreeViewColumn ();
Gtk.CellRendererToggle tog = new Gtk.CellRendererToggle ();
tog.Toggled += new Gtk.ToggledHandler (OnToggled);
col.PackStart (tog, false);
col.AddAttribute (tog, "active", 0);
Gtk.CellRendererText crt = new Gtk.CellRendererText ();
col.PackStart (crt, true);
col.AddAttribute (crt, "text", 1);
treeView.AppendColumn (col);
foreach (Enum value in enumDesc.Values) {
EnumValue eval = enumDesc[value];
if (eval.Label == "")
continue;
uint val = (uint) (int) eval.Value;
store.AppendValues (((flags & val) != 0), eval.Label, val);
}
}
示例3: BuildArray
public void BuildArray ()
{
Gtk.ListStore listStore = new Gtk.ListStore (typeof (string));
for (int i = min; i < (max + 1); i++) {
listStore.AppendValues(i.ToString());
}
combobox.Model = listStore;
}
示例4: Init
private void Init()
{
f_ListStore = new Gtk.ListStore(
typeof(ChatType),
typeof(string)
);
f_ListStore.AppendValues(ChatType.Person, _("Person / Private"));
f_ListStore.AppendValues(ChatType.Group, _("Group / Public"));
f_ListStore.SetSortColumnId(1, Gtk.SortType.Ascending);
f_ComboBox.Clear();
Gtk.CellRenderer cell = new Gtk.CellRendererText();
f_ComboBox.PackStart(cell, false);
f_ComboBox.AddAttribute(cell, "text", 1);
f_ComboBox.Model = f_ListStore;
f_ComboBox.Active = 0;
}
示例5: Image
public Image (bool allowStock, bool allowFile) : base (false, 6)
{
image = new Gtk.Image (GnomeStock.Blank, Gtk.IconSize.Button);
PackStart (image, false, false, 0);
if (allowStock) {
store = new Gtk.ListStore (typeof (string), typeof (string));
store.AppendValues (GnomeStock.Blank, Catalog.GetString ("(None)"));
for (int i = 0; i < stockIds.Length; i++)
store.AppendValues (stockIds[i], stockLabels[i]);
combo = new Gtk.ComboBoxEntry (store, LabelColumn);
Gtk.CellRendererPixbuf iconRenderer = new Gtk.CellRendererPixbuf ();
iconRenderer.StockSize = (uint)Gtk.IconSize.Menu;
combo.PackStart (iconRenderer, false);
combo.Reorder (iconRenderer, 0);
combo.AddAttribute (iconRenderer, "stock-id", IconColumn);
combo.Changed += combo_Changed;
// Pack the combo non-expandily into a VBox so it doesn't
// get stretched to the file button's height
Gtk.VBox vbox = new Gtk.VBox (false, 0);
vbox.PackStart (combo, true, false, 0);
PackStart (vbox, true, true, 0);
entry = (Gtk.Entry)combo.Child;
entry.Changed += entry_Changed;
useStock = true;
}
if (allowFile) {
if (!allowStock) {
entry = new Gtk.Entry ();
PackStart (entry, true, true, 0);
entry.Changed += entry_Changed;
}
button = new Gtk.Button ();
Gtk.Image icon = new Gtk.Image (Gtk.Stock.Open, Gtk.IconSize.Button);
button.Add (icon);
PackStart (button, false, false, 0);
button.Clicked += button_Clicked;
}
ShowAll ();
}
示例6: InitializeTreeView
private void InitializeTreeView()
{
Gtk.ListStore model = new Gtk.ListStore(typeof(string));
treeview1.AppendColumn("", new Gtk.CellRendererText(), "text", 0);
model.AppendValues("Pack Name: {0}", _configPackInformation.PackName);
model.AppendValues(_configPackInformation.Description);
Gtk.TreeIter iter = model.AppendValues("Credits");
foreach (var thing in _configPackInformation.CreditsParts)
{
iter = model.AppendValues(thing.Key);
foreach (var author in thing.Value)
{
model.AppendValues(iter, author.Author);
}
}
}
示例7: getMessageList
public Gtk.ListStore getMessageList()
{
MessagesRepository messageRepo = DaoFactory.getDao (DaoFactory.MySql).getMessagesRepository ();
List<Message> messages = messageRepo.getAllMessages ();
Gtk.ListStore messageList = new Gtk.ListStore ( typeof(string), typeof(string), typeof(string) );
foreach (Message message in messages)
{
messageList.AppendValues (message.getNumberReceiver (), message.getMessageBody (), Convert.ToString (message.getSendAt ()));
}
return messageList;
}
示例8: RefreshInstances
public void RefreshInstances()
{
var store = new Gtk.ListStore(typeof(Instance), typeof(string), typeof(string), typeof(string));
foreach (var instance in Context.GetInstances()) {
string host = "Unknown";
try {
host = new Uri(instance.Description.SyncUrl).Host;
} catch (Exception) { }
store.AppendValues(instance, instance.Description.Name, host,
System.IO.Path.GetFileName(instance.GameFolder));
}
instanceList.Model = store;
}
示例9: NewFormattingProfileDialog
public NewFormattingProfileDialog (List<CSharpFormattingPolicy> policies)
{
this.Build ();
this.policies = policies;
this.entryProfileName.Changed += delegate {
NewProfileName = entryProfileName.Text;
buttonOk.Sensitive = !string.IsNullOrEmpty (NewProfileName) && !this.policies.Any (p => p.Name == NewProfileName);
};
Gtk.ListStore model = new Gtk.ListStore (typeof(string));
foreach (var p in policies) {
model.AppendValues (p.Name);
}
comboboxInitFrom.Model = model;
comboboxInitFrom.Active = 0;
}
示例10: ParamsWindow
public ParamsWindow(string[] parameters)
: base(Gtk.WindowType.Toplevel, "ParamsWindow")
{
((Gtk.Dialog)Window).AddButton("gtk-close", Gtk.ResponseType.Cancel);
treeModel = new Gtk.ListStore(typeof(int), typeof(string), typeof(string), typeof(string));
ParamsTree.Model = treeModel;
var indexColumn = new Gtk.TreeViewColumn { Title = "Index" };
ParamsTree.AppendColumn(indexColumn);
var nameColumn = new Gtk.TreeViewColumn { Title = "Name" };
ParamsTree.AppendColumn(nameColumn);
var typeColumn = new Gtk.TreeViewColumn { Title = "Type" };
ParamsTree.AppendColumn(typeColumn);
var dataColumn = new Gtk.TreeViewColumn { Title = "Data" };
ParamsTree.AppendColumn(dataColumn);
var indexCell = new Gtk.CellRendererText();
indexColumn.PackStart(indexCell, true);
var nameCell = new Gtk.CellRendererText();
nameColumn.PackStart(nameCell, true);
var typeCell = new Gtk.CellRendererText();
typeColumn.PackStart(typeCell, true);
var dataCell = new Gtk.CellRendererText();
dataColumn.PackStart(dataCell, true);
indexColumn.AddAttribute(indexCell, "text", 0);
nameColumn.AddAttribute(nameCell, "text", 1);
typeColumn.AddAttribute(nameCell, "text", 2);
dataColumn.AddAttribute(dataCell, "text", 3);
var index = 0;
foreach (var param in parameters)
{
treeModel.AppendValues(index, "#" + index, "unknown", param);
index++;
}
Window.SetSizeRequest(500, System.Math.Min(500, 100 + index * 20));
}
示例11: NewFormattingProfileDialog
internal NewFormattingProfileDialog (List<CSharpFormattingPolicy> policies)
{
// ReSharper disable once DoNotCallOverridableMethodsInConstructor
this.Build ();
this.policies = policies;
this.entryProfileName.Changed += delegate {
NewProfileName = entryProfileName.Text;
buttonOk.Sensitive = !string.IsNullOrEmpty (NewProfileName) && !this.policies.Any (p => p.Name == NewProfileName);
};
var model = new Gtk.ListStore (typeof(string));
foreach (var p in policies) {
model.AppendValues (p.Name);
}
comboboxInitFrom.Model = model;
comboboxInitFrom.Active = 0;
}
示例12: RTPrefs
public RTPrefs()
{
RTPreferences prefs = new RTPreferences();
this.Build();
nameColumn = new Gtk.TreeViewColumn ();
nameColumn.Title = "Name";
urlColumn = new Gtk.TreeViewColumn ();
urlColumn.Title = "URL";
RTTree.AppendColumn (nameColumn);
RTTree.AppendColumn (urlColumn);
rtListStore = new Gtk.ListStore (typeof (string), typeof (string));
RTTree.Model = rtListStore;
Gtk.CellRendererText nameNameCell = new Gtk.CellRendererText ();
nameNameCell.Editable = true;
nameNameCell.Edited += OnNameCellEdited;
nameColumn.PackStart (nameNameCell, true);
Gtk.CellRendererText urlTitleCell = new Gtk.CellRendererText ();
urlTitleCell.Editable = true;
urlTitleCell.Edited += OnURLCellEdited;
urlColumn.PackStart (urlTitleCell, true);
nameColumn.AddAttribute (nameNameCell, "text", 0);
urlColumn.AddAttribute (urlTitleCell, "text", 1);
if (!string.IsNullOrEmpty (prefs.URLs)) {
string[] urlbits = prefs.URLs.Split('|');
for (int i = 0; i < urlbits.Length; i++) {
string name = urlbits[i];
string uri = urlbits[++i];
Uri url;
try {
url = new System.Uri(uri);
} catch (System.UriFormatException) {
continue;
}
rtListStore.AppendValues (name, url.ToString());
}
}
}
示例13: FlagsSelectorDialog
public FlagsSelectorDialog (Gtk.Window parent, Type enumDesc, ulong flags, string title)
{
this.flags = flags;
this.parent = parent;
Gtk.ScrolledWindow sc = new Gtk.ScrolledWindow ();
sc.HscrollbarPolicy = Gtk.PolicyType.Automatic;
sc.VscrollbarPolicy = Gtk.PolicyType.Automatic;
sc.ShadowType = Gtk.ShadowType.In;
sc.BorderWidth = 6;
treeView = new Gtk.TreeView ();
sc.Add (treeView);
dialog = new Gtk.Dialog ();
IdeTheme.ApplyTheme (dialog);
dialog.VBox.Add (sc);
dialog.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
dialog.AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok);
store = new Gtk.ListStore (typeof(bool), typeof(string), typeof(ulong));
treeView.Model = store;
treeView.HeadersVisible = false;
Gtk.TreeViewColumn col = new Gtk.TreeViewColumn ();
Gtk.CellRendererToggle tog = new Gtk.CellRendererToggle ();
tog.Toggled += new Gtk.ToggledHandler (OnToggled);
col.PackStart (tog, false);
col.AddAttribute (tog, "active", 0);
Gtk.CellRendererText crt = new Gtk.CellRendererText ();
col.PackStart (crt, true);
col.AddAttribute (crt, "text", 1);
treeView.AppendColumn (col);
values = System.Enum.GetValues (enumDesc);
foreach (object value in values) {
ulong val = Convert.ToUInt64 (value);
store.AppendValues ((flags == 0 && val == 0) || ((flags & val) != 0), value.ToString (), val);
}
}
示例14: DebuggerOptionsPanelWidget
public DebuggerOptionsPanelWidget ()
{
this.Build ();
options = DebuggingService.GetUserOptions ();
projectCodeOnly.Active = options.ProjectAssembliesOnly;
checkAllowEval.Active = options.EvaluationOptions.AllowTargetInvoke;
checkToString.Active = options.EvaluationOptions.AllowToStringCalls;
checkShowBaseGroup.Active = !options.EvaluationOptions.FlattenHierarchy;
checkGroupPrivate.Active = options.EvaluationOptions.GroupPrivateMembers;
checkGroupStatic.Active = options.EvaluationOptions.GroupStaticMembers;
checkToString.Sensitive = checkAllowEval.Active;
spinTimeout.Value = options.EvaluationOptions.EvaluationTimeout;
// Debugger priorities
engineStore = new Gtk.ListStore (typeof(string), typeof(string));
engineList.Model = engineStore;
engineList.AppendColumn ("", new Gtk.CellRendererText (), "text", 1);
foreach (DebuggerEngine engine in DebuggingService.GetDebuggerEngines ()) {
engineStore.AppendValues (engine.Id, engine.Name);
}
UpdatePriorityButtons ();
engineList.Selection.Changed += HandleEngineListSelectionChanged;
}
示例15: _Load
private void _Load()
{
Trace.Call();
// root
string startup_commands = String.Join("\n", (string[])Frontend.UserConfig["OnStartupCommands"]);
((Gtk.TextView)_Glade["OnStartupCommandsTextView"]).Buffer.Text = startup_commands;
// Connection
string nicknames = String.Join(" ", (string[])Frontend.UserConfig["Connection/Nicknames"]);
((Gtk.Entry)_Glade["ConnectionNicknamesEntry"]).Text = nicknames;
((Gtk.Entry)_Glade["ConnectionUsernameEntry"]).Text = (string)Frontend.UserConfig["Connection/Username"];
((Gtk.Entry)_Glade["ConnectionRealnameEntry"]).Text = (string)Frontend.UserConfig["Connection/Realname"];
string connect_commands = String.Join("\n", (string[])Frontend.UserConfig["Connection/OnConnectCommands"]);
((Gtk.TextView)_Glade["OnConnectCommandsTextView"]).Buffer.Text = connect_commands;
string encoding = (string)Frontend.UserConfig["Connection/Encoding"];
encoding = encoding.ToUpper();
Gtk.ComboBox cb = (Gtk.ComboBox)_Glade["EncodingComboBox"];
// glade might initialize it already!
cb.Clear();
Gtk.CellRendererText cell = new Gtk.CellRendererText();
cb.PackStart(cell, false);
cb.AddAttribute(cell, "text", 0);
Gtk.ListStore store = new Gtk.ListStore(typeof(string), typeof(string));
store.AppendValues(String.Format("<{0}>", _("System Default")), String.Empty);
ArrayList encodingList = new ArrayList();
ArrayList bodyNameList = new ArrayList();
foreach (EncodingInfo encInfo in Encoding.GetEncodings()) {
try {
Encoding enc = Encoding.GetEncoding(encInfo.CodePage);
string encodingName = enc.EncodingName.ToUpper();
// filter noise and duplicates
if (encodingName.IndexOf("DOS") != -1 ||
encodingName.IndexOf("MAC") != -1 ||
encodingName.IndexOf("EBCDIC") != -1 ||
encodingName.IndexOf("ISCII") != -1 ||
encodingList.Contains(encodingName) ||
bodyNameList.Contains(enc.BodyName)) {
continue;
}
#if LOG4NET
_Logger.Debug("_Load(): adding encoding: " + enc.BodyName);
#endif
encodingList.Add(encodingName);
bodyNameList.Add(enc.BodyName);
encodingName = enc.EncodingName;
// remove all (DOS) / (Windows) / (Mac) crap from the encoding name
if (enc.EncodingName.Contains(" (")) {
encodingName = encodingName.Substring(0, enc.EncodingName.IndexOf(" ("));
}
store.AppendValues(enc.BodyName.ToUpper() + " - " + encodingName, enc.BodyName.ToUpper());
} catch (NotSupportedException) {
}
}
cb.Model = store;
cb.Active = 0;
store.SetSortColumnId(0, Gtk.SortType.Ascending);
int j = 0;
foreach (object[] row in store) {
string encodingName = (string) row[1];
if (encodingName == encoding) {
cb.Active = j;
break;
}
j++;
}
// Interface
((Gtk.Entry)_Glade["TimestampFormatEntry"]).Text =
(string)Frontend.UserConfig["Interface/Notebook/TimestampFormat"];
// Interface/Notebook
((Gtk.SpinButton)_Glade["BufferLinesSpinButton"]).Value =
(double)(int)Frontend.UserConfig["Interface/Notebook/BufferLines"];
((Gtk.SpinButton)_Glade["EngineBufferLinesSpinButton"]).Value =
(double)(int)Frontend.UserConfig["Interface/Notebook/EngineBufferLines"];
((Gtk.CheckButton)_Glade["StripColorsCheckButton"]).Active =
(bool)Frontend.UserConfig["Interface/Notebook/StripColors"];
((Gtk.CheckButton)_Glade["StripFormattingsCheckButton"]).Active =
(bool)Frontend.UserConfig["Interface/Notebook/StripFormattings"];
switch ((string)Frontend.UserConfig["Interface/Notebook/TabPosition"]) {
case "top":
((Gtk.RadioButton)_Glade["TabPositionRadioButtonTop"]).Active = true;
break;
case "bottom":
((Gtk.RadioButton)_Glade["TabPositionRadioButtonBottom"]).Active = true;
break;
case "left":
((Gtk.RadioButton)_Glade["TabPositionRadioButtonLeft"]).Active = true;
break;
case "right":
((Gtk.RadioButton)_Glade["TabPositionRadioButtonRight"]).Active = true;
break;
case "none":
((Gtk.RadioButton)_Glade["TabPositionRadioButtonNone"]).Active = true;
break;
//.........这里部分代码省略.........