Re: [Vala] Hiding MenuItems; was Gtk menus
- From: Frederik <scumm_fredo gmx net>
- To: vala-list <vala-list gnome org>
- Subject: Re: [Vala] Hiding MenuItems; was Gtk menus
- Date: Thu, 03 Dec 2009 23:04:09 +0100
Mark Dewey wrote:
Okay, here are a few things that don't behave as expected:
MenuItem.destroy();
Menu.remove(someMenuItem);
.remove() should work:
---------------------------------------------------------------------
using Gtk;
void main (string[] args) {
Gtk.init (ref args);
var window = new Window (WindowType.TOPLEVEL);
window.destroy.connect (Gtk.main_quit);
var menubar = new MenuBar ();
var file_menu = new Menu ();
var file_menu_item = new MenuItem.with_label ("File");
menubar.add (file_menu_item);
file_menu_item.set_submenu (file_menu);
var item = new MenuItem.with_label ("Some menu item");
file_menu.add (item);
var button = new Button.with_label ("Remove menu item");
button.clicked.connect (() => {
file_menu.remove (item);
});
var vbox = new VBox (false, 0);
vbox.pack_start (menubar, true, false, 0);
vbox.pack_start (button, true, false, 0);
window.add (vbox);
window.show_all ();
Gtk.main ();
}
---------------------------------------------------------------------
Best regards,
Frederik
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]