Lazarus

Programming => Widgetset => GTK => Topic started by: El Salvador on April 25, 2021, 07:20:12 pm

Title: gdk_x11_window_get_xid and GDK_WINDOW_XID in GDK3 pascal bindings
Post by: El Salvador on April 25, 2021, 07:20:12 pm
Hello everyone,

I wanted to implement global hotkeys in GTK3, but I noticed that the required GDK_WINDOW_XID and gdk_x11_window_get_xid methods are not available in GDK3 pascal bindings in Lazarus. Why? Is there any valid reason (other than lack of time or resources)?
Title: Re: gdk_x11_window_get_xid and GDK_WINDOW_XID in GDK3 pascal bindings
Post by: zeljko on April 25, 2021, 07:21:35 pm
Is it in official gdk3 ? gtk3 is started from some version of gtk3, it is possible that it wasn't there when I created LCLGtk3.
Title: Re: gdk_x11_window_get_xid and GDK_WINDOW_XID in GDK3 pascal bindings
Post by: El Salvador on April 25, 2021, 08:00:30 pm
I didn't look. gdk_x11_window_get_xid (https://developer.gnome.org/gdk3/stable/gdk3-X-Window-System-Interaction.html#gdk-x11-window-get-xid) should be present from version 3.4. While GDK_WINDOW_XID (https://developer.gnome.org/gdk3/stable/gdk3-X-Window-System-Interaction.html#GDK-WINDOW-XID:CAPS) I don't know.
Title: Re: gdk_x11_window_get_xid and GDK_WINDOW_XID in GDK3 pascal bindings
Post by: zeljko on April 27, 2021, 01:31:12 pm
Gtk3 bindings are autocreated by gir2pascal, and it looks like there's no platform specific translations like gdk_x11_window_get_xid() or similar.
They can be added manually into new eg LazGdk3X11 unit.
Title: Re: gdk_x11_window_get_xid and GDK_WINDOW_XID in GDK3 pascal bindings
Post by: El Salvador on April 27, 2021, 05:11:24 pm
I looked at it yesterday and make a LazGdk3X11 unit with gir2pascal, using GTK3.22 gir files (from https://github.com/gtk-rs/gir-files) and extracted the methods I needed for my project.

But I'd rather create a new unit to put it in Lazarus. But I would like to do it by keeping the same version of the other units (3.8.6) and not mixing.
Title: Re: gdk_x11_window_get_xid and GDK_WINDOW_XID in GDK3 pascal bindings
Post by: zeljko on April 29, 2021, 02:56:09 pm
In that case it LazGdk3X11 should be extracted from 3.8.6, not from 3.22
TinyPortal © 2005-2018