2017-06-03 13:08:44 +00:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2020-02-10 03:24:47 +00:00
|
|
|
static void
|
|
|
|
quit_cb (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gboolean *done = data;
|
|
|
|
|
|
|
|
*done = TRUE;
|
|
|
|
|
|
|
|
g_main_context_wakeup (NULL);
|
|
|
|
}
|
|
|
|
|
2017-06-03 13:08:44 +00:00
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
|
|
|
{
|
|
|
|
GtkWidget *window;
|
|
|
|
GtkWidget *box;
|
|
|
|
GtkWidget *child;
|
2020-02-10 03:24:47 +00:00
|
|
|
gboolean done = FALSE;
|
2017-06-03 13:08:44 +00:00
|
|
|
|
|
|
|
gtk_init ();
|
|
|
|
|
|
|
|
if (g_getenv ("RTL"))
|
|
|
|
gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL);
|
|
|
|
|
2020-02-14 19:55:36 +00:00
|
|
|
window = gtk_window_new ();
|
2017-06-03 13:08:44 +00:00
|
|
|
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);
|
|
|
|
|
2020-02-10 03:24:47 +00:00
|
|
|
g_signal_connect (window, "destroy", G_CALLBACK (quit_cb), &done);
|
2017-09-01 17:35:30 +00:00
|
|
|
|
2017-06-03 13:08:44 +00:00
|
|
|
gtk_widget_show (window);
|
|
|
|
|
2020-02-10 03:24:47 +00:00
|
|
|
while (!done)
|
|
|
|
g_main_context_iteration (NULL, TRUE);
|
2017-06-03 13:08:44 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|