A TBaseForm is a Dialog which is a Frame and hence can have only one child.
Note that the constructor of TBaseForm  is adding a VBox as a child of the TBaseForm.
So the TBaseForm already has a child.
The error message
"A TBaseForm may Contain only a single graphic child."
implies that the TBaseForm was aked to add another child when it already had one.
I am not sure what the given code is trying to implement. I did notice that there is this "add-child" method.
{method public {add-child g:any}:void
    {self.fr.add replace?=true, g}
Calling this method on the Dialog will actually add "g" to  the internal Frame "fr" which is inside the VBox. But who calls this method?
If you expect Dialog.add to actually add stuff to the Frame "fr" then you must override Dialog.add. Also note that if you override Dialog.add then you will need to call add-internal inside the constructor of TBaseForm to add the internal VBox containing the Frame "fr" instead of "add".
-- Kamal.
----- Original Message -----
Sent: Thursday, July 14, 2005 4:17 AM
Subject: I met with difficulty for building a VLE Extension.

Hi, gurus!


I met with difficulty for building a VLE Extension.


My goal is to build a VLE Extension, to which users can take a class as its child.


First, I programmed the next class;



{define-class public TBaseForm {inherits Dialog}
  field protected fr : Frame = {Frame width={make-elastic}, height={make-elastic}}
  {constructor public {default label:any="TBaseForm", ...}
        border-width=1px, border-color="black", border-style="flat",
    {self.add replace?=true,
        {VBox width={make-elastic}, height={make-elastic}, background="",
            {CommandButton label=label},
  {method public {add-child g:any}:void
    {self.fr.add replace?=true, g}



As you already noticed it from the source code, if users take a class as its child,
the class becomes a child of TBaseForm.fr : Frame.


Next, I successfully built TBaseForm to a VLE extension, so when I launched the VLE,
I can see its icon in the palettes and use it, too.


However, when I ran it after I took a RecordGrid on it by a drag and drop,
an error raised; "A TBaseForm may Contain only a single graphic child."


Before I ran it, I certainly saw that the RecordGrid was added as a child of TBaseForm
in the Layout tree.


I tested that on Curl 4.0 beta.


If you know how to correct that problem, tell me please.
Besides, if you have any advices for me about that problem,
I welcome whatever they are.





Yongwoong Kim
 QTI International, Inc.
 B-2609  Kolon Tripolis, 210 Geumgok-dong, Bundang-gu, 
 Seongnam-shi Gyeonggi-do 463-805 Korea
 Phone   +82-31-728-1298
 Fax     +82-31-728-1299
 Mobile  +82-10-3435-6597

Reply via email to