Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Box2.py
diff options
context:
space:
mode:
Diffstat (limited to 'Box2.py')
-rw-r--r--Box2.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/Box2.py b/Box2.py
index cf0d62c..c9d90b9 100644
--- a/Box2.py
+++ b/Box2.py
@@ -10,13 +10,16 @@ from ListView import ListView
from gi.repository import Gtk
+import Globales as G
+
class Box2(Gtk.Box):
- def __init__(self):
+ def __init__(self, toolbar):
Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
self.iconview = IconView()
self.listview = ListView()
+ self.listview.set_path(G.USUARIO)
self.view = self.iconview
self.scrolled = Gtk.ScrolledWindow()
@@ -24,9 +27,18 @@ class Box2(Gtk.Box):
self.scrolled.add(self.view)
self.pack_start(self.scrolled, True, True, 4)
-
- def cambiar_view(self, view):
- if view == 'iconos':
+ self.toolbar = toolbar
+
+ self.actual = self.toolbar.icono
+ self.toolbar.icono.set_sensitive(False)
+ self.toolbar.icono.connect("clicked", self.cambiar_view, 'Iconos')
+ self.toolbar.arbol.connect("clicked", self.cambiar_view, "Arbol")
+
+ def cambiar_view(self, widget, view):
+ self.actual.set_sensitive(True)
+ self.actual = widget
+ widget.set_sensitive(False)
+ if view == 'Iconos':
self.view = self.iconview
else:
@@ -36,10 +48,3 @@ class Box2(Gtk.Box):
self.scrolled.add(self.view)
self.show_all()
-
-if __name__ == '__main__':
- Ventana = Gtk.Window()
- Ventana.connect("delete-event", lambda x, i: exit())
- Ventana.add(Box2())
- Ventana.show_all()
- Gtk.main()