SeparatorMenuItem


Object Hierarchy:

Gtk.SeparatorMenuItem Gtk.SeparatorMenuItem Gtk.SeparatorMenuItem Gtk.MenuItem Gtk.MenuItem Gtk.MenuItem->Gtk.SeparatorMenuItem Gtk.Bin Gtk.Bin Gtk.Bin->Gtk.MenuItem Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Gtk.Widget Gtk.Widget Gtk.Widget->Gtk.Container GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Atk.Implementor Atk.Implementor Atk.Implementor->Gtk.SeparatorMenuItem Atk.Implementor->Gtk.MenuItem Atk.Implementor->Gtk.Bin Atk.Implementor->Gtk.Container Atk.Implementor->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Gtk.SeparatorMenuItem Gtk.Buildable->Gtk.MenuItem Gtk.Buildable->Gtk.Bin Gtk.Buildable->Gtk.Container Gtk.Buildable->Gtk.Widget Gtk.Actionable Gtk.Actionable Gtk.Actionable->Gtk.SeparatorMenuItem Gtk.Actionable->Gtk.MenuItem Gtk.Activatable Gtk.Activatable Gtk.Activatable->Gtk.SeparatorMenuItem Gtk.Activatable->Gtk.MenuItem

Description:

[ CCode ( type_id = "gtk_separator_menu_item_get_type ()" ) ]
public class SeparatorMenuItem : MenuItem, Implementor, Actionable, Activatable, Buildable

The SeparatorMenuItem is a separator used to group items within a menu.

It displays a horizontal line with a shadow to make it appear sunken into the interface.

CSS nodes

GtkSeparatorMenuItem has a single CSS node with name separator.

Example: SeparatorMenuItem:

public class Application : Gtk.Window {
public Application () {
// Prepare Gtk.Window:
this.title = "My Gtk.SeparatorMenuItem";
this.window_position = Gtk.WindowPosition.CENTER;
this.destroy.connect (Gtk.main_quit);

// MenuBar:
Gtk.MenuBar bar = new Gtk.MenuBar ();
this.add (bar);

// File:
Gtk.MenuItem item_file = new Gtk.MenuItem.with_label ("File");
bar.add (item_file);

Gtk.Menu filemenu = new Gtk.Menu ();
item_file.set_submenu (filemenu);

Gtk.MenuItem item_open = new Gtk.MenuItem.with_label ("Open");
filemenu.add (item_open);

Gtk.SeparatorMenuItem separator = new Gtk.SeparatorMenuItem ();
filemenu.add (separator);

Gtk.MenuItem item_exit = new Gtk.MenuItem.with_label ("Exit");
item_exit.activate.connect (Gtk.main_quit);
filemenu.add (item_exit);
}

public static int main (string[] args) {
Gtk.init (ref args);

Application app = new Application ();
app.show_all ();
Gtk.main ();
return 0;
}
}

valac --pkg gtk+-3.0 Gtk.SeparatorMenuItem.vala


Namespace: Gtk
Package: gtk+-3.0

Content:

Creation methods:

Inherited Members:

All known members inherited from class Gtk.Bin
All known members inherited from class Gtk.Widget
All known members inherited from interface Atk.Implementor