Mercurial > MadButterfly
annotate pyink/pyink.py @ 1099:5ba2cab1d505
Add name editor to edit the inkscape:label withgout using the object property editor. This is more Flash-like operation.
author | wycc |
---|---|
date | Sun, 05 Dec 2010 08:16:54 +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 |