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