jverzani / gWidgets2

Rewrite of gWidgets
35 stars 9 forks source link

gcombobox(..., use_completion=TRUE) issues #61

Closed landroni closed 10 years ago

landroni commented 10 years ago

I'm having some trouble with the gcombobox(..., use_completion=TRUE) completion mechanism. Consider:

w <- gwindow()
cb <- gcombobox(letters, editable=TRUE, use_completion=TRUE, cont=ggroup(cont=w))

Does cb signal when a completion is available (i.e. say a is entered and the pop-up completion menu is activated) or not (i.e. say asdf is entered and the pop-up completion menu is NOT visible)?

Moreover, I'm unable to replicate the Gtk completion mechanism using grepl(). Is there a good reason to have two different completion mechanisms for gcomboboxgroup() search boxes and gcombobox(..., use_completion=TRUE) in gfilter.R?

landroni commented 10 years ago

For what it's worth, I learned how to replicate the Gtk completion mechanism:

substr(u_x, 1, nchar(val)) == val & grepl(val, u_x, fixed=TRUE)

But my other questions stand:

jverzani commented 10 years ago

I can't say for sure. I have a note in the file https://github.com/jverzani/gWidgets2RGtk2/blob/f6183e7bb4f695241377a39f7e743b66e373af2e/R/gcombobox.R#L140 that indicates I am working around something. Further down that file is the function add_completion. Perhaps the arguments passed along are different? I don't really have time to check right now.

landroni commented 10 years ago

I'm closing this for now. I seem to be able to work around with my ad-hoc searching method, and right now this approach works.