Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

comboboxtext and comboboxentry searching #43

Open
GoogleCodeExporter opened this issue May 19, 2015 · 3 comments
Open

comboboxtext and comboboxentry searching #43

GoogleCodeExporter opened this issue May 19, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

comboboxtext and comboboxentry searching.

Implemented in code and activated via a custom tag atttribute.

comboboxtext:
User presses a key, the next item that begins with that case insensitive char 
is selected and it'll wrap back to the first.

comboboxentry:
It can't be search-as-you-type because then the user would be trying to type 
something into the entry and the code would be attempting to set it to an item 
in the list, so the search code must be activated on Enter and it'll have to be 
done on the "activate" signal before the signal reaches the application. This 
could of course interfere with an <action signal="activate"> so the application 
developer is not going to want to use the both together.

Original issue reported on code.google.com by thunor...@hotmail.com on 14 Oct 2011 at 10:32

@GoogleCodeExporter
Copy link
Author

Greetings.

I wrote a small patch which implements the first half of this issue. That is, 
supporting basic search in comboboxtext lists. The custom attribute tag is 
"key-search".

A sample script that demonstrates it is:

export DIALOG="
<window>
<vbox>
 <comboboxtext key-search=\"true\">
 <sensitive>enabled</sensitive>
 <item>a</item>
 <item>b</item>
 <item>b</item>
 <item>c</item>
 <item>a</item>
 </comboboxtext>
  <button cancel></button>
</vbox>
</window>
"
gtkdialog -c --program=DIALOG

Pressing b will correctly iterate through the "b" options, likewise for "a".

I have one concern regarding the patch, though. Currently, it reads the 
attribute through get_tag_attribute(attr, "key-search"), but because tag_attr 
variables are not stored for callbacks, I had to invoke 
attributeset_set_if_unset to store it and ask for it in the callback with 
attributeset_is_avail. 

I admit just today I got familiar with the gtkdialog code, so I ask, is there a 
more polished way to do this? In any case, the patch does work, just maybe not 
in the most efficiently possible way.

Original comment by Walther...@gmail.com on 9 Feb 2012 at 3:13

Attachments:

@GoogleCodeExporter
Copy link
Author

Hi

Sorry for the delay in replying but my life's full of mundane things that waste 
my time at the moment :s

Many thanks for your patch :) I'll have a look at it and apply it when I get 
back into coding.

Regards,
Thunor

Original comment by thunor...@hotmail.com on 27 Feb 2012 at 2:05

@GoogleCodeExporter
Copy link
Author

When the comboboxtext widget is clicked or Enter is pressed resulting in the 
popup appearing, no events whatsoever are reported for the comboboxtext widget 
until the popup is closed, therefore I need to gain access to the popup as well 
so this isn't as straightforward as one might think.

http://developer.gnome.org/gtk/2.24/GtkComboBox.html#gtk-combo-box-get-popup-acc
essible

I'll have to come back to this.

Original comment by thunor...@hotmail.com on 28 Jul 2012 at 9:29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant