Esempio n. 1
0
        public void set_categories(List<Category> categories)
        {
            box = new Gtk.VBox();

            bool first = true;
            foreach (Category cat in categories)
            {
                CategoryDrawer c = new CategoryDrawer(cat);
                c.add_new_category_to_ui_callback = add_new_category;
                c.remove_category_callback = remove_category;
                category_drawers.Add(c);

                if (!first)
                    box.PackStart(new Gtk.HSeparator(), false, false, 5);
                else
                    first = false;

                box.PackStart(c.representation, false, false, 0);
            }

            foreach (Widget w in outer_event_box.Children)
                w.Destroy();

            outer_event_box.Add(box);

            outer_event_box.ShowAll();
        }
Esempio n. 2
0
        private void add_new_category()
        {
            Category cat = create_new_empty_category_callback();

            CategoryDrawer c = new CategoryDrawer(cat);
            c.add_new_category_to_ui_callback = add_new_category;
            c.remove_category_callback = remove_category;
            c.remove_category_from_ui_callback = remove_category_from_ui;
            category_drawers.Add(c);

            if (box.Children.Length > 0)
                box.PackStart(new Gtk.HSeparator(), false, false, 5);

            box.PackStart(c.representation, false, false, 0);

            c.rename_category(true);

            outer_event_box.ShowAll();
        }