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