Hopefully this is an easy question to answer! I am trying to use GtkEntryCompletion (a la the example here) but while this code works I can’t seem to get the GtkEntry to present the autocomplete results when I set the text of the field programatically. What I am trying to accomplish is a semi pre-filled text entry that is already presenting the user with some autocomplete options.
To set the text I have tried using the functions gtk_entry_set_text(…), gtk_entry_buffer_insert_text(…) and even gtk_entry_buffer_emit_inserted_text(…) but to no avail. Is there a way to do this in such a way as to act like regular user input and display the suggestions?
I think you need to call gtk_entry_completion_complete after setting the text.
EDIT
Sorry @Tylter, but wow, this is way more difficult than I imagined. The only way I can figure out how to do it is to actually send the keypress event to the window.
EDIT 2
Are you using a GtkDialog for your pop-up? I coded this up really quick and it seems to work. Here you would be creating the dialog in a button click event:
The only gotcha I saw with this is that your must show the dialog window before sending the keypress event.