Hi All,
Hi All,
I’m a newbie at ruby GUI. I learning how to append a page in the
notebook on the fly by attaching a function to a button. The idea is to
add/delete a page everytime I press the button. By using this way, I
could delete a page in the notebook on the fly but I couldn’t add a page
in the notebook on the fly. Anybody know how to add the page in the
notebook on the fly? I didn’t receive any error message but I didn’t see
any new page added to the notebook.
Below are the methods that I used to remove/add page to the notebook:
def remove_book( button, notebook )
page = notebook.page
notebook.remove_page( page )
end
def add_book( button, notebook)
checkbutton = Gtk::Button.new( “Check me please!” )
label = Gtk::Label.new( “Add Page” )
notebook.insert_page( 2, checkbutton, label)
end
Thanks for your input.
fjimmy