Forum: Ruby-Gnome 2 Unsetting the active item in a ComboBox

Posted by Bernie Schelberg (b_schelberg)
on 2010-06-08 08:14
Attachment: test-gtk.rb (250 Bytes)
Hi,
I want to unset the active item in a combobox, but setting active_iter
to nil is giving me an assertion failure. See the attached file for some
example code. When I run this script, I get the following:

(eval): line 1
   Gtk-CRITICAL **:gtk_tree_model_get_path: assertion `iter != NULL'
failed

The Ruby-Gnome doesn't say how to unset the active item. The GTK
documentation for gtk_combo_box_set_active_iter says:

... or unsets the active item if iter is NULL.

So I assumed that setting active_iter to nil would work in Ruby, but it
seems not.

Can anyone tell me how to unset the active item for a ComboBox?

Thanks,
Bernie
Posted by Mike Charlton (Guest)
on 2010-06-08 09:51
(Received via mailing list)
It works for me in the version that's with Ubuntu (0.19.3 I think).
You might also want to try active = -1  But it looks like a bug
in whatever version you have installed.

        MikeC

On 8 June 2010 15:14, Bernie Schelberg
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.