public class Ephraim { public static int main(string[] args) { Gtk.init(ref args); Gtk.Builder builder = new Gtk.Builder(); try { builder.add_from_file("ephraim.glade"); } catch(Error e) { return 1; } Roster roster = new Roster(); CoreConnector coreconn = new CoreConnector(roster); if(!coreconn.start()) return 1; unowned Gtk.Window window = builder.get_object("MainWindow") as Gtk.Window; window.hide.connect(Gtk.main_quit); unowned Gtk.MenuItem quitItem = builder.get_object("MenuItemQuit") as Gtk.MenuItem; quitItem.activate.connect(() => window.visible = false); unowned Gtk.TreeView rosterView = builder.get_object("Roster") as Gtk.TreeView; rosterView.set_model(roster); rosterView.query_tooltip.connect((x, y, keyboard_tip, tooltip) => { Gtk.TreeIter iter; if(!rosterView.get_tooltip_context(out x, out y, keyboard_tip, null, null, out iter)) return false; Value value; roster.get_value(iter, 0, out value); Contact? c = value.get_object() as Contact; if(c == null) return false; Gee.Map.Entry? r = c.get_resource_with_highest_priority(); if(r == null) return false; tooltip.set_text("Resource: " + r.key); return true; }); rosterView.has_tooltip = true; rosterView.append_column(new Gtk.TreeViewColumn.with_attributes("Contact", new CellRendererContact(), "contact", 0, null)); window.visible = true; Gtk.main(); coreconn.stop(); return 0; } }