Sign in Join

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

Mailing lists / fpc-pascal / 2008-08

GUI application sample for windows and linux

8 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Osvaldo Filho

Hi, i need a sample of an application with this:

One form
One button with an event, the event: showmessage('Hello, my name is: '+ button.name)

The application to be need cross plataform for windows and linux and not use gtk, gtk2, qt or fpGui.

No lazarus code, please.

This application is for an exemple in a course of programming.

Thanks very much.

PS: Sorry my english.

David Emerson
to Osvaldo Filho

Sorry Osvaldo, but we cannot help with your homework:

http://www.freepascal.org/faq.var#HOMEWORK

The advice I would give any person who actually needs to create a form with a button is to use fpgui or lazarus or msegui. If you like textmode, you could use freevision.

If you could come up with a compelling technical reason why none of the (excellent) existing solutions work, then it might be appropriate to engage in a discussion. However "it's prohibited for the assignment" is not a technical reason, it's an administrative one ;) thus it's outside the domain of reasonable topics for this mailing list.

You might want to have a look at the graph unit, and/or the gdi32 and x11 stuff which AFAIK are used for windows/*nix cross-platform libraries like fpgui and msegui. Happily I have never had to examine that stuff because I use fpgui to make forms and buttons.

Good luck with your class, though.

~David.

Osvaldo Filho wrote 18 lines
Hi, i need a sample of an application with this: One form One button with an event, the event: showmessage('Hello, my name is: '+ button.name) The application to be need cross plataform for windows and linux and not use gtk, gtk2, qt or fpGui. No lazarus code, please. This application is for an exemple in a course of programming. Thanks very much. PS: Sorry my english.
Graeme Geldenhuys
to Osvaldo Filho: Hi, i need a sample of an application with this: One form One button with an event, the…
Osvaldo Filho wrote 8 lines
Hi, i need a sample of an application with this: One form One button with an event, the event: showmessage('Hello, my name is: '+ button.name) The application to be need cross plataform for windows and linux and not use gtk, gtk2, qt or fpGui.

That is not a trivial task! For example: fpGUI talks directly to GDI (windows) and XLib (Linux & FreeBSD). The make the whole process "cross-platform" for the users of fpGUI, you have to abstract all drawing and painting calls to abstract classes. Override/Implement them for specific platforms. Then place a platform neutral interface over those. Plus you need to handle OS events, the event loop and application events in a cross-platform way.... Now the developer can use the platform neutral classes to design there applications and not worry about the platforms specific backend. A huge task which I have been busy with for the last 1.5 years in fpGUI.

It's simply easier to use one of the existing cross-platform solutions. The ones I know of that are implemented in Free Pascal are: fpGUI, MSEgui and Lazarus. Or if you are not happy with any of those and you are up to the challenge and you have A LOT of spare time, then start implemented you own cross-platform GUI toolkit. :-)

Good luck!

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Krishna
to Graeme Geldenhuys
Graeme Geldenhuys wrote 6 lines
Or if you are not happy with any of those and you are up to the challenge and you have A LOT of spare time, then start implemented you own cross-platform GUI toolkit. :-) Good luck!

oh no! Graeme, what are you doing? we already have enough toolkits and APIs to tear our hair with.

Programming today is a race between software engineers striving to build bigger and better idiot- proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Richard Cook
Nataraj S Narayan
to Graeme Geldenhuys: That is not a trivial task! For example: fpGUI talks directly to GDI (windows) and XLib…

Hi Graeme

I am trying out fpgui for arm-linux. Please tell me how different are msegui and fpgui. Why do we need two of them, if both are writing direct w/o gtk or qt?

regards

Nataraj

Graeme Geldenhuys wrote 41 lines
On 8/5/08, Osvaldo Filho wrote: > Hi, i need a sample of an application with this: > > One form > One button with an event, the event: showmessage('Hello, my name is: '+ > button.name) > > The application to be need cross plataform for windows and linux and not use > gtk, gtk2, qt or fpGui. That is not a trivial task! For example: fpGUI talks directly to GDI (windows) and XLib (Linux & FreeBSD). The make the whole process "cross-platform" for the users of fpGUI, you have to abstract all drawing and painting calls to abstract classes. Override/Implement them for specific platforms. Then place a platform neutral interface over those. Plus you need to handle OS events, the event loop and application events in a cross-platform way.... Now the developer can use the platform neutral classes to design there applications and not worry about the platforms specific backend. A huge task which I have been busy with for the last 1.5 years in fpGUI. It's simply easier to use one of the existing cross-platform solutions. The ones I know of that are implemented in Free Pascal are: fpGUI, MSEgui and Lazarus. Or if you are not happy with any of those and you are up to the challenge and you have A LOT of spare time, then start implemented you own cross-platform GUI toolkit. :-) Good luck! Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Graeme Geldenhuys
to Krishna: On Wed, Aug 6, 2008 at 1:47 PM, Graeme Geldenhuys oh no! Graeme, what are you doing? we…
Krishna wrote
oh no! Graeme, what are you doing? we already have enough toolkits and APIs to tear our hair with.

:-)

Show quoted text 5 lines
-- Programming today is a race between software engineers striving to build bigger and better idiot- proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Richard Cook

I love this quote!! I have never read a more accurate statement. :-)

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Graeme Geldenhuys
to Nataraj S Narayan: Hi Graeme I am trying out fpgui for arm-linux. Please tell me how different are msegui…
Nataraj S Narayan wrote 5 lines
Hi Graeme I am trying out fpgui for arm-linux. Please tell me how different are msegui and fpgui. Why do we need two of them, if both are writing direct w/o gtk or qt?

Ah, I couldn't find my 'template' reply.... ;-)
It basically comes down to personal needs and what you are used to I guess. Both are great frameworks (yes I may say that). :)

I had a look at MSEgui before I started with fpGUI. I did not plan on reinventing the wheel. I came from Delphi (many years with that tool), so I was used to how the VCL works. It wasn't cross-platform though and Borland killed Kylix as we started using it (plus CLX was very buggy and ugly).

I then moved to Lazarus LCL, which was an easy process because it was similar to VCL. The problem was, at that stage the LCL was too inconsistent for cross-platform business applications. That's when I found two problems that prevented me from using
MSEgui. It's too different to what I was used to, and the coding style was very different to what I was used to. Both those issues might be fine for Martin or others, but they were show stoppers for me. A personal thing I guess.

I then found the abandoned fpGUI code. It looked promising by design and coding style was nice. After toying with it for a few months I found some issues and decided to do a total rewrite of the code. 1.5 years later, and fpGUI is where it is today. :-)

fpGUI has a few design differences compared to MSEgui, but overall our goals similar. A custom written toolkit that makes us productive and doesn't rely on many large 3rd party libraries.

A short summary of some of the obvious difference:

* fpGUI uses the utf-8 string encoding internally, MSEgui use UCS-2. Though to a user of the toolkits, this shouldn't make much difference.

* fpGUI has one handle per widget. MSEgui has one handle per top level window (Form)

* fpGUI might resemble some ideas from VCL, but is NOT bound to those as a design (unlike LCL). fpGUI is not a VCL clone! MSEgui is just different. ;-)

* MSEgui comes with a full blown IDE (MSEide). I have no intention in reinventing the wheel here - I love the Lazarus IDE as is.

* To speed up the design of Forms, I created a UI Designer for fpGUI. So you can visually design your forms. MSEgui has the integrated forms designer as part of MSEide.

* MSEide, Delphi and Lazarus save the form designs as external files (.dfm, .lfm etc). In fpGUI, with the UI Designer, the form designs are part of the .pas unit file (no external file are required). This is similar to Visual Studio with C# or Java IDEs. The UI Designer can also handle multiple forms in a single .pas unit. I find the single .pas file easier to work with, easy to search and replace form properties, easy to make minor GUI changes without loading the form designer etc...

Like I said, the projects have similar goals, so it comes down to personal feeling. Try them both and see what you like.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Osvaldo Filho
to David Emerson: Sorry Osvaldo, but we cannot help with your homework:…

Sorry, and thank you.

2008/8/5, David Emerson :

Show quoted text 49 lines
Sorry Osvaldo, but we cannot help with your homework: http://www.freepascal.org/faq.var#HOMEWORK The advice I would give any person who actually needs to create a form with a button is to use fpgui or lazarus or msegui. If you like textmode, you could use freevision. If you could come up with a compelling technical reason why none of the (excellent) existing solutions work, then it might be appropriate to engage in a discussion. However "it's prohibited for the assignment" is not a technical reason, it's an administrative one ;) thus it's outside the domain of reasonable topics for this mailing list. You might want to have a look at the graph unit, and/or the gdi32 and x11 stuff which AFAIK are used for windows/*nix cross-platform libraries like fpgui and msegui. Happily I have never had to examine that stuff because I use fpgui to make forms and buttons. Good luck with your class, though. ~David. On Tuesday 05 August 2008 6:51 am, Osvaldo Filho wrote: > Hi, i need a sample of an application with this: > > One form > One button with an event, the event: showmessage('Hello, my name > is: '+ button.name) > > The application to be need cross plataform for windows and linux and > not use gtk, gtk2, qt or fpGui. > > No lazarus code, please. > > This application is for an exemple in a course of programming. > > Thanks very much. > > > PS: Sorry my english. > _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal