[Lazarus] Tools->Options segfaults with ancient gtk (GtkTreeView problem)

Juha Manninen juha.manninen62 at gmail.com
Wed Dec 7 18:57:52 CET 2016

On Wed, Dec 7, 2016 at 12:28 PM, Luca Olivetti via Lazarus
<lazarus at lists.lazarus-ide.org> wrote:
> Maybe the function could be simplified to
>         lisFocused:
>         begin
>           //gtk2 iter has no focus??
>           Path := gtk_tree_path_new_from_string(PChar(IntToStr(AIndex)));
>           if GTK_IS_TREE_VIEW(MainView) then
>             gtk_tree_view_set_cursor(PGtkTreeView(MainView), Path, nil,
> False)
>           else
>           if GTK_IS_ICON_VIEW(MainView) then
>             gtk_icon_view_set_cursor(PGtkIconView(MainView), Path, nil,
> False);
>           gtk_tree_path_free(Path);
>         end;

Yes, I believe so, too. LCL-GTK2 is full of historical remains. Many
of them come from GTK1 times, the sources were just copied. This piece
of code however was not from there.
According to documentation the API has not changed. Why should the
code be different?

> Should I file a bug report?

No need. I changed it in r53590. Please test.
If somebody finds an old GTK version where it does NOT work then we
will scratch our heads more, but I doubt it.


More information about the Lazarus mailing list