bugGNU Octave - Bugs: bug #59949, Various minor GUI issues

 
 

bug #59949: Various minor GUI issues

Submitter:  Arnaud Delorme <arnodelorme>
Submitted:  Tue 26 Jan 2021 07:51:21 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Arnaud Delorme Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 27 Jan 2021 04:38:59 AM UTC, comment #5: 

What is interesting is that Octave does correctly determine the extent of text objects with embedded LF characters.


ht = text (0.5, 0.5, ['a' 10 'b' 10 'c' 10 'd']);
warning: implicit conversion from numeric to char
set (ht, 'units', 'pixels')
get (ht, 'extent')
ans =

   218.0000   149.6500     6.0000    45.0000


The problem only arises when the object is a uicontrol object with "style", "text".

Rik <rik5>
Group administrator
Wed 27 Jan 2021 04:31:08 AM UTC, comment #4: 

With a little more testing on Matlab, it is clear that for multi-line objects where only one is displayed (such as "popupmenu") the "extent" property has the value of the extents for the first instance.  This is true even if a different value with a different extent is currently selected and displayed.  See the test code below which shows the extent for 'a' rather than the long string.


figure; h = uicontrol('style', 'popupmenu', 'string', {'a','very long string','c'}, 'value', 2); get(h, 'extent')


Rik <rik5>
Group administrator
Wed 27 Jan 2021 02:54:39 AM UTC, comment #3: 

Here is a 4th related problem where it should be the same extent

figure; h= uicontrol('style', 'listbox', 'string', 'a|b|c|d'); get(h, 'extent')
ans =

        0        0       40       16

>> figure; h= uicontrol('style', 'listbox', 'string', { 'a' 'b' 'c' 'd'}); get(h, 'extent')

ans =

        0        0        8       64

Arnaud Delorme <arnodelorme>
Wed 27 Jan 2021 02:37:22 AM UTC, comment #2: 

Thank you for the examples.  Please use the bug tracker (https://savannah.gnu.org/bugs/?59949) for answering, otherwise your information might get lost 🤯

[email submission:]

- For popupmenu uicontrols, Matlab consider one line to calculate the extent while Octave considers the multiple entries


figure; h = uicontrol('style', 'popupmenu', 'string', {'a' 'b' 'c' 'd'}); get(h, 'extent’)


Matlab -> [0     0    10    19]
Octave -> [0    0    7   48]

- For text uicontrols, Matlab takes into account character 10 as CR while Octave does not


figure; h = uicontrol('style', 'text', 'string', ['a' 10 'b' 10 'c' 10 'd']); get(h, 'extent’)


Matlab -> [0     0    11    64]
Octave -> [0    0   33   12]

- Octave generates an error when a string is numerically empty [] while Matlab does not.


figure; h = uicontrol('style', 'text', 'string', []);
figure; h = uicontrol('style', ‘checkbox', 'string', []);
figure; h = uicontrol('style', ‘edit', 'string', []);
figure; h = uicontrol('style', ‘popupmenu', 'string', []);
figure; h = uicontrol('style', ‘listbox', 'string', []);


Matlab -> OK
Octave -> error



Kai Torben Ohlhus <siko1056>
Group Member
Wed 27 Jan 2021 01:29:00 AM UTC, comment #1: 

Thank you for your bug report.  Was it possible to give a short example for each of your three observations?

Kai Torben Ohlhus <siko1056>
Group Member
Tue 26 Jan 2021 07:51:21 PM UTC, original submission:  

Extent:
- For popupmenu uicontrols, Matlab consider one line to calculate the extent while Octave considers the multiple entries
- For text uicontrols, Matlab takes into account character 10 as CR while Octave does not

Empty string input for all GUI types:
- Octave generates an error when a string is numerically empty [] while Matlab does not.

Arnaud Delorme <arnodelorme>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by arnodelorme (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-01-28 rik5 Release6.1.0 dev
        Operating SystemMicrosoft Windows Any
    2021-01-27 rik5 StatusNeed Info Confirmed
    2021-01-27 siko1056 StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code