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

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

[Octave-bug-tracker] [bug #44282] 'gui_mainfcn' undefined


From: Guillaume
Subject: [Octave-bug-tracker] [bug #44282] 'gui_mainfcn' undefined
Date: Thu, 14 Nov 2019 07:01:18 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

Follow-up Comment #4, bug #44282 (project octave):

Using the example files from bug #57212 and another one of my own, here is an
attempt at implementing gui_mainfcn.m:


function varargout = gui_mainfcn (gui_State, varargin)
  if (nargin == 1 || isempty (gui_State.gui_Callback))
    filename = file_in_loadpath ([gui_State.gui_Name ".fig"]);
    copies = ifelse (gui_State.gui_Singleton, "reuse", "new");
    H = openfig (filename, copies, "invisible");
    for i = 1:2:numel (varargin)
      try
        set (H, varargin{i}, varargin{i+1});
      catch
        break;
      end_try_catch
    endfor
    handles = guihandles (H);
    guidata (H, handles);
    feval (gui_State.gui_OpeningFcn, H, [], handles, varargin{:});
    set (H, "Visible", "on");
    handles = guidata (H);
    varargout{1} = feval (gui_State.gui_OutputFcn, H, [], handles);
  else
    [varargout{1:nargout}] = feval (gui_State.gui_Callback, varargin{2:end});
  endif
endfunction


I think it is already usable in many situations. Issues I am aware of are:

* gui_LayoutFcn is not implemented.
* if the GUIDE-generated function is called with ('Visible','off'), it will
not be used.
* unclear whether getappdata should be used (and where/how?).

Is there any chance this could be added to Octave 6 even if partially
incomplete? Getting more feedbacks would allow to figure out the missing bits.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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