The official site of Four13 Designs offering downloads for DesktopX.
Published on December 14, 2005 By Sranshaft In DesktopX
Is there any way to change the systray icon of gadgets on the fly through scripting? The documentation on it is sparse at best...for such an 'amazing developement tool' the documentation to go along with it is leaves something to desire. One case in point: the SetFontName call...I can't for the life of me get it to change the font name even though I've followed what the guide says.

If anyone can respond to this question I'd be most appreciative. Though whether anyone does or not...still trying to get help using ConnectObject which doesn't seem to work either though the script is correct. DesktopX keeps spitting back garbage at me.

Comments
on Dec 14, 2005
Don't think you can change the systray icon. At least I haven't seen anything documented.

for the Font, the reason why your code does work is because there is no SetFontName.

The syntax is:

Object.SetFont fontName, size, boolBold, boolItalic, boolUnderline, boolStrikeOut, lfCharSet
You can leave the last parameter = 0


Unfortunately there is not way to set each font property individually, you can only read them individually. Hopefully this will change in a future update as it's a bit awkward.

"ConnectObject"? NOt sure what you are refering to there....
on Dec 14, 2005
ConnectObject is a scripting property that allows a script to see events fired by an external program that's been hooked by the CreateObject property.

See: Link for a better explanation.

As for setting the individual aspects of the font according to the *cough* documentation it apparently is possible, I think. Like I said before I feel the manual, at least the scripting part of it, should be rewritten with clear and consise information.

Object.FontName, Object.FontSize, Object.FontBold, Object.FontItalic, Object.FontUnderline, Object.FontStrikeout
also Object.States("name").FontName, Object.States("name").FontSize, Object.States("name").FontBold, Object.States("name").FontItalic, Object.States("name").FontUnderline, Object.States("name").FontStrikeout

Let you get/set individual font options.


The last sentence states that you can and yet DesktopX says it's a No-no...

I haven't seen anything documented either and if this isn't possible now, it should be in the next version. This would open even more options and I can already think a couple ideas where this would be excellent (weather gadget that changes the tray icon to reflect the weather, album cover art, wallpaper changer, etc...)

Thanks for your response though Thomassen. Finally someone's answered (sort of) my questions.
on Dec 14, 2005
It's true that the manual says that these properties are read and write, but as you have notived they are read only. The history also says they are read only. I've reported this earlier and I know that they are aware of it, but... hopefully it will change soon. Lets hope the functionality will change and not the docs.
on Dec 14, 2005
That ConnectObject seem pretty nifty. I will have to have a look at that one. Thanks for the link.