root/branch/PreferencesWindow/umitPreferences/PreferencesWindow.py @ 2960

Revision 2960, 2.4 kB (checked in by luis, 5 years ago)

Added Tabs (make with a treeview)

Line 
1# Copyright (C) 2008 Adriano Monteiro Marques.
2#
3# Author: Luis A. Bastiao Silva <luis.kop@gmail.com>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19
20import gtk
21import gobject
22from higwidgets.higwindows import HIGWindow, HIGMainWindow
23from higwidgets.higboxes import HIGVBox
24"""
25Preferences Window is a module that managing the interface of Preferences
26"""
27
28class PreferencesWindow(HIGMainWindow):
29    def __init__(self):
30        HIGMainWindow.__init__(self)
31        self.set_title("Preferences")
32        self.__create()
33        self.__pack()
34        self.show_all()
35    def __create(self):
36        """ Create mainly widgets"""
37        menu = {
38            "Interface" : ["Fonts", "Diff Colors"],
39            "Network" : ["Proxy"]
40        }
41       
42        # Tabs - treeview
43
44        self.__tree_store = gtk.TreeStore( gobject.TYPE_STRING)
45       
46        # Main tabs
47        interface = self.__tree_store.append( None, ['Interface'])
48        network = self.__tree_store.append( None, ['Network'])
49       
50        # Options inside Interface
51        fonts = self.__tree_store.append( interface, ['Fonts'])
52        diff_colors = self.__tree_store.append( interface, ['Diff Colors'])
53        proxy = self.__tree_store.append( network, ['Proxy'] )
54       
55       
56        self.__treeview = gtk.TreeView(self.__tree_store)
57        self.__renderer = gtk.CellRendererText()
58        self.__renderer.set_property( 'editable', True )
59        self.__column = gtk.TreeViewColumn("Name", self.__renderer, text=0)
60        self.__treeview.append_column(self.__column)
61        self.__treeview.expand_all()
62        self.__box = HIGVBox()
63       
64    def __pack(self):
65        """ Organize widgets  """
66        self.__box.pack_start(self.__treeview, True, True)
67        self.add(self.__box)
68       
69       
70       
71       
72if __name__=="__main__":
73    p = PreferencesWindow()
74    p.show_all()
75
76    gtk.main()
77   
Note: See TracBrowser for help on using the browser.