[gDesklets] Looking for the path to current display file



Hi there,

I playing around a bit in the prefs-core (again :) ) and am implementing
icons on the prefs tabs (working only on config/ConfigDialog.py).
So you can provide an icon to be displayed in front of the tab's
(page's) label, like:

	<page label="Test 1" icon="test.png">

It's working pretty good / perfectly right now, including rescaling too
big icons, but I came across the following problem:

The above example would only work, if you have the icon in the root dir
(like /test.png - that's ("/") what an "print os.getcwd()" returns, too)
OR if you provide the whole path to the icon (like
/home/user/.gdesklets/Displays/MyDesklet/test.png).

Of course this should work with "test.png", too. Just like putting icons
into the user-menu :).

So far, I couldn't figure out how to get the path of the Desklet's dir.

There is a self.__path in display/Display.py:

        # the path of the .display file
        self.__path = os.path.dirname(rep)
        self.__display_file = rep

but I have no clue how to access it.
('DisplayConfigger' object has no attribute '_ConfigDialog__path')

Anyone any idea ???

Greetings, Bjoern



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]