Freeze in treeview

Hi.

I have a strange bug in a treview. It is quite hard to reproduce.
The code below can trigger it.
If you click on the Foo/Test menu entry the treeview freezes !
If you click on the Test button the treeview does not freeze.

Can you reproduce it ?
Is that something ruby-gnome2 can patch ?

require ‘gtk2’
mit=Gtk::MenuItem.new(“Test”)
menu=Gtk::Menu.new
menu.append(mit)
it=Gtk::MenuItem.new(“Foo”)
it.set_submenu(menu)
bar=Gtk::MenuBar.new
bar.append(it)
mit.signal_connect_after(‘activate’){it.remove_submenu}

store=Gtk::TreeStore.new(String)
iter=store.append(nil)
iter[0]=“0”
iter=store.append(iter)
iter[0]=“0.1”
iter=store.append(nil)
iter[0]=“1”
iter=store.append(iter)
iter[0]=“1.1”
col=Gtk::TreeViewColumn.new(“Col”, Gtk::CellRendererText.new, :text =>
0)
view=Gtk::TreeView.new(store)
view.append_column(col)

button=Gtk::Button.new(“Test”)
button.signal_connect(‘clicked’){it.remove_submenu}

b=Gtk::VBox.new
b.pack_start(bar)
b.pack_start(view)
b.pack_start(button)
w=Gtk::Window.new
w.add(b)
w.show_all
Gtk.main


Vincent C.

try this:

mit.signal_connect_after(‘activate’){|me| me.destroy}

On 10/23/2010 09:56 PM, Vincent C. wrote:

require ‘gtk2’
iter=store.append(nil)

Gtk.main


Dobai-Pataky B.

2010/10/26 Dobai-Pataky B. [email protected]:

try this:

mit.signal_connect_after(‘activate’){|me| me.destroy}

It does not freeze the treeeview (but it does not achieve my purpose :
to switch between to submenus).


Vincent C.

2010/10/23 Vincent C. [email protected]:

require ‘gtk2’
iter=store.append(nil)

Gtk.main


Vincent C.

I use mit.signal_connect(‘activate’){Glib::Idle.add{it.remove_submenu}}
to prevent the buggy behaviour.


Vincent C.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs