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

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

[Octave-bug-tracker] [bug #44700] Changing the style of a uicontrol afte


From: Guillaume
Subject: [Octave-bug-tracker] [bug #44700] Changing the style of a uicontrol after creation
Date: Fri, 27 Jul 2018 12:44:08 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Follow-up Comment #2, bug #44700 (project octave):

Looking at this again, it seems to actually work fine, if one just comments
out the call to error in libinterp/corefcn/graphics.cc:


void
uicontrol::properties::set_style (const octave_value& st)
{
  if (! get___object__ ().isempty ())
    error ("set: cannot change the style of a uicontrol object after
creation.");

  style = st;

  // if we know know what we are, can override value for listbox and
popupmenu
  if (style_is ("listbox") || style_is ("popupmenu"))
    {
      Matrix v = value.get ().matrix_value ();
      if (v.numel () == 1 && v (0) == 0)
        value.set (octave_value (1));
    }
}


The code below then works as expected, as well as with other styles of
uicontrols. I understand there might be styles that require changes to the
properties if they are swapped (?) but I can't think of any problem between
'text' and 'edit': could the error call be removed, either entirely or at
least when it's a change between "text" and "edit"?

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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