Differents behaviours of my application
Aleix Palet
aleix.palet at gmail.com
Tue Nov 18 12:13:56 EST 2008
Hi, I'm developing an application for sugar, and the problem is that I want
different behaviours depending on the execution of my app:
- when my app is opened through the icon of lower menu, I want a
filechooser to appear, so I can choose which file to open.
- when somebody downloads a .jclic.zip file, and clicks in the option resume
with my app (I have made my app appear as an option to resume using mime
_types), I don't want the filechooser, I want my app to open directly that
file
To do this, I've reading the wiki (which is a bit confusing) and I learned
that I have to play with the read_file and write_file options. What I've
done is what I write next (with the consequent problems):
- in the init method of my app, I do the the acticity.Activity.__init__ and
then I create the filechooser, I choose the file and then load, I guess i
shouldn't do it like this, because when my app is executed through the
read_file method, first this __init__ method is called, showing me the
filechooser which I don't want!
- another problem is that the read_file filename parameter, gives me the
path of the journal file copy, which is not a .jclic,zip file, then is not
the file that I want.
So my questions are:
- how to organize my code to get the behabiour that I want?
- how to get the real path?
And finally, I've got another problem which is not as important as the ones
before, but if I get an asnwer I would really grateful. When I open the
filechooser which is made with and wx.app, which it also has an wx.frame,
then I choose the file, but I don't get the window closed and the execution
returned to the main app. The window stays opened without showing anything
(a grey window).
Thank you for everything, maybe the questions are a bit basic, but as I
said, is really hard to find some documentation in the olpc wiki. Bye!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.laptop.org/pipermail/devel/attachments/20081118/21820603/attachment.html>
More information about the Devel
mailing list