|
yelayon Novice
Joined: 15 Mar 2005 Posts: 42
|
Posted: Tue Jun 16, 2009 9:20 pm
[3.08] Button's caption does not refresh |
Hi,
When I set caption of button (i.e. push type) to: Foo @getCurM2f
Where @getCurM2f is variable defined as:
Code: |
<var name="getCurM2f" id="3380">%item( @m2f, @m2fCurIndex)</var> |
The caption does not refresh while variables @m2f or @m2fCurIndex changes.
Button's caption has value of @getCurM2f in time when last time button was saved.
Rgds,
W. |
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Wed Jun 17, 2009 3:22 am |
Technically your variable @getCurM2f doesn't change (it always equal to %item( @m2f, @m2fCurIndex)) - that's why your button doesn't change caption.
|
|
_________________ My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Wed Jun 17, 2009 3:36 am |
I don't think this is a bug, and if I recall correctly i think it's by design.
I'm guess this is because what you have there isn't really a variable, but rather a variable function. Technically speaking the function hasn't changed, just it's return value when evaluated and CMUD only updates the button when the associated variable is updated. The simplest way around it put something in caption that will change but never show.
Code: |
Foo %if(@m2fCurIndex,,)@getCurM2f |
Make that your caption and every time you index variable is updated so will your caption, because it's in an empty if, it will not put any additional text in the caption. |
|
_________________ Asati di tempari! |
|
|
|
yelayon Novice
Joined: 15 Mar 2005 Posts: 42
|
Posted: Wed Jun 17, 2009 8:28 am |
I'm just getting familiar with cMud. Above example works on zMud, that's why I've posted this IMO bug.
|
|
_________________ Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Jun 17, 2009 3:11 pm |
zMUD updates all buttons every few seconds (which is why it's slow). CMUD only updates buttons when it detects a change in a direct variable used in the caption changes.
In the 3.08 Beta version there is an #UPDATE command that you can call to force a button to update whenever you want. Just use the ID name assigned to the button. |
|
|
|
yelayon Novice
Joined: 15 Mar 2005 Posts: 42
|
Posted: Wed Jun 17, 2009 4:23 pm |
Ok - thx.
EOT |
|
_________________ Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. |
|
|
|
|
|