Hi richard, great work.
I'm trying to use wydget in my project, a skinnable media player for
in-car use.
I encountered some problems when loading the xml file.
in my MainWindow class (inherited from window.Window)
i have a method "runscreen" that searches the right xml file and then:
self.gui = GUI(self)
print self.gui
wydget.loadxml.fromFile(self.gui,xmlFile)
xmlFile is located in ./skins/skinname/
and every image used by this skin is in that directory.
If I run the code, python returns me
Traceback (most recent call last):
File "main.py", line 219, in <module>
app.RunScreen("main")
File "main.py", line 140, in RunScreen
wydget.loadxml.fromFile(self.gui,self.screens[self.activeScreenNum]
["path"])
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/wydget/loadxml.py", line 19, in fromFile
return getConstructor(element.tag)(element, parent)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/wydget/widgets/frame.py", line 86, in fromXML
loadxml.getConstructor(child.tag)(child, obj)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/wydget/element.py", line 239, in fromXML
obj = cls(parent, **kw)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/wydget/widgets/label.py", line 92, in __init__
image = data.load_image(image)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/wydget/data.py", line 18, in load_image
_data[filename] = image.load(filename)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/pyglet/image/__init__.py", line 170, in load
file = open(filename, 'rb')
IOError: [Errno 2] No such file or directory: 'background.png'
I think wydget doesn't take care of providing the absolute path, am I
right?
here's the xml file:
<frame width="100%" height="100%">
<image x="0" y="0" image="background.png" />
<button x="376" y="548"
image="bottom_play.png"
over_image="bottom_play.png"
pressed_image="bottom_play.png" />
<button x="474" y="548"
image="bottom_ff.png"
over_image="bottom_ff.png"
pressed_image="bottom_ff.png" />
<button x="246" y="548"
image="bottom_rew.png"
over_image="bottom_rew.png"
pressed_image="bottom_rew.png" />
<button x="0" y="86"
image="music.png"
over_image="music.png"
pressed_image="music.png" />
<button x="0" y="390"
image="apps.png"
over_image="apps.png"
pressed_image="apps.png" />
<button x="0" y="273"
image="gps.png"
over_image="gps.png"
pressed_image="gps.png" />
<button x="437" y="79"
image="video.png"
over_image="video.png"
pressed_image="video.png" />
<button x="425" y="385"
image="settings.png"
over_image="settings.png"
pressed_image="settings.png" />
<button x="586" y="244"
image="web.png"
over_image="web.png"
pressed_image="web.png" />
<button x="714" y="7"
image="vol_up.png"
over_image="vol_up.png"
pressed_image="vol_up.png" />
<button x="25" y="7"
image="vol_down.png"
over_image="vol_down.png"
pressed_image="vol_down.png" />
</frame>
How can I solve this issue?
Thanks in advance
Amdrea
On 10 Lug, 07:57, Richard Jones <[EMAIL PROTECTED]> wrote:
> I've just checked in my GUI framework for pyglet, called "wydget". You
> can find it in pyglet's SVN contrib/wydgetdirectory. Please read the
> README and BUGS files if you're going to give it a go.
>
> Richard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---