Dear Bert,

Thank you for your great reply!

After I followed your comment, I could have achieved my goal.

My new code of TBaseForm is below and it works well.

||---------------------------------------------------------------------
|| Class : TBaseForm
|| Filename  : FRAMEWORK.BASEFORM.scurl
|| Package   : FRAMEWORK.BASEFORM
||---------------------------------------------------------------------
{define-class public TBaseForm {inherits Frame}
 
  field public fr : Frame = {Frame width={make-elastic}, height={make-elastic}}
 
  || Constructor
  {constructor public {default label:any="TBaseForm", ...}
   
    {construct-super       
        border-width=1px, border-color="black", border-style="flat",
        ...
    }

    || The new code from your 1st comment
    {self.add-internal
        {VBox width={make-elastic}, height={make-elastic}, background="",
            {CommandButton label=label},
            self.fr
        }
    }

||--    || I removed this because the TBaseForm should not have any child objects at the time;
||--    || it came from your last comment.
||--    {self.clear}

||--    || I changed this old method; it came from your 1st comment.
||--    {self.add replace?=true,
||--        {VBox width={make-elastic}, height={make-elastic}, background="",
||--            {CommandButton label=label},
||--            self.fr
||--        }
||--    }

  }

  ||===============================================================
  || The new method overridden the method Frame.add;
  || it came from your 2nd comment.
  ||===============================================================
  {method public {add g:any, ...}:#Visual
    {return {self.fr.add g, ...}}
  }

||--  ||-----------------------------------------------------------
||--  || The original method of mine; it was not working...
||--  ||-----------------------------------------------------------
||--  {method public {add-child g:any}:void
||--    {self.fr.add replace?=true, g}
||--  }

}

||---------------------------------------------------------------------

Your comment made me perceive many things and I corrected my wrong points
about the process of creating and using objects on the VLE.

I appreciate your help again. Gerry also send thanks to you.

Have a good days!

 

Sincerely yours,

 

Yong

Reply via email to