Hi again, I have following svg:
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<g
id="button1"
inkscape:label="button1">
<g
transform="translate(104.85714,-141.42857)"
inkscape:label="default_view"
id="default_view">
<path
style="fill:#008000;fill-opacity:
0.84722218;stroke:#000000;stroke-width:1.35399997;stroke-miterlimit:
4;stroke-opacity:1"
d="M 147.14286,591.08929 C 216.19047,523.97768
348.09524,632.58036 418.57143,595.46875 C 450.39511,557.33598
411.47681,519.49114 375.71429,485.25 C 316.66667,502.38244
256.19047,453.8006 194.28572,483.79018 C 155.71429,517.1756
182.85714,554.84672 147.14286,591.08929 z"
id="rect5036"
sodipodi:nodetypes="ccccc" />
<text
xml:space="preserve"
style="font-size:40px;font-style:normal;font-
weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:
1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-
family:Bitstream Vera Sans"
x="231.42859"
y="546.64783"
id="text5038"><tspan
sodipodi:role="line"
id="tspan5040"
x="231.42859"
y="546.64783">Default</tspan></text>
</g>
<g
transform="translate(198.57143,-287.14286)"
inkscape:label="clicked_view"
id="clicked_view">
<path
style="fill:#00ffff;fill-opacity:
0.84722218;stroke:#000000;stroke-width:1.35399997;stroke-miterlimit:
4;stroke-opacity:1"
d="M 52.684011,736.28232 C 121.73162,669.17071
253.63639,777.77339 324.11258,740.66178 C 355.93626,702.52901
317.01796,664.68417 281.25544,630.44303 C 222.20782,647.57547
161.73162,598.99363 99.826871,628.98321 C 61.255441,662.36863
88.398291,700.03975 52.684011,736.28232 z"
id="path5043"
sodipodi:nodetypes="ccccc" />
<text
xml:space="preserve"
style="font-size:40px;font-style:normal;font-
weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:
1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-
family:Bitstream Vera Sans"
x="136.96974"
y="691.84088"
id="text5045"><tspan
sodipodi:role="line"
id="tspan5047"
x="136.96974"
y="691.84088">Clicked</tspan></text>
</g>
<g
transform="translate(-129.42857,-285.14286)"
inkscape:label="disabled_view"
id="disabled_view">
<path
style="fill:#808000;fill-opacity:
0.84722218;stroke:#000000;stroke-width:1.35399997;stroke-miterlimit:
4;stroke-opacity:1"
d="M 381.25544,734.85374 C 450.30305,667.74213
582.20782,776.34481 652.68401,739.2332 C 684.50769,701.10043
645.58939,663.25559 609.82687,629.01445 C 550.77925,646.14689
490.30305,597.56505 428.3983,627.55463 C 389.82687,660.94005
416.96972,698.61117 381.25544,734.85374 z"
id="path5049"
sodipodi:nodetypes="ccccc" />
<text
xml:space="preserve"
style="font-size:40px;font-style:normal;font-
weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:
1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-
family:Bitstream Vera Sans"
x="465.54117"
y="690.41229"
id="text5051"><tspan
sodipodi:role="line"
id="tspan5053"
x="465.54117"
y="690.41229">Disabled</tspan></text>
</g>
</g>
</g>
And the python code:
import sys
from inkface.canvas import PygameFace, PygameCanvas
class App:
def main(self):
self.canvas = PygameCanvas((800,480))
self.face = PygameFace("/home/jecl/Develop/altcanvas/inkface-
pygame/tests/data/b4.svg")
self.face.button1.onLeftClick = self.handleClick
self.face.default_view.unhide()
self.face.clicked_view.hide()
self.face.disabled_view.hide()
self.canvas.add(self.face)
try:
self.canvas.eventloop()
except KeyboardInterrupt, ki:
sys.exit(0)
def handleClick(self, elem):
print "Clicked"
App().main()
So why can't i access default_view, clicked_view and disabled_view
nodes, though button1 is available. Thx!
> On Fri, Mar 13, 2009 at 10:27 PM, ekondrashev <
ekondras...@rambler.ru>wrote:
>
>
>
> > Yes, I've already played with this code, I was looking at you project
> > during couple of weeks. So it is quite clear for me how it works. And
> > yes I have some svgs that i wanted to test inkface with, but faced
> > with unimplemented svg tags exceptions. I was very surprised when you
> > decided to deny(sorry for my english:)) the librsvg, because i think
> > it will take long time to implement svg tiny at least.
>
> Yes the decision to move away from librsvg was tricky. I had put all pros
> and cons of my decision on my blog. You can find the post here:
http://jyro.blogspot.com/2009/02/planning-inkface-v02.html(Don't take the