Hello,
I am the lead developer of the Energy framework, which is a full set of API libraries for Golang based on the Laz LCL component library's encapsulation.
At present, I have encountered some issues while encapsulating the components.
Under Linux GTK3, because I need the functionality of Gtk3, which I know is still in the beta-testing stage and not yet perfected.
Currently under Gtk3, when encapsulating Dialog-related components, I found that they do not work normally. These include components (TSelectDirectoryDialog, TOpenDialog, TSaveDialog), and there may be others.
The problem occurs when executing the Execute function, and during the Debug tracking, an error appeared at "TGtk3WSOpenDialog.CreateHandle(const ACommonDialog: TCommonDialog): THandle;".
It occurred during the call to CreateOpenDialogHistory and CreateOpenDialogFilter.
Solution: I found that these functions used "virtual" modifier. After removing the "virtual" modifier, it can run normally.
I am not clear why the removal of the "virtual" modifier allows it to run normally. I am not sufficiently knowledgeable in this area.
Here is the code snippet:
TGtk3WSOpenDialog = class(TWSOpenDialog)
protected
class function CreateOpenDialogFilter(OpenDialog: TOpenDialog; Chooser: PGtkFileChooser): string;// virtual;
class procedure CreateOpenDialogHistory(OpenDialog: TOpenDialog; SelWidget: PGtkWidget);// virtual;
class procedure CreatePreviewDialogControl(PreviewDialog: TPreviewFileDialog; Chooser: PGtkFileChooser);// virtual;
published
class function CreateHandle(const ACommonDialog: TCommonDialog): THandle; override;
end;
Lazarus: 3.2
System: ubuntu 22
Energy Open source address:
https://github.com/energye/energy