Mercurial > MadButterfly
annotate pyink/pyink.py @ 1309:f2b1b22f7cbc
Make comp_dock editable
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Thu, 20 Jan 2011 10:54:27 +0800 |
parents | 6586cd10c92f |
children | ffbbd3aa218d |
rev | line source |
---|---|
1150
6586cd10c92f
Refactory frameline.py
Thinker K.F. Li <thinker@codemud.net>
parents:
943
diff
changeset
|
1 import os |
6586cd10c92f
Refactory frameline.py
Thinker K.F. Li <thinker@codemud.net>
parents:
943
diff
changeset
|
2 |
6586cd10c92f
Refactory frameline.py
Thinker K.F. Li <thinker@codemud.net>
parents:
943
diff
changeset
|
3 try: |
6586cd10c92f
Refactory frameline.py
Thinker K.F. Li <thinker@codemud.net>
parents:
943
diff
changeset
|
4 if os.environ['PYINK_DBG_ENABLE'] == 'yes': |
6586cd10c92f
Refactory frameline.py
Thinker K.F. Li <thinker@codemud.net>
parents:
943
diff
changeset
|
5 import pdb |
6586cd10c92f
Refactory frameline.py
Thinker K.F. Li <thinker@codemud.net>
parents:
943
diff
changeset
|
6 pdb.set_trace() |
6586cd10c92f
Refactory frameline.py
Thinker K.F. Li <thinker@codemud.net>
parents:
943
diff
changeset
|
7 pass |
6586cd10c92f
Refactory frameline.py
Thinker K.F. Li <thinker@codemud.net>
parents:
943
diff
changeset
|
8 pass |
6586cd10c92f
Refactory frameline.py
Thinker K.F. Li <thinker@codemud.net>
parents:
943
diff
changeset
|
9 except: |
6586cd10c92f
Refactory frameline.py
Thinker K.F. Li <thinker@codemud.net>
parents:
943
diff
changeset
|
10 pass |
6586cd10c92f
Refactory frameline.py
Thinker K.F. Li <thinker@codemud.net>
parents:
943
diff
changeset
|
11 |
941
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
12 import pybInkscape |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
13 import pygtk |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
14 import gtk |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
15 from MBScene import * |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
16 global ink_inited |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
17 ink_inited=0 |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
18 def start_desktop(inkscape,ptr): |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
19 global ink_inited |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
20 if ink_inited == 1: |
943
82321f404b5f
Change the implement to insert window into the toplevel of the spdesktop. However, we not not insert the scene editor after the aloat window since they are created latter.
wycc
parents:
941
diff
changeset
|
21 desktop = pybInkscape.GPointer_2_PYSPDesktop(ptr) |
82321f404b5f
Change the implement to insert window into the toplevel of the spdesktop. However, we not not insert the scene editor after the aloat window since they are created latter.
wycc
parents:
941
diff
changeset
|
22 top = desktop.getToplevel() |
82321f404b5f
Change the implement to insert window into the toplevel of the spdesktop. However, we not not insert the scene editor after the aloat window since they are created latter.
wycc
parents:
941
diff
changeset
|
23 #dock = desktop.getDock() |
82321f404b5f
Change the implement to insert window into the toplevel of the spdesktop. However, we not not insert the scene editor after the aloat window since they are created latter.
wycc
parents:
941
diff
changeset
|
24 #item = dock.new_item("scene", "scene", "feBlend-icon", dock.ITEM_ST_DOCKED_STATE) |
82321f404b5f
Change the implement to insert window into the toplevel of the spdesktop. However, we not not insert the scene editor after the aloat window since they are created latter.
wycc
parents:
941
diff
changeset
|
25 scene = MBScene(desktop,top) |
82321f404b5f
Change the implement to insert window into the toplevel of the spdesktop. However, we not not insert the scene editor after the aloat window since they are created latter.
wycc
parents:
941
diff
changeset
|
26 scene.show() |
941
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
27 return |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
28 |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
29 |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
30 ink_inited = 1 |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
31 |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
32 |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
33 def pyink_start(): |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
34 print 'pyink_start()' |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
35 pybInkscape.inkscape.connect('activate_desktop', start_desktop) |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
36 pass |