2 * Demo for FisheyeListView
4 * Copyright (C) 2009 Enrico Zini <enrico@enricozini.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 public class Fisheye : Gtk.Window
31 destroy += Gtk.main_quit;
33 flv = new FisheyeListView();
36 model = new Gtk.ListStore(1, typeof(string));
38 var infd = FileStream.open("/tmp/names", "r");
41 for (int i = 0; i < 300; ++i)
43 model.append(out iter);
44 model.set(iter, 0, "Antani %d".printf(i), -1);
50 string line = infd.gets(buf);
53 model.append(out iter);
54 model.set(iter, 0, line, -1);
60 flv.row_activated += on_row_activated;
63 public void on_row_activated(Gtk.TreePath path)
66 model.get_iter(out iter, path);
68 model.get(iter, 0, out val, -1);
69 stdout.printf("Clicked on %s\n", val);
73 static int main (string[] args) {
76 var fe = new Fisheye();
77 fe.set_size_request(200, 300);