~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to examples/label/label.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-05-04 12:24:25 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20070504122425-0m8midgzrp40y8w2
Tags: 2.10.12-1ubuntu1
* Sync with Debian
* New upstream version:
  Fixed bugs:
  - 379414 file chooser warnings when changing path in the entry
  - 418585 GtkFileChooserDefault sizing code is not DPI independent
  - 419568 Crash in search if start with special letter
  - 435062 build dies with icon cache validation
  - 379399 Segfault to call gtk_print_operation_run twice.
  - 387889 cups backend has problems when there are too many printers
  - 418531 invalid read to gtkicontheme.c gtk_icon_theme_lookup_icon...
  - 423916 crash in color scheme code
  - 424042 Segmentation fault while quickly pressing Alt+arrows
  - 415260 Protect against negative indices when setting values in G...
  - 419171 XGetVisualInfo() may not set nxvisuals
  - 128852 Gdk cursors don't look good on win32
  - 344657 Ctrl-H doesn't toggle "Show Hidden Files" setting
  - 345345 PrintOperation::paginate is not emitted for class handler
  - 347567 GtkPrintOperation::end-print is not emitted if it's cance...
  - 369112 gtk_ui_manager_add_ui should accept unnamed separator
  - 392015 Selected menu item invisible on Windows Vista
  - 399253 MS-Windows Theme Bottom Tab placement rendering glitches
  - 399425 gtk_input_dialog_fill_axes() adds child to gtkscrolledwin...
  - 403251 [patch] little memory leak in GtkPrintJob
  - 403267 [patch] memory leak in GtkPageSetupUnixDialog
  - 403470 MS-Windows Theme tab placement other than on top leaks a ...
  - 404506 Windows system fonts that have multi-byte font names cann...
  - 405089 Incorrect window placement for GtkEventBox private window
  - 405515 Minor leak in gtkfilesystemmodel.c
  - 405539 gdk_pixbuf_save() for PNG saver can return FALSE without ...
  - 415681 gdk_window_clear_area includes an extra line and column o...
  - 418219 GtkRecentChooser should apply filter before sorting and c...
  - 418403 Scroll to printer after selecting it from settings
  - 421985 _gtk_print_operation_platform_backend_launch_preview
  - 421990 gtk_print_job_get_surface
  - 421993 gtk_print_operation_init
  - 423064 Conditional jump or move depends on uninitialised value(s...
  - 423722 Fix printing header in gtk-demo
  - 424168 gtk_print_operation_run on async preview
  - 425655 Don't install gtk+-unix-print-2.0.pc on non-UNIX platforms
  - 425786 GDK segfaults if XineramaQueryScreens fails
  - 428665 Lpr Backend gets stuck in infinite loop during gtk_enumer...
  - 429902 GtkPrintOperation leaks cairo contextes
  - 431997 First delay of GdkPixbufAnimationIter is wrong
  - 433242 Inconsistent scroll arrow position calculations
  - 433972 Placing gtk.Expander inside a gtk.TextView() changes gtk....
  - 434261 _gtk_toolbar_elide_underscores incorrectly handles some s...
  - 383354 ctrl-L should make 'Location' entry disappear
  - 418673 gtk_recent_manager_add_item
  - 429732 gtk_accel_group_finalize accesses invalid memory
  - 435028 WM_CLIENT_LEADER is wrong on the leader_window
  - 431067 Background of the header window is not updated
  - 338843 add recent files support inside the ui manager
  - 148535 add drop shadow to menus, tooltips, etc. under Windows XP
* debian/control.in:
  - Conflicts on ubuntulooks (<= 0.9.11-1)
* debian/patches/15_default-fallback-icon-theme.patch:
  - patch from Debian, fallback on gnome icon theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#include <gtk/gtk.h>
 
3
 
 
4
int main( int   argc,
 
5
          char *argv[] )
 
6
{
 
7
  static GtkWidget *window = NULL;
 
8
  GtkWidget *hbox;
 
9
  GtkWidget *vbox;
 
10
  GtkWidget *frame;
 
11
  GtkWidget *label;
 
12
 
 
13
  /* Initialise GTK */
 
14
  gtk_init (&argc, &argv);
 
15
 
 
16
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
17
  g_signal_connect (G_OBJECT (window), "destroy",
 
18
                    G_CALLBACK (gtk_main_quit),
 
19
                    NULL);
 
20
 
 
21
  gtk_window_set_title (GTK_WINDOW (window), "Label");
 
22
  vbox = gtk_vbox_new (FALSE, 5);
 
23
  hbox = gtk_hbox_new (FALSE, 5);
 
24
  gtk_container_add (GTK_CONTAINER (window), hbox);
 
25
  gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
 
26
  gtk_container_set_border_width (GTK_CONTAINER (window), 5);
 
27
  
 
28
  frame = gtk_frame_new ("Normal Label");
 
29
  label = gtk_label_new ("This is a Normal label");
 
30
  gtk_container_add (GTK_CONTAINER (frame), label);
 
31
  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
 
32
  
 
33
  frame = gtk_frame_new ("Multi-line Label");
 
34
  label = gtk_label_new ("This is a Multi-line label.\nSecond line\n" \
 
35
                         "Third line");
 
36
  gtk_container_add (GTK_CONTAINER (frame), label);
 
37
  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
 
38
  
 
39
  frame = gtk_frame_new ("Left Justified Label");
 
40
  label = gtk_label_new ("This is a Left-Justified\n" \
 
41
                         "Multi-line label.\nThird      line");
 
42
  gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
 
43
  gtk_container_add (GTK_CONTAINER (frame), label);
 
44
  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
 
45
  
 
46
  frame = gtk_frame_new ("Right Justified Label");
 
47
  label = gtk_label_new ("This is a Right-Justified\nMulti-line label.\n" \
 
48
                         "Fourth line, (j/k)");
 
49
  gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT);
 
50
  gtk_container_add (GTK_CONTAINER (frame), label);
 
51
  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
 
52
 
 
53
  vbox = gtk_vbox_new (FALSE, 5);
 
54
  gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
 
55
  frame = gtk_frame_new ("Line wrapped label");
 
56
  label = gtk_label_new ("This is an example of a line-wrapped label.  It " \
 
57
                         "should not be taking up the entire             " /* big space to test spacing */\
 
58
                         "width allocated to it, but automatically " \
 
59
                         "wraps the words to fit.  " \
 
60
                         "The time has come, for all good men, to come to " \
 
61
                         "the aid of their party.  " \
 
62
                         "The sixth sheik's six sheep's sick.\n" \
 
63
                         "     It supports multiple paragraphs correctly, " \
 
64
                         "and  correctly   adds "\
 
65
                         "many          extra  spaces. ");
 
66
  gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
 
67
  gtk_container_add (GTK_CONTAINER (frame), label);
 
68
  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
 
69
  
 
70
  frame = gtk_frame_new ("Filled, wrapped label");
 
71
  label = gtk_label_new ("This is an example of a line-wrapped, filled label.  " \
 
72
                         "It should be taking "\
 
73
                         "up the entire              width allocated to it.  " \
 
74
                         "Here is a sentence to prove "\
 
75
                         "my point.  Here is another sentence. "\
 
76
                         "Here comes the sun, do de do de do.\n"\
 
77
                         "    This is a new paragraph.\n"\
 
78
                         "    This is another newer, longer, better " \
 
79
                         "paragraph.  It is coming to an end, "\
 
80
                         "unfortunately.");
 
81
  gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_FILL);
 
82
  gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
 
83
  gtk_container_add (GTK_CONTAINER (frame), label);
 
84
  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
 
85
  
 
86
  frame = gtk_frame_new ("Underlined label");
 
87
  label = gtk_label_new ("This label is underlined!\n"
 
88
                         "This one is underlined in quite a funky fashion");
 
89
  gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
 
90
  gtk_label_set_pattern (GTK_LABEL (label),
 
91
                         "_________________________ _ _________ _ ______     __ _______ ___");
 
92
  gtk_container_add (GTK_CONTAINER (frame), label);
 
93
  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
 
94
  
 
95
  gtk_widget_show_all (window);
 
96
 
 
97
  gtk_main ();
 
98
  
 
99
  return 0;
 
100
}