On Tue, 20 Jan 2015 23:24:58 +0100 Tobias Boege <tabo...@gmail.com> wrote:
> On Wed, 21 Jan 2015, adamn...@gmail.com 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 > Hmmm, bugger! I know it is in the form configuration file, but that's of little use to me in this instance. I was trying to implement a "Style" property for toolbars, i.e. {Default}, IconOnly, Icon+Text, TextOnly. I can handle the first three OK, but TextOnly means I need to know that path so I can reload the picture if the user selects one of the others after selecting TextOnly. The way I look at it now, if a toolbutton has both the Picture and Text properties set in the IDE then there is no way for "experienced" users to select a shorter rendition for their use, the picture and text are always displayed. Ce'st la vie! I guess I'll just go for the first three. regards Bruce -- B Bruen <adamn...@gnail.com (sort of)> ------------------------------------------------------------------------------ New Year. New Location. New Benefits. New Data Center in Ashburn, VA. GigeNET is offering a free month of service with a new server in Ashburn. Choose from 2 high performing configs, both with 100TB of bandwidth. Higher redundancy.Lower latency.Increased capacity.Completely compliant. http://p.sf.net/sfu/gigenet _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user