Thanks for you help, that did solve the problem.
I looked at the code to see if there was any difference between *value *and
*_value*. I don't understand why *value* is a simple wrapper around *_value*;
I don't see the reason for the existence of *_value*. Does anyone know why
this is the case?
I have also made a minor alteration to show how to do this in the
documentation. I'm unfamiliar with how to submit this as a patch so I'll
just post it here:
*cocos/menu.py, line 629:*
> class EntryMenuItem(MenuItem):
> """A menu item for entering a value.
>
> When selected, ``self.value`` is toggled, the callback function is
> called with ``self.value`` as argument.
>
> To alter the value in the callback function, do the following:
> 1. Alter _value (which is a list) to what you want, eg.
> menu_item._value = list("New")
> 2. Call menu_item._calculate_value()"""
>
On Monday, 9 December 2013 05:48:16 UTC, Claudio Canepa wrote:
>
>
>
>
> On Thu, Dec 5, 2013 at 11:05 AM, Qas K <[email protected] <javascript:>>wrote:
>
>> I would like to alter the value of *EntryMenuItem* inside the callback
>> function (ie. the user types on the keyboard for that menu item). I try to
>> alter it using self.the_menu_item.value = "What I want". But the problem is
>> that this updated value is not drawn until the user changes it *again*.
>>
>
> Looking at the the code in EntryMenuItem seems that you need to
> 1. Change the_entry_menu_item._value
> 2. call the_entry_menu_item._calculate_value()
>
> If that does not work, maybe you should post a brief runnable script
> demoing the problem
>
>
>
--
You received this message because you are subscribed to the Google Groups
"cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/groups/opt_out.