3 #include <libmmanager/mm.h>
4 #include <libmmanager-gtk/mm-gtk.h>
7 filter_closed_cb (GtkWidget
*toplevel
,
11 MMGtkFilterBuilder
*builder
= g_ptr_array_index (data
, 0);
12 MMCategory
*cat
= g_ptr_array_index (data
, 1);
14 MMHitCollection
*hits
;
18 filter
= mm_gtk_filter_builder_get_filter (builder
);
19 hits
= mm_category_get_hits (cat
, filter
, NULL
);
20 view
= mm_gtk_hit_view_new (hits
);
21 gtk_widget_show (GTK_WIDGET (view
));
23 window3
= gtk_window_new (GTK_WINDOW_TOPLEVEL
);
24 gtk_container_add (GTK_CONTAINER (window3
), GTK_WIDGET (view
));
25 gtk_widget_show (window3
);
31 cat_selected_cb (MMGtkApplicationView
*view
,
35 MMGtkFilterBuilder
*builder
;
39 builder
= mm_gtk_filter_builder_new (cat
);
40 gtk_widget_show (GTK_WIDGET (builder
));
41 window2
= gtk_window_new (GTK_WINDOW_TOPLEVEL
);
42 gtk_container_add (GTK_CONTAINER (window2
), GTK_WIDGET (builder
));
43 gtk_widget_show (window2
);
45 data
= g_ptr_array_sized_new (2);
46 g_ptr_array_add (data
, builder
);
47 g_ptr_array_add (data
, cat
);
49 g_signal_connect (window2
, "delete-event",
50 G_CALLBACK (filter_closed_cb
),
54 int main (int argc
, char **argv
)
57 MMGtkApplicationView
*view
;
59 gtk_init (&argc
, &argv
);
61 toplevel
= gtk_window_new (GTK_WINDOW_TOPLEVEL
);
62 g_signal_connect (toplevel
, "delete-event", G_CALLBACK (gtk_main_quit
), NULL
);
63 view
= mm_gtk_application_view_new ();
64 g_signal_connect (view
, "category-selected",
65 G_CALLBACK (cat_selected_cb
), toplevel
);
66 gtk_widget_show (GTK_WIDGET (view
));
68 gtk_container_add (GTK_CONTAINER (toplevel
), GTK_WIDGET (view
));
69 gtk_widget_show (toplevel
);