diff --git a/@MyGuiCont/MyGuiCont.m b/@MyGuiCont/MyGuiCont.m index b433077..bc2cccb 100644 --- a/@MyGuiCont/MyGuiCont.m +++ b/@MyGuiCont/MyGuiCont.m @@ -1,25 +1,35 @@ % Class that provides basic functionality for handling App-based GUIs classdef MyGuiCont < handle properties (Access = public) - % GUI object that is stored for reference only + % GUI object that is stored for reference only. Should include the + % main figure. Gui % Name of the GUI class that can be used with the instrument gui_name char end methods (Access = public) function createGui(this) assert(~isempty(this.gui_name), ['GUI name is not ' ... 'specified for the instrument class ' class(this)]); if isempty(this.Gui) || ~isvalid(this.Gui) this.Gui = feval(this.gui_name, this); end end end + + methods + function set.Gui(this, Val) + assert(~isempty(findFigure(Val)), ... + 'Value assigned to Gui property must include a figure'); + + this.Gui = Val; + end + end end