1 /*
2 * atree.c
3 *
4 * Copyright 2010 Alexander Petukhov <devel(at)apetukhov.ru>
5 *
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.
10 *
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.
15 *
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., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 */
21
22 /*
23 * Contains autos tree view functions.
24 */
25
26 #include <gtk/gtk.h>
27
28 #include "atree.h"
29 #include "watch_model.h"
30 #include "vtree.h"
31
32 /* pointer to a widget */
33 static GtkWidget *tree = NULL;
34
35 /*
36 * init autos tree, and sets on expanded handler
37 * arguments:
38 * expanded - handler to call when tree item is expanded
39 */
atree_init(watch_expanded_callback expanded,watch_button_pressed buttonpressed)40 GtkWidget* atree_init(watch_expanded_callback expanded, watch_button_pressed buttonpressed)
41 {
42 tree = vtree_create(NULL, NULL);
43 g_signal_connect(G_OBJECT(tree), "row-expanded", G_CALLBACK (expanded), NULL);
44 g_signal_connect(G_OBJECT(tree), "button-press-event", G_CALLBACK (buttonpressed), NULL);
45
46 return tree;
47 }
48