Tue 19 Mar 2013 08:57:16 PM UTC, comment #6:
I fixed the bug here (http://hg.savannah.gnu.org/hgweb/octave/rev/100a7bd2590e). There is one exception to the fix if "default" is the first row of a multi-row char matrix. Someone else can take up that case if it ever proves worthwhile.
|
Fri 15 Mar 2013 03:31:11 AM UTC, comment #5:
OK. The result is a bit long, so it is
attached.
(file #27605)
|
Fri 15 Mar 2013 02:28:11 AM UTC, comment #4:
Actually, I want to figure out a bit more about how Matlab is doing things.
Is Matlab case insensitive about 'default' and 'factory'? I kind of doubt it.
Second, I'm wondering if Matlab strips off the cell array around single strings.
|
Thu 14 Mar 2013 08:15:06 PM UTC, comment #3:
So it looks like, perhaps, '\default' is implemented and that text() automatically changes "default" to "\default" before calling set ('string', value).
|
Thu 14 Mar 2013 07:19:40 PM UTC, comment #2:
Rik,
I ran the script,
I've attached plots. Only the last includes the backslash, but is also gives the warning below.
(file #27604)
|
Thu 14 Mar 2013 03:45:41 PM UTC, comment #1:
Ben, check Matlab's own documentation (http://www.mathworks.com/help/matlab/creating_plots/setting-default-property-values.html)
-- CLIP --
Reserved Words
Setting a property value to default, remove, or factory produces the effects described in the previous sections. To set a property to one of these words (e.g., a text or uicontrol String property set to the word default), you must precede the word with the backslash character:
h = uicontrol('Style','edit','String','\default');
-- END CLIP --
Is the correct solution to implement backslash escaping for Octave?
What does Matlab do for
|
Thu 12 Apr 2012 12:04:30 PM UTC, original submission:
The command below produces text object with an empty "string" property.
If I add ....
... the string property remains empty. In fact, it should set the value to an empty string, since that is the default value.
Looks like the problem is with graphics.cc (graphics_object::set_value_or_default). Specifically lines 2078-2086.
From Matlab ...
Produces a text object with string = "default". However, after ...
The string property is reset to its default value (an empty string). The "text" function is built-in for Matlab. Perhaps that was done to fix this problem?
|