Closed rgri closed 1 month ago
Edit: As a workaround, it seems that
(gobj:coerce (drop-down-model dropdown) 'string-list)
will return the original:model
argument, i.e.stringlist
. Similarly you can coerce thedrop-down-selected-item
to'string-object
.
Yes, this is the correct approach, but also a limitation, where the subtype information of the object returned from the GIR function will be lost. The same approach applies: if you use (setf gtk:window-child)
to set the child of gtk:window
, but when you call (gtk:window-child)
on it, the object type you receive is only gtk:widget
. In this case, you also need to use gobj:coerce
to convert it back to its original type, which is the purpose of my adding that function to cl-glib
.
Ok, well I guess this resolves the issue. Thanks. It seems like they even do something similar for the Nim bindings example I linked in my issue.
Hi, I cannot figure out how to get the value of a string corresponding to the currently selected item of a drop-down:
Reading the gnome forums it seems I should expect
string-object-string
to work, but I getSimilarly, the last line in my example code seems to break in some inscrutable way.
Edit: As a workaround, it seems that
(gobj:coerce (drop-down-model dropdown) 'string-list)
will return the original:model
argument, i.e.stringlist
. Similarly you can coerce thedrop-down-selected-item
to'string-object
.