[Lazarus] More Gtk3 Status

Anthony Walter sysrpl at gmail.com
Thu Jul 21 07:55:07 CEST 2022


After some research, I found a few more serious issues with Gtk3. I will
not bother filing bugs as the issues seem too ingrained to the
implementation.

Here are some problems:

1) TGtkWidget makes custom drawing an inaccessible private field value that
cannot be set. What this means is that only certain predefined widgets
(with enumerated contents) in Gtk3Widgets.pas are allowed to receive paint
handling events.

2) The CreateWidget virtual method of TGtkWidget is designed to create an
underlying Gtk3 widget instance. But the design makes
brings inheritance problems, as you cannot make use of the inherited
CreateWidget implementation if you want a different widget type. For
example, a TCustomControl backed by a Gtk.DrawingArea.

3) TGtkWidget is defined as having a "property Widget: PGtkWidget".
PGtkWidget is ^TGtkWidget. TGtkWidget is not a TGtkWidget. Ridiculous.

4) There are a reduplication of header file translations, and they are each
incomplete in their own different ways. There is LazGtk3.pas and Gtk3.pas,
LazGdk3.pas and Gdk3, Pango and LazPango1. The latter names in the list are
duplicates to the lclgtk3 widgetset and are incomplete and different from
the former named units.

5) Colors are not being handled correctly with the Gtk3 implementation. I
don't know how many I have found where clWindowText is not being correctly
translated to a valid RGB (ColorToRGB). For example on my system theme
clWindowText is near white, but with lots of code parts of this Gtk3
implementation it's translated to near black because no RGB translations
are being made.

6) All drawing is being handled by cairo on Gtk3 and drawing on a parent
control (a Form for example) can change the drawing state in a child
control (TPaintBox for example). If I invalidate a form and draw using a
transform, the paintbox drawing is automatically transformed. There are
cairo functions to preserve the state, but they are not being used
correclty in the Gtk3 widgetset implementation.

7) There are lots of other problems.

I completed a couple of tasks related
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20220721/e826fc1c/attachment.htm>


More information about the lazarus mailing list