1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
#include <config.h>
#include <gtk/gtk.h>
#include <eel/eel-editable-label.h>
#if GTK_CHECK_VERSION (3, 0, 0)
#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
#endif
static void
quit (GtkWidget *widget, gpointer data)
{
gtk_main_quit ();
}
int
main (int argc, char* argv[])
{
GtkWidget *window;
GtkWidget *label;
GtkWidget *vbox;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (quit), NULL);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
label = eel_editable_label_new ("Centered dsau dsfgsdfgoydsfiugy oiusdyfg iouysdf goiuys dfioguy siodufgy iusdyfgiu ydsf giusydf gouiysdfgoiuysdfg oiudyfsg Label");
gtk_widget_set_size_request (label, 200, -1);
eel_editable_label_set_line_wrap (EEL_EDITABLE_LABEL (label), TRUE);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 4);
label = eel_editable_label_new ("Left aligned label");
#if GTK_CHECK_VERSION (3, 14, 0)
gtk_widget_set_halign (label, GTK_ALIGN_START);
#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
#endif
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 4);
label = eel_editable_label_new ("Right aligned label");
#if GTK_CHECK_VERSION (3, 14, 0)
gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
#else
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
#endif
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 4);
gtk_window_set_default_size (GTK_WINDOW (window), 300, 300);
gtk_widget_show_all (window);
gtk_main ();
return 0;
}
|