1 /* extendedlayoutexample.c
2 * Copyright (C) 2010 Openismus GmbH
5 * Tristan Van Berkom <tristan.van.berkom@gmail.com>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
28 const gchar *interface;
33 /* These strings were generated with:
35 * IFS=""; while read line; do echo -n \"; echo -n $line | sed -e 's|\"|\\"|g'; echo \"; done < file.glade
37 TestInterface interfaces[] = {
40 "Demonstrates how labels will request a natural size in a horizontal space",
42 " <requires lib=\"gtk+\" version=\"2.20\"/>"
43 " <!-- interface-naming-policy project-wide -->"
44 " <object class=\"GtkWindow\" id=\"window\">"
45 " <property name=\"default_width\">450</property>"
46 " <property name=\"default_height\">50</property>"
48 " <object class=\"GtkHBox\" id=\"hbox5\">"
49 " <property name=\"visible\">True</property>"
51 " <object class=\"GtkLabel\" id=\"label9\">"
52 " <property name=\"visible\">True</property>"
53 " <property name=\"label\" translatable=\"yes\">Some labels do ellipsize</property>"
54 " <property name=\"ellipsize\">end</property>"
56 " <attribute name=\"weight\" value=\"bold\"/>"
57 " <attribute name=\"foreground\" value=\"#09610feefe03\"/>"
61 " <property name=\"position\">0</property>"
65 " <object class=\"GtkLabel\" id=\"label10\">"
66 " <property name=\"visible\">True</property>"
67 " <property name=\"label\" translatable=\"yes\">but some</property>"
68 " <property name=\"ellipsize\">end</property>"
70 " <attribute name=\"weight\" value=\"bold\"/>"
71 " <attribute name=\"foreground\" value=\"#0000af6b0993\"/>"
75 " <property name=\"position\">1</property>"
79 " <object class=\"GtkLabel\" id=\"label11\">"
80 " <property name=\"visible\">True</property>"
81 " <property name=\"label\" translatable=\"yes\">do not at all</property>"
83 " <attribute name=\"style\" value=\"normal\"/>"
84 " <attribute name=\"weight\" value=\"bold\"/>"
85 " <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
89 " <property name=\"position\">2</property>"
101 "Demonstrates how a wrapping label can require a height contextual to its allocated width",
103 " <requires lib=\"gtk+\" version=\"2.18\"/>"
104 " <!-- interface-naming-policy project-wide -->"
105 " <object class=\"GtkWindow\" id=\"window\">"
106 " <property name=\"border_width\">12</property>"
107 " <property name=\"default_width\">300</property>"
109 " <object class=\"GtkHPaned\" id=\"hpaned1\">"
110 " <property name=\"visible\">True</property>"
111 " <property name=\"can_focus\">True</property>"
113 " <object class=\"GtkVBox\" id=\"vbox2\">"
114 " <property name=\"visible\">True</property>"
116 " <object class=\"GtkLabel\" id=\"label3\">"
117 " <property name=\"visible\">True</property>"
118 " <property name=\"label\" translatable=\"yes\">A short static label.</property>"
120 " <attribute name=\"weight\" value=\"bold\"/>"
124 " <property name=\"position\">0</property>"
128 " <object class=\"GtkFrame\" id=\"frame1\">"
129 " <property name=\"label\">Long label</property>"
130 " <property name=\"visible\">True</property>"
132 " <object class=\"GtkLabel\" id=\"label1\">"
133 " <property name=\"visible\">True</property>"
134 " <property name=\"label\" translatable=\"yes\">This is a really long label for the purpose of testing line wrapping is working correctly in conjunction with height-for-width support in GTK+</property>"
135 " <property name=\"wrap\">True</property>"
136 " <property name=\"max_width_chars\">30</property>"
138 " <attribute name=\"foreground\" value=\"#18c52119f796\"/>"
144 " <property name=\"expand\">False</property>"
145 " <property name=\"position\">1</property>"
149 " <object class=\"GtkButton\" id=\"button2\">"
150 " <property name=\"visible\">True</property>"
151 " <property name=\"can_focus\">True</property>"
152 " <property name=\"receives_default\">True</property>"
154 " <object class=\"GtkLabel\" id=\"label2\">"
155 " <property name=\"visible\">True</property>"
156 " <property name=\"label\" translatable=\"yes\">A really really long label inside a button to demonstrate height for width working inside buttons</property>"
157 " <property name=\"wrap\">True</property>"
158 " <property name=\"max_width_chars\">25</property>"
160 " <attribute name=\"foreground\" value=\"#1e3687ab0a52\"/>"
166 " <property name=\"expand\">False</property>"
167 " <property name=\"position\">2</property>"
172 " <property name=\"resize\">False</property>"
173 " <property name=\"shrink\">False</property>"
177 " <object class=\"GtkLabel\" id=\"label4\">"
178 " <property name=\"visible\">True</property>"
179 " <property name=\"label\" translatable=\"yes\">This static label\n"
180 "can shrink.</property>"
181 " <property name=\"justify\">center</property>"
183 " <attribute name=\"style\" value=\"normal\"/>"
184 " <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
188 " <property name=\"resize\">True</property>"
189 " <property name=\"shrink\">True</property>"
201 "Demonstrates how a horizontal box can calculate the collective height for an allocated width",
203 " <requires lib=\"gtk+\" version=\"2.20\"/>"
204 " <!-- interface-naming-policy project-wide -->"
205 " <object class=\"GtkWindow\" id=\"window\">"
206 " <property name=\"default_height\">200</property>"
207 " <property name=\"default_width\">600</property>"
209 " <object class=\"GtkHPaned\" id=\"hpaned1\">"
210 " <property name=\"visible\">True</property>"
211 " <property name=\"can_focus\">True</property>"
213 " <object class=\"GtkVBox\" id=\"vbox1\">"
214 " <property name=\"visible\">True</property>"
216 " <object class=\"GtkHBox\" id=\"hbox1\">"
217 " <property name=\"visible\">True</property>"
219 " <object class=\"GtkButton\" id=\"button1\">"
220 " <property name=\"visible\">True</property>"
221 " <property name=\"can_focus\">True</property>"
222 " <property name=\"receives_default\">True</property>"
223 " <property name=\"use_action_appearance\">False</property>"
225 " <object class=\"GtkLabel\" id=\"label2\">"
226 " <property name=\"visible\">True</property>"
227 " <property name=\"label\" translatable=\"yes\">A button that wraps.</property>"
228 " <property name=\"wrap\">True</property>"
229 " <property name=\"width_chars\">10</property>"
231 " <attribute name=\"foreground\" value=\"#0000041dffff\"/>"
237 " <property name=\"expand\">False</property>"
238 " <property name=\"position\">0</property>"
242 " <object class=\"GtkLabel\" id=\"label1\">"
243 " <property name=\"visible\">True</property>"
244 " <property name=\"label\" translatable=\"yes\">Lets try setting up some long text to wrap up in this hbox and see if the height-for-width is gonna work !</property>"
245 " <property name=\"wrap\">True</property>"
246 " <property name=\"width_chars\">30</property>"
248 " <attribute name=\"foreground\" value=\"#07d0a9b20972\"/>"
252 " <property name=\"position\">1</property>"
257 " <property name=\"expand\">False</property>"
258 " <property name=\"position\">0</property>"
262 " <object class=\"GtkButton\" id=\"button2\">"
263 " <property name=\"label\" translatable=\"yes\">A button that expands in the vbox</property>"
264 " <property name=\"visible\">True</property>"
265 " <property name=\"can_focus\">True</property>"
266 " <property name=\"receives_default\">True</property>"
267 " <property name=\"use_action_appearance\">False</property>"
270 " <property name=\"position\">1</property>"
275 " <property name=\"resize\">False</property>"
276 " <property name=\"shrink\">False</property>"
280 " <object class=\"GtkLabel\" id=\"label4\">"
281 " <property name=\"visible\">True</property>"
282 " <property name=\"label\" translatable=\"yes\">This label is\n"
283 "set to shrink inside\n"
284 "the paned window.</property>"
285 " <property name=\"justify\">center</property>"
287 " <attribute name=\"style\" value=\"normal\"/>"
288 " <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
292 " <property name=\"resize\">True</property>"
293 " <property name=\"shrink\">True</property>"
305 "Demonstrates how a horizontal box will consider width-for-height when allocating children "
306 "even if the toplevel window is requested as height-for-width.",
308 " <requires lib=\"gtk+\" version=\"2.20\"/>"
309 " <!-- interface-naming-policy project-wide -->"
310 " <object class=\"GtkWindow\" id=\"window\">"
311 " <property name=\"default_width\">400</property>"
312 " <property name=\"default_height\">300</property>"
314 " <object class=\"GtkVPaned\" id=\"vpaned1\">"
315 " <property name=\"visible\">True</property>"
316 " <property name=\"can_focus\">True</property>"
318 " <object class=\"GtkHBox\" id=\"hbox1\">"
319 " <property name=\"visible\">True</property>"
321 " <object class=\"GtkLabel\" id=\"label1\">"
322 " <property name=\"visible\">True</property>"
323 " <property name=\"label\" translatable=\"yes\">Some long width-for-height text that wraps</property>"
324 " <property name=\"justify\">center</property>"
325 " <property name=\"wrap\">True</property>"
326 " <property name=\"width_chars\">10</property>"
327 " <property name=\"angle\">90</property>"
329 " <attribute name=\"weight\" value=\"bold\"/>"
330 " <attribute name=\"foreground\" value=\"#03e307ddfb5f\"/>"
334 " <property name=\"expand\">False</property>"
335 " <property name=\"position\">0</property>"
339 " <object class=\"GtkFrame\" id=\"frame1\">"
340 " <property name=\"visible\">True</property>"
341 " <property name=\"label_xalign\">0</property>"
342 " <property name=\"shadow_type\">out</property>"
344 " <object class=\"GtkLabel\" id=\"label5\">"
345 " <property name=\"visible\">True</property>"
346 " <property name=\"label\" translatable=\"yes\">Neither of the panes are\n"
347 "set to shrink.</property>"
348 " <property name=\"justify\">center</property>"
350 " <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
354 " <child type=\"label_item\">"
359 " <property name=\"position\">1</property>"
364 " <property name=\"resize\">False</property>"
365 " <property name=\"shrink\">False</property>"
369 " <object class=\"GtkHBox\" id=\"hbox2\">"
370 " <property name=\"visible\">True</property>"
372 " <object class=\"GtkFrame\" id=\"frame2\">"
373 " <property name=\"visible\">True</property>"
374 " <property name=\"label_xalign\">0</property>"
375 " <property name=\"shadow_type\">out</property>"
377 " <object class=\"GtkLabel\" id=\"label4\">"
378 " <property name=\"visible\">True</property>"
379 " <property name=\"label\" translatable=\"yes\">The interface is allocated as height\n"
380 "for width, but the horizontal boxes\n"
381 "allocate in width for height mode.</property>"
383 " <attribute name=\"foreground\" value=\"#000097970808\"/>"
387 " <child type=\"label_item\">"
392 " <property name=\"position\">0</property>"
396 " <object class=\"GtkLabel\" id=\"label3\">"
397 " <property name=\"visible\">True</property>"
398 " <property name=\"label\" translatable=\"yes\">Some long width-for-height text that wraps</property>"
399 " <property name=\"justify\">center</property>"
400 " <property name=\"wrap\">True</property>"
401 " <property name=\"width_chars\">10</property>"
402 " <property name=\"angle\">270</property>"
404 " <attribute name=\"weight\" value=\"bold\"/>"
405 " <attribute name=\"foreground\" value=\"#03e307ddfb5f\"/>"
409 " <property name=\"expand\">False</property>"
410 " <property name=\"position\">1</property>"
415 " <property name=\"resize\">False</property>"
416 " <property name=\"shrink\">False</property>"
428 "This test demonstrates how \"width-chars\" and \"max-width-chars\" can be used "
429 "to effect minimum and natural widths in wrapping labels.",
431 " <requires lib=\"gtk+\" version=\"2.20\"/>"
432 " <!-- interface-naming-policy project-wide -->"
433 " <object class=\"GtkWindow\" id=\"window\">"
434 " <property name=\"default_width\">900</property>"
436 " <object class=\"GtkHPaned\" id=\"hpaned1\">"
437 " <property name=\"visible\">True</property>"
438 " <property name=\"can_focus\">True</property>"
440 " <object class=\"GtkVBox\" id=\"vbox1\">"
441 " <property name=\"visible\">True</property>"
443 " <object class=\"GtkHBox\" id=\"hbox1\">"
444 " <property name=\"visible\">True</property>"
445 " <property name=\"spacing\">6</property>"
447 " <object class=\"GtkLabel\" id=\"label1\">"
448 " <property name=\"visible\">True</property>"
449 " <property name=\"label\" translatable=\"yes\">The first 2 labels require 10 characters.</property>"
450 " <property name=\"wrap\">True</property>"
451 " <property name=\"width_chars\">10</property>"
453 " <attribute name=\"weight\" value=\"bold\"/>"
454 " <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
458 " <property name=\"expand\">False</property>"
459 " <property name=\"fill\">False</property>"
460 " <property name=\"position\">0</property>"
464 " <object class=\"GtkLabel\" id=\"label2\">"
465 " <property name=\"visible\">True</property>"
466 " <property name=\"label\" translatable=\"yes\">This label has a maximum natural width of 20 characters. The second two labels expand.</property>"
467 " <property name=\"wrap\">True</property>"
468 " <property name=\"width_chars\">10</property>"
469 " <property name=\"max_width_chars\">20</property>"
471 " <attribute name=\"weight\" value=\"bold\"/>"
472 " <attribute name=\"foreground\" value=\"#05c2a161134b\"/>"
476 " <property name=\"expand\">True</property>"
477 " <property name=\"fill\">True</property>"
478 " <property name=\"position\">1</property>"
482 " <object class=\"GtkLabel\" id=\"label3\">"
483 " <property name=\"visible\">True</property>"
484 " <property name=\"label\" translatable=\"yes\">This label requires a default minimum size.</property>"
485 " <property name=\"wrap\">True</property>"
487 " <attribute name=\"weight\" value=\"bold\"/>"
488 " <attribute name=\"foreground\" value=\"#03e30758fb5f\"/>"
492 " <property name=\"position\">2</property>"
497 " <property name=\"position\">0</property>"
501 " <object class=\"GtkLabel\" id=\"label4\">"
502 " <property name=\"visible\">True</property>"
503 " <property name=\"label\" translatable=\"yes\">This test demonstrates how the \"width-chars\" and \"max-width-chars\"\n"
504 "properties can be used to specify the minimum requested wrap width\n"
505 "and the maximum natural wrap width respectively.</property>"
506 " <property name=\"ellipsize\">end</property>"
507 " <property name=\"width_chars\">30</property>"
509 " <attribute name=\"style\" value=\"normal\"/>"
510 " <attribute name=\"foreground\" value=\"#05470000abaf\"/>"
514 " <property name=\"position\">1</property>"
519 " <property name=\"resize\">False</property>"
520 " <property name=\"shrink\">False</property>"
524 " <object class=\"GtkLabel\" id=\"label5\">"
525 " <property name=\"visible\">True</property>"
526 " <property name=\"label\" translatable=\"yes\">Some static\n"
527 "text that shrinks.\n"
529 "You will need to stretch\n"
530 "this window quite wide\n"
531 "to see the effects.</property>"
532 " <property name=\"justify\">center</property>"
534 " <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
538 " <property name=\"resize\">True</property>"
539 " <property name=\"shrink\">True</property>"
551 "This test demonstrates how the expander label can fill to its natural width "
552 "and also trade height for width.",
553 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
555 " <requires lib=\"gtk+\" version=\"2.20\"/>"
556 " <!-- interface-naming-policy project-wide -->"
557 " <object class=\"GtkWindow\" id=\"window\">"
558 " <property name=\"default_width\">500</property>"
560 " <object class=\"GtkHPaned\" id=\"hpaned1\">"
561 " <property name=\"visible\">True</property>"
562 " <property name=\"can_focus\">True</property>"
564 " <object class=\"GtkExpander\" id=\"expander1\">"
565 " <property name=\"visible\">True</property>"
566 " <property name=\"can_focus\">True</property>"
568 " <object class=\"GtkLabel\" id=\"label2\">"
569 " <property name=\"visible\">True</property>"
570 " <property name=\"label\" translatable=\"yes\">More wrapping text to fill the largish content area in the expander </property>"
571 " <property name=\"wrap\">True</property>"
572 " <property name=\"width_chars\">10</property>"
574 " <attribute name=\"weight\" value=\"bold\"/>"
575 " <attribute name=\"foreground\" value=\"#0000D0F00000\"/>"
579 " <child type=\"label\">"
580 " <object class=\"GtkLabel\" id=\"label1\">"
581 " <property name=\"visible\">True</property>"
582 " <property name=\"label\" translatable=\"yes\">Here is some expander text that wraps</property>"
583 " <property name=\"wrap\">True</property>"
584 " <property name=\"width_chars\">10</property>"
586 " <attribute name=\"weight\" value=\"bold\"/>"
587 " <attribute name=\"foreground\" value=\"blue\"/>"
593 " <property name=\"resize\">False</property>"
594 " <property name=\"shrink\">False</property>"
598 " <object class=\"GtkLabel\" id=\"label3\">"
599 " <property name=\"visible\">True</property>"
600 " <property name=\"label\" translatable=\"yes\">static\n"
604 " <attribute name=\"foreground\" value=\"red\"/>"
608 " <property name=\"resize\">True</property>"
609 " <property name=\"shrink\">True</property>"
620 "Wrapping Frame Label",
621 "This test demonstrates how the frame label can fill to its natural width "
622 "and also trade height for width.",
623 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
625 " <requires lib=\"gtk+\" version=\"2.20\"/>"
626 " <!-- interface-naming-policy project-wide -->"
627 " <object class=\"GtkWindow\" id=\"window\">"
628 " <property name=\"default_width\">400</property>"
629 " <property name=\"default_height\">150</property>"
631 " <object class=\"GtkFrame\" id=\"frame1\">"
632 " <property name=\"visible\">True</property>"
633 " <property name=\"border_width\">8</property>"
634 " <property name=\"label_xalign\">0</property>"
636 " <object class=\"GtkAlignment\" id=\"alignment1\">"
637 " <property name=\"visible\">True</property>"
638 " <property name=\"left_padding\">12</property>"
640 " <object class=\"GtkLabel\" id=\"label2\">"
641 " <property name=\"visible\">True</property>"
642 " <property name=\"label\" translatable=\"yes\">some content</property>"
647 " <child type=\"label\">"
648 " <object class=\"GtkLabel\" id=\"label1\">"
649 " <property name=\"visible\">True</property>"
650 " <property name=\"label\" translatable=\"yes\">A frame label that's a little long and wraps</property>"
651 " <property name=\"use_markup\">True</property>"
652 " <property name=\"wrap\">True</property>"
663 "Combo Boxes and Menus",
664 "This test shows wrapping and ellipsizing text in combo boxes (and consequently in menu items).",
665 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
667 " <requires lib=\"gtk+\" version=\"2.20\"/>"
668 " <!-- interface-naming-policy project-wide -->"
669 " <object class=\"GtkWindow\" id=\"window\">"
670 " <property name=\"border_width\">8</property>"
671 " <property name=\"default_width\">600</property>"
673 " <object class=\"GtkHPaned\" id=\"hpaned1\">"
674 " <property name=\"visible\">True</property>"
675 " <property name=\"can_focus\">True</property>"
677 " <object class=\"GtkVBox\" id=\"vbox1\">"
678 " <property name=\"visible\">True</property>"
679 " <property name=\"spacing\">5</property>"
681 " <object class=\"GtkHBox\" id=\"hbox1\">"
682 " <property name=\"visible\">True</property>"
683 " <property name=\"spacing\">5</property>"
685 " <object class=\"GtkLabel\" id=\"label1\">"
686 " <property name=\"visible\">True</property>"
687 " <property name=\"label\" translatable=\"yes\">this combo box</property>"
689 " <attribute name=\"weight\" value=\"bold\"/>"
690 " <attribute name=\"foreground\" value=\"#b3460000eb1c\"/>"
694 " <property name=\"expand\">True</property>"
695 " <property name=\"fill\">True</property>"
696 " <property name=\"position\">0</property>"
700 " <object class=\"GtkLabel\" id=\"label2\">"
701 " <property name=\"visible\">True</property>"
702 " <property name=\"label\" translatable=\"yes\">contains some wrapping locations</property>"
703 " <property name=\"ellipsize\">end</property>"
704 " <property name=\"width_chars\">10</property>"
706 " <attribute name=\"weight\" value=\"bold\"/>"
707 " <attribute name=\"foreground\" value=\"#b3460000eb1c\"/>"
711 " <property name=\"expand\">True</property>"
712 " <property name=\"fill\">True</property>"
713 " <property name=\"position\">1</property>"
717 " <object class=\"GtkComboBox\" id=\"combobox1\">"
718 " <property name=\"visible\">True</property>"
719 " <property name=\"model\">liststore1</property>"
720 " <property name=\"active\">0</property>"
722 " <object class=\"GtkCellRendererPixbuf\" id=\"cellrenderertext1\"/>"
724 " <attribute name=\"stock-id\">1</attribute>"
728 " <object class=\"GtkCellRendererText\" id=\"cellrenderertext2\">"
729 " <property name=\"foreground\">purple</property>"
730 " <property name=\"weight\">600</property>"
731 " <property name=\"wrap_mode\">word</property>"
732 " <property name=\"wrap_width\">100</property>"
735 " <attribute name=\"text\">0</attribute>"
740 " <property name=\"expand\">True</property>"
741 " <property name=\"fill\">True</property>"
742 " <property name=\"position\">2</property>"
747 " <property name=\"expand\">False</property>"
748 " <property name=\"fill\">True</property>"
749 " <property name=\"position\">0</property>"
753 " <object class=\"GtkFrame\" id=\"frame1\">"
754 " <property name=\"visible\">True</property>"
755 " <property name=\"label_xalign\">0</property>"
757 " <object class=\"GtkLabel\" id=\"label3\">"
758 " <property name=\"visible\">True</property>"
759 " <property name=\"label\" translatable=\"yes\">This test shows combo boxes\n"
760 "requesting and allocating space\n"
761 "for its backing content using\n"
762 "height-for-width geometry\n"
765 "Note this test also demonstrates\n"
766 "height-for-width menu items.</property>"
767 " <property name=\"justify\">center</property>"
769 " <attribute name=\"weight\" value=\"bold\"/>"
770 " <attribute name=\"foreground\" value=\"#00000000ffff\"/>"
776 " <property name=\"expand\">True</property>"
777 " <property name=\"fill\">True</property>"
778 " <property name=\"position\">1</property>"
782 " <object class=\"GtkHBox\" id=\"hbox2\">"
783 " <property name=\"visible\">True</property>"
784 " <property name=\"spacing\">5</property>"
786 " <object class=\"GtkLabel\" id=\"label4\">"
787 " <property name=\"visible\">True</property>"
788 " <property name=\"label\" translatable=\"yes\">this combo box</property>"
790 " <attribute name=\"weight\" value=\"bold\"/>"
791 " <attribute name=\"foreground\" value=\"#ffffa5a50000\"/>"
795 " <property name=\"expand\">True</property>"
796 " <property name=\"fill\">True</property>"
797 " <property name=\"position\">0</property>"
801 " <object class=\"GtkLabel\" id=\"label5\">"
802 " <property name=\"visible\">True</property>"
803 " <property name=\"label\" translatable=\"yes\">contains some ellipsizing locations</property>"
804 " <property name=\"ellipsize\">end</property>"
805 " <property name=\"width_chars\">10</property>"
807 " <attribute name=\"weight\" value=\"bold\"/>"
808 " <attribute name=\"foreground\" value=\"#ffffa5a50000\"/>"
812 " <property name=\"expand\">True</property>"
813 " <property name=\"fill\">True</property>"
814 " <property name=\"position\">1</property>"
818 " <object class=\"GtkComboBox\" id=\"combobox2\">"
819 " <property name=\"visible\">True</property>"
820 " <property name=\"model\">liststore1</property>"
821 " <property name=\"active\">0</property>"
823 " <object class=\"GtkCellRendererPixbuf\" id=\"cellrenderertext3\"/>"
825 " <attribute name=\"stock-id\">1</attribute>"
829 " <object class=\"GtkCellRendererText\" id=\"cellrenderertext4\">"
830 " <property name=\"ellipsize\">end</property>"
831 " <property name=\"foreground\">orange</property>"
832 " <property name=\"weight\">600</property>"
833 " <property name=\"width_chars\">10</property>"
836 " <attribute name=\"text\">0</attribute>"
841 " <property name=\"expand\">True</property>"
842 " <property name=\"fill\">True</property>"
843 " <property name=\"position\">2</property>"
848 " <property name=\"expand\">False</property>"
849 " <property name=\"fill\">True</property>"
850 " <property name=\"position\">2</property>"
855 " <property name=\"resize\">True</property>"
856 " <property name=\"shrink\">False</property>"
860 " <object class=\"GtkLabel\" id=\"label6\">"
861 " <property name=\"visible\">True</property>"
862 " <property name=\"label\" translatable=\"yes\">Some static\n"
864 "that shrinks.</property>"
865 " <property name=\"justify\">center</property>"
867 " <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
871 " <property name=\"resize\">False</property>"
872 " <property name=\"shrink\">True</property>"
878 " <object class=\"GtkListStore\" id=\"liststore1\">"
880 " <!-- column-name item-text -->"
881 " <column type=\"gchararray\"/>"
882 " <!-- column-name icon-name -->"
883 " <column type=\"gchararray\"/>"
887 " <col id=\"0\" translatable=\"yes\">Montreal, Quebec Canada</col>"
888 " <col id=\"1\" translatable=\"yes\">gtk-yes</col>"
891 " <col id=\"0\" translatable=\"yes\">Sao Paulo, SP Brazil</col>"
892 " <col id=\"1\" translatable=\"yes\">gtk-no</col>"
895 " <col id=\"0\" translatable=\"yes\">Buenos Aires, Argentina</col>"
896 " <col id=\"1\" translatable=\"yes\">gtk-stop</col>"
899 " <col id=\"0\" translatable=\"yes\">Los Angelos, California USA</col>"
900 " <col id=\"1\" translatable=\"yes\">gtk-media-record</col>"
903 " <col id=\"0\" translatable=\"yes\">Rio de Janeiro, RJ Brazil</col>"
904 " <col id=\"1\" translatable=\"yes\">gtk-dialog-error</col>"
907 " <col id=\"0\" translatable=\"yes\">Seoul, South Korea</col>"
908 " <col id=\"1\" translatable=\"yes\">gtk-info</col>"
920 test_clicked (GtkWidget *button,
921 TestInterface *interface)
923 if (!interface->window)
925 GtkBuilder *builder = gtk_builder_new ();
927 gtk_builder_add_from_string (builder, interface->interface, -1, NULL);
928 interface->window = (GtkWidget *)gtk_builder_get_object (builder, "window");
930 g_signal_connect (interface->window, "delete_event",
931 G_CALLBACK (gtk_widget_hide_on_delete), NULL);
934 gtk_widget_show (interface->window);
941 GtkWidget *window, *vbox, *button;
944 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
945 vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
947 gtk_container_set_border_width (GTK_CONTAINER (window), 8);
949 gtk_widget_show (vbox);
950 gtk_container_add (GTK_CONTAINER (window), vbox);
952 for (i = 0; i < G_N_ELEMENTS (interfaces); i++)
954 button = gtk_button_new_with_label (interfaces[i].name);
956 gtk_widget_set_tooltip_text (button, interfaces[i].tooltip);
958 g_signal_connect (G_OBJECT (button), "clicked",
959 G_CALLBACK (test_clicked), &interfaces[i]);
961 gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
962 gtk_widget_show (button);
971 main (int argc, char *argv[])
975 gtk_init (&argc, &argv);
977 window = create_window ();
979 g_signal_connect (window, "delete-event",
980 G_CALLBACK (gtk_main_quit), window);
982 gtk_widget_show (window);