[lazarus] writing GTK programs

Shane Miller smiller at lakefield.net
Mon May 1 22:17:13 EDT 2000


dvortex write:
>
> Well, if you know delphi, it is fairly straight forward.
>
> type
>   TMyForm = Class(TForm)
>   private
>    {private stuff}
>   Public
>    Constructor Create(AOwner: TObject);
>     MyLabel: TLabel;
>     MyEditBox: TEdit;
>   end;
>
> var MyForm: TMyForm
>
> ...
>
> Constructor Create(AOwner: TObject);
> Begin
>   inherited Create(AOwner);
>
>   MyLabel := TLabel.Create;
>   MyLabel.Text := "My Label";
>   MyLabel.left := 20;
>   MyLabel.Top := 50;
>   MyLabel.Show;
>
>   MyEditBox := TEdit.Create;
>   MyEditBox.Text := "edit me";
>   MyEditBox.Left := 40;
>   MyEditBox.Top := 70;
>   MyEditBox.Show;
>
> end;
>

Don't formget after calling CREATE you need to set the parent to SELF.
Otherwise, the coord's you are giving the left,top,width,height mean nothing
and the control will never appear.

Of course once the form designer is up and running then the CREATE will be
called and the parent will be set automatically.....

---------------------------------------
Shane Miller
Take a look at other product/projects of mine below!

Get paid to surf the net!
http://alladvantage.com/go.asp?refid=DEX-870

Get paid to surf the net by clicking here too!!!
http://epipo.com/sine.asp?dex870

Home page : http://www.lakefield.net/~smiller

Auto-IP Publisher : http://www.lakefield.net/~smiller/autoip

Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard

Lazarus : http://www.lazarus.freepascal.org







More information about the Lazarus mailing list