Mercurial > MadButterfly
annotate pyink/pyink.py @ 1032:148ce30a861d
SHift the ruler to the right to align to the frames
author | wycc |
---|---|
date | Mon, 22 Nov 2010 22:44:27 +0800 |
parents | 82321f404b5f |
children | 6586cd10c92f |
rev | line source |
---|---|
941
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
1 import pybInkscape |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
2 import pygtk |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
3 import gtk |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
4 from MBScene import * |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
5 global ink_inited |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
6 ink_inited=0 |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
7 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
|
8 global ink_inited |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
9 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
|
10 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
|
11 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
|
12 #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
|
13 #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
|
14 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
|
15 scene.show() |
941
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
16 return |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
17 |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
18 |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
19 ink_inited = 1 |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
20 |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
21 |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
22 def pyink_start(): |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
23 print 'pyink_start()' |
9ba94c577a6f
Add scene editor. This vewrsion can only switch scene. It can not change the scene yet.
wycc
parents:
diff
changeset
|
24 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
|
25 pass |