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
on 2010-10-23 20:56
on 2010-10-26 19:38
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
on 2010-10-26 20:21
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
on 2011-03-13 00:34
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
(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
Log in with Google account | Log in with Yahoo account
No account? Register here.