Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2000-05

writing GTK programs

15 messages · 9 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

dvortex
to Chris Moody: Actually my question was more supposed to mean: Since Lazarus doesn't have a form editor,…

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;

...

and then, in the main project file,

begin
  CreateForm(MyForm,TMyForm);
  Application.run;
end.

and that's it.. you have a form with a edit box and a label. (well.. this one, if it compiles, would be UGLY ! )

but as an example, you can look at some of the "test" stuff.

Ho well.. i hope this helps :o)

PS: this code is bogus, i'm pretty sure it won't compile, but if you know delphi, this should put you on the right track...

you can also look at the IDE code. it is a GOOD example .. and you might even find a bug in there, and fix it,... who knows :o)

Good luck.. :)

Chris Moody wrote 69 lines
Hi, Actually my question was more supposed to mean: Since Lazarus doesn't have a form editor, what commands do I use to create forms, put buttons on the form, ect. I don't know GTK at all (being mainly a Winblowz person) and would like to increase my knowledge, but not sure where to start. Chris ----- Original Message ----- From: "dvortex" To: "Lazarus Mail" Sent: Monday, May 01, 2000 4:37 PM Subject: Re: [lazarus] writing GTK programs > That is what lazarus is all about. > > code under one, run under all (TM) :o) > > Already, if you code some windowed application with lazarus under linux > for example, you can choose to compile it against GTK (gtk/win, GTK/lin, > qt, win32 --i'm not sure about that one, but i think it is on the way--, > or whatever is available. most of the code is already there, and if you > use only the component from the LCL, then it is full compliant with all > the supported Lazarus platforms... > > :o) > > Code once, use many, the ultimate Coding Tool... Lazarus... > > (sound good doesn't it ?) > > > > On Mon, 1 May 2000, Chris Moody wrote: > > > Hi all, > > > > I was wondering, has anyone written a file explaining how to write a GTK > > program in FPK? I suppose I could go thru the "How To" for C, and I'd prefer > > not to, if someone else has already done the work. > > > > Also, with out using GTK, or MOS, is there a way to write a Windowed program > > that would work in both Windows and Linux? > > > > Thanks, > > > > Chris > > > > _________________________________________________________________ > > To unsubscribe: mail with > > "unsubscribe" as the Subject > > archives at http://www.miraclec.com/list_archives/lazarus > > > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

d0hb0y
to dvortex: That is what lazarus is all about. code under one, run under all (TM) :o) Already, if you…

I know that Borland actually filed and won the patent (I cant remember where I read about it)... and I know that Microsoft paid Borland for an unlimited license of their (newly) patented RAD technology... Hopefully that was just a one-shot to get some quick cash out of Microsoft.

As far as the others, I can see Oracle paying them off .. Computer Associates (Power Builder) is a pretty big company too..

Just one of those things that make ya go, "hmmmmm" :-)

== Ron

you wrote 28 lines
I think if that were the case, then Borland would be in violation to Micro$oft, PowerSoft and Oracle because VB, PowerBuilder and Oracle Forms were all out long before Delphi, and all are RAD tools. Curtis d0hb0y wrote: > >At 01:59 AM 5/2/00 +0100, you wrote: > > > >Ok we know it ain't RAD yet but it is getting there! > > Are there any concerns regarding the fact that Borland owns the "patent" > (cough cough) on the "RAD" development method? > > I wonder how a company can collect on a patent from free software? (From > the users?).. do I smell another UNISYS LZW/GIF Fiasco? > > Just food for thought :-) > > == Ron > _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Cliff Baeseman

Hey you asked about the xml parser and yes I do have one that will work perfect for the LFM files. I have to finish a few things tonight reguarding our other conversation.

Cliff

Earlier message 54 lines
-----Original Message----- From: dvortex To: Lazarus Mail Date: Monday, May 01, 2000 4:50 PM Subject: Re: [lazarus] writing GTK programs >That is what lazarus is all about. > >code under one, run under all (TM) :o) > >Already, if you code some windowed application with lazarus under linux >for example, you can choose to compile it against GTK (gtk/win, GTK/lin, >qt, win32 --i'm not sure about that one, but i think it is on the way--, >or whatever is available. most of the code is already there, and if you >use only the component from the LCL, then it is full compliant with all >the supported Lazarus platforms... > >:o) > >Code once, use many, the ultimate Coding Tool... Lazarus... > >(sound good doesn't it ?) > > > >On Mon, 1 May 2000, Chris Moody wrote: > >> Hi all, >> >> I was wondering, has anyone written a file explaining how to write a GTK >> program in FPK? I suppose I could go thru the "How To" for C, and I'd prefer >> not to, if someone else has already done the work. >> >> Also, with out using GTK, or MOS, is there a way to write a Windowed program >> that would work in both Windows and Linux? >> >> Thanks, >> >> Chris >> >> _________________________________________________________________ >> To unsubscribe: mail with >> "unsubscribe" as the Subject >> archives at http://www.miraclec.com/list_archives/lazarus >> > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Chris Moody
to dvortex: That is what lazarus is all about. code under one, run under all (TM) :o) Already, if you…

Hi all,

Does the following message, along with messages from other people, mean that I could make a form in Delphi 3, and then call it from FPK?

Assuming of course, I limited my form to options availble in FPK.

Thanks,

Chris

Earlier message 32 lines
----- Original Message ----- From: "Michael A. Hess" To: Sent: Monday, May 01, 2000 5:30 PM Subject: Re: [lazarus] writing GTK programs > Chris Moody wrote: > > > > Actually my question was more supposed to mean: Since Lazarus doesn't > > have a form editor, what commands do I use to create forms, put > > buttons on the form, ect. > > > > I don't know GTK at all (being mainly a Winblowz person) and would > > like to increase my knowledge, but not sure where to start. > > That is just the point that was trying to be made. You don't have to > know anything about GTK+. You are using the LCL which is compatible with > Delphi's VCL. Code it the same way you would in Delphi without using the > form designer. Create the form and add the controls to it. Check out > some of the applications in the examples directory. > > -- > ==== Programming my first best destiny! ==== > > Michael A. Hess Miracle Concepts, Inc. > http://www.miraclec.com > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Peter Dyson
to dvortex: That is what lazarus is all about. code under one, run under all (TM) :o) Already, if you…

Forms are created at present in roughly the same way as if you view delphi forms as text.

See the code in the lazarus directory as to how to create forms, all the IDE is created this way so far. A forms editor will appear soon but as forms and controls are just objects, they can be declared and properties set just like any other pascal object.

Ok we know it ain't RAD yet but it is getting there!

Earlier message 19 lines
----- Original Message ----- From: Chris Moody To: Sent: Tuesday, May 02, 2000 1:08 AM Subject: Re: [lazarus] writing GTK programs > Hi, > > Actually my question was more supposed to mean: Since Lazarus doesn't have a > form editor, what commands do I use to create forms, put buttons on the > form, ect. > > I don't know GTK at all (being mainly a Winblowz person) and would like to > increase my knowledge, but not sure where to start. >

Reply by email

Chris Moody
to dvortex: That is what lazarus is all about. code under one, run under all (TM) :o) Already, if you…

Hi,

Actually my question was more supposed to mean: Since Lazarus doesn't have a form editor, what commands do I use to create forms, put buttons on the form, ect.

I don't know GTK at all (being mainly a Winblowz person) and would like to increase my knowledge, but not sure where to start.

Chris

Earlier message 53 lines
----- Original Message ----- From: "dvortex" To: "Lazarus Mail" Sent: Monday, May 01, 2000 4:37 PM Subject: Re: [lazarus] writing GTK programs > That is what lazarus is all about. > > code under one, run under all (TM) :o) > > Already, if you code some windowed application with lazarus under linux > for example, you can choose to compile it against GTK (gtk/win, GTK/lin, > qt, win32 --i'm not sure about that one, but i think it is on the way--, > or whatever is available. most of the code is already there, and if you > use only the component from the LCL, then it is full compliant with all > the supported Lazarus platforms... > > :o) > > Code once, use many, the ultimate Coding Tool... Lazarus... > > (sound good doesn't it ?) > > > > On Mon, 1 May 2000, Chris Moody wrote: > > > Hi all, > > > > I was wondering, has anyone written a file explaining how to write a GTK > > program in FPK? I suppose I could go thru the "How To" for C, and I'd prefer > > not to, if someone else has already done the work. > > > > Also, with out using GTK, or MOS, is there a way to write a Windowed program > > that would work in both Windows and Linux? > > > > Thanks, > > > > Chris > > > > _________________________________________________________________ > > To unsubscribe: mail with > > "unsubscribe" as the Subject > > archives at http://www.miraclec.com/list_archives/lazarus > > > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

d0hb0y
to dvortex: That is what lazarus is all about. code under one, run under all (TM) :o) Already, if you…
At 01:59 AM 5/2/00 +0100, you wrote: Ok we know it ain't RAD yet but it is getting there!

Are there any concerns regarding the fact that Borland owns the "patent" (cough cough) on the "RAD" development method?

I wonder how a company can collect on a patent from free software? (From the users?).. do I smell another UNISYS LZW/GIF Fiasco?

Just food for thought :-)

== Ron

Reply by email

Michael A. Hess
to dvortex: That is what lazarus is all about. code under one, run under all (TM) :o) Already, if you…
Chris Moody wrote 7 lines
Actually my question was more supposed to mean: Since Lazarus doesn't have a form editor, what commands do I use to create forms, put buttons on the form, ect. I don't know GTK at all (being mainly a Winblowz person) and would like to increase my knowledge, but not sure where to start.

That is just the point that was trying to be made. You don't have to know anything about GTK+. You are using the LCL which is compatible with Delphi's VCL. Code it the same way you would in Delphi without using the form designer. Create the form and add the controls to it. Check out some of the applications in the examples directory.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Shane Miller
to dvortex: Well, if you know delphi, it is fairly straight forward. type TMyForm = Class(TForm)…

dvortex write:

Show quoted text 35 lines
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

Reply by email

Unknown author
you wrote
I think if that were the case, then Borland would be in violation to Micro$oft, PowerSoft and Oracle because VB, PowerBuilder and Oracle Forms were all out long before Delphi, and all are RAD tools.

It's true that Borland has patent about rad technology. They may be not the first of using it but they are the only one that have thinking about the idea of making a patent of it. But has the owner of the patent they may decide not to worry about the use of this patent by other entity. It maybe just a protection for themself. As a proof of this patent I have recalled this from an old post from Delphi-Talk mailing list:

-------------------------------------------------------- Here is a URL I picked up on the Borland NG, thanks to Frank Cowan. Try it. You'll like it!

Glynn

http://164.195.100.11/netahtml/srchnum.htm

and type in patent number: 5911070
--------------------------------------------------------

Vital Tremblay

Reply by email

dvortex
to Chris Moody: I was wondering, has anyone written a file explaining how to write a GTK program in FPK?…

That is what lazarus is all about.

code under one, run under all (TM) :o)

Already, if you code some windowed application with lazarus under linux for example, you can choose to compile it against GTK (gtk/win, GTK/lin, qt, win32 --i'm not sure about that one, but i think it is on the way--, or whatever is available. most of the code is already there, and if you use only the component from the LCL, then it is full compliant with all the supported Lazarus platforms...

:o)

Code once, use many, the ultimate Coding Tool... Lazarus...

(sound good doesn't it ?)

Chris Moody wrote 18 lines
Hi all, I was wondering, has anyone written a file explaining how to write a GTK program in FPK? I suppose I could go thru the "How To" for C, and I'd prefer not to, if someone else has already done the work. Also, with out using GTK, or MOS, is there a way to write a Windowed program that would work in both Windows and Linux? Thanks, Chris _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Curtis White
to dvortex

I think if that were the case, then Borland would be in violation to Micro$oft, PowerSoft and Oracle because VB, PowerBuilder and Oracle Forms were all out long before Delphi, and all are RAD tools.

Curtis

d0hb0y wrote 14 lines
>At 01:59 AM 5/2/00 +0100, you wrote: > >Ok we know it ain't RAD yet but it is getting there! Are there any concerns regarding the fact that Borland owns the "patent" (cough cough) on the "RAD" development method? I wonder how a company can collect on a patent from free software? (From the users?).. do I smell another UNISYS LZW/GIF Fiasco? Just food for thought :-) == Ron

Reply by email

Chris Moody

Hi all,

I was wondering, has anyone written a file explaining how to write a GTK program in FPK? I suppose I could go thru the "How To" for C, and I'd prefer not to, if someone else has already done the work.

Also, with out using GTK, or MOS, is there a way to write a Windowed program that would work in both Windows and Linux?

Thanks,

Chris

Reply by email

Cliff Baeseman

Well yes and no. Remember that Delphi in the background is handling component creation for you. So say for instance you create one in delphi you will copy the code over and in the form constructor you will then do something like this.

Remember no DFM files exist but you can sure use delphi to code with to speed things along. I do this all of the time code a bunch of stuff in delphi , copy it over to the linux box and tweek just a tad and compile.

type
TfmMain = class(TForm)
   Button1:TButton
end;
constructor TfmMain.Create
begin
  Button1 := TButton.Create(Self)
  Button1.Height := 20
  Button1.Width := 20
  Button1.OnClick := @MyButtonOnClick;
end;

This means you will have to set all of the properties of the components in the create manually. In the future of course the
forms designer will do this for you.

Cliff

Earlier message 56 lines
-----Original Message----- From: Chris Moody To: Date: Monday, May 01, 2000 9:16 PM Subject: Re: [lazarus] writing GTK programs >Hi all, > >Does the following message, along with messages from other people, mean that >I could make a form in Delphi 3, and then call it from FPK? > >Assuming of course, I limited my form to options availble in FPK. > >Thanks, > >Chris >----- Original Message ----- >From: "Michael A. Hess" >To: >Sent: Monday, May 01, 2000 5:30 PM >Subject: Re: [lazarus] writing GTK programs > > >> Chris Moody wrote: >> > >> > Actually my question was more supposed to mean: Since Lazarus doesn't >> > have a form editor, what commands do I use to create forms, put >> > buttons on the form, ect. >> > >> > I don't know GTK at all (being mainly a Winblowz person) and would >> > like to increase my knowledge, but not sure where to start. >> >> That is just the point that was trying to be made. You don't have to >> know anything about GTK+. You are using the LCL which is compatible with >> Delphi's VCL. Code it the same way you would in Delphi without using the >> form designer. Create the form and add the controls to it. Check out >> some of the applications in the examples directory. >> >> -- >> ==== Programming my first best destiny! ==== >> >> Michael A. Hess Miracle Concepts, Inc. >> http://www.miraclec.com >> >> _________________________________________________________________ >> To unsubscribe: mail with >> "unsubscribe" as the Subject >> archives at http://www.miraclec.com/list_archives/lazarus > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email