Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Vinet <vince.vinet@gmail.com>2009-12-09 01:08:04 (GMT)
committer Vincent Vinet <vince.vinet@gmail.com>2009-12-09 01:08:31 (GMT)
commita6f01575d19ffaae326b10b1752a04b427901f13 (patch)
tree765f061bceb979ecc39f96ce207d2ceda3505a4d
parent713964bd8b9d84155701f8357ede529a73704bd5 (diff)
allow the FrameOverlayer to bind itself to a widget for show/hidedesktop_probes
-rw-r--r--tutorius/overlayer.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/tutorius/overlayer.py b/tutorius/overlayer.py
index 5eb0f49..6b75e8a 100644
--- a/tutorius/overlayer.py
+++ b/tutorius/overlayer.py
@@ -20,6 +20,9 @@ drawing management (Overlayer) and basic overlayable widgets are defined here.
import gobject
import gtk
+import logging
+LOGGER=logging.getLogger("tutorius.overlayer")
+
from gtk.gdk import screen_width, screen_height
import cairo
import pangocairo
@@ -162,11 +165,14 @@ class Overlayer(gtk.Layout):
self._overlayed.set_size_request(allocation.width, allocation.height)
class FrameOverlayer(gtk.Window):
- def __init__(self):
+ def __init__(self, bind_to=None):
gtk.Window.__init__(self)
self._vbox = gtk.VBox()
self._overlayer = Overlayer(self._vbox)
self.add(self._overlayer)
+ if bind_to:
+ self._child_map_id = bind_to.connect_after("map", self._child_map_event)
+ self._child_hide_id = bind_to.connect_after("hide", self._child_hide_event)
self._vbox.show()
self._overlayer.show()
self.show_all()
@@ -182,6 +188,16 @@ class FrameOverlayer(gtk.Window):
self.fullscreen() # Cover the entire screen
self.expose = self.connect("expose-event", self.apply_mask)
+ def _child_map_event(self, widget):
+ LOGGER.debug("map %s", str(widget))
+ #When the child is shown
+ self.show()
+
+ def _child_hide_event(self, widget):
+ LOGGER.debug("hide %s", str(widget))
+ #When the child is hiden
+ self.hide()
+
def show(self):
gtk.Window.show(self)