Bug description:
get(handle, "String") may fail to get the correct value of "edit" uicontrols (the value than can be seen on the screen) if no "enter" key has been typed at the end of the input string.
This is highly dangerous as nothing (on the screen) can tell that the "enter" key has not been typed.
The value returned by "get" should be the value that can be seen, whether an "enter" key has been typed or not.
[this means that the value must be stored internally after each character typed or loss of focus... TBD]
How to reproduce the bug:
- enter "x1" in field 1 (no "enter" key at the end)
- enter "x2" in field 2 (no "enter" key at end end)
- push "call CB"
=> you get:
val1 = x1 (OK)
val2 = string2 (instead of x2)
// --------------------------------------------------------------
fig = figure();
function CB()
val1 = get(h1, "string");
val2 = get(h2, "string");
disp("val1 = " + val1);
disp("val2 = " + val2);
endfunction
h1 = uicontrol("parent", fig, "style", "edit", "position", [10, 10, 200, 90], "string", "string1");
h2 = uicontrol("parent", fig, "style", "edit", "position", [10, 110, 200, 90], "string", "string2");
uicontrol("parent", fig, "style", "pushbutton", "position", [10, 210, 200, 90], "string", "call CB", "callback", "CB()");
// --------------------------------------------------------------
Other information:
- works as expected with version 5.3.3