Package dtk :: Package ui :: Module new_treeview

Source Code for Module dtk.ui.new_treeview

 1  #! /usr/bin/env python 
 2  # -*- coding: utf-8 -*- 
 3   
 4  # Copyright (C) 2011 ~ 2012 Deepin, Inc. 
 5  #               2011 ~ 2012 Wang Yong 
 6  #  
 7  # Author:     Wang Yong <lazycat.manatee@gmail.com> 
 8  # Maintainer: Wang Yong <lazycat.manatee@gmail.com> 
 9  #  
10  # This program is free software: you can redistribute it and/or modify 
11  # it under the terms of the GNU General Public License as published by 
12  # the Free Software Foundation, either version 3 of the License, or 
13  # any later version. 
14  #  
15  # This program is distributed in the hope that it will be useful, 
16  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
17  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
18  # GNU General Public License for more details. 
19  #  
20  # You should have received a copy of the GNU General Public License 
21  # along with this program.  If not, see <http://www.gnu.org/licenses/>. 
22   
23  import gtk 
24  import gobject 
25  from scrolled_window import ScrolledWindow 
26   
27 -class TreeView(ScrolledWindow):
28 ''' 29 TreeView widget. 30 ''' 31
32 - def __init__(self, 33 items=[], 34 sort_methods=[], 35 row_normal_height=None, 36 row_select_height=None, 37 drag_data=None, 38 enable_multiple_select=True, 39 enable_drag_drop=True, 40 drag_icon_pixbuf=None, 41 start_drag_offset=50, 42 right_space=2, 43 top_bottom_space=3 44 ):
45 ''' 46 Initialize TreeView class. 47 ''' 48 # Init. 49 ScrolledWindow.__init__(self, right_space, top_bottom_space) 50 self.draw_area = gtk.DrawingArea() 51 self.draw_align = gtk.Alignment() 52 self.draw_align.set(0.5, 0.5, 1, 1) 53 54 self.draw_align.add(self.draw_area) 55 self.add_child(self.draw_align)
56 57 gobject.type_register(TreeView) 58
59 -class TreeItem(gobject.GObject):
60 ''' 61 Tree item template use for L{ I{TreeView} <TreeView>}. 62 ''' 63
64 - def __init__(self):
65 ''' 66 Initialize TreeItem class. 67 ''' 68 pass
69 70 gobject.type_register(TreeItem) 71