Example #1
0
 def build_tag_treeview(self, tree, desc):
     treeview = TreeView(tree, desc)
     # Global treeview properties
     treeview.set_property("enable-tree-lines", False)
     treeview.set_rules_hint(False)
     treeview.set_row_separator_func(self.is_tag_separator_filter)
     treeview.set_headers_visible(False)
     treeview.set_dnd_name('gtg/tag-iter-str')
     treeview.set_dnd_external('gtg/task-iter-str', self.ontag_task_dnd)
     # Updating the unactive color (same for everyone)
     self.unactive_color = \
         treeview.style.text[gtk.STATE_INSENSITIVE].to_string()
     treeview.set_sort_column('tag_id')
     self.tags_view = treeview
     return treeview
 def build_tag_treeview(self, tree, desc):
     treeview = TreeView(tree, desc)
     # Global treeview properties
     treeview.set_property("enable-tree-lines", False)
     treeview.set_rules_hint(False)
     treeview.set_row_separator_func(self.is_tag_separator_filter)
     treeview.set_headers_visible(False)
     treeview.set_dnd_name('gtg/tag-iter-str')
     treeview.set_dnd_external('gtg/task-iter-str', self.ontag_task_dnd)
     # Updating the unactive color (same for everyone)
     self.unactive_color = \
         treeview.style.text[gtk.STATE_INSENSITIVE].to_string()
     treeview.set_sort_column('tag_id')
     self.tags_view = treeview
     return treeview
Example #3
0
 def build_task_treeview(self, tree, desc):
     treeview = TreeView(tree, desc)
     # Now that the treeview is done, we can polish
     treeview.set_main_search_column('label')
     treeview.set_expander_column('label')
     treeview.set_dnd_name('gtg/task-iter-str')
     # Background colors
     treeview.set_bg_color(self.task_bg_color, 'bg_color')
      # Global treeview properties
     treeview.set_property("enable-tree-lines", False)
     treeview.set_rules_hint(False)
     treeview.set_multiple_selection(True)
     # Updating the unactive color (same for everyone)
     self.unactive_color = \
         treeview.style.text[gtk.STATE_INSENSITIVE].to_string()
     return treeview
 def build_task_treeview(self, tree, desc):
     treeview = TreeView(tree, desc)
     # Now that the treeview is done, we can polish
     treeview.set_main_search_column('label')
     treeview.set_expander_column('label')
     treeview.set_dnd_name('gtg/task-iter-str')
     # Background colors
     treeview.set_bg_color(self.task_bg_color, 'bg_color')
      # Global treeview properties
     treeview.set_property("enable-tree-lines", False)
     treeview.set_rules_hint(False)
     treeview.set_multiple_selection(True)
     # Updating the unactive color (same for everyone)
     self.unactive_color = \
         treeview.style.text[gtk.STATE_INSENSITIVE].to_string()
     return treeview
Example #5
0
    def build_tag_treeview(self, tree, desc):
        treeview = TreeView(tree, desc)
        # Global treeview properties
        treeview.set_property("enable-tree-lines", False)
        treeview.set_rules_hint(False)
        treeview.set_row_separator_func(self.is_tag_separator_filter)
        treeview.set_headers_visible(False)
        treeview.set_dnd_name('gtg/tag-iter-str')
        treeview.set_dnd_external('gtg/task-iter-str', self.on_tag_task_dnd)
        # Updating the unactive color (same for everyone)
        color = treeview.get_style_context().get_color(Gtk.StateFlags.INSENSITIVE)
        # Convert color into #RRRGGGBBB
        self.unactive_color = color.to_color().to_string()

        treeview.set_sort_column('tag_id')
        self.tags_view = treeview
        return treeview
Example #6
0
 def build_task_treeview(self, tree, desc):
     treeview = TreeView(tree, desc)
     # Now that the treeview is done, we can polish
     treeview.set_main_search_column('label')
     treeview.set_expander_column('label')
     treeview.set_dnd_name('gtg/task-iter-str')
     # Background colors
     treeview.set_bg_color(self.get_task_bg_color, 'bg_color')
     # Global treeview properties
     treeview.set_property("enable-tree-lines", False)
     treeview.set_rules_hint(False)
     treeview.set_multiple_selection(True)
     # Updating the unactive color (same for everyone)
     color = treeview.get_style_context().get_color(Gtk.StateFlags.INSENSITIVE)
     # Convert color into #RRRGGGBBB
     self.unactive_color = color.to_color().to_string()
     return treeview
Example #7
0
    def build_tag_treeview(self, tree, desc):
        treeview = TreeView(tree, desc)
        # Global treeview properties
        treeview.set_property("enable-tree-lines", False)
        treeview.set_rules_hint(False)
        treeview.set_row_separator_func(self.is_tag_separator_filter)
        treeview.set_headers_visible(False)
        treeview.set_dnd_name('gtg/tag-iter-str')
        treeview.set_dnd_external('gtg/task-iter-str', self.ontag_task_dnd)
        # Updating the unactive color (same for everyone)
        color = treeview.get_style_context().get_color(
            Gtk.StateFlags.INSENSITIVE)
        # Convert color into #RRRGGGBBB
        self.unactive_color = color.to_color().to_string()

        treeview.set_sort_column('tag_id')
        self.tags_view = treeview
        return treeview
Example #8
0
 def build_task_treeview(self, tree, desc):
     treeview = TreeView(tree, desc)
     # Now that the treeview is done, we can polish
     treeview.set_main_search_column('label')
     treeview.set_expander_column('label')
     treeview.set_dnd_name('gtg/task-iter-str')
     # Background colors
     treeview.set_bg_color(self.task_bg_color, 'bg_color')
     # Global treeview properties
     treeview.set_property("enable-tree-lines", False)
     treeview.set_rules_hint(False)
     treeview.set_multiple_selection(True)
     # Updating the unactive color (same for everyone)
     color = treeview.get_style_context().get_color(
         Gtk.StateFlags.INSENSITIVE)
     # Convert color into #RRRGGGBBB
     self.unactive_color = color.to_color().to_string()
     return treeview
Example #9
0
    def _build_tree_view(self):
        self.tree = Tree()
        self.tree.add_filter("even",self.even_filter)
        self.tree.add_filter("odd",self.odd_filter)
        self.tree.add_filter("flat",self.flat_filter,{"flat": True})
        self.tree.add_filter("leaf",self.leaf_filter)
        self.view_tree = self.tree.get_viewtree()
        self.mod_counter = 0
        
        self.view_tree.register_cllbck('node-added-inview',self._update_title)
        self.view_tree.register_cllbck('node-modified-inview',self._modified_count)
        self.view_tree.register_cllbck('node-deleted-inview',self._update_title)

        desc = {}

        col_name = 'label'
        col = {}
        col['title'] = "Title"
        col['value'] = [str, self.task_label_column]
        col['expandable'] = True
        col['resizable'] = True
        col['sorting'] = 'label'
        col['order'] = 0
        desc[col_name] = col

        tree_view = TreeView(self.view_tree, desc)

        # Polish TreeView
        def on_row_activate(sender,a,b):
            print(
                "Selected nodes are: {0!s}".format(
                    tree_view.get_selected_nodes()
                )
            )

        tree_view.set_dnd_name('liblarch-demo/liblarch_widget')
        tree_view.set_multiple_selection(True)

        tree_view.set_property("enable-tree-lines", True)
        tree_view.connect('row-activated', on_row_activate)

        return tree_view