K
Kevin Redon
i'm trying to remove and add a widget to a container when an event
occur. removing and adding works outside the event, but only removing
works within
list = Gtk::ComboBox.new
list.signal_connect("changed") do
@options_list.each do |child|
@options_list.remove child
end
@options_list.pack_start_defaults(Gtk::Label.new("hello"))
# does only remove the label, but no new added
end
#~~~~~~~
# this works, the hello label is there
@options_list = Gtk::VBox.new(false,5)
@options_list.pack_start_defaults(Gtk::Label.new("hello"))
@options_list.each do |child|
@options_list.remove child
end
@options_list.pack_start_defaults(Gtk::Label.new("hello"))
occur. removing and adding works outside the event, but only removing
works within
list = Gtk::ComboBox.new
list.signal_connect("changed") do
@options_list.each do |child|
@options_list.remove child
end
@options_list.pack_start_defaults(Gtk::Label.new("hello"))
# does only remove the label, but no new added
end
#~~~~~~~
# this works, the hello label is there
@options_list = Gtk::VBox.new(false,5)
@options_list.pack_start_defaults(Gtk::Label.new("hello"))
@options_list.each do |child|
@options_list.remove child
end
@options_list.pack_start_defaults(Gtk::Label.new("hello"))