I’d start by placing some breakpoints. Is Label::addListener() called when you think it is? is Label::handleAsynchUpdate() called to notify the listeners when you think it should be?
No, handleAsynchUpdate() is where the call to all the LabelListeners is made when things in the label change. I was thinking that if you put a breakpoint there, you could see if 1)there were any listeners for that label and 2)follow the call to see why your listener wasn’t being invoked.
Well thanks, but there is a LabelListener for my label :
when I edit it, and I press “return key”, the callback “labelTextHasChanged” rules : for instance if I specify a tempo in a box, 138 BPM, I get the tempo changed.
But if i edit the label with a value, e.g. 60 BPM, and I dont press “return” but I click outside of the label (means a loss of focus), then my BPM is always 138 !
… thus you can see the LabelListener is here, but works a half…
What is the third parameter of your call to Label->setEditable() set to? If it’s set to true, then when you click outside the label, the label will loose focus, and that signals that the editor should discard all changes.
It sounds like you want that third parameter to be “false”
[quote]Label::textEditorFocusLost()
I assume this is being called when you click outside your editor [/quote]
Well well well, I just tried it more seriously : IN FACT : when I change the text, and click outside from the editor, it s ok.
The trouble comes from if i click outside without modifying text from original state… So obviously “labelTextChanged()” not called !!!
Im stupid.
But as excuses, i was assuming that get off from editor state was considered as a LabelTextChanged…
So, I’d finally need it : a method called when the text editor is turned off…