xInterface Thread last updated on 2006-12-18 09:18:05

Posted by member 348804 on 2006-12-17 17:41:59

I must be missing a really simple concept the following gives me weird errrors:

if xTrashItemCount
pl014_Image "$LSImageFolder$launch\trash_full.ico"
else
pl014_Image "$LSImageFolder$launch\trash_empty.ico"
endif

I've tried $xTrashItemCount$, [exportedevar('xTrashItemCount')], and %#xTrashItemCount%#, I always get a variable not defined, or syntax error in the if statement.

Peter

Posted by member 212670 on 2006-12-17 18:07:10 link

Are you loading the module before the 'include' line that the above is in?

Also, you are aware the the above will only assign the right image after litestep starts, and not during operation?

Posted by member 348804 on 2006-12-17 18:23:54 link

ok, I was loding the module slightly out of order, thx!

So how can one go about deciding an image for the recycle bin?

Peter

Posted by member 12025 on 2006-12-17 18:54:53 link

Use the events in xinterface to fire a !labelrefresh.

Posted by member 348804 on 2006-12-17 19:13:22 link

ok, I like the events, I didn't know it fired on startup. so did that, and it's not liking it. literally nothing happens :(. Changed the event to just do an alert and that worked fine.

Peter
;------------------------------------------------------------------------------
; pl014 button
;------------------------------------------------------------------------------
*label pl014_
pl014_AddToGroup pl0
pl014_X $pl013_X+pl0space$
pl014_Image "$LSImageFolder$launch\trash_empty.ico"
pl014_OnLeftClick !PopupRecycle
pl014_OnRightClick !alert "$xTrashItemCount$"
pl014_ToolTip "Recycle Bin"
xTrashBecomesEmpty !ParseEvars !LabelRefresh pl014_ pl014_Image "$LSImageFolder$launch\trash_empty.ico"
xTrashBecomesFilled !ParseEvars !LabelRefresh pl014_ pl014_Image "$LSImageFolder$launch\trash_full.ico"

Posted by member 12025 on 2006-12-17 21:32:01 link

Does the !labelrefresh work from lsxcommand?

Posted by member 348804 on 2006-12-17 22:56:59 link

yup sure does

Posted by member 12025 on 2006-12-18 00:06:06 link

erm...ask at ls-u if no one finds a glaring error soon?

BTW, how long are you waiting? The module docs say it defaults to 30 second cycles.

Posted by member 5575 on 2006-12-18 00:15:45 link

You don't need any !parseEvars statements in there - all of those evars are "static". The following works fine for me:

xTrashCheckInterval 5
xTrashBecomesEmpty !labelRefresh trash trashFontBold false
xTrashBecomesFilled !labelRefresh trash trashFontBold true

Ought to work for images, too, but perhaps you've found a bug.

Posted by member 348804 on 2006-12-18 09:18:05 link

ok, problem was I was loading xInterface before xLabel. So xInterface would fire the event, but xLabel would never get it.

Peter