| 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 | |
|---|
| 20 | """ |
|---|
| 21 | Widget to make semilar tabs to firefox |
|---|
| 22 | |
|---|
| 23 | References: |
|---|
| 24 | http://www.moeraki.com/pygtktutorial/pygtk2reference/class-gtkiconview.html |
|---|
| 25 | |
|---|
| 26 | Idea of implementation: |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | """ |
|---|
| 32 | import gtk |
|---|
| 33 | |
|---|
| 34 | from higwidgets.higboxes import HIGHBox |
|---|
| 35 | import os.path |
|---|
| 36 | from umitCore.Paths import Path |
|---|
| 37 | # Develpment step |
|---|
| 38 | Path.set_umit_conf("umit") |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | class TabStruct: |
|---|
| 42 | def __init__(self): |
|---|
| 43 | """ Constructor """ |
|---|
| 44 | self.__list = [] |
|---|
| 45 | def add_item(self, name): |
|---|
| 46 | pass |
|---|
| 47 | def del_item(self, name): |
|---|
| 48 | pass |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | class TabsIcon(HIGHBox): |
|---|
| 53 | def __init__(self): |
|---|
| 54 | """ Constructor """ |
|---|
| 55 | HIGHBox.__init__(self) |
|---|
| 56 | self._box = HIGHBox() |
|---|
| 57 | self._icons_list = [] |
|---|
| 58 | self._tabstruct = TabStruct() |
|---|
| 59 | |
|---|
| 60 | model = gtk.ListStore(str, gtk.gdk.Pixbuf) |
|---|
| 61 | pixmap_d = Path.pixmaps_dir |
|---|
| 62 | pixmap_file = os.path.join(pixmap_d, "Preferences" ,'logo.png') |
|---|
| 63 | pixbuf = gtk.gdk.pixbuf_new_from_file (pixmap_file) |
|---|
| 64 | model.append(['Cancel', pixbuf]) |
|---|
| 65 | self.__icon = gtk.IconView() |
|---|
| 66 | self.__icon.set_model(model) |
|---|
| 67 | self.__icon.set_text_column(0) |
|---|
| 68 | self.__icon.set_pixbuf_column(1) |
|---|
| 69 | |
|---|
| 70 | self.pack_start(self.__icon, True, True) |
|---|
| 71 | |
|---|
| 72 | |
|---|
| 73 | def __create_icon_list(self): |
|---|
| 74 | |
|---|
| 75 | iconView = gtk.IconView () |
|---|
| 76 | self._icons_list.append(iconView) |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | |
|---|