# Unsetting the active item in a ComboBox

**URL:** <https://www.ruby-forum.com/t/unsetting-the-active-item-in-a-combobox/189810>\
**Category:** Ruby-Gnome 2\
**Created:** [June 8, 2010, 8:14am UTC](https://www.ruby-forum.com/t/unsetting-the-active-item-in-a-combobox/189810 "2010-06-08T08:14:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![b\_schelberg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/7cd45c/32.png) [@b\_schelberg](https://www.ruby-forum.com/u/b_schelberg)\
**Post date:** [June 8, 2010, 8:14am UTC](https://www.ruby-forum.com/t/unsetting-the-active-item-in-a-combobox/189810/1 "2010-06-08T08:14:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![b\_schelberg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/7cd45c/32.png) [@b\_schelberg](https://www.ruby-forum.com/u/b_schelberg)\
**Post date:** [June 8, 2010, 9:51am UTC](https://www.ruby-forum.com/t/unsetting-the-active-item-in-a-combobox/189810/2 "2010-06-08T09:51:53Z")

</div>

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
