Recent

Author Topic: If you want to learn how to use GUI libraries without the LCL where do you start  (Read 1410 times)

vfclists

  • Hero Member
  • *****
  • Posts: 1146
    • HowTos Considered Harmful?
If you want to learn how to use GUI libraries without the VCL where do you start?

Using the LCL/VCL prevents the learning of how to link wo the widget sets directly.

Where do I start if I want to learn this and where can some example be found, starting with "Hello World" dialogs on Gtk3, Qt and Windows?
Lazarus 3.0/FPC 3.2.2

TRon

  • Hero Member
  • *****
  • Posts: 3623
Where do I start if I want to learn this and where can some example be found, starting with "Hello World" dialogs on Gtk3, Qt and Windows?
At their respective SDK's ? That should provide examples on how to use their framework. If not then it is not a framework to be used for public consumption.
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

vfclists

  • Hero Member
  • *****
  • Posts: 1146
    • HowTos Considered Harmful?
I'm talking about examples of such code, not reading about SDKs.

Sure I can start reading about the SDKs, but that assumes I am not doing other things as well, or that I am familiar with the process of linking Pascal code directly with C and C++ libraries.

Does anyone know any applications written in FreePascal that link with GUI libraries without going through the LCL or VCL?
Lazarus 3.0/FPC 3.2.2

Thaddy

  • Hero Member
  • *****
  • Posts: 16177
  • Censorship about opinions does not belong here.
Still, what TRon suggested is the only way. For most widget sets there are examples, though.
Hey, the implementors of the widget sets are programmers too... 8-) Difference between you and them is that they are usually very, very good... ;D
For now the difference.... :D
There are also low-level units in Lazarus for all widget sets and tests. Start there. Grep's your uncle.
« Last Edit: October 14, 2024, 03:41:25 pm by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

TRon

  • Hero Member
  • *****
  • Posts: 3623
I'm talking about examples of such code, not reading about SDKs.
I was not referring to what you want or not want to read.

Quote
Sure I can start reading about the SDKs, but that assumes I am not doing other things as well, or that I am familiar with the process of linking Pascal code directly with C and C++ libraries.
What has linking pascal code with C and C++ has to do anything with understanding how a framework actually works or is to be used ?

Quote
Does anyone know any applications written in FreePascal that link with GUI libraries without going through the LCL or VCL?
Ah, you want the "normal rules do not apply to/for me instead I ask and want it now on a platter" answer.

The other day someone asked about quiche, a library that I am not familiar with. There are no examples written in Pascal. One starts by reading their SDK documentation and any hints provided in its headers.

Taking shortcuts as what you seem to wish for only provides examples written by someone else who made its own interpretation of that same SDK. Sometimes that is for the better but more often than not it is for the worse and you are copying the same bad habits. It's like using AI to develop software: in the end you have learned absolutely zilch.
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

Thaddy

  • Hero Member
  • *****
  • Posts: 16177
  • Censorship about opinions does not belong here.
I co-wrote KOL (really in part, about 98% is written by Vladimir Kladov, but I contributed a lot). That is a framework, including a widget set around the Windows API:
So, I learned to handle the Windows API... That is how you start. 25 some years ago.
« Last Edit: October 14, 2024, 04:11:53 pm by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

440bx

  • Hero Member
  • *****
  • Posts: 4735
If you want to learn how to use GUI libraries without the VCL where do you start?

Using the LCL/VCL prevents the learning of how to link wo the widget sets directly.

Where do I start if I want to learn this and where can some example be found, starting with "Hello World" dialogs on Gtk3, Qt and Windows?
I'm not really sure what you're really asking for but, presuming that under Windows you'd like to code directly to the Win32 API, I suggest you look at the examples mentioned in this thread:
https://forum.lazarus.freepascal.org/index.php/topic,52984.0.html
I didn't update that index, there are additional examples/posts that can be found by searching the forum for "winapi examples".  That will give you a list of the 8 threads/posts that have examples.

Note also that, the examples are _not_ organized in order of complexity, that is, post #1 has some examples that are more complex than some examples found in later posts.

If this is what you're looking for then I suggest you look for the examples about eliminating flicker.  The first examples are about as basic as they can be and the complexity increases to eliminate flicker (which is something all GUI apps should care about.) those are posts 7 and 8:
https://forum.lazarus.freepascal.org/index.php/topic,53690.msg397421.html#msg397421
https://forum.lazarus.freepascal.org/index.php/topic,53791.msg398388.html#msg398388

HTH.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11941
  • FPC developer.
If you want to learn how to use GUI libraries without the VCL where do you start?

Using the LCL/VCL prevents the learning of how to link wo the widget sets directly.

Where do I start if I want to learn this and where can some example be found, starting with "Hello World" dialogs on Gtk3, Qt and Windows?

Well, the obvious choice would be to look at the LCL source?

p.s. Afaik FPC comes with a simple Windows API gui program in the examples.

p.p.s (as 440bx might confirm), looking out for certain books, like the "Tomes of Delphi - core win32 api" and "graphical api" might help. If you are in the USA or Western Europe you have some chance of finding them in some 2nd bookstore (-network).
« Last Edit: October 14, 2024, 05:17:44 pm by marcov »

Warfley

  • Hero Member
  • *****
  • Posts: 1758
The easiest is to look at C examples and translate them to Pascal.

Thaddy

  • Hero Member
  • *****
  • Posts: 16177
  • Censorship about opinions does not belong here.
 :) You and I both know that, but OP doesn't... O:-)
If I smell bad code it usually is bad code and that includes my own code.

zeljko

  • Hero Member
  • *****
  • Posts: 1668
    • http://wiki.lazarus.freepascal.org/User:Zeljan
If you want to learn how to use GUI libraries without the VCL where do you start?

Using the LCL/VCL prevents the learning of how to link wo the widget sets directly.

Where do I start if I want to learn this and where can some example be found, starting with "Hello World" dialogs on Gtk3, Qt and Windows?

There are some examples around howto create Qt4(5,6) application by using only C bindings (eg qt6.pas)...create QApplication object and one QMainWindow and that's it.

vfclists

  • Hero Member
  • *****
  • Posts: 1146
    • HowTos Considered Harmful?
Guys I'd like to make a point here.

Many of us would like contribute and as far as contributions are concerned some of them require indepth knowledge, and others are mechanical things that the main developers can't make the time for.

For instance I was checking on TRichMemo and realized that some features may not yet be implemented in the Qt package. I said may not yet be implemented  because it is  2 years since the document was updated.

I inquired in the thread https://forum.lazarus.freepascal.org/index.php/topic,68907.msg533627/topicseen.html#new and Zeljko responded.

There may be a few things there that I and others can help with are not that complicated, and can be done with limited knowledge once we have examples to look at. Then we can work our way back from there to the basics to get an idea of what the job entails.

So please don't assume that I don't want to do the hard work of learning everything from scratch not because I want things easy but simply because it just not practical.

No matter how clever I or others are there is still a limited amount of time available for learning let alone implementing solutions and sometimes the time it takes to learn is far longer that it takes to implement solutions which are often quite simple once you get an idea of what to do.

FreePascal and Lazarus have serious bus factor issues. I see that I joined the forum in 2009. I didn't even know that I registered that long ago, and as far as I can tell Zeljko has always been the person responsible for Qt integration. If God forbid something was to happen to him or he had to quit for some reason who would be there to carry on? Who among the developers has the knowledge or skills or tools that Zeljko employs in developing the library?

Is it documented somewhere?

I was very surprised to learn on a recent thread that PascalDragon is the main person new compiler features depend on, and I remember years ago he had to combine it with studying at college though I don't know whether it was undergrad or postgrad.

Making things easier for those wanting to contribute more matters. Over the years I have done some analyzing and implementing of ridiculously complicated stuff in software with my small brain that I'd rather not go through again, and I'm sure most of you have.

A lot of us here are just hobbyists. Please don't treat us as though we are writers of aircraft control software who need to make their bones or wanna be developers of Linux file systems.

Please don't LMGTFY me/us - The direct links are the spice - LET THE SPICE FLOW.
Lazarus 3.0/FPC 3.2.2

440bx

  • Hero Member
  • *****
  • Posts: 4735
p.p.s (as 440bx might confirm), looking out for certain books, like the "Tomes of Delphi - core win32 api" and "graphical api" might help.
Yes, I definitely can confirm that.  Those would be good choices to learn about the Windows API and how it fits in the VCL framework (which would help seeing how it fits in the LCL too.)

Comes close to killing two birds with one stone.  (please purposely miss the birds... they are natural debuggers ;) )

(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Fred vS

  • Hero Member
  • *****
  • Posts: 3412
    • StrumPract is the musicians best friend
Hello.
For Windows and his GDI you may take a look at source of fpGUI or MSEgui project.
But for unixes (Linux, BSD and Mac), they use the "root" X11 interface without any dependencies to any widgetset.
« Last Edit: October 14, 2024, 08:11:16 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11941
  • FPC developer.
Hello.
For Windows and his GDI you may take a look at source of fpGUI or MSEgui project.
But for unixes (Linux, BSD and Mac), they use the "root" X11 interface without any dependencies to any widgetset.

... but in this Wayland future, X might be an additional dependency in the near future.

 

TinyPortal © 2005-2018