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, see <http://www.gnu.org/licenses/>.
26 const gchar *interface;
31 /* These strings were generated with:
33 * IFS=""; while read line; do echo -n \"; echo -n $line | sed -e 's|\"|\\"|g'; echo \"; done < file.glade
35 TestInterface interfaces[] = {
38 "Demonstrates how labels will request a natural size in a horizontal space",
40 " <requires lib=\"gtk+\" version=\"2.20\"/>"
41 " <!-- interface-naming-policy project-wide -->"
42 " <object class=\"GtkWindow\" id=\"window\">"
43 " <property name=\"default_width\">450</property>"
44 " <property name=\"default_height\">50</property>"
46 " <object class=\"GtkHBox\" id=\"hbox5\">"
47 " <property name=\"visible\">True</property>"
49 " <object class=\"GtkLabel\" id=\"label9\">"
50 " <property name=\"visible\">True</property>"
51 " <property name=\"label\" translatable=\"yes\">Some labels do ellipsize</property>"
52 " <property name=\"ellipsize\">end</property>"
54 " <attribute name=\"weight\" value=\"bold\"/>"
55 " <attribute name=\"foreground\" value=\"#09610feefe03\"/>"
59 " <property name=\"position\">0</property>"
63 " <object class=\"GtkLabel\" id=\"label10\">"
64 " <property name=\"visible\">True</property>"
65 " <property name=\"label\" translatable=\"yes\">but some</property>"
66 " <property name=\"ellipsize\">end</property>"
68 " <attribute name=\"weight\" value=\"bold\"/>"
69 " <attribute name=\"foreground\" value=\"#0000af6b0993\"/>"
73 " <property name=\"position\">1</property>"
77 " <object class=\"GtkLabel\" id=\"label11\">"
78 " <property name=\"visible\">True</property>"
79 " <property name=\"label\" translatable=\"yes\">do not at all</property>"
81 " <attribute name=\"style\" value=\"normal\"/>"
82 " <attribute name=\"weight\" value=\"bold\"/>"
83 " <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
87 " <property name=\"position\">2</property>"
99 "Demonstrates how a wrapping label can require a height contextual to its allocated width",
101 " <requires lib=\"gtk+\" version=\"2.18\"/>"
102 " <!-- interface-naming-policy project-wide -->"
103 " <object class=\"GtkWindow\" id=\"window\">"
104 " <property name=\"border_width\">12</property>"
105 " <property name=\"default_width\">300</property>"
107 " <object class=\"GtkHPaned\" id=\"hpaned1\">"
108 " <property name=\"visible\">True</property>"
109 " <property name=\"can_focus\">True</property>"
111 " <object class=\"GtkVBox\" id=\"vbox2\">"
112 " <property name=\"visible\">True</property>"
114 " <object class=\"GtkLabel\" id=\"label3\">"
115 " <property name=\"visible\">True</property>"
116 " <property name=\"label\" translatable=\"yes\">A short static label.</property>"
118 " <attribute name=\"weight\" value=\"bold\"/>"
122 " <property name=\"position\">0</property>"
126 " <object class=\"GtkFrame\" id=\"frame1\">"
127 " <property name=\"label\">Long label</property>"
128 " <property name=\"visible\">True</property>"
130 " <object class=\"GtkLabel\" id=\"label1\">"
131 " <property name=\"visible\">True</property>"
132 " <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>"
133 " <property name=\"wrap\">True</property>"
134 " <property name=\"max_width_chars\">30</property>"
136 " <attribute name=\"foreground\" value=\"#18c52119f796\"/>"
142 " <property name=\"expand\">False</property>"
143 " <property name=\"position\">1</property>"
147 " <object class=\"GtkButton\" id=\"button2\">"
148 " <property name=\"visible\">True</property>"
149 " <property name=\"can_focus\">True</property>"
150 " <property name=\"receives_default\">True</property>"
152 " <object class=\"GtkLabel\" id=\"label2\">"
153 " <property name=\"visible\">True</property>"
154 " <property name=\"label\" translatable=\"yes\">A really really long label inside a button to demonstrate height for width working inside buttons</property>"
155 " <property name=\"wrap\">True</property>"
156 " <property name=\"max_width_chars\">25</property>"
158 " <attribute name=\"foreground\" value=\"#1e3687ab0a52\"/>"
164 " <property name=\"expand\">False</property>"
165 " <property name=\"position\">2</property>"
170 " <property name=\"resize\">False</property>"
171 " <property name=\"shrink\">False</property>"
175 " <object class=\"GtkLabel\" id=\"label4\">"
176 " <property name=\"visible\">True</property>"
177 " <property name=\"label\" translatable=\"yes\">This static label\n"
178 "can shrink.</property>"
179 " <property name=\"justify\">center</property>"
181 " <attribute name=\"style\" value=\"normal\"/>"
182 " <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
186 " <property name=\"resize\">True</property>"
187 " <property name=\"shrink\">True</property>"
199 "Demonstrates how a horizontal box can calculate the collective height for an allocated width",
201 " <requires lib=\"gtk+\" version=\"2.20\"/>"
202 " <!-- interface-naming-policy project-wide -->"
203 " <object class=\"GtkWindow\" id=\"window\">"
204 " <property name=\"default_height\">200</property>"
205 " <property name=\"default_width\">600</property>"
207 " <object class=\"GtkHPaned\" id=\"hpaned1\">"
208 " <property name=\"visible\">True</property>"
209 " <property name=\"can_focus\">True</property>"
211 " <object class=\"GtkVBox\" id=\"vbox1\">"
212 " <property name=\"visible\">True</property>"
214 " <object class=\"GtkHBox\" id=\"hbox1\">"
215 " <property name=\"visible\">True</property>"
217 " <object class=\"GtkButton\" id=\"button1\">"
218 " <property name=\"visible\">True</property>"
219 " <property name=\"can_focus\">True</property>"
220 " <property name=\"receives_default\">True</property>"
221 " <property name=\"use_action_appearance\">False</property>"
223 " <object class=\"GtkLabel\" id=\"label2\">"
224 " <property name=\"visible\">True</property>"
225 " <property name=\"label\" translatable=\"yes\">A button that wraps.</property>"
226 " <property name=\"wrap\">True</property>"
227 " <property name=\"width_chars\">10</property>"
229 " <attribute name=\"foreground\" value=\"#0000041dffff\"/>"
235 " <property name=\"expand\">False</property>"
236 " <property name=\"position\">0</property>"
240 " <object class=\"GtkLabel\" id=\"label1\">"
241 " <property name=\"visible\">True</property>"
242 " <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>"
243 " <property name=\"wrap\">True</property>"
244 " <property name=\"width_chars\">30</property>"
246 " <attribute name=\"foreground\" value=\"#07d0a9b20972\"/>"
250 " <property name=\"position\">1</property>"
255 " <property name=\"expand\">False</property>"
256 " <property name=\"position\">0</property>"
260 " <object class=\"GtkButton\" id=\"button2\">"
261 " <property name=\"label\" translatable=\"yes\">A button that expands in the vbox</property>"
262 " <property name=\"visible\">True</property>"
263 " <property name=\"can_focus\">True</property>"
264 " <property name=\"receives_default\">True</property>"
265 " <property name=\"use_action_appearance\">False</property>"
268 " <property name=\"position\">1</property>"
273 " <property name=\"resize\">False</property>"
274 " <property name=\"shrink\">False</property>"
278 " <object class=\"GtkLabel\" id=\"label4\">"
279 " <property name=\"visible\">True</property>"
280 " <property name=\"label\" translatable=\"yes\">This label is\n"
281 "set to shrink inside\n"
282 "the paned window.</property>"
283 " <property name=\"justify\">center</property>"
285 " <attribute name=\"style\" value=\"normal\"/>"
286 " <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
290 " <property name=\"resize\">True</property>"
291 " <property name=\"shrink\">True</property>"
303 "Demonstrates how a horizontal box will consider width-for-height when allocating children "
304 "even if the toplevel window is requested as height-for-width.",
306 " <requires lib=\"gtk+\" version=\"2.20\"/>"
307 " <!-- interface-naming-policy project-wide -->"
308 " <object class=\"GtkWindow\" id=\"window\">"
309 " <property name=\"default_width\">400</property>"
310 " <property name=\"default_height\">300</property>"
312 " <object class=\"GtkVPaned\" id=\"vpaned1\">"
313 " <property name=\"visible\">True</property>"
314 " <property name=\"can_focus\">True</property>"
316 " <object class=\"GtkHBox\" id=\"hbox1\">"
317 " <property name=\"visible\">True</property>"
319 " <object class=\"GtkLabel\" id=\"label1\">"
320 " <property name=\"visible\">True</property>"
321 " <property name=\"label\" translatable=\"yes\">Some long width-for-height text that wraps</property>"
322 " <property name=\"justify\">center</property>"
323 " <property name=\"wrap\">True</property>"
324 " <property name=\"width_chars\">10</property>"
325 " <property name=\"angle\">90</property>"
327 " <attribute name=\"weight\" value=\"bold\"/>"
328 " <attribute name=\"foreground\" value=\"#03e307ddfb5f\"/>"
332 " <property name=\"expand\">False</property>"
333 " <property name=\"position\">0</property>"
337 " <object class=\"GtkFrame\" id=\"frame1\">"
338 " <property name=\"visible\">True</property>"
339 " <property name=\"label_xalign\">0</property>"
340 " <property name=\"shadow_type\">out</property>"
342 " <object class=\"GtkLabel\" id=\"label5\">"
343 " <property name=\"visible\">True</property>"
344 " <property name=\"label\" translatable=\"yes\">Neither of the panes are\n"
345 "set to shrink.</property>"
346 " <property name=\"justify\">center</property>"
348 " <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
352 " <child type=\"label_item\">"
357 " <property name=\"position\">1</property>"
362 " <property name=\"resize\">False</property>"
363 " <property name=\"shrink\">False</property>"
367 " <object class=\"GtkHBox\" id=\"hbox2\">"
368 " <property name=\"visible\">True</property>"
370 " <object class=\"GtkFrame\" id=\"frame2\">"
371 " <property name=\"visible\">True</property>"
372 " <property name=\"label_xalign\">0</property>"
373 " <property name=\"shadow_type\">out</property>"
375 " <object class=\"GtkLabel\" id=\"label4\">"
376 " <property name=\"visible\">True</property>"
377 " <property name=\"label\" translatable=\"yes\">The interface is allocated as height\n"
378 "for width, but the horizontal boxes\n"
379 "allocate in width for height mode.</property>"
381 " <attribute name=\"foreground\" value=\"#000097970808\"/>"
385 " <child type=\"label_item\">"
390 " <property name=\"position\">0</property>"
394 " <object class=\"GtkLabel\" id=\"label3\">"
395 " <property name=\"visible\">True</property>"
396 " <property name=\"label\" translatable=\"yes\">Some long width-for-height text that wraps</property>"
397 " <property name=\"justify\">center</property>"
398 " <property name=\"wrap\">True</property>"
399 " <property name=\"width_chars\">10</property>"
400 " <property name=\"angle\">270</property>"
402 " <attribute name=\"weight\" value=\"bold\"/>"
403 " <attribute name=\"foreground\" value=\"#03e307ddfb5f\"/>"
407 " <property name=\"expand\">False</property>"
408 " <property name=\"position\">1</property>"
413 " <property name=\"resize\">False</property>"
414 " <property name=\"shrink\">False</property>"
426 "This test demonstrates how \"width-chars\" and \"max-width-chars\" can be used "
427 "to effect minimum and natural widths in wrapping labels.",
429 " <requires lib=\"gtk+\" version=\"2.20\"/>"
430 " <!-- interface-naming-policy project-wide -->"
431 " <object class=\"GtkWindow\" id=\"window\">"
432 " <property name=\"default_width\">900</property>"
434 " <object class=\"GtkHPaned\" id=\"hpaned1\">"
435 " <property name=\"visible\">True</property>"
436 " <property name=\"can_focus\">True</property>"
438 " <object class=\"GtkVBox\" id=\"vbox1\">"
439 " <property name=\"visible\">True</property>"
441 " <object class=\"GtkHBox\" id=\"hbox1\">"
442 " <property name=\"visible\">True</property>"
443 " <property name=\"spacing\">6</property>"
445 " <object class=\"GtkLabel\" id=\"label1\">"
446 " <property name=\"visible\">True</property>"
447 " <property name=\"label\" translatable=\"yes\">The first 2 labels require 10 characters.</property>"
448 " <property name=\"wrap\">True</property>"
449 " <property name=\"width_chars\">10</property>"
451 " <attribute name=\"weight\" value=\"bold\"/>"
452 " <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
456 " <property name=\"expand\">False</property>"
457 " <property name=\"fill\">False</property>"
458 " <property name=\"position\">0</property>"
462 " <object class=\"GtkLabel\" id=\"label2\">"
463 " <property name=\"visible\">True</property>"
464 " <property name=\"label\" translatable=\"yes\">This label has a maximum natural width of 20 characters. The second two labels expand.</property>"
465 " <property name=\"wrap\">True</property>"
466 " <property name=\"width_chars\">10</property>"
467 " <property name=\"max_width_chars\">20</property>"
469 " <attribute name=\"weight\" value=\"bold\"/>"
470 " <attribute name=\"foreground\" value=\"#05c2a161134b\"/>"
474 " <property name=\"expand\">True</property>"
475 " <property name=\"fill\">True</property>"
476 " <property name=\"position\">1</property>"
480 " <object class=\"GtkLabel\" id=\"label3\">"
481 " <property name=\"visible\">True</property>"
482 " <property name=\"label\" translatable=\"yes\">This label requires a default minimum size.</property>"
483 " <property name=\"wrap\">True</property>"
485 " <attribute name=\"weight\" value=\"bold\"/>"
486 " <attribute name=\"foreground\" value=\"#03e30758fb5f\"/>"
490 " <property name=\"position\">2</property>"
495 " <property name=\"position\">0</property>"
499 " <object class=\"GtkLabel\" id=\"label4\">"
500 " <property name=\"visible\">True</property>"
501 " <property name=\"label\" translatable=\"yes\">This test demonstrates how the \"width-chars\" and \"max-width-chars\"\n"
502 "properties can be used to specify the minimum requested wrap width\n"
503 "and the maximum natural wrap width respectively.</property>"
504 " <property name=\"ellipsize\">end</property>"
505 " <property name=\"width_chars\">30</property>"
507 " <attribute name=\"style\" value=\"normal\"/>"
508 " <attribute name=\"foreground\" value=\"#05470000abaf\"/>"
512 " <property name=\"position\">1</property>"
517 " <property name=\"resize\">False</property>"
518 " <property name=\"shrink\">False</property>"
522 " <object class=\"GtkLabel\" id=\"label5\">"
523 " <property name=\"visible\">True</property>"
524 " <property name=\"label\" translatable=\"yes\">Some static\n"
525 "text that shrinks.\n"
527 "You will need to stretch\n"
528 "this window quite wide\n"
529 "to see the effects.</property>"
530 " <property name=\"justify\">center</property>"
532 " <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
536 " <property name=\"resize\">True</property>"
537 " <property name=\"shrink\">True</property>"
549 "This test demonstrates how the expander label can fill to its natural width "
550 "and also trade height for width.",
551 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
553 " <requires lib=\"gtk+\" version=\"2.20\"/>"
554 " <!-- interface-naming-policy project-wide -->"
555 " <object class=\"GtkWindow\" id=\"window\">"
556 " <property name=\"default_width\">500</property>"
558 " <object class=\"GtkHPaned\" id=\"hpaned1\">"
559 " <property name=\"visible\">True</property>"
560 " <property name=\"can_focus\">True</property>"
562 " <object class=\"GtkExpander\" id=\"expander1\">"
563 " <property name=\"visible\">True</property>"
564 " <property name=\"can_focus\">True</property>"
566 " <object class=\"GtkLabel\" id=\"label2\">"
567 " <property name=\"visible\">True</property>"
568 " <property name=\"label\" translatable=\"yes\">More wrapping text to fill the largish content area in the expander </property>"
569 " <property name=\"wrap\">True</property>"
570 " <property name=\"width_chars\">10</property>"
572 " <attribute name=\"weight\" value=\"bold\"/>"
573 " <attribute name=\"foreground\" value=\"#0000D0F00000\"/>"
577 " <child type=\"label\">"
578 " <object class=\"GtkLabel\" id=\"label1\">"
579 " <property name=\"visible\">True</property>"
580 " <property name=\"label\" translatable=\"yes\">Here is some expander text that wraps</property>"
581 " <property name=\"wrap\">True</property>"
582 " <property name=\"width_chars\">10</property>"
584 " <attribute name=\"weight\" value=\"bold\"/>"
585 " <attribute name=\"foreground\" value=\"blue\"/>"
591 " <property name=\"resize\">False</property>"
592 " <property name=\"shrink\">False</property>"
596 " <object class=\"GtkLabel\" id=\"label3\">"
597 " <property name=\"visible\">True</property>"
598 " <property name=\"label\" translatable=\"yes\">static\n"
602 " <attribute name=\"foreground\" value=\"red\"/>"
606 " <property name=\"resize\">True</property>"
607 " <property name=\"shrink\">True</property>"
618 "Wrapping Frame Label",
619 "This test demonstrates how the frame label can fill to its natural width "
620 "and also trade height for width.",
621 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
623 " <requires lib=\"gtk+\" version=\"2.20\"/>"
624 " <!-- interface-naming-policy project-wide -->"
625 " <object class=\"GtkWindow\" id=\"window\">"
626 " <property name=\"default_width\">400</property>"
627 " <property name=\"default_height\">150</property>"
629 " <object class=\"GtkFrame\" id=\"frame1\">"
630 " <property name=\"visible\">True</property>"
631 " <property name=\"border_width\">8</property>"
632 " <property name=\"label_xalign\">0</property>"
634 " <object class=\"GtkAlignment\" id=\"alignment1\">"
635 " <property name=\"visible\">True</property>"
636 " <property name=\"left_padding\">12</property>"
638 " <object class=\"GtkLabel\" id=\"label2\">"
639 " <property name=\"visible\">True</property>"
640 " <property name=\"label\" translatable=\"yes\">some content</property>"
645 " <child type=\"label\">"
646 " <object class=\"GtkLabel\" id=\"label1\">"
647 " <property name=\"visible\">True</property>"
648 " <property name=\"label\" translatable=\"yes\">A frame label that's a little long and wraps</property>"
649 " <property name=\"use_markup\">True</property>"
650 " <property name=\"wrap\">True</property>"
661 "Combo Boxes and Menus",
662 "This test shows wrapping and ellipsizing text in combo boxes (and consequently in menu items).",
663 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
665 " <requires lib=\"gtk+\" version=\"2.20\"/>"
666 " <!-- interface-naming-policy project-wide -->"
667 " <object class=\"GtkWindow\" id=\"window\">"
668 " <property name=\"border_width\">8</property>"
669 " <property name=\"default_width\">600</property>"
671 " <object class=\"GtkHPaned\" id=\"hpaned1\">"
672 " <property name=\"visible\">True</property>"
673 " <property name=\"can_focus\">True</property>"
675 " <object class=\"GtkVBox\" id=\"vbox1\">"
676 " <property name=\"visible\">True</property>"
677 " <property name=\"spacing\">5</property>"
679 " <object class=\"GtkHBox\" id=\"hbox1\">"
680 " <property name=\"visible\">True</property>"
681 " <property name=\"spacing\">5</property>"
683 " <object class=\"GtkLabel\" id=\"label1\">"
684 " <property name=\"visible\">True</property>"
685 " <property name=\"label\" translatable=\"yes\">this combo box</property>"
687 " <attribute name=\"weight\" value=\"bold\"/>"
688 " <attribute name=\"foreground\" value=\"#b3460000eb1c\"/>"
692 " <property name=\"expand\">True</property>"
693 " <property name=\"fill\">True</property>"
694 " <property name=\"position\">0</property>"
698 " <object class=\"GtkLabel\" id=\"label2\">"
699 " <property name=\"visible\">True</property>"
700 " <property name=\"label\" translatable=\"yes\">contains some wrapping locations</property>"
701 " <property name=\"ellipsize\">end</property>"
702 " <property name=\"width_chars\">10</property>"
704 " <attribute name=\"weight\" value=\"bold\"/>"
705 " <attribute name=\"foreground\" value=\"#b3460000eb1c\"/>"
709 " <property name=\"expand\">True</property>"
710 " <property name=\"fill\">True</property>"
711 " <property name=\"position\">1</property>"
715 " <object class=\"GtkComboBox\" id=\"combobox1\">"
716 " <property name=\"visible\">True</property>"
717 " <property name=\"model\">liststore1</property>"
718 " <property name=\"active\">0</property>"
720 " <object class=\"GtkCellRendererPixbuf\" id=\"cellrenderertext1\"/>"
722 " <attribute name=\"stock-id\">1</attribute>"
726 " <object class=\"GtkCellRendererText\" id=\"cellrenderertext2\">"
727 " <property name=\"foreground\">purple</property>"
728 " <property name=\"weight\">600</property>"
729 " <property name=\"wrap_mode\">word</property>"
730 " <property name=\"wrap_width\">100</property>"
733 " <attribute name=\"text\">0</attribute>"
738 " <property name=\"expand\">True</property>"
739 " <property name=\"fill\">True</property>"
740 " <property name=\"position\">2</property>"
745 " <property name=\"expand\">False</property>"
746 " <property name=\"fill\">True</property>"
747 " <property name=\"position\">0</property>"
751 " <object class=\"GtkFrame\" id=\"frame1\">"
752 " <property name=\"visible\">True</property>"
753 " <property name=\"label_xalign\">0</property>"
755 " <object class=\"GtkLabel\" id=\"label3\">"
756 " <property name=\"visible\">True</property>"
757 " <property name=\"label\" translatable=\"yes\">This test shows combo boxes\n"
758 "requesting and allocating space\n"
759 "for its backing content using\n"
760 "height-for-width geometry\n"
763 "Note this test also demonstrates\n"
764 "height-for-width menu items.</property>"
765 " <property name=\"justify\">center</property>"
767 " <attribute name=\"weight\" value=\"bold\"/>"
768 " <attribute name=\"foreground\" value=\"#00000000ffff\"/>"
774 " <property name=\"expand\">True</property>"
775 " <property name=\"fill\">True</property>"
776 " <property name=\"position\">1</property>"
780 " <object class=\"GtkHBox\" id=\"hbox2\">"
781 " <property name=\"visible\">True</property>"
782 " <property name=\"spacing\">5</property>"
784 " <object class=\"GtkLabel\" id=\"label4\">"
785 " <property name=\"visible\">True</property>"
786 " <property name=\"label\" translatable=\"yes\">this combo box</property>"
788 " <attribute name=\"weight\" value=\"bold\"/>"
789 " <attribute name=\"foreground\" value=\"#ffffa5a50000\"/>"
793 " <property name=\"expand\">True</property>"
794 " <property name=\"fill\">True</property>"
795 " <property name=\"position\">0</property>"
799 " <object class=\"GtkLabel\" id=\"label5\">"
800 " <property name=\"visible\">True</property>"
801 " <property name=\"label\" translatable=\"yes\">contains some ellipsizing locations</property>"
802 " <property name=\"ellipsize\">end</property>"
803 " <property name=\"width_chars\">10</property>"
805 " <attribute name=\"weight\" value=\"bold\"/>"
806 " <attribute name=\"foreground\" value=\"#ffffa5a50000\"/>"
810 " <property name=\"expand\">True</property>"
811 " <property name=\"fill\">True</property>"
812 " <property name=\"position\">1</property>"
816 " <object class=\"GtkComboBox\" id=\"combobox2\">"
817 " <property name=\"visible\">True</property>"
818 " <property name=\"model\">liststore1</property>"
819 " <property name=\"active\">0</property>"
821 " <object class=\"GtkCellRendererPixbuf\" id=\"cellrenderertext3\"/>"
823 " <attribute name=\"stock-id\">1</attribute>"
827 " <object class=\"GtkCellRendererText\" id=\"cellrenderertext4\">"
828 " <property name=\"ellipsize\">end</property>"
829 " <property name=\"foreground\">orange</property>"
830 " <property name=\"weight\">600</property>"
831 " <property name=\"width_chars\">10</property>"
834 " <attribute name=\"text\">0</attribute>"
839 " <property name=\"expand\">True</property>"
840 " <property name=\"fill\">True</property>"
841 " <property name=\"position\">2</property>"
846 " <property name=\"expand\">False</property>"
847 " <property name=\"fill\">True</property>"
848 " <property name=\"position\">2</property>"
853 " <property name=\"resize\">True</property>"
854 " <property name=\"shrink\">False</property>"
858 " <object class=\"GtkLabel\" id=\"label6\">"
859 " <property name=\"visible\">True</property>"
860 " <property name=\"label\" translatable=\"yes\">Some static\n"
862 "that shrinks.</property>"
863 " <property name=\"justify\">center</property>"
865 " <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
869 " <property name=\"resize\">False</property>"
870 " <property name=\"shrink\">True</property>"
876 " <object class=\"GtkListStore\" id=\"liststore1\">"
878 " <!-- column-name item-text -->"
879 " <column type=\"gchararray\"/>"
880 " <!-- column-name icon-name -->"
881 " <column type=\"gchararray\"/>"
885 " <col id=\"0\" translatable=\"yes\">Montreal, Quebec Canada</col>"
886 " <col id=\"1\" translatable=\"yes\">gtk-yes</col>"
889 " <col id=\"0\" translatable=\"yes\">Sao Paulo, SP Brazil</col>"
890 " <col id=\"1\" translatable=\"yes\">gtk-no</col>"
893 " <col id=\"0\" translatable=\"yes\">Buenos Aires, Argentina</col>"
894 " <col id=\"1\" translatable=\"yes\">gtk-stop</col>"
897 " <col id=\"0\" translatable=\"yes\">Los Angelos, California USA</col>"
898 " <col id=\"1\" translatable=\"yes\">gtk-media-record</col>"
901 " <col id=\"0\" translatable=\"yes\">Rio de Janeiro, RJ Brazil</col>"
902 " <col id=\"1\" translatable=\"yes\">gtk-dialog-error</col>"
905 " <col id=\"0\" translatable=\"yes\">Seoul, South Korea</col>"
906 " <col id=\"1\" translatable=\"yes\">gtk-info</col>"
918 test_clicked (GtkWidget *button,
919 TestInterface *interface)
921 if (!interface->window)
923 GtkBuilder *builder = gtk_builder_new ();
925 gtk_builder_add_from_string (builder, interface->interface, -1, NULL);
926 interface->window = (GtkWidget *)gtk_builder_get_object (builder, "window");
928 g_signal_connect (interface->window, "delete_event",
929 G_CALLBACK (gtk_widget_hide_on_delete), NULL);
932 gtk_widget_show (interface->window);
939 GtkWidget *window, *vbox, *button;
942 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
943 vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
945 gtk_container_set_border_width (GTK_CONTAINER (window), 8);
947 gtk_widget_show (vbox);
948 gtk_container_add (GTK_CONTAINER (window), vbox);
950 for (i = 0; i < G_N_ELEMENTS (interfaces); i++)
952 button = gtk_button_new_with_label (interfaces[i].name);
954 gtk_widget_set_tooltip_text (button, interfaces[i].tooltip);
956 g_signal_connect (G_OBJECT (button), "clicked",
957 G_CALLBACK (test_clicked), &interfaces[i]);
959 gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
960 gtk_widget_show (button);
969 main (int argc, char *argv[])
973 gtk_init (&argc, &argv);
975 window = create_window ();
977 g_signal_connect (window, "delete-event",
978 G_CALLBACK (gtk_main_quit), window);
980 gtk_widget_show (window);