Closed mkelley closed 1 month ago
Hi @mkelley, you are correct: the easiest thing is to add a new type to make_widget
. I've pushed a commit to main
to add the type "comboboxedit". Can you verify that this gives you the capability that you want?
(sorry for late reply)
Note that when you get the callback for setting a custom value in the editable combobox, the index you receive will not correspond to any of the known items in the list. The value can be extracted with w.get_text()
(where w
is the first of two parameters in the widget callback (widget, index)).
Thanks! I've implemented it and tested with GTK and QT5 and it works as advertised.
I'm using the
Widgets.build_info
tool in a reference viewer local plugin and would like to add an editableComboBox
, but it doesn't seem to be easily done.make_widget
cannot pass initialization options toComboBox
(or anything else), and replacing or re-initializing the widgets in thebuild_info
return objects does not update the widget drawn in the reference viewer.Perhaps
make_widget
could be updated with a new wtype "editablecombobox"? Or is there another solution? In the meantime, I can make a separate textentry and add items to the combobox.