I am writing a project with Quickly and GTK 3 and I want to use the get_media_file()
helper so I can load an icon in my data/media directory.
I can't see how I use get_media_file()
with the latest quickly; it looks like the Quickly helpers have changed.
Can anyone provide me with some sample code of how this works?
Tell me if by 'latest' you don't mean the one that ships with 11.10, but this is how to use the function here:
"hello.svg" can be any fragment of a path (like
../media/hello.svg
orstuff/hello.svg
). I.e.get_media_file(f)
is the equivalent ofAnd
get_data_path()
will return/home/stefano/hello/data
.These functions are defined in
hello/hello_lib/helpers.py
andhello/hello_lib/helloconfig.py
.It seems you just give it the name of the file in your data/media directory.
For example, if you want data/media/foo.png, you just call
get_media_file('foo.png')
. This will return a file:/// URI of the absolute path to foo.png.