Forum: Ruby-Gnome 2 freeze in treeview

C4a836af7263f84a4f7cc91ed6f3ae77?d=identicon&s=25 Vincent Carmona (vinc-mai)
on 2010-10-23 20:56
(Received via mailing list)
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 Carmona
8e6374c0ef7b66942f34798e31edf014?d=identicon&s=25 "Dobai-Pataky Bálint" <dpblnt@gmail.com> (Guest)
on 2010-10-26 19:38
(Received via mailing list)
try this:

mit.signal_connect_after('activate'){|me| me.destroy}



On 10/23/2010 09:56 PM, Vincent Carmona wrote:
> require 'gtk2'
> iter=store.append(nil)
>
> Gtk.main
>

--
Dobai-Pataky Balint
C4a836af7263f84a4f7cc91ed6f3ae77?d=identicon&s=25 Vincent Carmona (vinc-mai)
on 2010-10-26 20:21
(Received via mailing list)
2010/10/26 Dobai-Pataky Blint <dpblnt@gmail.com>:
> 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 Carmona
C4a836af7263f84a4f7cc91ed6f3ae77?d=identicon&s=25 Vincent Carmona (vinc-mai)
on 2011-03-13 00:34
(Received via mailing list)
2010/10/23 Vincent Carmona <vinc4mai@gmail.com>:
> require 'gtk2'
> iter=store.append(nil)
>
> Gtk.main
>
> --
> Vincent Carmona
>

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

--
Vincent Carmona
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.