2 /* Circ.Frontend.GtkSharp : GTK# frontend for Circ
3 * Copyright (C) 2007 LAVAL Jérémie
5 * This file is licensed under the terms of the LGPL.
7 * For the complete licence see the file COPYING.
11 using System
.Collections
.Generic
;
15 namespace Circ
.Frontend
.GtkSharp
17 public class UsersPanel
: TreeView
19 List
<string> usersList
= new List
<string>();
20 bool usersChanged
= false;
22 public UsersPanel(): base()
24 ListStore list
= new ListStore(typeof(string));
25 this.HeadersVisible
= false;
27 this.AppendColumn("Users", new CellRendererText(), "text", 0);
30 public void AddUser(string user
)
32 this.usersList
.Add(user
);
33 Gtk
.Application
.Invoke( delegate(object s
, EventArgs e
) {
34 ((ListStore
)this.Model
).AppendValues(user
);
39 public void AddUser(string[] users
)
41 Gtk
.Application
.Invoke( delegate(object ss
, EventArgs e
) {
42 foreach (string s
in users
) {
43 this.usersList
.Add(s
);
44 ((ListStore
)this.Model
).AppendValues(s
);
50 public void RemoveUser(string user
)
52 this.usersList
.Remove(user
);
54 Gtk
.Application
.Invoke( delegate(object ss
, EventArgs e
) {
55 ((ListStore
)this.Model
).Clear();
56 foreach (string s
in usersList
)
57 ((ListStore
)this.Model
).AppendValues(s
);
62 /*public string FindNickFromIncomplete(string partialNick)
71 public string[] Users
{
73 return usersList
.ToArray();