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

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

[Octave-bug-tracker] [bug #57523] [Feature Request] legend should accept


From: Pantxo Diribarne
Subject: [Octave-bug-tracker] [bug #57523] [Feature Request] legend should accept 2-letter abbreviations for "Location" property
Date: Tue, 11 May 2021 07:28:32 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0

Follow-up Comment #6, bug #57523 (project octave):

We use the default property value matching mechanism to detect whether a given
location string is valid, so "set (hlegend, 'location', 'someacronym')" will
be rejected unless we list all possible valid acronyms in the first place. Is
this something doable? If not then I see a few other solutions, in order of
complexity:
* allow any string value for "location" and validate afterward (through an
"addlistener" callback, see below). This approach would work but we need to
keep track of the previous value (e.g. in an appdata or a hidden property) to
which we could fallback in case of an invalid new location.

* add to possibility to specify a validation callback (in place of the
default/valid values argument) to "addproperty".


* add a PRESET/POSTSET argument to the "addlistener" function, (similar to
Matlab's handle method "addlisterner"'s "EventName" argument [1]) and use a
PRESET listener to decide to which valid value an acronym corresponds to. Note
that our current implementation of "addlitener" triggers the execution of the
callback *after* the property has been changed (equivalent to "POSTSET") so if
we used that function to track "location" changes, acronyms would be rejected
before we can validate them.
  
[1] https://fr.mathworks.com/help/matlab/ref/handle.addlistener.html

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57523>

_______________________________________________
  Message posté via Savannah
  https://savannah.gnu.org/




reply via email to

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