bohonghuang / cl-gtk4

GTK4/Libadwaita/WebKit2 bindings for Common Lisp.
GNU Lesser General Public License v3.0
216 stars 9 forks source link

‘Bad FFI method name get_insert’ #17

Closed bradrn closed 1 year ago

bradrn commented 1 year ago

I’ve been trying to play around with adding markup tags to a GTK TextView using cl-gtk4, but have encountered a few issues with getting the appropriate TextIters for a user selection in CL. The obvious route would be to use get_selection_bounds, but as a relative newcomer to Common Lisp I’m unsure exactly how the two TextIter* arguments are represented in cl-gtk4; I thus decided to instead use get_insert and get_selection_bound, and then get the corresponding TextIter using get_iter_at_mark. Alas, trying to call gtk4:text-buffer-get-insert produces the following error:

Bad FFI method name get_insert
   [Condition of type SIMPLE-ERROR]
bohonghuang commented 1 year ago

Fixed in https://github.com/bohonghuang/cl-gobject-introspection-wrapper/commit/2d197cba7e7d734ac8a2e181e5e709e5b218bada and 2a8a09145fb0ebddc2cae88ee309d9813e4275af. You may need to install the cl-gtk4 and cl-gobject-introspection-wrapper manually into local-projects before they get updated in Ultralisp. Here is an example of TextView for your reference:

https://github.com/bohonghuang/cl-gtk4/blob/ae99571208f2e36fcfbe7918e4f9dca585adf884/examples/gtk4.lisp#L154-L185

text-view

bradrn commented 1 year ago

Thanks!