octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #49751] Output of uicontrol


From: Rik
Subject: [Octave-bug-tracker] [bug #49751] Output of uicontrol
Date: Fri, 2 Dec 2016 17:26:30 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Update of bug #49751 (project octave):

                Severity:              3 - Normal => 2 - Minor              
                  Status:                    None => In Progress            

    _______________________________________________________

Follow-up Comment #2:

No objections to making such a change.  Take a look at how this is done for
the scripts in the plot/draw directory.  As just one example, here is
waterfall.m:


function h = waterfall (varargin)

  htmp = meshz (varargin{:});

  set (htmp, "meshstyle", "row");

  if (nargout > 0)
    h = htmp;
  endif

endfunction


The code uses 'htmp' rather than tmp so that it is clear that the underlying
variable is a handle.  Otherwise, 'tmp' might be an integer, a string, who
knows?

In this case the function is so short one wouldn't become confused, but it is
still good practice.

Also, in this case the documentation refers to the return value as 'hui' so
the code should use that variable as well.


  if (nargout > 0)
    hui = htmp;
  endif


Does Matlab avoid returning the handle if there is no output argument for all
uiXXX functions?  If so, we should implement the--easy--change across all the
uiXX functions in scripts/gui/.



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49751>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]