mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
67649763b6
We can use ::destroy in most cases.
39 lines
1011 B
C
39 lines
1011 B
C
#include <gtk/gtk.h>
|
|
|
|
int
|
|
main (int argc, char *argv[])
|
|
{
|
|
GtkWidget *window;
|
|
GtkWidget *box;
|
|
GtkWidget *child;
|
|
|
|
gtk_init ();
|
|
|
|
if (g_getenv ("RTL"))
|
|
gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL);
|
|
|
|
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
|
box = gtk_center_box_new ();
|
|
gtk_container_add (GTK_CONTAINER (window), box);
|
|
|
|
child = gtk_label_new ("Start Start Start Start Start");
|
|
gtk_label_set_ellipsize (GTK_LABEL (child), PANGO_ELLIPSIZE_END);
|
|
gtk_center_box_set_start_widget (GTK_CENTER_BOX (box), child);
|
|
|
|
child = gtk_label_new ("Center");
|
|
gtk_label_set_ellipsize (GTK_LABEL (child), PANGO_ELLIPSIZE_END);
|
|
gtk_center_box_set_center_widget (GTK_CENTER_BOX (box), child);
|
|
|
|
child = gtk_label_new ("End");
|
|
gtk_label_set_ellipsize (GTK_LABEL (child), PANGO_ELLIPSIZE_END);
|
|
gtk_center_box_set_end_widget (GTK_CENTER_BOX (box), child);
|
|
|
|
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
|
|
|
|
gtk_widget_show (window);
|
|
|
|
gtk_main ();
|
|
|
|
return 0;
|
|
}
|