[Gambas-user] Getting the "source string" for a picture
Tobias Boege
taboege at ...626...
Tue Jan 20 23:24:58 CET 2015
On Wed, 21 Jan 2015, adamnt42 at ...626... wrote:
> I need to get the "source string" for a control's Picture property (specifically a ToolButton control). However, the control's Picture property returns a picture.
>
> Is there any way of determining what that source string e.g. "icon:/22/connect.png" or "img/somepic.png" is?
>
I don't think that this information is anywhere. When you assign the Picture
property, you assign a Picture object which does not contain a path.
As usual, the best way to get hold again of lost information is to not lose
it in the first place: you can try to extend the Picture class. Add a Path
property and override Picture's _get() and Load() methods to set the path of
a Picture when its loaded.
Regards,
Tobi
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
More information about the User
mailing list