# Separator (Vala)

Tiffany Antopolski
tiffany.antopolski@gmail.com 2013
Un élément graphique séparateur
Luc Rebert,
traduc@rebert.name 2011
Alain Lojewski,
allomervan@gmail.com 2011-2012
Luc Pionchon
pionchon.luc@gmail.com 2011
Bruno Brouard
annoa.b@gmail.com 2011-12
Luis Menina
liberforce@freeside.fr 2014

# Séparateur

Un séparateur horizontal et un vertical séparent quelques étiquettes.

# Code utilisé pour générer cet exemple

/* This is the application. */ public class Application : Gtk.Application {

public Application () { Object (application_id: "org.example.window"); }

/* Override the 'activate' signal of GLib.Application, * which is inherited by Gtk.Application. */ public override void activate () {

var window = new Gtk.Window (); window.title = "Separator Example";

var label1 = new Gtk.Label ("Below, a horizontal separator."); var label2 = new Gtk.Label ("On the right, a vertical separator."); var label3 = new Gtk.Label ("On the left, a vertical separator.");

var hseparator = new Gtk.Separator (Gtk.Orientation.HORIZONTAL); var vseparator = new Gtk.Separator (Gtk.Orientation.VERTICAL);

var grid = new Gtk.Grid();

grid.attach (label1, 0, 0, 3, 1); grid.attach (hseparator, 0, 1, 3, 1); grid.attach (label2, 0, 2, 1, 1); grid.attach (vseparator, 1, 2, 1, 1); grid.attach (label3, 2, 2, 1, 1);

grid.set_column_homogeneous(true);

window.add (grid); this.add_window (window);

window.show_all (); } }

/* The main function creates the application and runs it.*/ int main (string[] args) { var app = new Application (); return app.run (args); }

# Référence API

Dans cet exemple, les éléments suivants sont utilisés :

GtkApplication

GtkWindow

GtkSeparator

GtkGrid

GtkLabel