Mercurial > MadButterfly
comparison pyink/comp_dock.py @ 1304:94e6594dea59
Make comp_dock being instantiated by domview_ui
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Wed, 19 Jan 2011 17:56:21 +0800 |
parents | cf2691a18a7a |
children | 573a51b1eb37 |
comparison
equal
deleted
inserted
replaced
1303:cf2691a18a7a | 1304:94e6594dea59 |
---|---|
1 import gtk | 1 import gtk |
2 import os | 2 import os |
3 import data_monitor | |
3 | 4 |
4 ## \brief User interface for management components and their timelines. | 5 ## \brief User interface for management components and their timelines. |
5 # | 6 # |
6 class comp_dock(gtk.VBox): | 7 class comp_dock(object): |
7 def __init__(self, fname=None): | 8 __metaclass__ = data_monitor.data_monitor |
9 | |
10 def __init__(self, domview_ui, fname=None): | |
8 super(comp_dock, self).__init__() | 11 super(comp_dock, self).__init__() |
9 | 12 |
10 if not fname: | 13 if not fname: |
11 dirname = os.path.dirname(__file__) | 14 dirname = os.path.dirname(__file__) |
12 fname = os.path.join(dirname, 'component_dock.glade') | 15 fname = os.path.join(dirname, 'component_dock.glade') |
16 builder = gtk.Builder() | 19 builder = gtk.Builder() |
17 builder.add_from_file(fname) | 20 builder.add_from_file(fname) |
18 dock_top = builder.get_object('component_dock_top') | 21 dock_top = builder.get_object('component_dock_top') |
19 dock_top_parent = dock_top.get_parent() | 22 dock_top_parent = dock_top.get_parent() |
20 dock_top_parent.remove(dock_top) | 23 dock_top_parent.remove(dock_top) |
21 self.pack_start(dock_top) | |
22 dock_top.show() | |
23 | 24 |
25 self._domview_ui = domview_ui | |
26 self._locker = domview_ui | |
24 self._builder = builder | 27 self._builder = builder |
25 self._dock_top = dock_top | 28 self._dock_top = dock_top |
26 self._desktop = None | 29 self._desktop = None |
27 self._dock_item = None | 30 self._dock_item = None |
28 pass | 31 pass |
33 dock = desktop.getDock() | 36 dock = desktop.getDock() |
34 item = dock.new_item('component_dock', | 37 item = dock.new_item('component_dock', |
35 'Component and timeline manager', | 38 'Component and timeline manager', |
36 'feBlend-icon', dock.ITEM_ST_DOCKED_STATE) | 39 'feBlend-icon', dock.ITEM_ST_DOCKED_STATE) |
37 item_vbox = item.get_vbox() | 40 item_vbox = item.get_vbox() |
38 item_vbox.pack_start(self) | |
39 self._dock_item = item | 41 self._dock_item = item |
40 | 42 |
41 self.show() | 43 item_vbox.pack_start(self._dock_top) |
44 self._dock_top.show() | |
42 pass | 45 pass |
43 pass | 46 pass |