Recent

Author Topic: Proposing new widgetset: dwindows  (Read 9564 times)

s6nonqxt

  • Guest
Proposing new widgetset: dwindows
« on: December 11, 2022, 11:35:38 am »
It's too much a surprise for me to know LCL GTK1 widgetset is still maintained. The latest commit was from Feb 12, 2022. It's still alive and well maintained!  :o

This is the reason why I proposed dwindows widgetset. As for people has no idea about it, dwindows is a clone of GTK1. The API is almost the same, just rename gtk_ to dw_ and done  ;D

https://dbsoft.org/

dwindows could serve as a thin compatibility layer on top of GTK. It has full support for GTK4 now  8-)

The plus point is dwindows is much much simpler than GTK and doesn't change much as GTK  ::)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4474
  • I like bugs.
Re: Proposing new widgetset: dwindows
« Reply #1 on: December 11, 2022, 12:03:35 pm »
It's too much a surprise for me to know LCL GTK1 widgetset is still maintained. The latest commit was from Feb 12, 2022. It's still alive and well maintained!  :o
I am also surprised to see it has commits this year. No, it is not well maintained. Only random commits sometimes. There was a time it didn't even compile. Now it maybe does, I didn't check.

Quote
This is the reason why I proposed dwindows widgetset. As for people has no idea about it, dwindows is a clone of GTK1. The API is almost the same, just rename gtk_ to dw_ and done  ;D
https://dbsoft.org/
dwindows could serve as a thin compatibility layer on top of GTK. It has full support for GTK4 now  8-)
The plus point is dwindows is much much simpler than GTK and doesn't change much as GTK  ::)
If you provide a patch or Gitlab fork that implements it and promise to maintain it, I believe it could be added.
If you only ask other people to implement it, there is a very slim chance for it to happen. This is FOSS development.

There are serious issues with such a widgetset.
First, the LCL-GTK binding code is not very good. All development and bug fixes went into the GTK2 bindings already many many years ago.
Second, the actual GTK1 lib API is ancient and limited. Later versions of GTK libs are better.
But still, the old GTK1 and thus dwindows could fit some use cases. I am not against it.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6693
Re: Proposing new widgetset: dwindows
« Reply #2 on: December 11, 2022, 01:20:09 pm »
I am also surprised to see it has commits this year. No, it is not well maintained. Only random commits sometimes. There was a time it didn't even compile. Now it maybe does, I didn't check.

Thee and me both. I've just spent half a day investigating whether something I'm working on that has occasional problems will compile for GTK using 0.9.24+2.2.4 (eventually yes :-)

Under normal circumstances I'd promise to take a bit of a look at the current situation later, but I don't think I've got a Debian version active which has the v1 -dev package available and due to having upgraded my main system and not yet checking Docker out I'd rather not commit myself to running a VM etc... I suspect that I'd need to go back to something like "Lenny".

However from my POV this is extremely timely news, since it means that anywhere that I've just used an LCLGTK to distinguish "old style" resources etc. in a sourcefile needs to also be qualified by the compiler version.. and the sooner I do that the less painful it will be.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

s6nonqxt

  • Guest
Re: Proposing new widgetset: dwindows
« Reply #3 on: December 12, 2022, 02:56:07 am »
@All dwindows is a clone of GTK1 in the same sense as GNU/Linux is a clone of Unix. dwindows has a very similar API to GTK1 but is not identical (of course, I said just changing gtk_ to dw_ is a bit detached from the reality, sorry everyone :-[). What I really proposed is using dwindows as a thin compatibility layer on top of GTK. This way dwindows served the same purpose as what Qt4Pas for Qt 8)

Bonus: dwindows is a single library, it doesn't depend on other libraries like GTK (no ATK, no GDK, no GObject, GLib,...). It's much easier to deal with than vanilla GTK 8-)

Another point for dwindows is it supports iOS and Android too :-[

s6nonqxt

  • Guest
Re: Proposing new widgetset: dwindows
« Reply #4 on: December 12, 2022, 03:07:43 am »
dwindows consisted of only a single header: dw.h (you could forget about dwcompat.h as this header caused for problems that it worth and it only has meaning for C programmers), the soon the be released dwindows 3.4 will have full support for GTK4 and iOS and Android. The current is dwindows 3.3 (GTK4 support is just experimental with this version) :D

https://github.com/dbsoft/dwindows

dwindows API: https://dbsoft.org/dw_help.php

The GTK1.2 tut could be used as a reference :D

https://docs.huihoo.com/gtk/tutorial/1.2/index.html

s6nonqxt

  • Guest
Re: Proposing new widgetset: dwindows
« Reply #5 on: December 12, 2022, 03:12:04 am »
dwindows consisted of only a single header: dw.h (you could forget about dwcompat.h as this header caused for problems that it worth and it only has meaning for C programmers), the soon the be released dwindows 3.4 will have full support for GTK4 and iOS and Android. The current is dwindows 3.3 (GTK4 support is just experimental with this version) :D

https://github.com/dbsoft/dwindows

dwindows API: https://dbsoft.org/dw_help.php

The GTK1.2 tut could be used as a reference :D

https://docs.huihoo.com/gtk/tutorial/1.2/index.html

Something is wrong with my brain :( Corrected:

dwindows consisted of only a single header: dw.h (you could forget about dwcompat.h as this header caused more problems that it worth and it only has meanings for C programmers), the soon to be released dwindows 3.4 will have full support for GTK4 and iOS and Android. The current is dwindows 3.3 (GTK4 support is just experimental with this version) :D

dbannon

  • Hero Member
  • *****
  • Posts: 2802
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Proposing new widgetset: dwindows
« Reply #6 on: December 12, 2022, 03:30:21 am »
s6nonqxt, welcome to the forum, I see you are very new, great !  By the way, there is a 'Modify' link, top right of a message you post, easier to correct things than reposting the whole message.

I am not sure what you are suggesting here. Lets look at it from the end user point of view. Suppose I am a Linux user, I have just installed a 2023 release of Fedora and find it has not GTK2 (and obviously, no GTK1) but does have GTK3.

What do I need to install to get my 2023 Lazarus app that uses the dwindows widgetset to work ?  Just this one library you mention ? If so, sounds good to me (but that means nothing by the way).

OK, now I am a developer (stop s!ing people), when I work on that Lazarus and dwindow app, to I need to think about which widget set dwindows will ultimately choose to use ?  Or is that the dwindows developers problem ?

And the Lazarus Developers, the one who maintains the DWindow Widget Set in Lazarus. Does he/she need to understand the differences between GTK2/3/4 and, Lord help us, 5 ?

Davo

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

s6nonqxt

  • Guest
Re: Proposing new widgetset: dwindows
« Reply #7 on: December 12, 2022, 04:17:03 am »
s6nonqxt, welcome to the forum, I see you are very new, great !  By the way, there is a 'Modify' link, top right of a message you post, easier to correct things than reposting the whole message.

I am not sure what you are suggesting here. Lets look at it from the end user point of view. Suppose I am a Linux user, I have just installed a 2023 release of Fedora and find it has not GTK2 (and obviously, no GTK1) but does have GTK3.

What do I need to install to get my 2023 Lazarus app that uses the dwindows widgetset to work ?  Just this one library you mention ? If so, sounds good to me (but that means nothing by the way).

OK, now I am a developer (stop s!ing people), when I work on that Lazarus and dwindow app, to I need to think about which widget set dwindows will ultimately choose to use ?  Or is that the dwindows developers problem ?

And the Lazarus Developers, the one who maintains the DWindow Widget Set in Lazarus. Does he/she need to understand the differences between GTK2/3/4 and, Lord help us, 5 ?

Davo

Davo

Maybe new account is limited but I don't see any Modify button :'(

dwindows uses the native API of the system: on Windows is Win32 API, on Linux and Unix is GTK (which GTK version is used is depend on how you configured the dwindows library), on macOS is Cocoa and so on...

It's more or less like Qt4Pas. The LCL calls dwindows, dwindows calls the corresponding native API.

The procedure is the same as Qt4Pas. You will have to build and install dwindows. The LCL will only uses this dw.dll/dw.so/dw.dylib. dwindows' API is pretty much stable. New APIs will be added on new dwindows version, but old APIs are also kept. It's excellent backward compatibility.

You are the one distributed binary builds of Qt5Pas/Qt6Pas, you should know how it works.

s6nonqxt

  • Guest
Re: Proposing new widgetset: dwindows
« Reply #8 on: December 12, 2022, 04:23:19 am »
@All This proposal is my solution to the future of GTK support of Lazarus. My solution is: GTK changed too much and too fast, breaking compatibility. So it's better to use the small dwindows library as the compability layer. It will work with any future GTK versions. This proposal is to all Lazarus developers and the foundation, it's not about adding a new shiny widgetset but it's a way to deal with GTK support for Lazarus in the future. Please evaluation it. Thanks :D

dbannon

  • Hero Member
  • *****
  • Posts: 2802
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Proposing new widgetset: dwindows
« Reply #9 on: December 12, 2022, 06:44:37 am »
Maybe new account is limited but I don't see any Modify button :'(
Oh, I was not aware of that.

dwindows uses the native API of the system: on Windows is Win32 API, on Linux and Unix is GTK (which GTK version is used is depend on how you configured the dwindows library), on macOS is Cocoa and so on...
OK, thats pretty much what Lazarus claims. And, pretty obviously its a very big task. There is a team of active Lazarus developers and they find it hard, DWindows appears to have one developer and keeps up OK ? Wow ....

Honestly, it sounds very good, an answer to all my dreams etc but it also sounds too good to be true.  I googled around, no one using it. I have looked at the website, not one example project ?  I'd expect to see a few beginners projects, things that pop up a window with a close button (obviously in C) but nothing I can find.

It would be a steep learning curve building those initial Pascal bindings, if someone put that work in, you sure would hope Brian keeps on developing it. My old boss would say "beware of trusting in hero code" and he was occasionally right.

But it sure does look promising ....

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

af0815

  • Hero Member
  • *****
  • Posts: 1291
Re: Proposing new widgetset: dwindows
« Reply #10 on: December 12, 2022, 07:01:04 am »
OK, thats pretty much what Lazarus claims. And, pretty obviously its a very big task. There is a team of active Lazarus developers and they find it hard, DWindows appears to have one developer and keeps up OK ? Wow ....
To have only one Developer (or a very small team) can be dangerous. (we can see whats happen with MSE)

But in Lazarus there is the problem, if you have no maintainer for gtk3/4 you have also no maintainer for dwindows. This high-skill frameworks altogether have the sam problems - free resources. So it is nice to discuss about dwindows, but....

regards
Andreas

s6nonqxt

  • Guest
Re: Proposing new widgetset: dwindows
« Reply #11 on: December 12, 2022, 07:15:30 am »
Honestly, it sounds very good, an answer to all my dreams etc but it also sounds too good to be true.  I googled around, no one using it. I have looked at the website, not one example project ?  I'd expect to see a few beginners projects, things that pop up a window with a close button (obviously in C) but nothing I can find.

It would be a steep learning curve building those initial Pascal bindings, if someone put that work in, you sure would hope Brian keeps on developing it. My old boss would say "beware of trusting in hero code" and he was occasionally right.

But it sure does look promising ....

Davo

An all in one demo is right in dwindows' github repo: https://github.com/dbsoft/dwindows/blob/master/dwtest.c ;D

On https://dbsoft.org/ listed a bunch of dwindows based application. You could have a look at the source code :D

https://github.com/dbsoft/HandyFTP

https://github.com/dbsoft/DynamicMail

https://github.com/dbsoft/controlcenter

Bonus: dwindows has a GUI designer :-X

https://github.com/dbsoft/dwib

PierceNg

  • Sr. Member
  • ****
  • Posts: 374
    • SamadhiWeb
Re: Proposing new widgetset: dwindows
« Reply #12 on: December 12, 2022, 07:31:16 am »
An all in one demo is right in dwindows' github repo: https://github.com/dbsoft/dwindows/blob/master/dwtest.c ;D

Compiles easily enough on my Ubuntu 20.04 with GTK3. Demo looks good: Shows up in dark mode as per my system preference, and even embeds WebKitGTK like my fpwebview does.

Edit: Ditto on my macOS Catalina. Dark mode, embeds WebKit. The demo has no app menu, just a clickable menu a la menubar app.
« Last Edit: December 12, 2022, 07:41:17 am by PierceNg »

dbannon

  • Hero Member
  • *****
  • Posts: 2802
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Proposing new widgetset: dwindows
« Reply #13 on: December 12, 2022, 08:15:40 am »
Compiles easily enough on my Ubuntu 20.04 with GTK3.

Not on a clean Ubuntu 22.04, the configure script complains it cannot find gtk-config which was apparently a gtk(1) thing. Pierce, I guess you don't have GTK installed ?

I tried forcing something newer with --with-gtk2 and --with-gtk4 but same result.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

PierceNg

  • Sr. Member
  • ****
  • Posts: 374
    • SamadhiWeb
Re: Proposing new widgetset: dwindows
« Reply #14 on: December 12, 2022, 08:55:46 am »
Compiles easily enough on my Ubuntu 20.04 with GTK3.

Not on a clean Ubuntu 22.04, the configure script complains it cannot find gtk-config which was apparently a gtk(1) thing. Pierce, I guess you don't have GTK installed ?

AFAICT, I have GTK2 and GTK3, no GTK1 nor GTK4. There is no gtk-config program on my system.
« Last Edit: December 12, 2022, 08:58:09 am by PierceNg »

 

TinyPortal © 2005-2018