2006-07-24 12:15:52 +02:00
|
|
|
import gtk
|
|
|
|
|
|
|
|
from sugar.scene.Stage import Stage
|
|
|
|
|
2006-07-24 15:11:14 +02:00
|
|
|
class StageView(gtk.Fixed):
|
2006-07-24 12:15:52 +02:00
|
|
|
def __init__(self, stage):
|
2006-07-24 15:11:14 +02:00
|
|
|
gtk.Fixed.__init__(self)
|
|
|
|
self.set_has_window(True)
|
2006-07-24 12:15:52 +02:00
|
|
|
|
|
|
|
self._stage = stage
|
|
|
|
self._stage.connect('changed', self.__stage_changed_cb)
|
|
|
|
self.connect('expose_event', self.__expose_cb)
|
|
|
|
|
|
|
|
def __stage_changed_cb(self, stage):
|
|
|
|
if self.window:
|
|
|
|
self.window.invalidate_rect(None, False)
|
|
|
|
|
|
|
|
def __expose_cb(self, widget, event):
|
|
|
|
self._stage.render(widget.window)
|
|
|
|
|
|
|
|
def get_stage(self):
|
|
|
|
return self._stage
|