# PaCkAgE DaTaStReAm SMCgtk 1 63320 # end of header 07070100008529000081a40000000a0000000a000000013d12d48b000000aa000000880000000300000000000000000000000fff350886SMCgtk/pkginfoPKG=SMCgtk NAME=gtk+ ARCH=sparc VERSION=1.2.10 CATEGORY=application VENDOR=The GTK Team EMAIL=steve@smc.vnet.net PSTAMP=Steve Christensen BASEDIR=/usr/local CLASSES=none 07070100008528000081a40000000a0000000a000000013d12d48c00009a16000000880000000300000000000000000000000eff350886SMCgtk/pkgmap: 1 63320 1 d none bin 0755 bin bin 1 f none bin/gtk-config 0755 bin bin 2141 30819 1024643894 1 d none doc 0755 bin bin 1 d none doc/gtk 0755 bin bin 1 f none doc/gtk/ABOUT-NLS 0644 bin bin 11651 30128 1024643992 1 f none doc/gtk/AUTHORS 0644 bin bin 1061 21652 1024643992 1 f none doc/gtk/COPYING 0644 bin bin 25292 37909 1024643992 1 f none doc/gtk/ChangeLog 0644 bin bin 449090 15343 1024643992 1 f none doc/gtk/ChangeLog.pre-1-0 0644 bin bin 180062 64143 1024643992 1 f none doc/gtk/HACKING 0644 bin bin 2002 43267 1024643992 1 f none doc/gtk/INSTALL 0644 bin bin 7332 46784 1024643992 1 f none doc/gtk/Makefile 0644 bin bin 21100 15916 1024643992 1 f none doc/gtk/Makefile.am 0644 bin bin 3752 55832 1024643992 1 f none doc/gtk/Makefile.in 0644 bin bin 20291 1967 1024643992 1 f none doc/gtk/NEWS 0644 bin bin 19945 59558 1024643992 1 f none doc/gtk/NEWS.pre-1-0 0644 bin bin 4525 10420 1024643992 1 f none doc/gtk/README 0644 bin bin 2201 61184 1024643992 1 f none doc/gtk/README.cvs-commits 0644 bin bin 2470 18579 1024643992 1 f none doc/gtk/TODO 0644 bin bin 6515 35168 1024643992 1 d none doc/gtk/docs 0755 bin bin 1 f none doc/gtk/docs/Changes-1.2.txt 0644 bin bin 10567 46789 1024643996 1 f none doc/gtk/docs/Makefile 0644 bin bin 16747 23950 1024643998 1 f none doc/gtk/docs/Makefile.am 0644 bin bin 5020 18346 1024643996 1 f none doc/gtk/docs/Makefile.in 0644 bin bin 15864 4290 1024643992 1 f none doc/gtk/docs/debugging.txt 0644 bin bin 2800 38340 1024643996 1 f none doc/gtk/docs/developers.txt 0644 bin bin 2607 27852 1024643996 1 f none doc/gtk/docs/gdk.info 0644 bin bin 10909 15388 1024643998 1 f none doc/gtk/docs/gdk.texi 0644 bin bin 10714 39693 1024643996 1 f none doc/gtk/docs/generation.txt 0644 bin bin 4490 59371 1024643996 1 f none doc/gtk/docs/gtk-config.1 0644 bin bin 1886 33770 1024643998 1 f none doc/gtk/docs/gtk-config.1.in 0644 bin bin 1889 34160 1024643996 1 f none doc/gtk/docs/gtk-config.txt 0644 bin bin 7067 2376 1024643996 1 f none doc/gtk/docs/gtk.info 0644 bin bin 3892 61250 1024643998 1 f none doc/gtk/docs/gtk.info-1 0644 bin bin 49892 15371 1024643998 1 f none doc/gtk/docs/gtk.info-2 0644 bin bin 50130 23514 1024643998 1 f none doc/gtk/docs/gtk.info-3 0644 bin bin 50215 36011 1024643998 1 f none doc/gtk/docs/gtk.info-4 0644 bin bin 50716 10096 1024643998 1 f none doc/gtk/docs/gtk.info-5 0644 bin bin 8294 27617 1024643998 1 f none doc/gtk/docs/gtk.info-6 0644 bin bin 46874 54808 1024643998 1 f none doc/gtk/docs/gtk.texi 0644 bin bin 189766 17138 1024643996 1 f none doc/gtk/docs/gtk_tut.sgml 0644 bin bin 620476 51693 1024643997 1 f none doc/gtk/docs/gtk_tut_fr.sgml 0644 bin bin 283566 19880 1024643997 1 f none doc/gtk/docs/gtk_tut_it.sgml 0644 bin bin 360095 8942 1024643997 1 f none doc/gtk/docs/gtk_tut_packbox1.gif 0644 bin bin 6797 8787 1024643997 1 f none doc/gtk/docs/gtk_tut_packbox2.gif 0644 bin bin 6024 42005 1024643997 1 f none doc/gtk/docs/gtk_tut_table.gif 0644 bin bin 2429 48186 1024643998 1 f none doc/gtk/docs/gtkdocs_fix 0755 bin bin 289 21383 1024643996 1 f none doc/gtk/docs/gtkfaq.sgml 0644 bin bin 100889 21943 1024643996 1 d none doc/gtk/docs/html 0755 bin bin 1 f none doc/gtk/docs/html/gtk_tut-1.html 0644 bin bin 4824 30855 1024643992 1 f none doc/gtk/docs/html/gtk_tut-10.html 0644 bin bin 68535 30730 1024643993 1 f none doc/gtk/docs/html/gtk_tut-11.html 0644 bin bin 26424 31572 1024643993 1 f none doc/gtk/docs/html/gtk_tut-12.html 0644 bin bin 30794 24696 1024643993 1 f none doc/gtk/docs/html/gtk_tut-13.html 0644 bin bin 18302 35669 1024643993 1 f none doc/gtk/docs/html/gtk_tut-14.html 0644 bin bin 14845 16710 1024643993 1 f none doc/gtk/docs/html/gtk_tut-15.html 0644 bin bin 1820 10975 1024643993 1 f none doc/gtk/docs/html/gtk_tut-16.html 0644 bin bin 2451 44684 1024643993 1 f none doc/gtk/docs/html/gtk_tut-17.html 0644 bin bin 4371 27693 1024643993 1 f none doc/gtk/docs/html/gtk_tut-18.html 0644 bin bin 6952 29396 1024643993 1 f none doc/gtk/docs/html/gtk_tut-19.html 0644 bin bin 14510 40898 1024643993 1 f none doc/gtk/docs/html/gtk_tut-2.html 0644 bin bin 25913 61398 1024643992 1 f none doc/gtk/docs/html/gtk_tut-20.html 0644 bin bin 14437 27671 1024643993 1 f none doc/gtk/docs/html/gtk_tut-21.html 0644 bin bin 10418 22001 1024643993 1 f none doc/gtk/docs/html/gtk_tut-22.html 0644 bin bin 45855 33815 1024643993 1 f none doc/gtk/docs/html/gtk_tut-23.html 0644 bin bin 28988 35198 1024643993 1 f none doc/gtk/docs/html/gtk_tut-24.html 0644 bin bin 1596 2313 1024643993 1 f none doc/gtk/docs/html/gtk_tut-25.html 0644 bin bin 1326 43141 1024643993 1 f none doc/gtk/docs/html/gtk_tut-26.html 0644 bin bin 3462 26176 1024643993 1 f none doc/gtk/docs/html/gtk_tut-27.html 0644 bin bin 1916 33867 1024643993 1 f none doc/gtk/docs/html/gtk_tut-28.html 0644 bin bin 26132 4336 1024643993 1 f none doc/gtk/docs/html/gtk_tut-29.html 0644 bin bin 8648 31486 1024643993 1 f none doc/gtk/docs/html/gtk_tut-3.html 0644 bin bin 7633 20237 1024643992 1 f none doc/gtk/docs/html/gtk_tut-30.html 0644 bin bin 44662 23401 1024643993 1 f none doc/gtk/docs/html/gtk_tut-31.html 0644 bin bin 20835 8756 1024643993 1 f none doc/gtk/docs/html/gtk_tut-4.html 0644 bin bin 25994 5542 1024643993 1 f none doc/gtk/docs/html/gtk_tut-5.html 0644 bin bin 6163 56663 1024643993 1 f none doc/gtk/docs/html/gtk_tut-6.html 0644 bin bin 15119 2130 1024643993 1 f none doc/gtk/docs/html/gtk_tut-7.html 0644 bin bin 10366 49084 1024643993 1 f none doc/gtk/docs/html/gtk_tut-8.html 0644 bin bin 23761 48075 1024643993 1 f none doc/gtk/docs/html/gtk_tut-9.html 0644 bin bin 119844 43479 1024643993 1 f none doc/gtk/docs/html/gtk_tut.html 0644 bin bin 13040 58095 1024643992 1 f none doc/gtk/docs/html/gtk_tut_fr-1.html 0644 bin bin 2958 3360 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-10.html 0644 bin bin 4000 3855 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-11.html 0644 bin bin 18769 37139 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-12.html 0644 bin bin 20552 60406 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-13.html 0644 bin bin 4045 9874 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-14.html 0644 bin bin 3102 12911 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-15.html 0644 bin bin 4660 7174 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-16.html 0644 bin bin 14970 2818 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-17.html 0644 bin bin 10957 37437 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-18.html 0644 bin bin 11240 60482 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-19.html 0644 bin bin 47425 56611 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-2.html 0644 bin bin 22833 21211 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-20.html 0644 bin bin 31743 47222 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-21.html 0644 bin bin 1155 30231 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-22.html 0644 bin bin 1418 55581 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-23.html 0644 bin bin 2878 48217 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-24.html 0644 bin bin 1682 11799 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-3.html 0644 bin bin 7617 64961 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-4.html 0644 bin bin 24720 21792 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-5.html 0644 bin bin 6983 38542 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-6.html 0644 bin bin 9782 50436 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-7.html 0644 bin bin 28101 51713 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-8.html 0644 bin bin 17294 42351 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-9.html 0644 bin bin 21851 12130 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr.html 0644 bin bin 7811 20724 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-1.html 0644 bin bin 3129 11674 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-10.html 0644 bin bin 24012 17137 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-11.html 0644 bin bin 9997 55570 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-12.html 0644 bin bin 20730 51529 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-13.html 0644 bin bin 4080 8292 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-14.html 0644 bin bin 3016 2784 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-15.html 0644 bin bin 4582 55917 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-16.html 0644 bin bin 15298 60321 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-17.html 0644 bin bin 10727 8006 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-18.html 0644 bin bin 11352 55157 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-19.html 0644 bin bin 48196 59809 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-2.html 0644 bin bin 23042 9480 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-20.html 0644 bin bin 33068 37569 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-21.html 0644 bin bin 1052 19385 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-22.html 0644 bin bin 1384 48999 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-23.html 0644 bin bin 2747 33292 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-24.html 0644 bin bin 3478 47279 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-3.html 0644 bin bin 7476 40303 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-4.html 0644 bin bin 28862 41895 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-5.html 0644 bin bin 6628 30132 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-6.html 0644 bin bin 13722 36225 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-7.html 0644 bin bin 58099 14116 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-8.html 0644 bin bin 27452 989 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-9.html 0644 bin bin 22361 47362 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it.html 0644 bin bin 8901 34680 1024643994 1 f none doc/gtk/docs/html/gtk_tut_packbox1.gif 0644 bin bin 6797 8787 1024643992 1 f none doc/gtk/docs/html/gtk_tut_packbox2.gif 0644 bin bin 6024 42005 1024643992 1 f none doc/gtk/docs/html/gtk_tut_table.gif 0644 bin bin 2429 48186 1024643992 1 f none doc/gtk/docs/html/gtkfaq-1.html 0644 bin bin 9526 16464 1024643994 1 f none doc/gtk/docs/html/gtkfaq-2.html 0644 bin bin 6902 59667 1024643994 1 f none doc/gtk/docs/html/gtkfaq-3.html 0644 bin bin 7901 13768 1024643994 1 f none doc/gtk/docs/html/gtkfaq-4.html 0644 bin bin 6229 58291 1024643994 1 f none doc/gtk/docs/html/gtkfaq-5.html 0644 bin bin 33321 31515 1024643994 1 f none doc/gtk/docs/html/gtkfaq-6.html 0644 bin bin 19428 32242 1024643994 1 f none doc/gtk/docs/html/gtkfaq-7.html 0644 bin bin 2798 28296 1024643994 1 f none doc/gtk/docs/html/gtkfaq.html 0644 bin bin 9414 24030 1024643994 1 f none doc/gtk/docs/macros.texi 0644 bin bin 521 47454 1024643996 1 f none doc/gtk/docs/refcounting.txt 0644 bin bin 11785 40896 1024643996 1 f none doc/gtk/docs/styles.txt 0644 bin bin 3855 14979 1024643996 1 f none doc/gtk/docs/texinfo.tex 0644 bin bin 183111 21239 1024643996 1 d none doc/gtk/docs/text 0755 bin bin 1 f none doc/gtk/docs/text/gtk_tut.txt 0644 bin bin 619212 22985 1024643995 1 f none doc/gtk/docs/text/gtk_tut_fr.txt 0644 bin bin 307528 3924 1024643995 1 f none doc/gtk/docs/text/gtk_tut_it.txt 0644 bin bin 360990 12279 1024643996 1 f none doc/gtk/docs/text/gtkfaq.txt 0644 bin bin 104712 33153 1024643996 1 f none doc/gtk/docs/text_widget.txt 0644 bin bin 21485 36639 1024643996 1 f none doc/gtk/docs/widget_system.txt 0644 bin bin 15559 13425 1024643996 1 d none doc/gtk/examples 0755 bin bin 1 f none doc/gtk/examples/Makefile 0644 bin bin 688 51427 1024643999 1 f none doc/gtk/examples/README.1ST 0644 bin bin 1280 45473 1024643999 1 d none doc/gtk/examples/aspectframe 0755 bin bin 1 f none doc/gtk/examples/aspectframe/Makefile 0644 bin bin 150 12434 1024643998 1 f none doc/gtk/examples/aspectframe/aspectframe.c 0644 bin bin 1515 45741 1024643998 1 d none doc/gtk/examples/base 0755 bin bin 1 f none doc/gtk/examples/base/Makefile 0644 bin bin 115 8674 1024643998 1 f none doc/gtk/examples/base/base.c 0644 bin bin 310 22765 1024643998 1 d none doc/gtk/examples/buttons 0755 bin bin 1 f none doc/gtk/examples/buttons/Makefile 0644 bin bin 130 10534 1024643998 1 f none doc/gtk/examples/buttons/buttons.c 0644 bin bin 2866 27852 1024643998 1 f none doc/gtk/examples/buttons/info.xpm 0644 bin bin 2039 41784 1024643998 1 d none doc/gtk/examples/calendar 0755 bin bin 1 f none doc/gtk/examples/calendar/Makefile 0644 bin bin 129 10454 1024643998 1 f none doc/gtk/examples/calendar/calendar.c 0644 bin bin 12616 19475 1024643998 1 d none doc/gtk/examples/clist 0755 bin bin 1 f none doc/gtk/examples/clist/Makefile 0644 bin bin 120 9334 1024643998 1 f none doc/gtk/examples/clist/clist.c 0644 bin bin 5702 53953 1024643998 1 d none doc/gtk/examples/entry 0755 bin bin 1 f none doc/gtk/examples/entry/Makefile 0644 bin bin 120 9429 1024643998 1 f none doc/gtk/examples/entry/entry.c 0644 bin bin 3025 40464 1024643998 1 d none doc/gtk/examples/eventbox 0755 bin bin 1 f none doc/gtk/examples/eventbox/Makefile 0644 bin bin 135 10994 1024643998 1 f none doc/gtk/examples/eventbox/eventbox.c 0644 bin bin 1467 48857 1024643998 1 f none doc/gtk/examples/extract.awk 0644 bin bin 1509 44029 1024643999 1 f none doc/gtk/examples/extract.sh 0755 bin bin 746 58798 1024643999 1 d none doc/gtk/examples/filesel 0755 bin bin 1 f none doc/gtk/examples/filesel/Makefile 0644 bin bin 130 10319 1024643998 1 f none doc/gtk/examples/filesel/filesel.c 0644 bin bin 1437 44837 1024643998 1 f none doc/gtk/examples/find-examples.sh 0755 bin bin 183 14278 1024643999 1 d none doc/gtk/examples/fixed 0755 bin bin 1 f none doc/gtk/examples/fixed/Makefile 0644 bin bin 120 9259 1024643998 1 f none doc/gtk/examples/fixed/fixed.c 0644 bin bin 2024 30168 1024643998 1 d none doc/gtk/examples/frame 0755 bin bin 1 f none doc/gtk/examples/frame/Makefile 0644 bin bin 120 9234 1024643998 1 f none doc/gtk/examples/frame/frame.c 0644 bin bin 1328 39900 1024643998 1 d none doc/gtk/examples/gtkdial 0755 bin bin 1 f none doc/gtk/examples/gtkdial/Makefile 0644 bin bin 318 26581 1024643998 1 f none doc/gtk/examples/gtkdial/dial_test.c 0644 bin bin 1598 62541 1024643998 1 f none doc/gtk/examples/gtkdial/gtkdial.c 0644 bin bin 16913 38278 1024643998 1 f none doc/gtk/examples/gtkdial/gtkdial.h 0644 bin bin 2596 14061 1024643998 1 d none doc/gtk/examples/helloworld 0755 bin bin 1 f none doc/gtk/examples/helloworld/Makefile 0644 bin bin 145 12039 1024643998 1 f none doc/gtk/examples/helloworld/helloworld.c 0644 bin bin 3432 11103 1024643998 1 d none doc/gtk/examples/helloworld2 0755 bin bin 1 f none doc/gtk/examples/helloworld2/Makefile 0644 bin bin 150 12289 1024643998 1 f none doc/gtk/examples/helloworld2/helloworld2.c 0644 bin bin 3165 57344 1024643998 1 d none doc/gtk/examples/list 0755 bin bin 1 f none doc/gtk/examples/list/Makefile 0644 bin bin 115 8839 1024643998 1 f none doc/gtk/examples/list/list.c 0644 bin bin 8644 35499 1024643998 1 d none doc/gtk/examples/menu 0755 bin bin 1 f none doc/gtk/examples/menu/Makefile 0644 bin bin 255 21508 1024643998 1 f none doc/gtk/examples/menu/itemfactory.c 0644 bin bin 4130 54659 1024643998 1 f none doc/gtk/examples/menu/menu.c 0644 bin bin 4386 18656 1024643998 1 d none doc/gtk/examples/notebook 0755 bin bin 1 f none doc/gtk/examples/notebook/Makefile 0644 bin bin 135 10944 1024643998 1 f none doc/gtk/examples/notebook/notebook.c 0644 bin bin 5573 47349 1024643998 1 d none doc/gtk/examples/packbox 0755 bin bin 1 f none doc/gtk/examples/packbox/Makefile 0644 bin bin 130 10339 1024643998 1 f none doc/gtk/examples/packbox/packbox.c 0644 bin bin 10230 26786 1024643998 1 d none doc/gtk/examples/packer 0755 bin bin 1 f none doc/gtk/examples/packer/Makefile 0644 bin bin 124 9519 1024643998 1 f none doc/gtk/examples/packer/pack.c 0644 bin bin 23450 64162 1024643999 1 d none doc/gtk/examples/paned 0755 bin bin 1 f none doc/gtk/examples/paned/Makefile 0644 bin bin 120 9219 1024643999 1 f none doc/gtk/examples/paned/paned.c 0644 bin bin 4408 15417 1024643999 1 d none doc/gtk/examples/pixmap 0755 bin bin 1 f none doc/gtk/examples/pixmap/Makefile 0644 bin bin 125 9894 1024643999 1 f none doc/gtk/examples/pixmap/pixmap.c 0644 bin bin 2455 44545 1024643999 1 d none doc/gtk/examples/progressbar 0755 bin bin 1 f none doc/gtk/examples/progressbar/Makefile 0644 bin bin 150 12589 1024643999 1 f none doc/gtk/examples/progressbar/progressbar.c 0644 bin bin 7600 56269 1024643999 1 d none doc/gtk/examples/radiobuttons 0755 bin bin 1 f none doc/gtk/examples/radiobuttons/Makefile 0644 bin bin 155 13169 1024643999 1 f none doc/gtk/examples/radiobuttons/radiobuttons.c 0644 bin bin 2641 7699 1024643999 1 d none doc/gtk/examples/rangewidgets 0755 bin bin 1 f none doc/gtk/examples/rangewidgets/Makefile 0644 bin bin 155 13039 1024643999 1 f none doc/gtk/examples/rangewidgets/rangewidgets.c 0644 bin bin 10489 20444 1024643999 1 d none doc/gtk/examples/rulers 0755 bin bin 1 f none doc/gtk/examples/rulers/Makefile 0644 bin bin 125 9964 1024643999 1 f none doc/gtk/examples/rulers/rulers.c 0644 bin bin 3175 38007 1024643999 1 d none doc/gtk/examples/scribble-simple 0755 bin bin 1 f none doc/gtk/examples/scribble-simple/Makefile 0644 bin bin 170 14284 1024643999 1 f none doc/gtk/examples/scribble-simple/scribble-simple.c 0644 bin bin 4898 60283 1024643999 1 d none doc/gtk/examples/scrolledwin 0755 bin bin 1 f none doc/gtk/examples/scrolledwin/Makefile 0644 bin bin 150 12569 1024643999 1 f none doc/gtk/examples/scrolledwin/scrolledwin.c 0644 bin bin 3311 60371 1024643999 1 d none doc/gtk/examples/selection 0755 bin bin 1 f none doc/gtk/examples/selection/Makefile 0644 bin bin 298 26052 1024643999 1 f none doc/gtk/examples/selection/gettargets.c 0644 bin bin 2634 9231 1024643999 1 f none doc/gtk/examples/selection/setselection.c 0644 bin bin 3257 60634 1024643999 1 d none doc/gtk/examples/spinbutton 0755 bin bin 1 f none doc/gtk/examples/spinbutton/Makefile 0644 bin bin 145 12169 1024643999 1 f none doc/gtk/examples/spinbutton/spinbutton.c 0644 bin bin 7689 14690 1024643999 1 d none doc/gtk/examples/statusbar 0755 bin bin 1 f none doc/gtk/examples/statusbar/Makefile 0644 bin bin 140 11544 1024643999 1 f none doc/gtk/examples/statusbar/statusbar.c 0644 bin bin 2154 38078 1024643999 1 d none doc/gtk/examples/table 0755 bin bin 1 f none doc/gtk/examples/table/Makefile 0644 bin bin 120 9219 1024643999 1 f none doc/gtk/examples/table/table.c 0644 bin bin 2870 26462 1024643999 1 d none doc/gtk/examples/text 0755 bin bin 1 f none doc/gtk/examples/text/Makefile 0644 bin bin 115 8884 1024643999 1 f none doc/gtk/examples/text/text.c 0644 bin bin 5355 31741 1024643999 1 d none doc/gtk/examples/tictactoe 0755 bin bin 1 f none doc/gtk/examples/tictactoe/Makefile 0644 bin bin 325 27815 1024643999 1 f none doc/gtk/examples/tictactoe/tictactoe.c 0644 bin bin 4208 65529 1024643999 1 f none doc/gtk/examples/tictactoe/tictactoe.h 0644 bin bin 1825 17915 1024643999 1 f none doc/gtk/examples/tictactoe/ttt_test.c 0644 bin bin 891 4041 1024643999 1 d none doc/gtk/examples/tree 0755 bin bin 1 f none doc/gtk/examples/tree/Makefile 0644 bin bin 115 8779 1024643999 1 f none doc/gtk/examples/tree/tree.c 0644 bin bin 6598 64650 1024643999 1 d none doc/gtk/examples/wheelbarrow 0755 bin bin 1 f none doc/gtk/examples/wheelbarrow/Makefile 0644 bin bin 149 12517 1024643999 1 f none doc/gtk/examples/wheelbarrow/wheelbarrow.c 0644 bin bin 6188 36846 1024643999 1 d none etc 0755 bin bin 1 d none etc/gtk 0755 bin bin 1 f none etc/gtk/gtkrc.az 0644 bin bin 453 31980 1024643889 1 s none etc/gtk/gtkrc.be=gtkrc.cp1251 1 s none etc/gtk/gtkrc.bg=gtkrc.cp1251 1 s none etc/gtk/gtkrc.bg_BG.iso88595=gtkrc.iso-8859-5 1 f none etc/gtk/gtkrc.cp1251 0644 bin bin 338 25038 1024643890 1 f none etc/gtk/gtkrc.cp1255 0644 bin bin 338 25054 1024643890 1 s none etc/gtk/gtkrc.cs=gtkrc.iso-8859-2 1 s none etc/gtk/gtkrc.cy=gtkrc.iso-8859-14 1 f none etc/gtk/gtkrc.el 0644 bin bin 316 23060 1024643889 1 f none etc/gtk/gtkrc.eo 0644 bin bin 330 23552 1024643889 1 s none etc/gtk/gtkrc.et=gtkrc.iso-8859-15 1 s none etc/gtk/gtkrc.ga=gtkrc.iso-8859-14 1 f none etc/gtk/gtkrc.he 0644 bin bin 198 14668 1024643889 1 s none etc/gtk/gtkrc.he_IL.cp1255=gtkrc.cp1255 1 s none etc/gtk/gtkrc.he_IL.microsoftcp1255=gtkrc.cp1255 1 s none etc/gtk/gtkrc.hr=gtkrc.iso-8859-2 1 s none etc/gtk/gtkrc.hu=gtkrc.iso-8859-2 1 f none etc/gtk/gtkrc.hy 0644 bin bin 219 16669 1024643889 1 f none etc/gtk/gtkrc.iso-8859-13 0644 bin bin 349 24702 1024643889 1 f none etc/gtk/gtkrc.iso-8859-14 0644 bin bin 350 24716 1024643889 1 f none etc/gtk/gtkrc.iso-8859-15 0644 bin bin 350 24720 1024643889 1 f none etc/gtk/gtkrc.iso-8859-2 0644 bin bin 556 42032 1024643889 1 f none etc/gtk/gtkrc.iso-8859-5 0644 bin bin 555 42021 1024643889 1 f none etc/gtk/gtkrc.ja 0644 bin bin 311 22430 1024643889 1 s none etc/gtk/gtkrc.ka=gtkrc.ka_GE.georgianps 1 f none etc/gtk/gtkrc.ka_GE.georgianacademy 0644 bin bin 611 51535 1024643889 1 f none etc/gtk/gtkrc.ka_GE.georgianps 0644 bin bin 550 45920 1024643890 1 f none etc/gtk/gtkrc.ko 0644 bin bin 363 24262 1024643889 1 s none etc/gtk/gtkrc.lt=gtkrc.iso-8859-13 1 s none etc/gtk/gtkrc.lv=gtkrc.iso-8859-13 1 s none etc/gtk/gtkrc.mi=gtkrc.iso-8859-13 1 s none etc/gtk/gtkrc.mk=gtkrc.iso-8859-5 1 s none etc/gtk/gtkrc.pl=gtkrc.iso-8859-2 1 s none etc/gtk/gtkrc.ro=gtkrc.iso-8859-2 1 f none etc/gtk/gtkrc.ru 0644 bin bin 361 25447 1024643889 1 s none etc/gtk/gtkrc.ru_RU.iso88595=gtkrc.iso-8859-5 1 s none etc/gtk/gtkrc.sk=gtkrc.iso-8859-2 1 s none etc/gtk/gtkrc.sl=gtkrc.iso-8859-2 1 s none etc/gtk/gtkrc.sp=gtkrc.iso-8859-5 1 s none etc/gtk/gtkrc.sq=gtkrc.iso-8859-2 1 s none etc/gtk/gtkrc.sr=gtkrc.iso-8859-2 1 f none etc/gtk/gtkrc.th 0644 bin bin 441 33911 1024643889 1 f none etc/gtk/gtkrc.tr 0644 bin bin 330 23600 1024643889 1 f none etc/gtk/gtkrc.uk 0644 bin bin 509 39121 1024643889 1 s none etc/gtk/gtkrc.vi=gtkrc.vi_VN.tcvn 1 f none etc/gtk/gtkrc.vi_VN.tcvn 0644 bin bin 774 61566 1024643890 1 f none etc/gtk/gtkrc.vi_VN.viscii 0644 bin bin 767 61232 1024643890 1 s none etc/gtk/gtkrc.vi_VN.viscii111=gtkrc.vi_VN.viscii 1 s none etc/gtk/gtkrc.yi=gtkrc.cp1255 1 f none etc/gtk/gtkrc.zh_CN 0644 bin bin 431 34545 1024643889 1 f none etc/gtk/gtkrc.zh_TW.big5 0644 bin bin 614 49491 1024643889 1 d none include 0755 bin bin 1 d none include/gtk-1.2 0755 bin bin 1 d none include/gtk-1.2/gdk 0755 bin bin 1 f none include/gtk-1.2/gdk/gdk.h 0644 bin bin 34746 14919 1024643869 1 f none include/gtk-1.2/gdk/gdkcursors.h 0644 bin bin 1574 35617 1024643869 1 f none include/gtk-1.2/gdk/gdki18n.h 0644 bin bin 1776 11437 1024643869 1 f none include/gtk-1.2/gdk/gdkkeysyms.h 0644 bin bin 38539 16727 1024643869 1 f none include/gtk-1.2/gdk/gdkprivate.h 0644 bin bin 8515 56532 1024643869 1 f none include/gtk-1.2/gdk/gdkrgb.h 0644 bin bin 3305 65355 1024643869 1 f none include/gtk-1.2/gdk/gdktypes.h 0644 bin bin 29094 49524 1024643869 1 f none include/gtk-1.2/gdk/gdkx.h 0644 bin bin 2956 40212 1024643869 1 d none include/gtk-1.2/gtk 0755 bin bin 1 f none include/gtk-1.2/gtk/gtk.h 0644 bin bin 4155 38784 1024643890 1 f none include/gtk-1.2/gtk/gtkaccelgroup.h 0644 bin bin 5339 38855 1024643890 1 f none include/gtk-1.2/gtk/gtkaccellabel.h 0644 bin bin 2815 32619 1024643890 1 f none include/gtk-1.2/gtk/gtkadjustment.h 0644 bin bin 2848 32829 1024643890 1 f none include/gtk-1.2/gtk/gtkalignment.h 0644 bin bin 2529 64695 1024643890 1 f none include/gtk-1.2/gtk/gtkarg.h 0644 bin bin 3056 46336 1024643890 1 f none include/gtk-1.2/gtk/gtkarrow.h 0644 bin bin 2250 49186 1024643890 1 f none include/gtk-1.2/gtk/gtkaspectframe.h 0644 bin bin 2626 11697 1024643890 1 f none include/gtk-1.2/gtk/gtkbbox.h 0644 bin bin 3340 22421 1024643890 1 f none include/gtk-1.2/gtk/gtkbin.h 0644 bin bin 1986 27390 1024643890 1 f none include/gtk-1.2/gtk/gtkbindings.h 0644 bin bin 4486 43424 1024643890 1 f none include/gtk-1.2/gtk/gtkbox.h 0644 bin bin 3280 57926 1024643890 1 f none include/gtk-1.2/gtk/gtkbutton.h 0644 bin bin 2944 40219 1024643890 1 f none include/gtk-1.2/gtk/gtkcalendar.h 0644 bin bin 3989 57366 1024643890 1 f none include/gtk-1.2/gtk/gtkcheckbutton.h 0644 bin bin 2577 12526 1024643890 1 f none include/gtk-1.2/gtk/gtkcheckmenuitem.h 0644 bin bin 2787 32597 1024643890 1 f none include/gtk-1.2/gtk/gtkclist.h 0644 bin bin 22695 18593 1024643890 1 f none include/gtk-1.2/gtk/gtkcolorsel.h 0644 bin bin 4943 6088 1024643890 1 f none include/gtk-1.2/gtk/gtkcombo.h 0644 bin bin 3594 16793 1024643890 1 f none include/gtk-1.2/gtk/gtkcompat.h 0644 bin bin 2394 8427 1024643890 1 f none include/gtk-1.2/gtk/gtkcontainer.h 0644 bin bin 8536 16372 1024643890 1 f none include/gtk-1.2/gtk/gtkctree.h 0644 bin bin 16313 20001 1024643890 1 f none include/gtk-1.2/gtk/gtkcurve.h 0644 bin bin 3029 49395 1024643890 1 f none include/gtk-1.2/gtk/gtkdata.h 0644 bin bin 1956 27224 1024643890 1 f none include/gtk-1.2/gtk/gtkdebug.h 0644 bin bin 1812 8608 1024643890 1 f none include/gtk-1.2/gtk/gtkdialog.h 0644 bin bin 2157 42136 1024643890 1 f none include/gtk-1.2/gtk/gtkdnd.h 0644 bin bin 4399 14579 1024643890 1 f none include/gtk-1.2/gtk/gtkdrawingarea.h 0644 bin bin 2321 54753 1024643890 1 f none include/gtk-1.2/gtk/gtkeditable.h 0644 bin bin 5753 48091 1024643890 1 f none include/gtk-1.2/gtk/gtkentry.h 0644 bin bin 3803 39004 1024643890 1 f none include/gtk-1.2/gtk/gtkenums.h 0644 bin bin 6456 37366 1024643890 1 f none include/gtk-1.2/gtk/gtkeventbox.h 0644 bin bin 2054 36290 1024643890 1 f none include/gtk-1.2/gtk/gtkfeatures.h 0644 bin bin 3362 62071 1024643892 1 f none include/gtk-1.2/gtk/gtkfilesel.h 0644 bin bin 3238 4123 1024643890 1 f none include/gtk-1.2/gtk/gtkfixed.h 0644 bin bin 2694 3546 1024643890 1 f none include/gtk-1.2/gtk/gtkfontsel.h 0644 bin bin 10826 37908 1024643891 1 f none include/gtk-1.2/gtk/gtkframe.h 0644 bin bin 2497 65419 1024643891 1 f none include/gtk-1.2/gtk/gtkgamma.h 0644 bin bin 2093 42141 1024643891 1 f none include/gtk-1.2/gtk/gtkgc.h 0644 bin bin 1503 54590 1024643891 1 f none include/gtk-1.2/gtk/gtkhandlebox.h 0644 bin bin 3351 4606 1024643891 1 f none include/gtk-1.2/gtk/gtkhbbox.h 0644 bin bin 2248 58973 1024643891 1 f none include/gtk-1.2/gtk/gtkhbox.h 0644 bin bin 1982 29306 1024643891 1 f none include/gtk-1.2/gtk/gtkhpaned.h 0644 bin bin 1882 22827 1024643891 1 f none include/gtk-1.2/gtk/gtkhruler.h 0644 bin bin 1882 23609 1024643891 1 f none include/gtk-1.2/gtk/gtkhscale.h 0644 bin bin 2046 33765 1024643891 1 f none include/gtk-1.2/gtk/gtkhscrollbar.h 0644 bin bin 2153 44207 1024643891 1 f none include/gtk-1.2/gtk/gtkhseparator.h 0644 bin bin 2162 43442 1024643891 1 f none include/gtk-1.2/gtk/gtkimage.h 0644 bin bin 2317 50017 1024643891 1 f none include/gtk-1.2/gtk/gtkinputdialog.h 0644 bin bin 2632 14846 1024643891 1 f none include/gtk-1.2/gtk/gtkinvisible.h 0644 bin bin 2062 36807 1024643891 1 f none include/gtk-1.2/gtk/gtkitem.h 0644 bin bin 2201 44641 1024643891 1 f none include/gtk-1.2/gtk/gtkitemfactory.h 0644 bin bin 7933 53452 1024643891 1 f none include/gtk-1.2/gtk/gtklabel.h 0644 bin bin 3110 45735 1024643891 1 f none include/gtk-1.2/gtk/gtklayout.h 0644 bin bin 4096 56233 1024643891 1 f none include/gtk-1.2/gtk/gtklist.h 0644 bin bin 4756 38059 1024643891 1 f none include/gtk-1.2/gtk/gtklistitem.h 0644 bin bin 3127 54845 1024643891 1 f none include/gtk-1.2/gtk/gtkmain.h 0644 bin bin 5425 33154 1024643891 1 f none include/gtk-1.2/gtk/gtkmarshal.h 0644 bin bin 5876 6147 1024643892 1 f none include/gtk-1.2/gtk/gtkmenu.h 0644 bin bin 5471 40199 1024643891 1 f none include/gtk-1.2/gtk/gtkmenubar.h 0644 bin bin 2502 4064 1024643891 1 f none include/gtk-1.2/gtk/gtkmenufactory.h 0644 bin bin 3059 54415 1024643891 1 f none include/gtk-1.2/gtk/gtkmenuitem.h 0644 bin bin 3529 27609 1024643891 1 f none include/gtk-1.2/gtk/gtkmenushell.h 0644 bin bin 3377 13627 1024643891 1 f none include/gtk-1.2/gtk/gtkmisc.h 0644 bin bin 2184 44111 1024643891 1 f none include/gtk-1.2/gtk/gtknotebook.h 0644 bin bin 7766 60569 1024643891 1 f none include/gtk-1.2/gtk/gtkobject.h 0644 bin bin 13065 64212 1024643891 1 f none include/gtk-1.2/gtk/gtkoptionmenu.h 0644 bin bin 2564 13123 1024643891 1 f none include/gtk-1.2/gtk/gtkpacker.h 0644 bin bin 4809 35910 1024643891 1 f none include/gtk-1.2/gtk/gtkpaned.h 0644 bin bin 3549 17621 1024643891 1 f none include/gtk-1.2/gtk/gtkpixmap.h 0644 bin bin 2430 64768 1024643891 1 f none include/gtk-1.2/gtk/gtkplug.h 0644 bin bin 1958 30344 1024643891 1 f none include/gtk-1.2/gtk/gtkpreview.h 0644 bin bin 4303 215 1024643891 1 f none include/gtk-1.2/gtk/gtkprivate.h 0644 bin bin 3314 59335 1024643891 1 f none include/gtk-1.2/gtk/gtkprogress.h 0644 bin bin 3811 40702 1024643891 1 f none include/gtk-1.2/gtk/gtkprogressbar.h 0644 bin bin 3422 14983 1024643891 1 f none include/gtk-1.2/gtk/gtkradiobutton.h 0644 bin bin 2678 22279 1024643891 1 f none include/gtk-1.2/gtk/gtkradiomenuitem.h 0644 bin bin 2562 12866 1024643891 1 f none include/gtk-1.2/gtk/gtkrange.h 0644 bin bin 5155 1666 1024643891 1 f none include/gtk-1.2/gtk/gtkrc.h 0644 bin bin 4339 17856 1024643891 1 f none include/gtk-1.2/gtk/gtkruler.h 0644 bin bin 3296 4250 1024643891 1 f none include/gtk-1.2/gtk/gtkscale.h 0644 bin bin 2504 2819 1024643891 1 f none include/gtk-1.2/gtk/gtkscrollbar.h 0644 bin bin 2050 35025 1024643891 1 f none include/gtk-1.2/gtk/gtkscrolledwindow.h 0644 bin bin 3547 30178 1024643891 1 f none include/gtk-1.2/gtk/gtkselection.h 0644 bin bin 4305 9256 1024643891 1 f none include/gtk-1.2/gtk/gtkseparator.h 0644 bin bin 2082 36705 1024643891 1 f none include/gtk-1.2/gtk/gtksignal.h 0644 bin bin 7366 37659 1024643891 1 f none include/gtk-1.2/gtk/gtksocket.h 0644 bin bin 2163 46821 1024643891 1 f none include/gtk-1.2/gtk/gtkspinbutton.h 0644 bin bin 4509 38215 1024643891 1 f none include/gtk-1.2/gtk/gtkstatusbar.h 0644 bin bin 2979 49063 1024643892 1 f none include/gtk-1.2/gtk/gtkstyle.h 0644 bin bin 21243 65172 1024643891 1 f none include/gtk-1.2/gtk/gtktable.h 0644 bin bin 4032 52888 1024643892 1 f none include/gtk-1.2/gtk/gtktearoffmenuitem.h 0644 bin bin 2289 56327 1024643892 1 f none include/gtk-1.2/gtk/gtktext.h 0644 bin bin 7012 28848 1024643892 1 f none include/gtk-1.2/gtk/gtkthemes.h 0644 bin bin 3275 10931 1024643892 1 f none include/gtk-1.2/gtk/gtktipsquery.h 0644 bin bin 3168 63724 1024643892 1 f none include/gtk-1.2/gtk/gtktogglebutton.h 0644 bin bin 2819 33343 1024643892 1 f none include/gtk-1.2/gtk/gtktoolbar.h 0644 bin bin 6870 7372 1024643892 1 f none include/gtk-1.2/gtk/gtktooltips.h 0644 bin bin 3139 58528 1024643892 1 f none include/gtk-1.2/gtk/gtktree.h 0644 bin bin 4519 11771 1024643892 1 f none include/gtk-1.2/gtk/gtktreeitem.h 0644 bin bin 2939 42454 1024643892 1 f none include/gtk-1.2/gtk/gtktypebuiltins.h 0644 bin bin 4905 16777 1024643892 1 f none include/gtk-1.2/gtk/gtktypeutils.h 0644 bin bin 12068 1433 1024643892 1 f none include/gtk-1.2/gtk/gtkvbbox.h 0644 bin bin 2248 59295 1024643892 1 f none include/gtk-1.2/gtk/gtkvbox.h 0644 bin bin 1982 29628 1024643892 1 f none include/gtk-1.2/gtk/gtkviewport.h 0644 bin bin 2903 43020 1024643892 1 f none include/gtk-1.2/gtk/gtkvpaned.h 0644 bin bin 1882 23093 1024643892 1 f none include/gtk-1.2/gtk/gtkvruler.h 0644 bin bin 1882 23875 1024643892 1 f none include/gtk-1.2/gtk/gtkvscale.h 0644 bin bin 2045 34077 1024643892 1 f none include/gtk-1.2/gtk/gtkvscrollbar.h 0644 bin bin 2153 44529 1024643892 1 f none include/gtk-1.2/gtk/gtkvseparator.h 0644 bin bin 2161 43678 1024643892 1 f none include/gtk-1.2/gtk/gtkwidget.h 0644 bin bin 25121 20503 1024643892 1 f none include/gtk-1.2/gtk/gtkwindow.h 0644 bin bin 5616 38853 1024643892 1 d none info 0755 bin bin 1 f none info/gdk.info 0644 bin bin 10909 15388 1024643893 1 f none info/gtk.info 0644 bin bin 3892 61250 1024643893 1 f none info/gtk.info-1 0644 bin bin 49892 15371 1024643893 1 f none info/gtk.info-2 0644 bin bin 50130 23514 1024643893 1 f none info/gtk.info-3 0644 bin bin 50215 36011 1024643893 1 f none info/gtk.info-4 0644 bin bin 50716 10096 1024643893 1 f none info/gtk.info-5 0644 bin bin 8294 27617 1024643893 1 f none info/gtk.info-6 0644 bin bin 46874 54808 1024643893 1 d none lib 0755 bin bin 1 s none lib/libgdk-1.2.so.0=libgdk-1.2.so.0.9.1 1 f none lib/libgdk-1.2.so.0.9.1 0755 bin bin 2156420 44347 1024643866 1 f none lib/libgdk.a 0644 bin bin 2196180 9934 1024643869 1 f none lib/libgdk.la 0755 bin bin 808 2156 1024643867 1 s none lib/libgdk.so=libgdk-1.2.so.0.9.1 1 s none lib/libgtk-1.2.so.0=libgtk-1.2.so.0.9.1 1 f none lib/libgtk-1.2.so.0.9.1 0755 bin bin 9832680 64272 1024643879 1 f none lib/libgtk.a 0644 bin bin 10480576 34803 1024643889 1 f none lib/libgtk.la 0755 bin bin 808 2268 1024643879 1 s none lib/libgtk.so=libgtk-1.2.so.0.9.1 1 d none lib/locale 0755 bin bin 1 d none lib/locale/az 0755 bin bin 1 d none lib/locale/az/LC_MESSAGES 0755 bin bin 1 f none lib/locale/az/LC_MESSAGES/gtk+.mo 0644 bin bin 5413 9574 1024643859 1 d none lib/locale/ca 0755 bin bin 1 d none lib/locale/ca/LC_MESSAGES 0755 bin bin 1 f none lib/locale/ca/LC_MESSAGES/gtk+.mo 0644 bin bin 5469 56144 1024643859 1 d none lib/locale/cs 0755 bin bin 1 d none lib/locale/cs/LC_MESSAGES 0755 bin bin 1 f none lib/locale/cs/LC_MESSAGES/gtk+.mo 0644 bin bin 5370 919 1024643859 1 d none lib/locale/da 0755 bin bin 1 d none lib/locale/da/LC_MESSAGES 0755 bin bin 1 f none lib/locale/da/LC_MESSAGES/gtk+.mo 0644 bin bin 5316 43981 1024643859 1 d none lib/locale/de 0755 bin bin 1 d none lib/locale/de/LC_MESSAGES 0755 bin bin 1 f none lib/locale/de/LC_MESSAGES/gtk+.mo 0644 bin bin 5476 58786 1024643859 1 d none lib/locale/el 0755 bin bin 1 d none lib/locale/el/LC_MESSAGES 0755 bin bin 1 f none lib/locale/el/LC_MESSAGES/gtk+.mo 0644 bin bin 5612 38482 1024643859 1 d none lib/locale/es 0755 bin bin 1 d none lib/locale/es/LC_MESSAGES 0755 bin bin 1 f none lib/locale/es/LC_MESSAGES/gtk+.mo 0644 bin bin 5544 62985 1024643859 1 d none lib/locale/et 0755 bin bin 1 d none lib/locale/et/LC_MESSAGES 0755 bin bin 1 f none lib/locale/et/LC_MESSAGES/gtk+.mo 0644 bin bin 5291 39891 1024643860 1 d none lib/locale/eu 0755 bin bin 1 d none lib/locale/eu/LC_MESSAGES 0755 bin bin 1 f none lib/locale/eu/LC_MESSAGES/gtk+.mo 0644 bin bin 5473 54832 1024643860 1 d none lib/locale/fi 0755 bin bin 1 d none lib/locale/fi/LC_MESSAGES 0755 bin bin 1 f none lib/locale/fi/LC_MESSAGES/gtk+.mo 0644 bin bin 5448 60501 1024643860 1 d none lib/locale/fr 0755 bin bin 1 d none lib/locale/fr/LC_MESSAGES 0755 bin bin 1 f none lib/locale/fr/LC_MESSAGES/gtk+.mo 0644 bin bin 5628 7320 1024643860 1 d none lib/locale/ga 0755 bin bin 1 d none lib/locale/ga/LC_MESSAGES 0755 bin bin 1 f none lib/locale/ga/LC_MESSAGES/gtk+.mo 0644 bin bin 5574 6189 1024643860 1 d none lib/locale/gl 0755 bin bin 1 d none lib/locale/gl/LC_MESSAGES 0755 bin bin 1 f none lib/locale/gl/LC_MESSAGES/gtk+.mo 0644 bin bin 5498 59235 1024643861 1 d none lib/locale/hr 0755 bin bin 1 d none lib/locale/hr/LC_MESSAGES 0755 bin bin 1 f none lib/locale/hr/LC_MESSAGES/gtk+.mo 0644 bin bin 4882 25017 1024643861 1 d none lib/locale/hu 0755 bin bin 1 d none lib/locale/hu/LC_MESSAGES 0755 bin bin 1 f none lib/locale/hu/LC_MESSAGES/gtk+.mo 0644 bin bin 5423 9786 1024643861 1 d none lib/locale/it 0755 bin bin 1 d none lib/locale/it/LC_MESSAGES 0755 bin bin 1 f none lib/locale/it/LC_MESSAGES/gtk+.mo 0644 bin bin 5611 2597 1024643861 1 d none lib/locale/ja 0755 bin bin 1 d none lib/locale/ja/LC_MESSAGES 0755 bin bin 1 f none lib/locale/ja/LC_MESSAGES/gtk+.mo 0644 bin bin 5291 65475 1024643861 1 d none lib/locale/ko 0755 bin bin 1 d none lib/locale/ko/LC_MESSAGES 0755 bin bin 1 f none lib/locale/ko/LC_MESSAGES/gtk+.mo 0644 bin bin 5085 27163 1024643861 1 d none lib/locale/lt 0755 bin bin 1 d none lib/locale/lt/LC_MESSAGES 0755 bin bin 1 f none lib/locale/lt/LC_MESSAGES/gtk+.mo 0644 bin bin 5444 1988 1024643861 1 d none lib/locale/nl 0755 bin bin 1 d none lib/locale/nl/LC_MESSAGES 0755 bin bin 1 f none lib/locale/nl/LC_MESSAGES/gtk+.mo 0644 bin bin 5275 48315 1024643862 1 d none lib/locale/nn 0755 bin bin 1 d none lib/locale/nn/LC_MESSAGES 0755 bin bin 1 f none lib/locale/nn/LC_MESSAGES/gtk+.mo 0644 bin bin 5395 49503 1024643862 1 d none lib/locale/no 0755 bin bin 1 d none lib/locale/no/LC_MESSAGES 0755 bin bin 1 f none lib/locale/no/LC_MESSAGES/gtk+.mo 0644 bin bin 5387 48583 1024643862 1 d none lib/locale/pl 0755 bin bin 1 d none lib/locale/pl/LC_MESSAGES 0755 bin bin 1 f none lib/locale/pl/LC_MESSAGES/gtk+.mo 0644 bin bin 5474 65101 1024643862 1 d none lib/locale/pt 0755 bin bin 1 d none lib/locale/pt/LC_MESSAGES 0755 bin bin 1 f none lib/locale/pt/LC_MESSAGES/gtk+.mo 0644 bin bin 5198 40372 1024643862 1 d none lib/locale/pt_BR 0755 bin bin 1 d none lib/locale/pt_BR/LC_MESSAGES 0755 bin bin 1 f none lib/locale/pt_BR/LC_MESSAGES/gtk+.mo 0644 bin bin 5471 58830 1024643862 1 d none lib/locale/ro 0755 bin bin 1 d none lib/locale/ro/LC_MESSAGES 0755 bin bin 1 f none lib/locale/ro/LC_MESSAGES/gtk+.mo 0644 bin bin 5372 49809 1024643862 1 d none lib/locale/ru 0755 bin bin 1 d none lib/locale/ru/LC_MESSAGES 0755 bin bin 1 f none lib/locale/ru/LC_MESSAGES/gtk+.mo 0644 bin bin 5367 29101 1024643863 1 d none lib/locale/sk 0755 bin bin 1 d none lib/locale/sk/LC_MESSAGES 0755 bin bin 1 f none lib/locale/sk/LC_MESSAGES/gtk+.mo 0644 bin bin 5332 58175 1024643863 1 d none lib/locale/sl 0755 bin bin 1 d none lib/locale/sl/LC_MESSAGES 0755 bin bin 1 f none lib/locale/sl/LC_MESSAGES/gtk+.mo 0644 bin bin 5396 50016 1024643863 1 d none lib/locale/sp 0755 bin bin 1 d none lib/locale/sp/LC_MESSAGES 0755 bin bin 1 f none lib/locale/sp/LC_MESSAGES/gtk+.mo 0644 bin bin 5378 33117 1024643863 1 d none lib/locale/sr 0755 bin bin 1 d none lib/locale/sr/LC_MESSAGES 0755 bin bin 1 f none lib/locale/sr/LC_MESSAGES/gtk+.mo 0644 bin bin 5386 49440 1024643863 1 d none lib/locale/sv 0755 bin bin 1 d none lib/locale/sv/LC_MESSAGES 0755 bin bin 1 f none lib/locale/sv/LC_MESSAGES/gtk+.mo 0644 bin bin 5355 50150 1024643863 1 d none lib/locale/tr 0755 bin bin 1 d none lib/locale/tr/LC_MESSAGES 0755 bin bin 1 f none lib/locale/tr/LC_MESSAGES/gtk+.mo 0644 bin bin 5331 58986 1024643863 1 d none lib/locale/uk 0755 bin bin 1 d none lib/locale/uk/LC_MESSAGES 0755 bin bin 1 f none lib/locale/uk/LC_MESSAGES/gtk+.mo 0644 bin bin 5399 30588 1024643863 1 d none lib/locale/vi 0755 bin bin 1 d none lib/locale/vi/LC_MESSAGES 0755 bin bin 1 f none lib/locale/vi/LC_MESSAGES/gtk+.mo 0644 bin bin 5407 5195 1024643864 1 d none lib/locale/wa 0755 bin bin 1 d none lib/locale/wa/LC_MESSAGES 0755 bin bin 1 f none lib/locale/wa/LC_MESSAGES/gtk+.mo 0644 bin bin 5471 60745 1024643864 1 d none lib/locale/zh_CN.GB2312 0755 bin bin 1 d none lib/locale/zh_CN.GB2312/LC_MESSAGES 0755 bin bin 1 f none lib/locale/zh_CN.GB2312/LC_MESSAGES/gtk+.mo 0644 bin bin 4687 53901 1024643864 1 d none lib/locale/zh_TW.Big5 0755 bin bin 1 d none lib/locale/zh_TW.Big5/LC_MESSAGES 0755 bin bin 1 f none lib/locale/zh_TW.Big5/LC_MESSAGES/gtk+.mo 0644 bin bin 4704 33304 1024643864 1 d none lib/pkgconfig 0755 bin bin 1 f none lib/pkgconfig/gdk.pc 0644 bin bin 322 28217 1024643894 1 f none lib/pkgconfig/gtk+.pc 0644 bin bin 197 17454 1024643894 1 d none man 0755 bin bin 1 d none man/man1 0755 bin bin 1 f none man/man1/gtk-config.1 0644 bin bin 1886 33770 1024643894 1 i pkginfo 170 13789 1024644235 1 d none share 0755 bin bin 1 d none share/aclocal 0755 bin bin 1 f none share/aclocal/gtk.m4 0644 bin bin 8285 54690 1024643894 1 d none share/themes 0755 bin bin 1 d none share/themes/Default 0755 bin bin 1 d none share/themes/Default/gtk 0755 bin bin 1 f none share/themes/Default/gtk/gtkrc 0644 bin bin 32 2870 1024643892 07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000b00000000TRAILER!!!07070100008529000081a40000000a0000000a000000013d12d48b000000aa000000880000000300000000000000000000000800000000pkginfoPKG=SMCgtk NAME=gtk+ ARCH=sparc VERSION=1.2.10 CATEGORY=application VENDOR=The GTK Team EMAIL=steve@smc.vnet.net PSTAMP=Steve Christensen BASEDIR=/usr/local CLASSES=none 07070100008528000081a40000000a0000000a000000013d12d48c00009a16000000880000000300000000000000000000000700000000pkgmap: 1 63320 1 d none bin 0755 bin bin 1 f none bin/gtk-config 0755 bin bin 2141 30819 1024643894 1 d none doc 0755 bin bin 1 d none doc/gtk 0755 bin bin 1 f none doc/gtk/ABOUT-NLS 0644 bin bin 11651 30128 1024643992 1 f none doc/gtk/AUTHORS 0644 bin bin 1061 21652 1024643992 1 f none doc/gtk/COPYING 0644 bin bin 25292 37909 1024643992 1 f none doc/gtk/ChangeLog 0644 bin bin 449090 15343 1024643992 1 f none doc/gtk/ChangeLog.pre-1-0 0644 bin bin 180062 64143 1024643992 1 f none doc/gtk/HACKING 0644 bin bin 2002 43267 1024643992 1 f none doc/gtk/INSTALL 0644 bin bin 7332 46784 1024643992 1 f none doc/gtk/Makefile 0644 bin bin 21100 15916 1024643992 1 f none doc/gtk/Makefile.am 0644 bin bin 3752 55832 1024643992 1 f none doc/gtk/Makefile.in 0644 bin bin 20291 1967 1024643992 1 f none doc/gtk/NEWS 0644 bin bin 19945 59558 1024643992 1 f none doc/gtk/NEWS.pre-1-0 0644 bin bin 4525 10420 1024643992 1 f none doc/gtk/README 0644 bin bin 2201 61184 1024643992 1 f none doc/gtk/README.cvs-commits 0644 bin bin 2470 18579 1024643992 1 f none doc/gtk/TODO 0644 bin bin 6515 35168 1024643992 1 d none doc/gtk/docs 0755 bin bin 1 f none doc/gtk/docs/Changes-1.2.txt 0644 bin bin 10567 46789 1024643996 1 f none doc/gtk/docs/Makefile 0644 bin bin 16747 23950 1024643998 1 f none doc/gtk/docs/Makefile.am 0644 bin bin 5020 18346 1024643996 1 f none doc/gtk/docs/Makefile.in 0644 bin bin 15864 4290 1024643992 1 f none doc/gtk/docs/debugging.txt 0644 bin bin 2800 38340 1024643996 1 f none doc/gtk/docs/developers.txt 0644 bin bin 2607 27852 1024643996 1 f none doc/gtk/docs/gdk.info 0644 bin bin 10909 15388 1024643998 1 f none doc/gtk/docs/gdk.texi 0644 bin bin 10714 39693 1024643996 1 f none doc/gtk/docs/generation.txt 0644 bin bin 4490 59371 1024643996 1 f none doc/gtk/docs/gtk-config.1 0644 bin bin 1886 33770 1024643998 1 f none doc/gtk/docs/gtk-config.1.in 0644 bin bin 1889 34160 1024643996 1 f none doc/gtk/docs/gtk-config.txt 0644 bin bin 7067 2376 1024643996 1 f none doc/gtk/docs/gtk.info 0644 bin bin 3892 61250 1024643998 1 f none doc/gtk/docs/gtk.info-1 0644 bin bin 49892 15371 1024643998 1 f none doc/gtk/docs/gtk.info-2 0644 bin bin 50130 23514 1024643998 1 f none doc/gtk/docs/gtk.info-3 0644 bin bin 50215 36011 1024643998 1 f none doc/gtk/docs/gtk.info-4 0644 bin bin 50716 10096 1024643998 1 f none doc/gtk/docs/gtk.info-5 0644 bin bin 8294 27617 1024643998 1 f none doc/gtk/docs/gtk.info-6 0644 bin bin 46874 54808 1024643998 1 f none doc/gtk/docs/gtk.texi 0644 bin bin 189766 17138 1024643996 1 f none doc/gtk/docs/gtk_tut.sgml 0644 bin bin 620476 51693 1024643997 1 f none doc/gtk/docs/gtk_tut_fr.sgml 0644 bin bin 283566 19880 1024643997 1 f none doc/gtk/docs/gtk_tut_it.sgml 0644 bin bin 360095 8942 1024643997 1 f none doc/gtk/docs/gtk_tut_packbox1.gif 0644 bin bin 6797 8787 1024643997 1 f none doc/gtk/docs/gtk_tut_packbox2.gif 0644 bin bin 6024 42005 1024643997 1 f none doc/gtk/docs/gtk_tut_table.gif 0644 bin bin 2429 48186 1024643998 1 f none doc/gtk/docs/gtkdocs_fix 0755 bin bin 289 21383 1024643996 1 f none doc/gtk/docs/gtkfaq.sgml 0644 bin bin 100889 21943 1024643996 1 d none doc/gtk/docs/html 0755 bin bin 1 f none doc/gtk/docs/html/gtk_tut-1.html 0644 bin bin 4824 30855 1024643992 1 f none doc/gtk/docs/html/gtk_tut-10.html 0644 bin bin 68535 30730 1024643993 1 f none doc/gtk/docs/html/gtk_tut-11.html 0644 bin bin 26424 31572 1024643993 1 f none doc/gtk/docs/html/gtk_tut-12.html 0644 bin bin 30794 24696 1024643993 1 f none doc/gtk/docs/html/gtk_tut-13.html 0644 bin bin 18302 35669 1024643993 1 f none doc/gtk/docs/html/gtk_tut-14.html 0644 bin bin 14845 16710 1024643993 1 f none doc/gtk/docs/html/gtk_tut-15.html 0644 bin bin 1820 10975 1024643993 1 f none doc/gtk/docs/html/gtk_tut-16.html 0644 bin bin 2451 44684 1024643993 1 f none doc/gtk/docs/html/gtk_tut-17.html 0644 bin bin 4371 27693 1024643993 1 f none doc/gtk/docs/html/gtk_tut-18.html 0644 bin bin 6952 29396 1024643993 1 f none doc/gtk/docs/html/gtk_tut-19.html 0644 bin bin 14510 40898 1024643993 1 f none doc/gtk/docs/html/gtk_tut-2.html 0644 bin bin 25913 61398 1024643992 1 f none doc/gtk/docs/html/gtk_tut-20.html 0644 bin bin 14437 27671 1024643993 1 f none doc/gtk/docs/html/gtk_tut-21.html 0644 bin bin 10418 22001 1024643993 1 f none doc/gtk/docs/html/gtk_tut-22.html 0644 bin bin 45855 33815 1024643993 1 f none doc/gtk/docs/html/gtk_tut-23.html 0644 bin bin 28988 35198 1024643993 1 f none doc/gtk/docs/html/gtk_tut-24.html 0644 bin bin 1596 2313 1024643993 1 f none doc/gtk/docs/html/gtk_tut-25.html 0644 bin bin 1326 43141 1024643993 1 f none doc/gtk/docs/html/gtk_tut-26.html 0644 bin bin 3462 26176 1024643993 1 f none doc/gtk/docs/html/gtk_tut-27.html 0644 bin bin 1916 33867 1024643993 1 f none doc/gtk/docs/html/gtk_tut-28.html 0644 bin bin 26132 4336 1024643993 1 f none doc/gtk/docs/html/gtk_tut-29.html 0644 bin bin 8648 31486 1024643993 1 f none doc/gtk/docs/html/gtk_tut-3.html 0644 bin bin 7633 20237 1024643992 1 f none doc/gtk/docs/html/gtk_tut-30.html 0644 bin bin 44662 23401 1024643993 1 f none doc/gtk/docs/html/gtk_tut-31.html 0644 bin bin 20835 8756 1024643993 1 f none doc/gtk/docs/html/gtk_tut-4.html 0644 bin bin 25994 5542 1024643993 1 f none doc/gtk/docs/html/gtk_tut-5.html 0644 bin bin 6163 56663 1024643993 1 f none doc/gtk/docs/html/gtk_tut-6.html 0644 bin bin 15119 2130 1024643993 1 f none doc/gtk/docs/html/gtk_tut-7.html 0644 bin bin 10366 49084 1024643993 1 f none doc/gtk/docs/html/gtk_tut-8.html 0644 bin bin 23761 48075 1024643993 1 f none doc/gtk/docs/html/gtk_tut-9.html 0644 bin bin 119844 43479 1024643993 1 f none doc/gtk/docs/html/gtk_tut.html 0644 bin bin 13040 58095 1024643992 1 f none doc/gtk/docs/html/gtk_tut_fr-1.html 0644 bin bin 2958 3360 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-10.html 0644 bin bin 4000 3855 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-11.html 0644 bin bin 18769 37139 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-12.html 0644 bin bin 20552 60406 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-13.html 0644 bin bin 4045 9874 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-14.html 0644 bin bin 3102 12911 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-15.html 0644 bin bin 4660 7174 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-16.html 0644 bin bin 14970 2818 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-17.html 0644 bin bin 10957 37437 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-18.html 0644 bin bin 11240 60482 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-19.html 0644 bin bin 47425 56611 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-2.html 0644 bin bin 22833 21211 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-20.html 0644 bin bin 31743 47222 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-21.html 0644 bin bin 1155 30231 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-22.html 0644 bin bin 1418 55581 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-23.html 0644 bin bin 2878 48217 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-24.html 0644 bin bin 1682 11799 1024643994 1 f none doc/gtk/docs/html/gtk_tut_fr-3.html 0644 bin bin 7617 64961 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-4.html 0644 bin bin 24720 21792 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-5.html 0644 bin bin 6983 38542 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-6.html 0644 bin bin 9782 50436 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-7.html 0644 bin bin 28101 51713 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-8.html 0644 bin bin 17294 42351 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr-9.html 0644 bin bin 21851 12130 1024643993 1 f none doc/gtk/docs/html/gtk_tut_fr.html 0644 bin bin 7811 20724 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-1.html 0644 bin bin 3129 11674 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-10.html 0644 bin bin 24012 17137 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-11.html 0644 bin bin 9997 55570 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-12.html 0644 bin bin 20730 51529 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-13.html 0644 bin bin 4080 8292 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-14.html 0644 bin bin 3016 2784 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-15.html 0644 bin bin 4582 55917 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-16.html 0644 bin bin 15298 60321 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-17.html 0644 bin bin 10727 8006 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-18.html 0644 bin bin 11352 55157 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-19.html 0644 bin bin 48196 59809 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-2.html 0644 bin bin 23042 9480 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-20.html 0644 bin bin 33068 37569 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-21.html 0644 bin bin 1052 19385 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-22.html 0644 bin bin 1384 48999 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-23.html 0644 bin bin 2747 33292 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-24.html 0644 bin bin 3478 47279 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-3.html 0644 bin bin 7476 40303 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-4.html 0644 bin bin 28862 41895 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-5.html 0644 bin bin 6628 30132 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-6.html 0644 bin bin 13722 36225 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-7.html 0644 bin bin 58099 14116 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-8.html 0644 bin bin 27452 989 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it-9.html 0644 bin bin 22361 47362 1024643994 1 f none doc/gtk/docs/html/gtk_tut_it.html 0644 bin bin 8901 34680 1024643994 1 f none doc/gtk/docs/html/gtk_tut_packbox1.gif 0644 bin bin 6797 8787 1024643992 1 f none doc/gtk/docs/html/gtk_tut_packbox2.gif 0644 bin bin 6024 42005 1024643992 1 f none doc/gtk/docs/html/gtk_tut_table.gif 0644 bin bin 2429 48186 1024643992 1 f none doc/gtk/docs/html/gtkfaq-1.html 0644 bin bin 9526 16464 1024643994 1 f none doc/gtk/docs/html/gtkfaq-2.html 0644 bin bin 6902 59667 1024643994 1 f none doc/gtk/docs/html/gtkfaq-3.html 0644 bin bin 7901 13768 1024643994 1 f none doc/gtk/docs/html/gtkfaq-4.html 0644 bin bin 6229 58291 1024643994 1 f none doc/gtk/docs/html/gtkfaq-5.html 0644 bin bin 33321 31515 1024643994 1 f none doc/gtk/docs/html/gtkfaq-6.html 0644 bin bin 19428 32242 1024643994 1 f none doc/gtk/docs/html/gtkfaq-7.html 0644 bin bin 2798 28296 1024643994 1 f none doc/gtk/docs/html/gtkfaq.html 0644 bin bin 9414 24030 1024643994 1 f none doc/gtk/docs/macros.texi 0644 bin bin 521 47454 1024643996 1 f none doc/gtk/docs/refcounting.txt 0644 bin bin 11785 40896 1024643996 1 f none doc/gtk/docs/styles.txt 0644 bin bin 3855 14979 1024643996 1 f none doc/gtk/docs/texinfo.tex 0644 bin bin 183111 21239 1024643996 1 d none doc/gtk/docs/text 0755 bin bin 1 f none doc/gtk/docs/text/gtk_tut.txt 0644 bin bin 619212 22985 1024643995 1 f none doc/gtk/docs/text/gtk_tut_fr.txt 0644 bin bin 307528 3924 1024643995 1 f none doc/gtk/docs/text/gtk_tut_it.txt 0644 bin bin 360990 12279 1024643996 1 f none doc/gtk/docs/text/gtkfaq.txt 0644 bin bin 104712 33153 1024643996 1 f none doc/gtk/docs/text_widget.txt 0644 bin bin 21485 36639 1024643996 1 f none doc/gtk/docs/widget_system.txt 0644 bin bin 15559 13425 1024643996 1 d none doc/gtk/examples 0755 bin bin 1 f none doc/gtk/examples/Makefile 0644 bin bin 688 51427 1024643999 1 f none doc/gtk/examples/README.1ST 0644 bin bin 1280 45473 1024643999 1 d none doc/gtk/examples/aspectframe 0755 bin bin 1 f none doc/gtk/examples/aspectframe/Makefile 0644 bin bin 150 12434 1024643998 1 f none doc/gtk/examples/aspectframe/aspectframe.c 0644 bin bin 1515 45741 1024643998 1 d none doc/gtk/examples/base 0755 bin bin 1 f none doc/gtk/examples/base/Makefile 0644 bin bin 115 8674 1024643998 1 f none doc/gtk/examples/base/base.c 0644 bin bin 310 22765 1024643998 1 d none doc/gtk/examples/buttons 0755 bin bin 1 f none doc/gtk/examples/buttons/Makefile 0644 bin bin 130 10534 1024643998 1 f none doc/gtk/examples/buttons/buttons.c 0644 bin bin 2866 27852 1024643998 1 f none doc/gtk/examples/buttons/info.xpm 0644 bin bin 2039 41784 1024643998 1 d none doc/gtk/examples/calendar 0755 bin bin 1 f none doc/gtk/examples/calendar/Makefile 0644 bin bin 129 10454 1024643998 1 f none doc/gtk/examples/calendar/calendar.c 0644 bin bin 12616 19475 1024643998 1 d none doc/gtk/examples/clist 0755 bin bin 1 f none doc/gtk/examples/clist/Makefile 0644 bin bin 120 9334 1024643998 1 f none doc/gtk/examples/clist/clist.c 0644 bin bin 5702 53953 1024643998 1 d none doc/gtk/examples/entry 0755 bin bin 1 f none doc/gtk/examples/entry/Makefile 0644 bin bin 120 9429 1024643998 1 f none doc/gtk/examples/entry/entry.c 0644 bin bin 3025 40464 1024643998 1 d none doc/gtk/examples/eventbox 0755 bin bin 1 f none doc/gtk/examples/eventbox/Makefile 0644 bin bin 135 10994 1024643998 1 f none doc/gtk/examples/eventbox/eventbox.c 0644 bin bin 1467 48857 1024643998 1 f none doc/gtk/examples/extract.awk 0644 bin bin 1509 44029 1024643999 1 f none doc/gtk/examples/extract.sh 0755 bin bin 746 58798 1024643999 1 d none doc/gtk/examples/filesel 0755 bin bin 1 f none doc/gtk/examples/filesel/Makefile 0644 bin bin 130 10319 1024643998 1 f none doc/gtk/examples/filesel/filesel.c 0644 bin bin 1437 44837 1024643998 1 f none doc/gtk/examples/find-examples.sh 0755 bin bin 183 14278 1024643999 1 d none doc/gtk/examples/fixed 0755 bin bin 1 f none doc/gtk/examples/fixed/Makefile 0644 bin bin 120 9259 1024643998 1 f none doc/gtk/examples/fixed/fixed.c 0644 bin bin 2024 30168 1024643998 1 d none doc/gtk/examples/frame 0755 bin bin 1 f none doc/gtk/examples/frame/Makefile 0644 bin bin 120 9234 1024643998 1 f none doc/gtk/examples/frame/frame.c 0644 bin bin 1328 39900 1024643998 1 d none doc/gtk/examples/gtkdial 0755 bin bin 1 f none doc/gtk/examples/gtkdial/Makefile 0644 bin bin 318 26581 1024643998 1 f none doc/gtk/examples/gtkdial/dial_test.c 0644 bin bin 1598 62541 1024643998 1 f none doc/gtk/examples/gtkdial/gtkdial.c 0644 bin bin 16913 38278 1024643998 1 f none doc/gtk/examples/gtkdial/gtkdial.h 0644 bin bin 2596 14061 1024643998 1 d none doc/gtk/examples/helloworld 0755 bin bin 1 f none doc/gtk/examples/helloworld/Makefile 0644 bin bin 145 12039 1024643998 1 f none doc/gtk/examples/helloworld/helloworld.c 0644 bin bin 3432 11103 1024643998 1 d none doc/gtk/examples/helloworld2 0755 bin bin 1 f none doc/gtk/examples/helloworld2/Makefile 0644 bin bin 150 12289 1024643998 1 f none doc/gtk/examples/helloworld2/helloworld2.c 0644 bin bin 3165 57344 1024643998 1 d none doc/gtk/examples/list 0755 bin bin 1 f none doc/gtk/examples/list/Makefile 0644 bin bin 115 8839 1024643998 1 f none doc/gtk/examples/list/list.c 0644 bin bin 8644 35499 1024643998 1 d none doc/gtk/examples/menu 0755 bin bin 1 f none doc/gtk/examples/menu/Makefile 0644 bin bin 255 21508 1024643998 1 f none doc/gtk/examples/menu/itemfactory.c 0644 bin bin 4130 54659 1024643998 1 f none doc/gtk/examples/menu/menu.c 0644 bin bin 4386 18656 1024643998 1 d none doc/gtk/examples/notebook 0755 bin bin 1 f none doc/gtk/examples/notebook/Makefile 0644 bin bin 135 10944 1024643998 1 f none doc/gtk/examples/notebook/notebook.c 0644 bin bin 5573 47349 1024643998 1 d none doc/gtk/examples/packbox 0755 bin bin 1 f none doc/gtk/examples/packbox/Makefile 0644 bin bin 130 10339 1024643998 1 f none doc/gtk/examples/packbox/packbox.c 0644 bin bin 10230 26786 1024643998 1 d none doc/gtk/examples/packer 0755 bin bin 1 f none doc/gtk/examples/packer/Makefile 0644 bin bin 124 9519 1024643998 1 f none doc/gtk/examples/packer/pack.c 0644 bin bin 23450 64162 1024643999 1 d none doc/gtk/examples/paned 0755 bin bin 1 f none doc/gtk/examples/paned/Makefile 0644 bin bin 120 9219 1024643999 1 f none doc/gtk/examples/paned/paned.c 0644 bin bin 4408 15417 1024643999 1 d none doc/gtk/examples/pixmap 0755 bin bin 1 f none doc/gtk/examples/pixmap/Makefile 0644 bin bin 125 9894 1024643999 1 f none doc/gtk/examples/pixmap/pixmap.c 0644 bin bin 2455 44545 1024643999 1 d none doc/gtk/examples/progressbar 0755 bin bin 1 f none doc/gtk/examples/progressbar/Makefile 0644 bin bin 150 12589 1024643999 1 f none doc/gtk/examples/progressbar/progressbar.c 0644 bin bin 7600 56269 1024643999 1 d none doc/gtk/examples/radiobuttons 0755 bin bin 1 f none doc/gtk/examples/radiobuttons/Makefile 0644 bin bin 155 13169 1024643999 1 f none doc/gtk/examples/radiobuttons/radiobuttons.c 0644 bin bin 2641 7699 1024643999 1 d none doc/gtk/examples/rangewidgets 0755 bin bin 1 f none doc/gtk/examples/rangewidgets/Makefile 0644 bin bin 155 13039 1024643999 1 f none doc/gtk/examples/rangewidgets/rangewidgets.c 0644 bin bin 10489 20444 1024643999 1 d none doc/gtk/examples/rulers 0755 bin bin 1 f none doc/gtk/examples/rulers/Makefile 0644 bin bin 125 9964 1024643999 1 f none doc/gtk/examples/rulers/rulers.c 0644 bin bin 3175 38007 1024643999 1 d none doc/gtk/examples/scribble-simple 0755 bin bin 1 f none doc/gtk/examples/scribble-simple/Makefile 0644 bin bin 170 14284 1024643999 1 f none doc/gtk/examples/scribble-simple/scribble-simple.c 0644 bin bin 4898 60283 1024643999 1 d none doc/gtk/examples/scrolledwin 0755 bin bin 1 f none doc/gtk/examples/scrolledwin/Makefile 0644 bin bin 150 12569 1024643999 1 f none doc/gtk/examples/scrolledwin/scrolledwin.c 0644 bin bin 3311 60371 1024643999 1 d none doc/gtk/examples/selection 0755 bin bin 1 f none doc/gtk/examples/selection/Makefile 0644 bin bin 298 26052 1024643999 1 f none doc/gtk/examples/selection/gettargets.c 0644 bin bin 2634 9231 1024643999 1 f none doc/gtk/examples/selection/setselection.c 0644 bin bin 3257 60634 1024643999 1 d none doc/gtk/examples/spinbutton 0755 bin bin 1 f none doc/gtk/examples/spinbutton/Makefile 0644 bin bin 145 12169 1024643999 1 f none doc/gtk/examples/spinbutton/spinbutton.c 0644 bin bin 7689 14690 1024643999 1 d none doc/gtk/examples/statusbar 0755 bin bin 1 f none doc/gtk/examples/statusbar/Makefile 0644 bin bin 140 11544 1024643999 1 f none doc/gtk/examples/statusbar/statusbar.c 0644 bin bin 2154 38078 1024643999 1 d none doc/gtk/examples/table 0755 bin bin 1 f none doc/gtk/examples/table/Makefile 0644 bin bin 120 9219 1024643999 1 f none doc/gtk/examples/table/table.c 0644 bin bin 2870 26462 1024643999 1 d none doc/gtk/examples/text 0755 bin bin 1 f none doc/gtk/examples/text/Makefile 0644 bin bin 115 8884 1024643999 1 f none doc/gtk/examples/text/text.c 0644 bin bin 5355 31741 1024643999 1 d none doc/gtk/examples/tictactoe 0755 bin bin 1 f none doc/gtk/examples/tictactoe/Makefile 0644 bin bin 325 27815 1024643999 1 f none doc/gtk/examples/tictactoe/tictactoe.c 0644 bin bin 4208 65529 1024643999 1 f none doc/gtk/examples/tictactoe/tictactoe.h 0644 bin bin 1825 17915 1024643999 1 f none doc/gtk/examples/tictactoe/ttt_test.c 0644 bin bin 891 4041 1024643999 1 d none doc/gtk/examples/tree 0755 bin bin 1 f none doc/gtk/examples/tree/Makefile 0644 bin bin 115 8779 1024643999 1 f none doc/gtk/examples/tree/tree.c 0644 bin bin 6598 64650 1024643999 1 d none doc/gtk/examples/wheelbarrow 0755 bin bin 1 f none doc/gtk/examples/wheelbarrow/Makefile 0644 bin bin 149 12517 1024643999 1 f none doc/gtk/examples/wheelbarrow/wheelbarrow.c 0644 bin bin 6188 36846 1024643999 1 d none etc 0755 bin bin 1 d none etc/gtk 0755 bin bin 1 f none etc/gtk/gtkrc.az 0644 bin bin 453 31980 1024643889 1 s none etc/gtk/gtkrc.be=gtkrc.cp1251 1 s none etc/gtk/gtkrc.bg=gtkrc.cp1251 1 s none etc/gtk/gtkrc.bg_BG.iso88595=gtkrc.iso-8859-5 1 f none etc/gtk/gtkrc.cp1251 0644 bin bin 338 25038 1024643890 1 f none etc/gtk/gtkrc.cp1255 0644 bin bin 338 25054 1024643890 1 s none etc/gtk/gtkrc.cs=gtkrc.iso-8859-2 1 s none etc/gtk/gtkrc.cy=gtkrc.iso-8859-14 1 f none etc/gtk/gtkrc.el 0644 bin bin 316 23060 1024643889 1 f none etc/gtk/gtkrc.eo 0644 bin bin 330 23552 1024643889 1 s none etc/gtk/gtkrc.et=gtkrc.iso-8859-15 1 s none etc/gtk/gtkrc.ga=gtkrc.iso-8859-14 1 f none etc/gtk/gtkrc.he 0644 bin bin 198 14668 1024643889 1 s none etc/gtk/gtkrc.he_IL.cp1255=gtkrc.cp1255 1 s none etc/gtk/gtkrc.he_IL.microsoftcp1255=gtkrc.cp1255 1 s none etc/gtk/gtkrc.hr=gtkrc.iso-8859-2 1 s none etc/gtk/gtkrc.hu=gtkrc.iso-8859-2 1 f none etc/gtk/gtkrc.hy 0644 bin bin 219 16669 1024643889 1 f none etc/gtk/gtkrc.iso-8859-13 0644 bin bin 349 24702 1024643889 1 f none etc/gtk/gtkrc.iso-8859-14 0644 bin bin 350 24716 1024643889 1 f none etc/gtk/gtkrc.iso-8859-15 0644 bin bin 350 24720 1024643889 1 f none etc/gtk/gtkrc.iso-8859-2 0644 bin bin 556 42032 1024643889 1 f none etc/gtk/gtkrc.iso-8859-5 0644 bin bin 555 42021 1024643889 1 f none etc/gtk/gtkrc.ja 0644 bin bin 311 22430 1024643889 1 s none etc/gtk/gtkrc.ka=gtkrc.ka_GE.georgianps 1 f none etc/gtk/gtkrc.ka_GE.georgianacademy 0644 bin bin 611 51535 1024643889 1 f none etc/gtk/gtkrc.ka_GE.georgianps 0644 bin bin 550 45920 1024643890 1 f none etc/gtk/gtkrc.ko 0644 bin bin 363 24262 1024643889 1 s none etc/gtk/gtkrc.lt=gtkrc.iso-8859-13 1 s none etc/gtk/gtkrc.lv=gtkrc.iso-8859-13 1 s none etc/gtk/gtkrc.mi=gtkrc.iso-8859-13 1 s none etc/gtk/gtkrc.mk=gtkrc.iso-8859-5 1 s none etc/gtk/gtkrc.pl=gtkrc.iso-8859-2 1 s none etc/gtk/gtkrc.ro=gtkrc.iso-8859-2 1 f none etc/gtk/gtkrc.ru 0644 bin bin 361 25447 1024643889 1 s none etc/gtk/gtkrc.ru_RU.iso88595=gtkrc.iso-8859-5 1 s none etc/gtk/gtkrc.sk=gtkrc.iso-8859-2 1 s none etc/gtk/gtkrc.sl=gtkrc.iso-8859-2 1 s none etc/gtk/gtkrc.sp=gtkrc.iso-8859-5 1 s none etc/gtk/gtkrc.sq=gtkrc.iso-8859-2 1 s none etc/gtk/gtkrc.sr=gtkrc.iso-8859-2 1 f none etc/gtk/gtkrc.th 0644 bin bin 441 33911 1024643889 1 f none etc/gtk/gtkrc.tr 0644 bin bin 330 23600 1024643889 1 f none etc/gtk/gtkrc.uk 0644 bin bin 509 39121 1024643889 1 s none etc/gtk/gtkrc.vi=gtkrc.vi_VN.tcvn 1 f none etc/gtk/gtkrc.vi_VN.tcvn 0644 bin bin 774 61566 1024643890 1 f none etc/gtk/gtkrc.vi_VN.viscii 0644 bin bin 767 61232 1024643890 1 s none etc/gtk/gtkrc.vi_VN.viscii111=gtkrc.vi_VN.viscii 1 s none etc/gtk/gtkrc.yi=gtkrc.cp1255 1 f none etc/gtk/gtkrc.zh_CN 0644 bin bin 431 34545 1024643889 1 f none etc/gtk/gtkrc.zh_TW.big5 0644 bin bin 614 49491 1024643889 1 d none include 0755 bin bin 1 d none include/gtk-1.2 0755 bin bin 1 d none include/gtk-1.2/gdk 0755 bin bin 1 f none include/gtk-1.2/gdk/gdk.h 0644 bin bin 34746 14919 1024643869 1 f none include/gtk-1.2/gdk/gdkcursors.h 0644 bin bin 1574 35617 1024643869 1 f none include/gtk-1.2/gdk/gdki18n.h 0644 bin bin 1776 11437 1024643869 1 f none include/gtk-1.2/gdk/gdkkeysyms.h 0644 bin bin 38539 16727 1024643869 1 f none include/gtk-1.2/gdk/gdkprivate.h 0644 bin bin 8515 56532 1024643869 1 f none include/gtk-1.2/gdk/gdkrgb.h 0644 bin bin 3305 65355 1024643869 1 f none include/gtk-1.2/gdk/gdktypes.h 0644 bin bin 29094 49524 1024643869 1 f none include/gtk-1.2/gdk/gdkx.h 0644 bin bin 2956 40212 1024643869 1 d none include/gtk-1.2/gtk 0755 bin bin 1 f none include/gtk-1.2/gtk/gtk.h 0644 bin bin 4155 38784 1024643890 1 f none include/gtk-1.2/gtk/gtkaccelgroup.h 0644 bin bin 5339 38855 1024643890 1 f none include/gtk-1.2/gtk/gtkaccellabel.h 0644 bin bin 2815 32619 1024643890 1 f none include/gtk-1.2/gtk/gtkadjustment.h 0644 bin bin 2848 32829 1024643890 1 f none include/gtk-1.2/gtk/gtkalignment.h 0644 bin bin 2529 64695 1024643890 1 f none include/gtk-1.2/gtk/gtkarg.h 0644 bin bin 3056 46336 1024643890 1 f none include/gtk-1.2/gtk/gtkarrow.h 0644 bin bin 2250 49186 1024643890 1 f none include/gtk-1.2/gtk/gtkaspectframe.h 0644 bin bin 2626 11697 1024643890 1 f none include/gtk-1.2/gtk/gtkbbox.h 0644 bin bin 3340 22421 1024643890 1 f none include/gtk-1.2/gtk/gtkbin.h 0644 bin bin 1986 27390 1024643890 1 f none include/gtk-1.2/gtk/gtkbindings.h 0644 bin bin 4486 43424 1024643890 1 f none include/gtk-1.2/gtk/gtkbox.h 0644 bin bin 3280 57926 1024643890 1 f none include/gtk-1.2/gtk/gtkbutton.h 0644 bin bin 2944 40219 1024643890 1 f none include/gtk-1.2/gtk/gtkcalendar.h 0644 bin bin 3989 57366 1024643890 1 f none include/gtk-1.2/gtk/gtkcheckbutton.h 0644 bin bin 2577 12526 1024643890 1 f none include/gtk-1.2/gtk/gtkcheckmenuitem.h 0644 bin bin 2787 32597 1024643890 1 f none include/gtk-1.2/gtk/gtkclist.h 0644 bin bin 22695 18593 1024643890 1 f none include/gtk-1.2/gtk/gtkcolorsel.h 0644 bin bin 4943 6088 1024643890 1 f none include/gtk-1.2/gtk/gtkcombo.h 0644 bin bin 3594 16793 1024643890 1 f none include/gtk-1.2/gtk/gtkcompat.h 0644 bin bin 2394 8427 1024643890 1 f none include/gtk-1.2/gtk/gtkcontainer.h 0644 bin bin 8536 16372 1024643890 1 f none include/gtk-1.2/gtk/gtkctree.h 0644 bin bin 16313 20001 1024643890 1 f none include/gtk-1.2/gtk/gtkcurve.h 0644 bin bin 3029 49395 1024643890 1 f none include/gtk-1.2/gtk/gtkdata.h 0644 bin bin 1956 27224 1024643890 1 f none include/gtk-1.2/gtk/gtkdebug.h 0644 bin bin 1812 8608 1024643890 1 f none include/gtk-1.2/gtk/gtkdialog.h 0644 bin bin 2157 42136 1024643890 1 f none include/gtk-1.2/gtk/gtkdnd.h 0644 bin bin 4399 14579 1024643890 1 f none include/gtk-1.2/gtk/gtkdrawingarea.h 0644 bin bin 2321 54753 1024643890 1 f none include/gtk-1.2/gtk/gtkeditable.h 0644 bin bin 5753 48091 1024643890 1 f none include/gtk-1.2/gtk/gtkentry.h 0644 bin bin 3803 39004 1024643890 1 f none include/gtk-1.2/gtk/gtkenums.h 0644 bin bin 6456 37366 1024643890 1 f none include/gtk-1.2/gtk/gtkeventbox.h 0644 bin bin 2054 36290 1024643890 1 f none include/gtk-1.2/gtk/gtkfeatures.h 0644 bin bin 3362 62071 1024643892 1 f none include/gtk-1.2/gtk/gtkfilesel.h 0644 bin bin 3238 4123 1024643890 1 f none include/gtk-1.2/gtk/gtkfixed.h 0644 bin bin 2694 3546 1024643890 1 f none include/gtk-1.2/gtk/gtkfontsel.h 0644 bin bin 10826 37908 1024643891 1 f none include/gtk-1.2/gtk/gtkframe.h 0644 bin bin 2497 65419 1024643891 1 f none include/gtk-1.2/gtk/gtkgamma.h 0644 bin bin 2093 42141 1024643891 1 f none include/gtk-1.2/gtk/gtkgc.h 0644 bin bin 1503 54590 1024643891 1 f none include/gtk-1.2/gtk/gtkhandlebox.h 0644 bin bin 3351 4606 1024643891 1 f none include/gtk-1.2/gtk/gtkhbbox.h 0644 bin bin 2248 58973 1024643891 1 f none include/gtk-1.2/gtk/gtkhbox.h 0644 bin bin 1982 29306 1024643891 1 f none include/gtk-1.2/gtk/gtkhpaned.h 0644 bin bin 1882 22827 1024643891 1 f none include/gtk-1.2/gtk/gtkhruler.h 0644 bin bin 1882 23609 1024643891 1 f none include/gtk-1.2/gtk/gtkhscale.h 0644 bin bin 2046 33765 1024643891 1 f none include/gtk-1.2/gtk/gtkhscrollbar.h 0644 bin bin 2153 44207 1024643891 1 f none include/gtk-1.2/gtk/gtkhseparator.h 0644 bin bin 2162 43442 1024643891 1 f none include/gtk-1.2/gtk/gtkimage.h 0644 bin bin 2317 50017 1024643891 1 f none include/gtk-1.2/gtk/gtkinputdialog.h 0644 bin bin 2632 14846 1024643891 1 f none include/gtk-1.2/gtk/gtkinvisible.h 0644 bin bin 2062 36807 1024643891 1 f none include/gtk-1.2/gtk/gtkitem.h 0644 bin bin 2201 44641 1024643891 1 f none include/gtk-1.2/gtk/gtkitemfactory.h 0644 bin bin 7933 53452 1024643891 1 f none include/gtk-1.2/gtk/gtklabel.h 0644 bin bin 3110 45735 1024643891 1 f none include/gtk-1.2/gtk/gtklayout.h 0644 bin bin 4096 56233 1024643891 1 f none include/gtk-1.2/gtk/gtklist.h 0644 bin bin 4756 38059 1024643891 1 f none include/gtk-1.2/gtk/gtklistitem.h 0644 bin bin 3127 54845 1024643891 1 f none include/gtk-1.2/gtk/gtkmain.h 0644 bin bin 5425 33154 1024643891 1 f none include/gtk-1.2/gtk/gtkmarshal.h 0644 bin bin 5876 6147 1024643892 1 f none include/gtk-1.2/gtk/gtkmenu.h 0644 bin bin 5471 40199 1024643891 1 f none include/gtk-1.2/gtk/gtkmenubar.h 0644 bin bin 2502 4064 1024643891 1 f none include/gtk-1.2/gtk/gtkmenufactory.h 0644 bin bin 3059 54415 1024643891 1 f none include/gtk-1.2/gtk/gtkmenuitem.h 0644 bin bin 3529 27609 1024643891 1 f none include/gtk-1.2/gtk/gtkmenushell.h 0644 bin bin 3377 13627 1024643891 1 f none include/gtk-1.2/gtk/gtkmisc.h 0644 bin bin 2184 44111 1024643891 1 f none include/gtk-1.2/gtk/gtknotebook.h 0644 bin bin 7766 60569 1024643891 1 f none include/gtk-1.2/gtk/gtkobject.h 0644 bin bin 13065 64212 1024643891 1 f none include/gtk-1.2/gtk/gtkoptionmenu.h 0644 bin bin 2564 13123 1024643891 1 f none include/gtk-1.2/gtk/gtkpacker.h 0644 bin bin 4809 35910 1024643891 1 f none include/gtk-1.2/gtk/gtkpaned.h 0644 bin bin 3549 17621 1024643891 1 f none include/gtk-1.2/gtk/gtkpixmap.h 0644 bin bin 2430 64768 1024643891 1 f none include/gtk-1.2/gtk/gtkplug.h 0644 bin bin 1958 30344 1024643891 1 f none include/gtk-1.2/gtk/gtkpreview.h 0644 bin bin 4303 215 1024643891 1 f none include/gtk-1.2/gtk/gtkprivate.h 0644 bin bin 3314 59335 1024643891 1 f none include/gtk-1.2/gtk/gtkprogress.h 0644 bin bin 3811 40702 1024643891 1 f none include/gtk-1.2/gtk/gtkprogressbar.h 0644 bin bin 3422 14983 1024643891 1 f none include/gtk-1.2/gtk/gtkradiobutton.h 0644 bin bin 2678 22279 1024643891 1 f none include/gtk-1.2/gtk/gtkradiomenuitem.h 0644 bin bin 2562 12866 1024643891 1 f none include/gtk-1.2/gtk/gtkrange.h 0644 bin bin 5155 1666 1024643891 1 f none include/gtk-1.2/gtk/gtkrc.h 0644 bin bin 4339 17856 1024643891 1 f none include/gtk-1.2/gtk/gtkruler.h 0644 bin bin 3296 4250 1024643891 1 f none include/gtk-1.2/gtk/gtkscale.h 0644 bin bin 2504 2819 1024643891 1 f none include/gtk-1.2/gtk/gtkscrollbar.h 0644 bin bin 2050 35025 1024643891 1 f none include/gtk-1.2/gtk/gtkscrolledwindow.h 0644 bin bin 3547 30178 1024643891 1 f none include/gtk-1.2/gtk/gtkselection.h 0644 bin bin 4305 9256 1024643891 1 f none include/gtk-1.2/gtk/gtkseparator.h 0644 bin bin 2082 36705 1024643891 1 f none include/gtk-1.2/gtk/gtksignal.h 0644 bin bin 7366 37659 1024643891 1 f none include/gtk-1.2/gtk/gtksocket.h 0644 bin bin 2163 46821 1024643891 1 f none include/gtk-1.2/gtk/gtkspinbutton.h 0644 bin bin 4509 38215 1024643891 1 f none include/gtk-1.2/gtk/gtkstatusbar.h 0644 bin bin 2979 49063 1024643892 1 f none include/gtk-1.2/gtk/gtkstyle.h 0644 bin bin 21243 65172 1024643891 1 f none include/gtk-1.2/gtk/gtktable.h 0644 bin bin 4032 52888 1024643892 1 f none include/gtk-1.2/gtk/gtktearoffmenuitem.h 0644 bin bin 2289 56327 1024643892 1 f none include/gtk-1.2/gtk/gtktext.h 0644 bin bin 7012 28848 1024643892 1 f none include/gtk-1.2/gtk/gtkthemes.h 0644 bin bin 3275 10931 1024643892 1 f none include/gtk-1.2/gtk/gtktipsquery.h 0644 bin bin 3168 63724 1024643892 1 f none include/gtk-1.2/gtk/gtktogglebutton.h 0644 bin bin 2819 33343 1024643892 1 f none include/gtk-1.2/gtk/gtktoolbar.h 0644 bin bin 6870 7372 1024643892 1 f none include/gtk-1.2/gtk/gtktooltips.h 0644 bin bin 3139 58528 1024643892 1 f none include/gtk-1.2/gtk/gtktree.h 0644 bin bin 4519 11771 1024643892 1 f none include/gtk-1.2/gtk/gtktreeitem.h 0644 bin bin 2939 42454 1024643892 1 f none include/gtk-1.2/gtk/gtktypebuiltins.h 0644 bin bin 4905 16777 1024643892 1 f none include/gtk-1.2/gtk/gtktypeutils.h 0644 bin bin 12068 1433 1024643892 1 f none include/gtk-1.2/gtk/gtkvbbox.h 0644 bin bin 2248 59295 1024643892 1 f none include/gtk-1.2/gtk/gtkvbox.h 0644 bin bin 1982 29628 1024643892 1 f none include/gtk-1.2/gtk/gtkviewport.h 0644 bin bin 2903 43020 1024643892 1 f none include/gtk-1.2/gtk/gtkvpaned.h 0644 bin bin 1882 23093 1024643892 1 f none include/gtk-1.2/gtk/gtkvruler.h 0644 bin bin 1882 23875 1024643892 1 f none include/gtk-1.2/gtk/gtkvscale.h 0644 bin bin 2045 34077 1024643892 1 f none include/gtk-1.2/gtk/gtkvscrollbar.h 0644 bin bin 2153 44529 1024643892 1 f none include/gtk-1.2/gtk/gtkvseparator.h 0644 bin bin 2161 43678 1024643892 1 f none include/gtk-1.2/gtk/gtkwidget.h 0644 bin bin 25121 20503 1024643892 1 f none include/gtk-1.2/gtk/gtkwindow.h 0644 bin bin 5616 38853 1024643892 1 d none info 0755 bin bin 1 f none info/gdk.info 0644 bin bin 10909 15388 1024643893 1 f none info/gtk.info 0644 bin bin 3892 61250 1024643893 1 f none info/gtk.info-1 0644 bin bin 49892 15371 1024643893 1 f none info/gtk.info-2 0644 bin bin 50130 23514 1024643893 1 f none info/gtk.info-3 0644 bin bin 50215 36011 1024643893 1 f none info/gtk.info-4 0644 bin bin 50716 10096 1024643893 1 f none info/gtk.info-5 0644 bin bin 8294 27617 1024643893 1 f none info/gtk.info-6 0644 bin bin 46874 54808 1024643893 1 d none lib 0755 bin bin 1 s none lib/libgdk-1.2.so.0=libgdk-1.2.so.0.9.1 1 f none lib/libgdk-1.2.so.0.9.1 0755 bin bin 2156420 44347 1024643866 1 f none lib/libgdk.a 0644 bin bin 2196180 9934 1024643869 1 f none lib/libgdk.la 0755 bin bin 808 2156 1024643867 1 s none lib/libgdk.so=libgdk-1.2.so.0.9.1 1 s none lib/libgtk-1.2.so.0=libgtk-1.2.so.0.9.1 1 f none lib/libgtk-1.2.so.0.9.1 0755 bin bin 9832680 64272 1024643879 1 f none lib/libgtk.a 0644 bin bin 10480576 34803 1024643889 1 f none lib/libgtk.la 0755 bin bin 808 2268 1024643879 1 s none lib/libgtk.so=libgtk-1.2.so.0.9.1 1 d none lib/locale 0755 bin bin 1 d none lib/locale/az 0755 bin bin 1 d none lib/locale/az/LC_MESSAGES 0755 bin bin 1 f none lib/locale/az/LC_MESSAGES/gtk+.mo 0644 bin bin 5413 9574 1024643859 1 d none lib/locale/ca 0755 bin bin 1 d none lib/locale/ca/LC_MESSAGES 0755 bin bin 1 f none lib/locale/ca/LC_MESSAGES/gtk+.mo 0644 bin bin 5469 56144 1024643859 1 d none lib/locale/cs 0755 bin bin 1 d none lib/locale/cs/LC_MESSAGES 0755 bin bin 1 f none lib/locale/cs/LC_MESSAGES/gtk+.mo 0644 bin bin 5370 919 1024643859 1 d none lib/locale/da 0755 bin bin 1 d none lib/locale/da/LC_MESSAGES 0755 bin bin 1 f none lib/locale/da/LC_MESSAGES/gtk+.mo 0644 bin bin 5316 43981 1024643859 1 d none lib/locale/de 0755 bin bin 1 d none lib/locale/de/LC_MESSAGES 0755 bin bin 1 f none lib/locale/de/LC_MESSAGES/gtk+.mo 0644 bin bin 5476 58786 1024643859 1 d none lib/locale/el 0755 bin bin 1 d none lib/locale/el/LC_MESSAGES 0755 bin bin 1 f none lib/locale/el/LC_MESSAGES/gtk+.mo 0644 bin bin 5612 38482 1024643859 1 d none lib/locale/es 0755 bin bin 1 d none lib/locale/es/LC_MESSAGES 0755 bin bin 1 f none lib/locale/es/LC_MESSAGES/gtk+.mo 0644 bin bin 5544 62985 1024643859 1 d none lib/locale/et 0755 bin bin 1 d none lib/locale/et/LC_MESSAGES 0755 bin bin 1 f none lib/locale/et/LC_MESSAGES/gtk+.mo 0644 bin bin 5291 39891 1024643860 1 d none lib/locale/eu 0755 bin bin 1 d none lib/locale/eu/LC_MESSAGES 0755 bin bin 1 f none lib/locale/eu/LC_MESSAGES/gtk+.mo 0644 bin bin 5473 54832 1024643860 1 d none lib/locale/fi 0755 bin bin 1 d none lib/locale/fi/LC_MESSAGES 0755 bin bin 1 f none lib/locale/fi/LC_MESSAGES/gtk+.mo 0644 bin bin 5448 60501 1024643860 1 d none lib/locale/fr 0755 bin bin 1 d none lib/locale/fr/LC_MESSAGES 0755 bin bin 1 f none lib/locale/fr/LC_MESSAGES/gtk+.mo 0644 bin bin 5628 7320 1024643860 1 d none lib/locale/ga 0755 bin bin 1 d none lib/locale/ga/LC_MESSAGES 0755 bin bin 1 f none lib/locale/ga/LC_MESSAGES/gtk+.mo 0644 bin bin 5574 6189 1024643860 1 d none lib/locale/gl 0755 bin bin 1 d none lib/locale/gl/LC_MESSAGES 0755 bin bin 1 f none lib/locale/gl/LC_MESSAGES/gtk+.mo 0644 bin bin 5498 59235 1024643861 1 d none lib/locale/hr 0755 bin bin 1 d none lib/locale/hr/LC_MESSAGES 0755 bin bin 1 f none lib/locale/hr/LC_MESSAGES/gtk+.mo 0644 bin bin 4882 25017 1024643861 1 d none lib/locale/hu 0755 bin bin 1 d none lib/locale/hu/LC_MESSAGES 0755 bin bin 1 f none lib/locale/hu/LC_MESSAGES/gtk+.mo 0644 bin bin 5423 9786 1024643861 1 d none lib/locale/it 0755 bin bin 1 d none lib/locale/it/LC_MESSAGES 0755 bin bin 1 f none lib/locale/it/LC_MESSAGES/gtk+.mo 0644 bin bin 5611 2597 1024643861 1 d none lib/locale/ja 0755 bin bin 1 d none lib/locale/ja/LC_MESSAGES 0755 bin bin 1 f none lib/locale/ja/LC_MESSAGES/gtk+.mo 0644 bin bin 5291 65475 1024643861 1 d none lib/locale/ko 0755 bin bin 1 d none lib/locale/ko/LC_MESSAGES 0755 bin bin 1 f none lib/locale/ko/LC_MESSAGES/gtk+.mo 0644 bin bin 5085 27163 1024643861 1 d none lib/locale/lt 0755 bin bin 1 d none lib/locale/lt/LC_MESSAGES 0755 bin bin 1 f none lib/locale/lt/LC_MESSAGES/gtk+.mo 0644 bin bin 5444 1988 1024643861 1 d none lib/locale/nl 0755 bin bin 1 d none lib/locale/nl/LC_MESSAGES 0755 bin bin 1 f none lib/locale/nl/LC_MESSAGES/gtk+.mo 0644 bin bin 5275 48315 1024643862 1 d none lib/locale/nn 0755 bin bin 1 d none lib/locale/nn/LC_MESSAGES 0755 bin bin 1 f none lib/locale/nn/LC_MESSAGES/gtk+.mo 0644 bin bin 5395 49503 1024643862 1 d none lib/locale/no 0755 bin bin 1 d none lib/locale/no/LC_MESSAGES 0755 bin bin 1 f none lib/locale/no/LC_MESSAGES/gtk+.mo 0644 bin bin 5387 48583 1024643862 1 d none lib/locale/pl 0755 bin bin 1 d none lib/locale/pl/LC_MESSAGES 0755 bin bin 1 f none lib/locale/pl/LC_MESSAGES/gtk+.mo 0644 bin bin 5474 65101 1024643862 1 d none lib/locale/pt 0755 bin bin 1 d none lib/locale/pt/LC_MESSAGES 0755 bin bin 1 f none lib/locale/pt/LC_MESSAGES/gtk+.mo 0644 bin bin 5198 40372 1024643862 1 d none lib/locale/pt_BR 0755 bin bin 1 d none lib/locale/pt_BR/LC_MESSAGES 0755 bin bin 1 f none lib/locale/pt_BR/LC_MESSAGES/gtk+.mo 0644 bin bin 5471 58830 1024643862 1 d none lib/locale/ro 0755 bin bin 1 d none lib/locale/ro/LC_MESSAGES 0755 bin bin 1 f none lib/locale/ro/LC_MESSAGES/gtk+.mo 0644 bin bin 5372 49809 1024643862 1 d none lib/locale/ru 0755 bin bin 1 d none lib/locale/ru/LC_MESSAGES 0755 bin bin 1 f none lib/locale/ru/LC_MESSAGES/gtk+.mo 0644 bin bin 5367 29101 1024643863 1 d none lib/locale/sk 0755 bin bin 1 d none lib/locale/sk/LC_MESSAGES 0755 bin bin 1 f none lib/locale/sk/LC_MESSAGES/gtk+.mo 0644 bin bin 5332 58175 1024643863 1 d none lib/locale/sl 0755 bin bin 1 d none lib/locale/sl/LC_MESSAGES 0755 bin bin 1 f none lib/locale/sl/LC_MESSAGES/gtk+.mo 0644 bin bin 5396 50016 1024643863 1 d none lib/locale/sp 0755 bin bin 1 d none lib/locale/sp/LC_MESSAGES 0755 bin bin 1 f none lib/locale/sp/LC_MESSAGES/gtk+.mo 0644 bin bin 5378 33117 1024643863 1 d none lib/locale/sr 0755 bin bin 1 d none lib/locale/sr/LC_MESSAGES 0755 bin bin 1 f none lib/locale/sr/LC_MESSAGES/gtk+.mo 0644 bin bin 5386 49440 1024643863 1 d none lib/locale/sv 0755 bin bin 1 d none lib/locale/sv/LC_MESSAGES 0755 bin bin 1 f none lib/locale/sv/LC_MESSAGES/gtk+.mo 0644 bin bin 5355 50150 1024643863 1 d none lib/locale/tr 0755 bin bin 1 d none lib/locale/tr/LC_MESSAGES 0755 bin bin 1 f none lib/locale/tr/LC_MESSAGES/gtk+.mo 0644 bin bin 5331 58986 1024643863 1 d none lib/locale/uk 0755 bin bin 1 d none lib/locale/uk/LC_MESSAGES 0755 bin bin 1 f none lib/locale/uk/LC_MESSAGES/gtk+.mo 0644 bin bin 5399 30588 1024643863 1 d none lib/locale/vi 0755 bin bin 1 d none lib/locale/vi/LC_MESSAGES 0755 bin bin 1 f none lib/locale/vi/LC_MESSAGES/gtk+.mo 0644 bin bin 5407 5195 1024643864 1 d none lib/locale/wa 0755 bin bin 1 d none lib/locale/wa/LC_MESSAGES 0755 bin bin 1 f none lib/locale/wa/LC_MESSAGES/gtk+.mo 0644 bin bin 5471 60745 1024643864 1 d none lib/locale/zh_CN.GB2312 0755 bin bin 1 d none lib/locale/zh_CN.GB2312/LC_MESSAGES 0755 bin bin 1 f none lib/locale/zh_CN.GB2312/LC_MESSAGES/gtk+.mo 0644 bin bin 4687 53901 1024643864 1 d none lib/locale/zh_TW.Big5 0755 bin bin 1 d none lib/locale/zh_TW.Big5/LC_MESSAGES 0755 bin bin 1 f none lib/locale/zh_TW.Big5/LC_MESSAGES/gtk+.mo 0644 bin bin 4704 33304 1024643864 1 d none lib/pkgconfig 0755 bin bin 1 f none lib/pkgconfig/gdk.pc 0644 bin bin 322 28217 1024643894 1 f none lib/pkgconfig/gtk+.pc 0644 bin bin 197 17454 1024643894 1 d none man 0755 bin bin 1 d none man/man1 0755 bin bin 1 f none man/man1/gtk-config.1 0644 bin bin 1886 33770 1024643894 1 i pkginfo 170 13789 1024644235 1 d none share 0755 bin bin 1 d none share/aclocal 0755 bin bin 1 f none share/aclocal/gtk.m4 0644 bin bin 8285 54690 1024643894 1 d none share/themes 0755 bin bin 1 d none share/themes/Default 0755 bin bin 1 d none share/themes/Default/gtk 0755 bin bin 1 f none share/themes/Default/gtk/gtkrc 0644 bin bin 32 2870 1024643892 0707010000cf00000041ed0000000a0000000a0000000a3d12d49b00000000000000880000000300000000000000000000000600000000reloc0707010000dda3000041ed0000000a0000000a000000023d12d48c00000000000000880000000300000000000000000000000a00000000reloc/bin0707010000dda4000081a40000000a0000000a000000013d12d3360000085d0000008800000003000000000000000000000015ff350889reloc/bin/gtk-config#!/bin/sh glib_libs="-L/usr/local/lib -lgmodule -lglib -ldl" glib_cflags="-I/usr/local/include/glib-1.2 -I/usr/local/lib/glib/include" glib_thread_libs="-L/usr/local/lib -lgmodule -lgthread -lglib -lthread -ldl" glib_thread_cflags="-I/usr/local/include/glib-1.2 -I/usr/local/lib/glib/include -D_REENTRANT" prefix=/usr/local exec_prefix=${prefix} exec_prefix_set=no usage() { cat <&2 fi lib_gtk=yes while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $1 in --prefix=*) prefix=$optarg if test $exec_prefix_set = no ; then exec_prefix=$optarg fi ;; --prefix) echo_prefix=yes ;; --exec-prefix=*) exec_prefix=$optarg exec_prefix_set=yes ;; --exec-prefix) echo_exec_prefix=yes ;; --version) echo 1.2.10 ;; --cflags) echo_cflags=yes ;; --libs) echo_libs=yes ;; gtk) lib_gtk=yes ;; gthread) lib_gthread=yes ;; *) usage 1 1>&2 ;; esac shift done if test "$echo_prefix" = "yes"; then echo $prefix fi if test "$echo_exec_prefix" = "yes"; then echo $exec_prefix fi if test "$lib_gthread" = "yes"; then glib_cflags="$glib_thread_cflags" glib_libs="$glib_thread_libs" fi if test "$echo_cflags" = "yes"; then echo -I${prefix}/include/gtk-1.2 $glib_cflags -I/usr/openwin/include fi if test "$echo_libs" = "yes"; then my_glib_libs= libdirs=-L${exec_prefix}/lib for i in $glib_libs ; do if test $i != -L${exec_prefix}/lib ; then if test -z "$my_glib_libs" ; then my_glib_libs="$i" else my_glib_libs="$my_glib_libs $i" fi fi done echo $libdirs -L/usr/openwin/lib -R/usr/openwin/lib -lgtk -lgdk $my_glib_libs -lXext -lX11 -lsocket -lnsl -lm fi 07070100012770000041ed0000000a0000000a000000033d12d48c00000000000000880000000300000000000000000000000aff350889reloc/doc070701000153b7000041ed0000000a0000000a000000043d12d48e00000000000000880000000300000000000000000000000eff350889reloc/doc/gtk070701000153b8000081a40000000a0000000a000000013d12d39800002d830000008800000003000000000000000000000018ff35088dreloc/doc/gtk/ABOUT-NLSNotes on the Free Translation Project ************************************* Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do *not* need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work at translations should contact the appropriate team. When reporting bugs in the `intl/' directory or bugs which may be related to internationalization, you should tell about the version of `gettext' which is used. The information can be found in the `intl/VERSION' file, in internationalized packages. One advise in advance ===================== If you want to exploit the full power of internationalization, you should configure it using ./configure --with-included-gettext to force usage of internationalizing routines provided within this package, despite the existence of internationalizing capabilities in the operating system where this package is being installed. So far, only the `gettext' implementation in the GNU C library version 2 provides as many features (such as locale alias or message inheritance) as the implementation here. It is also not possible to offer this additional functionality on top of a `catgets' implementation. Future versions of GNU `gettext' will very likely convey even more functionality. So it might be a good idea to change to GNU `gettext' as soon as possible. So you need not provide this option if you are using GNU libc 2 or you have installed a recent copy of the GNU gettext package with the included `libintl'. INSTALL Matters =============== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system provides usable `catgets' (if using this is selected by the installer) or `gettext' functions. If neither is available, the GNU `gettext' own library will be used. This library is wholly contained within this package, usually in the `intl/' subdirectory, so prior installation of the GNU `gettext' package is *not* required. Installers may use special options at configuration time for changing the default behaviour. The commands: ./configure --with-included-gettext ./configure --with-catgets ./configure --disable-nls will respectively bypass any pre-existing `catgets' or `gettext' to use the internationalizing routines provided within this package, enable the use of the `catgets' functions (if found on the locale system), or else, *totally* disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl.a' file and will decide to use this. This might be not what is desirable. You should use the more recent version of the GNU `gettext' library. I.e. if the file `intl/VERSION' shows that the library which comes with this package is more recent, you should use ./configure --with-included-gettext to prevent auto-detection. By default the configuration process will not test for the `catgets' function and therefore they will not be used. The reasons are already given above: the emulation on top of `catgets' cannot provide all the extensions provided by the GNU `gettext' library. If you nevertheless want to use the `catgets' functions use ./configure --with-catgets to enable the test for `catgets' (this causes no harm if `catgets' is not available on your system). If you really select this option we would like to hear about the reasons because we cannot think of any good one ourself. Internationalized packages have usually many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. Using This Package ================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate ISO 639 `LL' two-letter code prior to using the programs in the package. For example, let's suppose that you speak German. At the shell prompt, merely execute `setenv LANG de' (in `csh'), `export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. An operating system might already offer message localization for many of its programs, while other programs have been installed locally with the full capabilities of GNU `gettext'. Just using `gettext' extended syntax for `LANG' would break proper localization of already available operating system programs. In this case, users should set both `LANGUAGE' and `LANG' variables in their environment, as programs using GNU `gettext' give preference to `LANGUAGE'. For example, some Swedish users would rather read translations in German than English for when Swedish is not available. This is easily accomplished by setting `LANGUAGE' to `sv:de' while leaving `LANG' to `sv'. Translating Teams ================= For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list, courtesy of Linux International. You may reach your translation team at the address `LL@li.org', replacing LL by the two-letter ISO 639 code for your language. Language codes are *not* the same as the country codes given in ISO 3166. The following translation teams exist, as of December 1997: Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en', Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian `hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja', Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish `pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es', Swedish `sv', and Turkish `tr'. For example, you may reach the Chinese translation team by writing to `zh@li.org'. If you'd like to volunteer to *work* at translating messages, you should become a member of the translating team for your own language. The subscribing address is *not* the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate *actively* in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `translation@iro.umontreal.ca' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skill are praised more than programming skill, here. Available Packages ================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of December 1997. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination. Ready PO files cs da de en es fi fr it ja ko nl no pl pt ru sl sv .----------------------------------------------------. bash | [] [] [] | 3 bison | [] [] [] | 3 clisp | [] [] [] [] | 4 cpio | [] [] [] [] [] [] | 6 diffutils | [] [] [] [] [] | 5 enscript | [] [] [] [] [] [] | 6 fileutils | [] [] [] [] [] [] [] [] [] [] | 10 findutils | [] [] [] [] [] [] [] [] [] | 9 flex | [] [] [] [] | 4 gcal | [] [] [] [] [] | 5 gettext | [] [] [] [] [] [] [] [] [] [] [] | 12 grep | [] [] [] [] [] [] [] [] [] [] | 10 hello | [] [] [] [] [] [] [] [] [] [] [] | 11 id-utils | [] [] [] | 3 indent | [] [] [] [] [] | 5 libc | [] [] [] [] [] [] [] | 7 m4 | [] [] [] [] [] [] | 6 make | [] [] [] [] [] [] | 6 music | [] [] | 2 ptx | [] [] [] [] [] [] [] [] | 8 recode | [] [] [] [] [] [] [] [] [] | 9 sh-utils | [] [] [] [] [] [] [] [] | 8 sharutils | [] [] [] [] [] [] | 6 tar | [] [] [] [] [] [] [] [] [] [] [] | 11 texinfo | [] [] [] | 3 textutils | [] [] [] [] [] [] [] [] [] | 9 wdiff | [] [] [] [] [] [] [] [] | 8 `----------------------------------------------------' 17 languages cs da de en es fi fr it ja ko nl no pl pt ru sl sv 27 packages 6 4 25 1 18 1 26 2 1 12 20 9 19 7 4 7 17 179 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If December 1997 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. 070701000153b9000081a40000000a0000000a000000013d12d398000004250000008800000003000000000000000000000016ff35088dreloc/doc/gtk/AUTHORSOriginal Authors ---------------- Peter Mattis Spencer Kimball Josh MacDonald Please do not mail the original authors asking questions about this version of GTK+. The GTK+ Team (in alphabetical order) ------------------------------------- Shawn T. Amundson Jerome Bolliet Damon Chaplin Tony Gale Jeff Garzik Lars Hamann Raja R Harinath Carsten Haitzler Tim Janik Stefan Jeske Elliot Lee Raph Levien Ian Main Federico Mena Paolo Molaro Jay Painter Manish Singh Owen Taylor There are many others who have contributed patches; we thank them, GTK+ is much better because of them. 070701000153ba000081a40000000a0000000a000000013d12d398000062cc0000008800000003000000000000000000000016ff35088dreloc/doc/gtk/COPYING GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! 070701000153bb000081a40000000a0000000a000000013d12d3980006da420000008800000003000000000000000000000018ff35088dreloc/doc/gtk/ChangeLogSun Apr 1 23:01:31 2001 Owen Taylor * Released 1.2.10. Sun Apr 1 22:22:47 2001 Owen Taylor [ Addition of safety checks to try to avoid segfaulting on broken setups always. ] * gdk/gdkfont.c (_gdk_font_wc_to_glyphs): Add a boolean return value to deal with failure of conversion of wide characters to glyphs. * gtk/gtkentry.c gtk/gtklabel.c: Handle failure of mbstowcs/wcstombs a bit better. * gdk/gdkfont.c gdk/gdkdraw.c: Deal with failure of _gdk_font_wc_to_glyphs() gracefully * gdk/gdkim.c (_gdk_wcstombs_len): quietly return NULL on failure instead of g_return_if_fail(). Wed Mar 28 16:05:29 2001 Owen Taylor * gtk/gtkfontsel.c (gtk_font_selection_select_size): Fix problem where fractional sizes caused infinite loop. (bugzilla.redhat.com #33081) Wed Mar 28 14:52:08 2001 Owen Taylor * docs/Makefile.am: Remove excess rules breaking distcheck. Wed Mar 28 12:33:20 2001 Owen Taylor * gtk/gtkdnd.c: Fix problem where dropping into internal child widgets (such as GtkCList tab labels) (#52457, reported by Daniel Erat). Can't use gtk_container_children(), so provide a substitute which uses gtk_container_forall(). 2001-03-22 Darin Adler * gtk/gtkobject.h: Fixed #if G_ENABLE_DEBUG that was supposed to be #ifdef G_ENABLE_DEBUG. Thu Mar 15 15:23:11 2001 Owen Taylor * NEWS: Updated * configure.in (GTK_BINARY_AGE): Up micro => 10, binary => 10, interface => 1. * INSTALL.in: Add some discouraging words about --with-xinput=gxi. * configure.in (x_ldflags): Make --with-xinput be --with-xinput=xfree, and warn for --with-xinput=gxi. Thu Mar 15 14:29:47 2001 Owen Taylor * gdk/gdkselection.c (sanitize_ctext): Handle extended segments, which can contain arbitrary octets, properly. (Fixes problems with cut-and-paste and, e.g., KOI8-R.) * gtk/gtktext.c gtk/gtkeditable.c: Patch from Vlad Harchev to avoid using gdk_draw_text_wc() on text that is really chars, not wchars. (Cannot convert between chars and wide chars with assignment!) Thu Mar 15 01:31:07 2001 Owen Taylor * gdk/gdkim.c (_gdk_wcstombs_len): Make somewhat more safe on broken libcs, also add a g_return_if_fail() to make the failure case when we somehow get a string of invalid wide characters more clear. (#51644, Sergey Vlasov) Thu Mar 15 01:05:49 2001 Owen Taylor * gtk/gtkrc.c (gtk_rc_add_initial_default_files): Fix problem in testing the result of g_get_home_dir(), and test the result of g_get_home_dir() in another place for consistency. (#51833). Also fix off-by-one error in check against GTK_RC_MAX_MODULE_PATHS. Thu Mar 15 00:41:47 2001 Owen Taylor * gtk/gtkcalender.c gtk/gtkcombo.c gtk/gtkeditable.c gtk/gtkplug.c gtk/gtkradiobutton.c gtk/gtkvpaned.c: Patch from Darin Adler to fix unused variables warning. (But use gutter_size variable in gtk_vpaned_button_press.) (#51835) Wed Mar 14 23:38:23 2001 Owen Taylor * gdk/gdk.c (gdk_init_check): Fix missed equal_pos => option for --with-xinput=gxi. (Which is broken anyways, but oh well...) * gtk/gtkeditable.c (gtk_editable_get_event_time): Fix excess free in case where there is no current event. * gtk/gtkwindow.[ch]: Handle focus for the case of PointerRoot (no window manager) by using algorithm taken from xterm. Fri Mar 9 22:32:32 2001 Owen Taylor * gtk/gtkmenushell.c (gtk_menu_shell_enter_notify): Only check the ignore_enter flag for the menu shell that the item is actually a child of, not for attached submenus. (#51536) Fri Mar 2 12:35:40 2001 Owen Taylor * Release 1.2.9 * NEWS: Final update for 1.2.9 * INSTALL INSTALL.in: Add note about the movement of the include files. Fri Mar 2 19:33:59 2001 Fatih Demir * configure.in: Added tr to ALL_LINGUAS. Thu Mar 1 04:35:51 2001 Owen Taylor * gtk/gtkwidget.c (gtk_widget_class_init): Never make harmless warning fixes! :-( Wed Feb 28 21:14:08 2001 Owen Taylor * README.in INSTALL.in: Fix the .in files, add note about --with-native-locale. * */po/*: Line-number-creepage. Wed Feb 28 19:10:43 2001 Owen Taylor * gtk/gtkclist.c (real_remove_row): Patch from ChiDeok Hwang to move call to sync_selection() up a few lines to before the row list is modified, to fix crash when removing rows in the undo_selection list. (Test case provided by Daniel Elstner: http://mail.gnome.org/archives/gtk-list/2001-February/msg00359.html) Wed Feb 28 15:40:27 2001 Owen Taylor * gtk/gtkcalender.c gtk/gtkdnd.c gtk/gtkitemfactory.c gtk/gtklayout.c gtk/gtkplug.c gtk/gtksocket.c gtk/gtktypeutils.c gtk/gtkwidget.c genmarshal.pl: Fix implicit casts between void * and function pointers. * gtk/gtklayout.c: Remove cruft after #endif * gtk/gtkdnd.c: Include stdlib.h for abs. Tue Feb 27 18:38:27 2001 Owen Taylor * gtk/gtkwindow.c (gtk_window_map): Redo the focus stuff once more. Keep track of the focus status via an event filter, so we can keep track of whether the window or any child has the focus; something that requires fields from the XEvent not in the GdkEvent. Install this event filter in gtk_window_map() before mapping the window, on the guess that this is unlikely to be overriden without the overrider chaining up. (fingers crossed) Tue Feb 27 04:14:21 2001 Owen Taylor * gtk/gtkmain.c (gtk_propagate_event): Remove left-over debug-printf. * gtk/gtkdnd.c (gtk_drag_find_widget): Don't use new_allocation.x/new_allocation.y for coordinate, translation since they are clip, use the x_offset/y_offset variables we keep for the purpose instead. Tue Feb 27 02:29:20 2001 Owen Taylor * gtk/gtkdnd.c (gtk_drag_find_widget): When recursing, get the list of children and ref them all before walking through the list, to prevent problems when the widget hierarchy changes in ::drag_motion/drop handlers. * gtk/gtkmain.c (gtk_propagate_event): Only activate special key-press grab handling for widgets within GtkWindows. Otherwise, fall through to normal case. This prevents key events being sent twice to GtkInvisible widgets, which can cause all sorts of mischief. Tue Feb 27 02:16:14 2001 Owen Taylor * gtk/gtkmain.c (gtk_propagate_event): Only do special special key-press grab handling for widgets within GtkWindows. Otherwise, fall through to normal case. This prevents key events being sent twice to GtkInvisible widgets, which can cause all sorts of mischief. Tue Feb 27 01:29:34 2001 Owen Taylor * configure.in acconfig.h gdk/gdkfont.c gdk/gdkim.c INSTALL: Add a configuration option --with-native-locale, that greatly speeds up wide-character/multibyte conversions by dropping the indirection through Xlib's property-conversion functions. Off by default due to lack of testing for portability, but it should, in general be a more correct way of doing things, and should also remove much of the speed hit that the recent change to the handling of 8-bit fonts may have introduced. Mon Feb 26 16:34:33 2001 Owen Taylor * README: Update to describe submitting patches and bug reports to bugzilla.gnome.org. Tue Feb 20 23:48:16 2001 Owen Taylor * gdk/gdkim.c,gdk/gdkprivate.h: Add private function _gdk_wcstombs_len() which takes a length. * gdk/gdkfont.c,gdk/gdkprivate.h,gdk/gdkdraw.c: Consistently handle calls to _wc() font for GDK_FONT_FONT routines by: a) for 8-bit fonts, converting to chars via wcstombs (Will make GtkLabel handle using GDK_FONT_FONT for non-iso-8859-1 a wee bit better, though GDK_FONT_FONTSET is still the only supported way to get correct i18n. #50834) b) for 16-bit fonts, assuming each wchar is a glyph index. (Broken, but no more broken than anything else) Mon Feb 26 21:36:11 2001 Owen Taylor * gtk/gtkwindow.[ch] (gtk_window_focus_in/out_event): We can't maintain a flag in gtk_window_focus_in/out, because GtkPlug and cut-and-pastes of GtkPlug override these methods and don't chain up. So back out recent change adding such a flag, and instead recycle the hack GtkPlug uses of making GTK_WIDGET_HAS_FOCUS on the top level represent this information Fri Feb 23 15:06:48 2001 Owen Taylor * gtk/gtktree.c (gtk_tree_class_init): Do the setting of tree->root_tree in parent_set rather than _map(), fixing #50892 in a bit better manner. Fri Feb 23 11:54:25 2001 Owen Taylor * gtk/gtklistitem.c (gtk_list_item_focus_out): Emit "end_selection", since we won't get subsequent key releases. (#13447) Thu Feb 22 20:50:08 2001 Owen Taylor * gtk/gtkplug.c (gtk_plug_set_focus): Change to parent implementation instead of cut-and-paste that was out of sync. * gtk/gtkwindow.[ch] (gtk_window_set_focus): Only send ::focus_in_event when the toplevel window actually has focus on it. (Fixes #50857, Akira Higuchi) Thu Feb 22 19:53:55 2001 Owen Taylor * gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Grab on a offscreen GtkInvisible so that we can move handle boxes whose parents are iconified or on another desktop. Also, make sure we don't reattach to such parents. (#1923) Thu Feb 22 17:07:58 2001 Owen Taylor * gtk/gtkmenu.c (gtk_menu_popup): Don't flip cursor. (#50934) Thu Feb 22 16:45:17 2001 Owen Taylor * gtk/gtkfontsel.c (gtk_font_selection_get_font[_name]): Update the current font from the contents of the entry. (#3123) Tue Feb 2 11:22:33 2001 Jody Goldberg * gtk/gtkstyle.c : Remove duplicate fwd decl for gtk_default_draw_shadow. Tue Feb 20 11:40:58 2001 Owen Taylor * gdk/gdkimage.c (gdk_image_new): Remove excess warning, make warnings more verbose, treat a error in shmat as permanent, and don't try again. (#51163, Ed Randall.) Mon Feb 19 20:46:21 2001 Owen Taylor * gtk/gtkentry.c (gtk_entry_key_press): Take key presses of GDK_Left/GDK_Right when there is a selection to mean "move the cursor to the start/end of the selection". (Inspired by #50492, Jay Cox, though the implementation is different for GTK+-1.2.) Mon Feb 19 20:15:28 2001 Owen Taylor * gtk/gtkrange.c (gtk_range_timer_1st_time): Add an initial delay for the first click before starting to scroll. (based on #51026, gtk-enf-990512-0.patch, Eric Fisher) * gtk/gtktext.c: GtkText should have I-beam cursor. (based on gtk-enf-990513-1.patch, Eric Fisher.) Mon Feb 19 18:39:21 2001 Owen Taylor * gdk/gdkselection.c (gdk_string_to_compound_text,gdk_text_property_to_text_list): Robustify by stripping control characters not allowed in COMPOUND_TEXT out before passing to XmbTextpropertyToTextList(), and from the result of XmbTextListToTextProperty(). This is in the spirit of "Be lenient in what you receive, strict in what you generate." (Fixes #1704) Mon Feb 19 14:20:36 2001 Owen Taylor * gdk/gdkrgb.c (gdk_rgb_convert_555_br): Fix incorrect mask. (#51039, fix from Martin Maierhofer) Fri Feb 16 20:09:42 2001 Owen Taylor * gtk/gtkctree.c (gtk_ctree_class_init): Add bindings for unshifted + and shifted = for non-us keyboards. Make + and - work as well as KP_Plus, KP_Minus for recursive open/close. (#2682, René Seindal) Fri Feb 16 18:50:59 2001 Owen Taylor * gtk/gtkmenushell.c (gtk_real_menu_shell_cancel): Unset the active menu item before deactivating the menu, so gtk_menu_popdown doesn't change the history. (#50964) Fri Feb 16 15:55:22 2001 Owen Taylor * gtk/gtktreeitem.c (gtk_tree_item_draw_lines): draw lines with text_gc rather than black_gc. (Patch from Vlad Harchev , #50926) Tue Feb 13 15:39:28 2001 Owen Taylor * 1.2.9pre1 * NEWS: Update. * docs/Makefile.am: Remove building of HTML for gdk.texi gtk.texi since it doesn't work. Tue Feb 13 13:56:58 2001 Owen Taylor * gtk/gtktext.c (find_char_width): Fix problems with characters < 256 in wide character locales. (Patch from Yoichi Imai.) Tue Feb 13 00:58:49 2001 Owen Taylor * gtk/gtkclist.c: Properly handle passive buttons at button creation time (#50686). Mon Feb 12 20:37:32 2001 Owen Taylor * gdk/gdkrgb.c (gdk_rgb_try_colormap): Call gdk_colormap_sync() - fixes #50678. * gdk/gdk.h: Add missing prototype for gdk_colormap_sync(). Mon Feb 12 20:02:32 2001 Owen Taylor * gtk/gtkmain.c: Fix some cases of implicit casting between void * and function pointers. * configure.in gtk/gtkmain.c: Add checks for setuid/setgid, and refuse to initialize GTK+ if they fail. * configure.in (GTK_INTERFACE_AGE): Reset GTK_INTERFACE_AGE to zero. Mon Feb 12 15:55:26 2001 Owen Taylor [ Enabling patch for better looking theme engines ] * gtk/gtkstyle.[ch]: Add new API functions for making better looking GTK+-1.2.x themes. THESE FUNCTIONS WILL NOT BE SUPPORTED IN THE FUTURE. ANY THEMES DEPENDING ON THESE FUNCTIONS MUST CHECK FOR GTK+-1.2.x WHERE x >= 1.2.9. The functions: _gtk_style_set_prop_experimental() _gtk_style_get_prop_experimental() are used to allow configuration of assorted geometry parameters. * gtk/gtkbutton.c: Make DEFAULT_SPACING configurable as GtkButton::default_spacing. * gtk/gtkcheckbutton.c gtk/gtkradiobutton.c: Make indicator_size and indicator_spacing configurable as GtkCheckButton::indicator_size, GtkCheckButton::indicator_spacing. * gtk/gtkcheckbutton.[ch]: Private function _gtk_check_button_get_props(). * gtk/gtkcheckmenuitem.c (gtk_check_button_menu_item_set_show_toggle): Make a noop - turning this on is just a bad idea visually, and changing this from a program is just asking a bad idea. * gtk/gtk{h,v,}paned.c: Provide configuration parameters GtkPaned::handle_full_size, which, if true, will turn on GTK+-1.3.2 style full-size paned handles. GtkPaned::handle_width, which sets the gutter size for paned widgets. (If set, overrides setting via gtk_paned_set_gutter_size()) * gtk/gtkpaned.[ch]: Add private functions _gtk_paned_is_handle_full_size(), _gtk_paned_get_handle_rect(), _gtk_paned_get_gutter_size(). * gtk/gtkstyle.c (gtk_default_draw_box): Add handling for details "hpaned", "vpaned", used for drawing full-size grips on horizontal and vertical paned widgets. (In the style of GTK+-1.3.2) * gtk/gtkhscale.c gtk/gtkhscrollbar.c: * gtk/gtkoptionmenu.c: Add configurable parameters: GtkOptionMenu::indicator_width GtkOptionMenu::indicator_height GtkOptionMenu::indicator_left_spacing GtkOptionMenu::indicator_right_spacing GtkOptionMenu::indicator_top_spacing GtkOptionMenu::indicator_bottom_spacing To control where the indicator is drawn and how big it is. * gtk/gtkrange.[ch]: Add configurable parameters: GtkRange::slider_width - width of trough GtkRange::trough_border - space to reserve for trough border GtkRange::stepper_size - size of arrows GtkRange::stepper_spacing - spacing between scrollbar and arrows and private accessor _gtk_range_get_props(). * gtk/gtkwidget.c (gtk_widget_event): Rewrite a bit to quiet GCC. * gtk/gtkwidget.c (gtk_widget_propagate_state): Fix typo in last commit. Mon Feb 5 12:47:09 2001 Owen Taylor * gtk/gtkwidget.c (gtk_widget_propagate_state) gtk/gtkmain.c (gtk_grab_add): Don't allow insensitive widgets to have a grab. 2001-02-10 Ian Peters * gtk/gtkprogressbar.c (gtk_progress_bar_size_request): use the font->ascent and ->descent to calculate the requisition height, rather than the gdk_text_height (gtk_progress_bar_paint): use the font->ascent instead of the gdk_text_height when calculating the vertical offset of the text label on the progress bar. This fixes the baseline of the font on the widget. Fri Feb 2 19:21:23 2001 Owen Taylor * gdk/gdkwindow.c (gdk_propagate_shapes): Surround additional regions with HAVE_SHAPE_EXT. (#50511, Eric Ding) Fri Feb 2 18:31:54 2001 Owen Taylor * gdk/gdkimage.c: Remove definition of _XOPEN_SOURCE, since it breaks things on BSD. If you want to compile GTK+ with -ansi -pedantic, you should supply CPP_FLAGS=_XOPEN_SOURCE when configuring, since GTK+ simply can't be "pure ANSI" in the header files it uses. (#8170, Greg Hudson) * gdk/gdkrgb.c (gdk_rgb_select_conv): Exit with an informative warning message if no converter can be found. Fri Feb 2 15:09:51 2001 Owen Taylor * gtk/fnmatch.c (FOLD): Fix problem with passing signed chars to isupper() / tolower(). * examples/packer/pack.c: Add GINT_TO_POINTER, GPOINTER_TO_INT to clear up 64-bit warnings. (#567) Fri Feb 2 13:38:21 2001 Owen Taylor * gtk/gtkmain.c (gtk_propagate_event): Fix some reference counting problems problems in last patch. Fri Feb 2 13:20:12 2001 Owen Taylor * gtk/gtkmain.c (gtk_propagate_event): When a grab widget is in effect, give the grab widget a first crack at KEY_PRESS/RELEASE events. (#424) Fri Feb 2 12:02:23 2001 Owen Taylor * gtk/gtkrc.c Makefile.am: Use $(libdir), not $(exe_prefix), since some people set $(libdir) separately. (#1290, David Kaelbling) Thu Feb 1 20:32:49 2001 Owen Taylor * gdk/gdk.c: Improve warnings a bit in a fashion similar to the part of gtk-enf-990513-0.patch (Eric Fisher) that hasn't been superceded. Thu Feb 1 18:25:46 2001 Owen Taylor * gtk/gtkfilesel.c: If PATH_MAX and MAXPATHLEN are not defined, define MAXPATHLEN to 2048. (The Hurd doesn't have MAXPATHLEN, but the code here depends on a fixed value.) (#4524) Wed Jan 31 22:01:04 2001 Owen Taylor * gtk/gtkhandlebox.c (gtk_handle_box_draw): Remove a dependency on bin->child != NULL. (Basically, just a cleanup) * gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Handle the case where child == NULL and handle_position == RIGHT or BOTTOM. (#8041) Wed Jan 31 21:20:39 2001 Owen Taylor * gtk/gtkctree.c (real_tree_move): If the node being moved isn't viewable there is no way that moving the node will cause the focus row to become not viewable, so omit check on the visibility of new_sibling, which is irrelevant. (Fixes #8002, David Helder) Wed Jan 31 20:33:35 2001 Owen Taylor * gtk/gtkentry.c (gtk_entry_set_selection): Check bounds when setting selection. (#7302) Thu Feb 1 02:26:18 2001 Tim Janik * gtk/Makefile.am ($(srcdir)/gtkmarshal.c): avoid regeneration of gtkmarshal.c from stamp file dep, when not @REBUILD@, fixes #11008. Wed Jan 31 19:23:01 2001 Owen Taylor * gtk/gtkfontsel.c (gtk_font_selection_set_font_name): Apply patch gtk-gharris-000907-0.patch (Guy Harris) fixing problem where wrong row was selected when filters filtered out some fonts. Wed Jan 31 18:49:33 2001 Owen Taylor * gtk/gtkoptionmenu.c (gtk_option_menu_item_state_changed_cb): Make the sensitivity of the reparented child track that of the original parent menu item. (#34218, David Hodson) * gtk/gtkoptionmenu.c (gtk_option_menu_item_destroy_cb): Handle the case where the current item is destroyed properly. * gtk/gtkoptionmenu.c: Some additional code cleanups and fix some edge cases with child-less menuitems. Wed Jan 31 17:16:13 2001 Owen Taylor * gtk/gtkcombo.c (gtk_combo_window_key_press): Make Return key pop down window. (#12074, Jon K Hellan) Wed Jan 31 16:21:42 2001 Owen Taylor * gtk/gtklist.c (gtk_list_signal_item_toggle): Don't allow toggling of rows off in BROWSE or EXTENDED mode. (#12072, Jon K Hellan) The solution here isn't perfect - you get an extraneous emission of "toggle", which could conceivably confuse an app, but better than the current situation. LXR search seems to indicate that no apps in GNOME CVS connect to "toggle". Wed Jan 31 15:46:13 2001 Owen Taylor * gtk/Makefile.am (libgtkinclude_HEADERS): Move gtkfeatures.h from gtk_public_h_sources to directly here to avoid warning when building srcdir != builddir. (#9656) Tue Jan 30 19:49:02 2001 Owen Taylor * gtk/gtkrange.c: Patch from Kipp Hickman to make the event handlers in gtkrange.c return the proper values (TRUE == handled) (#10316). This is just the tip of the iceberg, but gtkrange.c is the most common place where the propagation is problematical, and also a place where it is almost certainly safe to change this in the stable branch. (You don't want right click popups on a range control or anything...) Tue Jan 30 19:12:52 2001 Owen Taylor * gtk/gtkwindow.c (gtk_window_unmap): Call gdk_window_withdraw rather than gdk_window_hide; this makes things work correctly if the window is programmatically hidden while iconified. [ Backport from HEAD, hope, hope it doesn't break anything since it fixes a bunch of stuff. ] (#14082) Tue Jan 30 18:57:59 2001 Owen Taylor * gtk/gtktext.c (clear_focus_area): We need to clear the focus area on focus out, even if a background pixmap isn't set. (#13941) Tue Jan 30 18:31:23 2001 Owen Taylor * gtk/gtkstyle.c (gtk_style_detach): Handle the case where bg_pixmap[i] == GDK_PARENT_RELATIVE. Tue Jan 30 18:24:10 2001 Owen Taylor * gtk/gtknotebook.c (gtk_notebook_set_shape): Fix from Sean Cunningham to deal with setting the shape properly when scrolling arrows are turned on, but not visible because there is sufficient space. (#13432) Tue Jan 30 16:39:25 2001 Owen Taylor * gtk/gtkitemfactory.c (gtk_item_factory_delete_item): For menu items with submenus, destroy the item along with the submenu. (#7841, Brian Masney(?)) Also, handle paths of the form '/abcd...' properly. * gtk/testgtk.c (menu_items): Add a dummy branch that we delete later. Tue Jan 30 15:51:25 2001 Owen Taylor * gtk/gtkwindow.c (gtk_window_real_set_focus): Fix a problem where the focus widget sometimes wasn't drawn with the default if there was no default widget. * gdk/gdkim.c (gdk_ic_destroy): Don't rely on ic->mask, which is completely unreliably set, when deciding what items to unref/free. (A bit of a hack, but this code will be dead in GTK+-2.0.) (#6739) * gtk/gtkstyle.c (gtk_style_detach): free colors, unreference pixmaps. * gtk/gtkstyle.c (gtk_style_init): Reference colormap for some extra safety. Mon Jan 29 19:44:26 2001 Owen Taylor [ Backport from HEAD ] * gtk/gtkmenuitem.c gtk/gtkmenushell.c: Patch from David Santiago so that when selecting menus with the mouse, the first item will not be selected, but when selecting with an accelerator, or navigating left-right on a menubar with the menus popped up, the first item will be selected. Mon Jan 29 19:00:01 2001 Owen Taylor * gtk/gtk{ctree.c,clist.c} (set_cell_contents): Handle setting the text of a cell to the old pointer value better, by copying the new text before freeing the old text. Some code cleanup. (#8079, Karl Nelson) Mon Jan 29 18:33:24 2001 Owen Taylor * gdk/gdk.c (gdk_init_check): Handle --display= forms of options taking arguments. Fix some memory leaks with repeated arguments. (#28842, Sam Hunter) Mon Jan 29 16:34:28 2001 Owen Taylor * gtk/gtkfontsel.c (gtk_font_selection_select_best_size): Return if fontsel->font_index == -1 - that is, if no font is selected. (Should fix #50290) Mon Jan 29 15:22:51 2001 Owen Taylor * gtk/gtkmenu.c (gtk_menu_remove): When removing an item from a menu, check to see if it matches menu->old_active_menu_item, and if so, unref and clear old_active_menu_item (Patch from Pavel Cisler) * gtk/gtkmenushell.c (gtk_menu_shell_remove): Unset menu_shell->active_menu_item, if it is the child being removed. (Patch based on that of Gene Ragan, #50337) 2001-01-03 Alexander Larsson * gdk/gdkwindow.c: Set the colormap of input only windows to the system colormap. The previous GtkInvisible patch generated a lot of colormap == NULL warnings without this. 2000-12-20 Alexander Larsson * gtk/gtkinvisible.c (gtk_invisible_realize): Attach the style to the window so that the style it is not leaked when unrealizing the window. 2000-12-19 Ramiro Estrugo * gdk/gdkimage.c: (gdk_image_get): Deal with the possibility that XGetImage() might return NULL. Allocate the GdkImagePrivate structure only after XGetImage() succeeds in order not to dereference a NULL ximage pointer. This prevents a core dump when XGetImage() fails - which is unlikely, but can happen due to race conditions accessing the geometries of drawables. An x error will still be triggered, but the gdk image wrapper at least wont seg fault. Tue Dec 12 11:52:16 2000 Owen Taylor * gtk/gtkclist.c (gtk_clist_optimal_column_width): Fix off-by-one error in checks. (Dave Lambert) Sun Dec 3 11:44:07 2000 Owen Taylor * gdk/gdkevents.c: Strip GDK_RELEASE_MASK out of the state we get from X as a temporary hack to deal with the fact that GDK_RELEASE_MASK has the same values as bits used by XFree86 to indicate the keyboard group. (After patch from Vlad Harchev) 2000-20-01 Anders Carlsson * gtk/gtktogglebutton.c (gtk_toggle_button_draw): Fix bug when a GtkToggleButton is both insensitive and active, it was being drawn by the GtkButton draw handler which doesn't check the state. Now it's calling gtk_toggle_button_paint instead. Thu Nov 30 12:39:22 2000 Owen Taylor * gtk/gtkspinbutton.c (gtk_spin_button_insert_text): Fix some signed/unsigned comparison problems. (#6510, David Kaelbling) Thu Nov 30 11:19:56 2000 Owen Taylor * gtk/gtkentry.c (gtk_entry_move_word): Fix stupid bug causing extra word movement backwards. (#15282, Marco Goetze) Wed Nov 29 21:47:26 2000 Owen Taylor [ Backport from 1.3.x ] * gtk/gtktoolbar.c (gtk_toolbar_prepend_widget): Fix to prepend not append. (Pointed out by Brett Hall.) #11887. Wed Nov 29 20:56:38 2000 Owen Taylor * gtk/gtkwidget.[ch] (gtk_widget_is_ancestor): Change return type to boolean (Oskar Liljeblad, #18648) Wed Nov 29 20:44:09 2000 Owen Taylor * gtk/gtkclist.c (gtk_clist_get_pixtext): Allow mask to be NULL. (Vladimir Klebanov, #26545) Thu Oct 26 02:10:32 2000 Tim Janik [ Backport from 1.3 / otaylor, 29 Nov 2000 ] * gtk/Makefile.am: invoke maketypes.awk with LC_ALL=C to avoid localization misbehaviour. 2000-11-29 Martin Baulig * *.pc.in: Make the pkg-config scripts actually work. 2000-11-27 Federico Mena Quintero * gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to the "changed" callback of the adjustment. We need to redraw the spin button's arrows when the adjustment's range changes. (adjustment_changed_cb): Draw the arrows. (gtk_spin_button_value_changed): Draw the arrows. Sat Nov 18 11:56:39 2000 Owen Taylor [ backport from 1.3.x ] * gdk/gdkrgb.c: If possible, create only a single shm segment and use multiple parts of it instead of creating a bunch of separate segments, since the maximum number of segments per system is not large. * gdk/x11/gdkimage-x11.c (gdk_image_new): Don't set gdk_use_xshm to False when we get EINVAL from shmget so that the caller of gdk_image_new can retry with a smaller segment size. Sat Nov 18 11:45:09 2000 Owen Taylor * gtk/gtkcalendar.c: Patch from ChiDeok Hwang to fix memleaks found by Evan Martin. 2000-11-10 Elliot Lee * gtk/gtksocket.c: To handle a really weird error case (race condition), check if socket->plug_window is there before doing things with it. Fri Nov 03 Pablo Saratxaga * gtk/gtkrc.zh_TW.*: moved gtkrc.zh_TW.Big5 to gtkrc.zh_TW.big5; the charset encodign portion MUST be in lowercase. * gtk/gtkrc.az: added file for Azeri language Mon Oct 16 11:39:29 2000 Tim Janik * configure.in: up version number to 1.2.9, interface 4, binary 9. 2000-10-13 Yukihiro Nakai * configure.in: Add zh_CN.GB2312 (Chinese GB2312) to ALL_LINGUAS 2000-09-30 Martin Baulig * gtk+.pc.in, gdk.pc.in: Provide pkg-config scripts. * configure.in: Create *.pc scripts from the *.pc.in templates. * Makefile.am (pkgconfig_DATA): Install the *.pc scripts in `$(libdir)/pkgconfig'. Thu Sep 07 20:50:49 2000 George Lebl * gtk/gtkmenu.c: Backported Nils Barth's patch for submenu navigation with Owen's fixes and suggestions. The original ChangeLog from Owen for HEAD goes as folllows: Apply patch from Nils Barth and David Santiago to improve submenu navigation. The patch does this by creating a triangular region from the point where the pointer leaves the menu to the submenu. While the pointer is in that region and a timeout has not expired, events that would cause the active submenu to change are ignored. Sun Sep 03 00:47:08 2000 George Lebl * gtk/gtkwidget.h: Add some documenting comments about GTK_CAN_DEFAULT, GTK_HAS_DEFAULT and GTK_RECEIVES_DEFAULT just as owen said on irc. * gtk/gtkwindow.c (gtk_window_set_default): Don't blindly set HAS_DEFAULT. Only set it if there isn't another window holding it (a focus window which RECEIVES_DEFAULT) and only unset it if the widget is not the focused window with RECEIVES_DEFAULT. This fixes weird double default bugs in dialogs which has things call gtk_window_set_default at times. Fri Aug 18 17:27:46 2000 Owen Taylor * gtk/gtkclist.c (gtk_clist_merge): Don't leave dangling ->prev fields when merging lists. (Found simultaneously by Pawel Salek and Jakub Jelinek) Sun Jul 30 14:17:43 2000 Pablo Saratxaga * configure.in,po/{sp,sr}.po: Added Serbian files Thu Jul 27 05:06:29 2000 Tim Janik * gtk/gtktable.c: applied patch from Phil Thompson that enables space settings for the last row/columns as well. 2000-07-19 Sebastian Wilhelmi * gdk/gdk.h, gtk/gtktypeutils.h: Include gdk/gdkrgb.h and gtk/gtktypebuiltins.h resp. outside of the extern "C" block. Makes some C++ compiler happy. Reported by Denis Vakatov . Tue Jul 11 20:47:13 2000 Tim Janik * docs/gtk_tut_it.sgml (name): * docs/gtk_tut_fr.sgml (name): * docs/gtk_tut.sgml (name): scratched notion of completely outdated email adress: s/timj@psynet.net/timj@gtk.org/. Tue Jul 11 08:04:58 2000 Tim Janik * gtk/gtktree.c (gtk_real_tree_select_child): eek, i've never seen a bug here, never been here and never fixed anything ;( (don't segfault if tree->root_tree is NULL, which happens prior to widget realization, but puke instead). Sun Jun 18 15:35:35 2000 Pablo Saratxaga * gtk/gtkrc.cp1251,gtk/Makefile.am: the cp1251 is also used by Byelorussian language; changed the Makefile and file names to reflect that. Sun Jun 11 12:46:19 2000 Owen Taylor * gtk/gtkdnd.c (gtk_drag_set_default_icon): Fix cut and paste typo where wrong pixmap was being unref'ed. (Pointed out by a friend of KUSANO Takayuki.) Sun Jun 11 10:22:36 2000 Owen Taylor * gtk/gtkselection.c (gtk_selection_bytes_per_item): Add helper function to compute format / bytes relationship. Use in a couple places to fix up errors which assume 8 * format. * gtk/gtkselection.c (gtk_selection_request): Use 32 rather than 8 * sizeof (GdkAtom), to work correctly on Alpha. Thu May 25 03:54:30 2000 Tim Janik * released Gtk+-1.2.8. Thu May 25 02:30:57 2000 Tim Janik * configure.in: gtk version 1.2.8, interface age 3, binary age 8. Fri May 19 09:54:53 2000 Tim Janik * gtk/gtkwidget.c (gtk_widget_clip_rect): fix mangling of rectangle height with its width, spotted by Justin David Smith (Ytinasni) . Fri May 19 06:49:23 2000 Tim Janik * gtk/gtkfontsel.c (gtk_font_selection_get_font_name): handle "(nil)" foundries, patch from Grigorios Magklis. * gtk/gtkfontsel.c (gtk_font_selection_load_font): don't crash on non-available fonts, based on a patch by Grigorios Magklis . Fri May 19 05:52:08 2000 Tim Janik * gdk/gdkx.h: wrap contents into extern "C" { }, patch by Leonardo Zide (leo@lokigames.com). Wed May 17 01:03:50 2000 Raph Levien * gdk/gdkrgb.c (gdk_rgb_try_colormap): Changed the behavior when the number of colors requested (gdk_rgb_min_colors) exceeds the maximum cube tried. Old behavior segfaulted. New behavior just uses the maximum cube. Mon May 8 16:16:53 1999 Pablo Saratxaga * gtk/gtkrc.*: added "*-r-*" to all fontsets; that works quite well, always finding a font (maybe not very nice, but at least readable) Thu May 4 02:04:46 2000 Tim Janik * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are broken and require an empty arg, give it to them. Sun Mar 26 03:21:28 2000 Tim Janik * gtk/gtksignal.c (gtk_signal_handlers_destroy): when unref-ing the handlers, also invalidate them. bug nailed down by Karl Nelson . Mon Mar 13 18:37:55 2000 Owen Taylor * gdk/gdkdnd.c: Fix a bunch of cases where XGetWindowProperty() is called without trapping X errors. Thu Mar 9 22:10:56 GMT 2000 Tony Gale * docs/gtkfaq.sgml: FAQ Update: - Minor cleanups (Emmanuel, me) - New questions: I need to add a new signal to a GTK+ widget. Any idea? (timj) How can I retrieve the text from a GtkMenuItem? (timj) How do I validate/limit/filter the input to a GtkEntry? (me) Memory does not seem to be released when I free the list nodes I've allocated (timj) Tue Feb 29 13:10:00 GMT 2000 Tony Gale * gdk/gdkwindow.h gdk/x11/gxid.c gtk/gtkclist.c gtk/gtkclist.h gtk/gtkctree.c gtk/gtkmenu.h gtk/gtkwidget.c gtk/testgtk.c docs/styles.txt docs/refcounting.txt docs/gtkfaq.sgml docs/gtk_tut.sgml docs/gtk.texi TODO: Spelling/grammar fixes from Martin Buchholz Fri Feb 25 10:48:53 2000 Owen Taylor * gtk/gtkrc.*: Fix problem where stray '"' characters found their way into the fontset lists. Thu Feb 24 16:12:27 GMT 2000 Tony Gale * gtk/gtkcalendar.c: Implement num_marked_dates, and don't emit mutiple day_selected signals on month_prev. Wed Feb 23 10:54:14 GMT 2000 Tony Gale * docs/gtk_tut.sgml: New section on GtkCalendar * examples/calendar: Update example code Tue Feb 22 13:54:12 GMT 2000 Tony Gale * docs/gtkfaq.sgml: FAQ Update Tue Feb 22 08:52:52 2000 Tim Janik * gtk/gtkthemes.h: add extern "C" scope. Mon Feb 21 20:16:42 2000 Lars Hamann * gtk/gtkclist.c: applied patch from Guy Harris to make appends to the list constant. (gtk-guy-990901-0.patch) 2000-02-19 Havoc Pennington * docs/gtk_tut.sgml: Don't recommend the use of gtk_signal_handlers_destroy, closes bug #6390 Thu Feb 17 02:19:32 2000 Tim Janik * gdk/gdk.h: * gtk/gtkaccelgroup.h: * gtk/gtkthemes.h: remove extraneous prototypes, patch from Sam O'Connor . Wed Feb 16 05:22:36 CST 2000 Shawn T. Amundson * Released GTK+ 1.2.7 Mon Feb 14 22:50:10 2000 Tim Janik * gtk/gtktypeutils.c (gtk_type_init): use g_str_hash() and g_str_equal() for the typename hash table. Mon Feb 14 15:01:23 2000 Owen Taylor * gtk/gtkpaned.c (gtk_paned_compute_position): Add some sanity checks to make sure we never divide by zero. (Problem pointed out by Michal Jaegermann ) Mon Feb 14 12:29:38 2000 Owen Taylor * gtk/gtkfontsel.c: Apply patch from SHIRASAKI Yasuhiro to make font selector work a little better with 2-byte fonts. (Load a fontset instead of a font for two byte fonts.) Also, some cleanups in atom handling. Sun Feb 13 08:02:21 2000 Tim Janik * gtk/gtksocket.c (gtk_socket_class_init): parent class is GtkContainer, not GtkWidget. Fri Feb 11 02:19:32 2000 Tim Janik * gtk/gtkhpaned.c (gtk_hpaned_size_allocate): * gtk/gtkvpaned.c (gtk_vpaned_size_allocate): * gtk/gtkpaned.c (gtk_paned_compute_position): had to squeeze some more guint wrap-around bugs before going to bed. Thu Feb 10 16:16:35 2000 Tim Janik * gtk/gtkspinbutton.c (gtk_spin_button_size_allocate): guard against guint wrap arounds in allocation.width. * gtk/gtktable.c (gtk_table_size_allocate_pass1): repeat shrinking process untill we fit the allocation given. Tue Feb 8 09:38:29 2000 Tim Janik * gtk/gtkwidget.c: (gtk_widget_unrealize): guard widget access with ref/unref around signal emission. (gtk_widget_hide): same here, but also check its destroyed state before queueing a resize. Tue Feb 8 03:05:55 2000 Tim Janik * gtk/gtkstyle.c (gtk_style_new): use gtk_default_prelight_bg instead of gtk_default_insensitive_bg as insensitive base color. * gtk/gtktext.c (gtk_text_style_set): set the background color according to the widget's state. (gtk_text_realize): same here. (gtk_text_state_changed): same here. (draw_bg_rect): compare background color against base[] from GTK_WIDGET_STATE (text) not GTK_STATE_NORMAL. Mon Feb 7 04:01:55 2000 Tim Janik * gtk/gtkmain.c (gtk_main_do_event): ignore delete events when grabs are active, unless a delete event is send to the toplevel of the currently grab holding widget. Sun Feb 6 10:13:15 2000 Owen Taylor * gtk/gtkctree.c (gtk_ctree_drag_data_received): Remove debugging g_print's. Fri Feb 4 19:40:50 2000 Tim Janik * configure.in: up version number to 1.2.7, interface age 2, binary age 7. depend on glib 1.2.7. * NEWS: updates. Fri Feb 4 15:54:54 2000 Owen Taylor * gtk/gtkscrolledwindow.c (gtk_scrolled_window_size_request): Don't ever make the scrolled-window requisition ever depend on the visibility state of the scrollbars for the AUTOMATIC policy. This breaks the GTK+ requisition model, and causes loops. Fri Feb 4 15:09:12 2000 Owen Taylor * gtk/gtkstyle.c (gtk_style_new): Set the charset explicitely for the default font to avoid problems with XFree86-4.0 where the default charset is iso10646-1, not iso8859-1. Thu Feb 3 14:58:48 PST 2000 Manish Singh * acinclude.m4 * config.guess * config.sub * ltconfig * ltmain.sh: upgrade to libtool 1.3.4 (bugfix only release) * gtk/Makefile.am: minor cosmetic consistency tweak Thu Feb 3 14:46:01 2000 Owen Taylor * gtk/gtkmenushell.c (gtk_menu_shell_button_release): Set the activate_time to 0, so that we handle a quick press/release press/release properly and don't suppress the second release. (Red Hat bug #7545) Wed Feb 2 22:25:17 2000 Tim Janik * gtk/gtkctree.c (row_delete): (gtk_ctree_node_set_row_data_full): fixed very evil reentrancy bugs with destruction notifier, *always* update internal structures *before* calling user code. Sun Jan 30 20:10:52 2000 Lars Hamann A few more fixes for bug #5487, #2051, #2677. * gtk/gtkclist.c : (gtk_clist_button_press): Reset clist->anchor to -1 if event->type is not GDK_BUTTON_PRESS. (resync_selection): resync only if selection_mode is GTK_SELECTION_EXTENDED * gtk/gtkctree.c (resync_selection): same here Sun Jan 30 12:29:20 2000 Owen Taylor * gdk/gdk.h gtk/gtkmenu.h: Removed duplicate prototypes for gdk_drag_get_selection() and gtk_menu_detach(). [ From Jeroen Ruigrok/Asmodai ] Sat Jan 29 10:11:56 2000 Owen Taylor * gtk/gtknotebook.c (gtk_notebook_size_request): page->tab_label can be NULL. 2000-01-25 Havoc Pennington * gdk/gdkwindow.c (gdk_window_set_back_pixmap): parent_relative arg is boolean * gdk/gdkselection.c (gdk_selection_owner_set): return boolean * gdk/gdkrectangle.c (gdk_rectangle_intersect): return boolean * gdk/gdkproperty.c (gdk_property_get): return boolean * gdk/gdkinput.c (gdk_input_set_mode): return boolean * gdk/gdkim.c (gdk_im_ready): return boolean * gdk/gdkgc.c (gdk_gc_set_exposures): gboolean arg * gdk/gdkfont.c (gdk_font_equal): return gboolean (mild glib clash, should fix glib) * gdk/gdkevents.c (gdk_set_show_events): take gboolean arg (gdk_get_show_events): return gboolean, and canonicalize to TRUE/FALSE * gdk/gdkcolor.c (gdk_colormap_new): gboolean flag whether the colormap is private (gdk_colors_alloc): gboolean whether to be contiguous (gdk_color_equal): return gboolean since we are a predicate and not a qsort() (this looks semi-wrong due to glib breakage, IMO glib should be fixed) * gdk/gdk.c (gdk_set_use_xshm): take gboolean arg (gdk_get_use_xshm): return gboolean (gdk_pointer_is_grabbed): return gboolean * gdk/gdk.h: Change prototypes to match all the above changes, and re-run egtk-format-protos as required. Fri Jan 28 12:28:17 2000 Owen Taylor * gtk/gtkctree.c (resync_selection): * gtk/gtkclist.c (resync_selection): Return immediately if clist->drag_pos < 0. This is a workaround for the corrupt state that the clist gets into when a GDK_2BUTTON_PRESS occurs. See note in gtk_clist_button_press(). Bug #5487, #2051, #2677; fix suggested by David Helder and T. Alexander Popiel. * gtk/gtknotebook.c (gtk_notebook_size_request): Fix uninitialized variable from recent commit. Thu Jan 27 15:22:09 2000 Owen Taylor * gtk/gtkdnd.c (gtk_drag_begin): Fix stupid typo in last commit. Thu Jan 27 18:00:55 2000 Tim Janik * gtk/Makefile.am: prefix all autogenerated source that get build in $(srcdir) with $(srcdir)/, so make doesn't assume they got generted in builddir. since we subsequently cd into srcdir for autogeneration, the paths have to be stripped from the target file names, thusly we use $(@F) as target names now. put a comment about configure.in's --disable-rebuilds option, which can be used for non-writable source directories, for development setups though, srcdir has to be *writable*. Thu Jan 27 00:15:03 2000 Owen Taylor * gtk/gtkdnd.c (gtk_drag_begin gtk_drag_get_event_actions): Finish the job of allowing event to be NULL. (Fixes bug #4283, reported by Chris Blizzard) * gtk/gtkentry.c (entry_adjust_scroll): When calculating things so that the cursor appears on screen, properly take into account INNER_BORDER. (Fixes bug #4754, reported by Antonio Campos) Wed Jan 26 23:12:28 2000 Owen Taylor * gtk/gtknotebook.c (gtk_notebook_map): Don't show the tab_label unless it itself is visible. gtk/gtknotebook.c (gtk_notebook_size_request): Do a better job of making sure that the visibility of the tab label corresponds to whether it should be mapped or not. Wed Jan 26 21:17:03 2000 Owen Taylor * gtk/gtkoptionmenu.c (gtk_option_menu_position): Use the requisition, not the allocation, since the allocation has not necessarily been computed yet. (Pointed out by Eugene Osintsev) Wed Jan 26 19:44:25 2000 Owen Taylor * gtk/gtkstyle.c (gtk_style_new): Dont' set style/base[GTK_STATE_INSENSITIVE] both to gtk_default_insensitive_bg! (Bug #2187, reported by Jonathan Blandford) * gtk/gtkaccelgroup.c (gtk_accelerator_valid): Add Alt_L, Alt_R to list of invalid accelerators. (Bug #3736, reported by Vlad Harchev) Wed Jan 26 19:01:56 2000 Owen Taylor * gtk/gtkfilesel.c (open_ref_dir): Fix several bugs which occured after an attempt to open invalid home directory left cmpl_state->reference_dir == NULL. - completion on files in home directory didn't work - completion on an empty string caused segfault (Bug #3678, reported by Steve Ratcliffe) * gtk/gtkscale.c (gtk_scale_get_value_width): Fix cut and paste error that was causing scales to be incorrectly positioned. (Bug #2956, patch from Steve Ratcliffe ) 2000-01-27 Shirasaki Yasuhiro * acinclude.m4 (AM_GTK_WITH_NLS): Add -lintl to libs when checking for dcgettext, if we've found we needed it for dgettext. Wed Jan 26 18:06:07 2000 Owen Taylor * gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore queue_clear on NO_WINDOW widgets during a reparent, since at that point the window and widget heirarchies are out of sync. This stops crashing in some cases (the scrolled window reparent test, for instance), and _probably_ won't cause drawing errors. * gtk/testgtk.c: Make the reparenting-a-scrolled-window test do what it was supposed to do and be robust against window closings, etc. (Bug #2443) Wed Jan 26 16:56:54 2000 Owen Taylor * gtk/gtkentry.c: Fix return values on mouse events. (Bug #2686, Sky ) * gtk/genmarshal.pl: Fix up handling of FOREIGN. (pointed out by George Lebl) * gdk/gdkcolor.c (gdk_color_copy): Made const-safe. (From Ettore Perazzoli ) Mon Jan 24 10:44:48 2000 Owen Taylor * gtk/gtkcalendar.c (gtk_calendar_main_button): Handle clicks between rows or outside calender area correctly. (Patch from Damon Chaplin) * gtk/gtkclist.c (gtk_clist_set_row_data_full): * gtk/gtkctree.c (gtk_ctree_node_set_row_data_full): Call destroy function when overwriting existing data. (Pointed out by Damon Chaplin) Tue Jan 25 09:55:41 2000 Owen Taylor * gdk/gdk.c: Remove useless #include of , which was causing problems on various systems with Xmu. This hasn't been needed for a very long time. (Fixes #1185 3167) Sun Jan 23 22:27:36 2000 Owen Taylor * gdk/gdki18n.h: Include when defining gdk_isw* in terms of is* as a fallback. (Bug #4106 - Dan Winship ) Sun Jan 23 22:12:36 2000 Owen Taylor * gtk/gtkviewport.c (gtk_viewport_size_allocate): Don't realize the widget when it is size allocated! (old, old bug) * gtk/gtkviewport.c (gtk_viewport_adjustment_value_changed): Removed unused call to gdk_window_get_size() that showed up when the above was fixed. Sun Jan 23 20:52:40 2000 Owen Taylor * INSTALL: Added short note about setting LDFLAGS and CPPFLAGS to find libraries not in the default install path. Fixed env/setenv confusion for csh. Sat Jan 22 15:44:30 2000 Owen Taylor * gtk/gtkwidget.c (gtk_widget_reparent): Correctly fix up widget->window when the widget is a NO_WINDOW container widget. Sat Jan 22 12:40:48 2000 Owen Taylor * gdk/gdkpixmap.c (gdk_pixmap_seek_string): Rewrite to account for the fact that feof() does _not_ return TRUE on errors, and thus avoid infinite loops when trying to use gdk_pixmap_create_from_xpm() on unreadable values. Fri Jan 21 18:32:43 2000 Owen Taylor * gtk/gtkaspectframe.h (struct _GtkAspectFrame): s/gint/gboolean/. Fri Jan 21 16:24:08 2000 Owen Taylor * gdk/gdkgc.c (gdk_gc_set_dashes): Change from gdk_gc_set_dashes to take gint8 instead of gchar to make it clearer that it is _not_ a NULL terminated string. * gdk/gdk.h gdk/gdkfont.c gdk/gdkgc.c gdk/gdkselection.c gdk/gdkwindow.c gtk/gtkprogress.[ch] gtk/gtkthemes.[ch] gtk/gtktreeitem.[ch] gtk/gtkwidget.[ch]: Constify string arguments. 2000-01-13 Elliot Lee * gtk/gtktooltips.c: Add note about gtk_tooltips_set_colors(). 2000-01-07 Jesus Bravo Alvarez * configure.in (ALL_LINGUAS): Oops, Galician (gl) wasn't there yet Thu Dec 30 04:51:05 1999 Tim Janik * gtk/gtkvscale.c (gtk_vscale_pos_background): * gtk/gtkhscale.c (gtk_hscale_pos_background): when calculating the background size relative to our allocation, guard against small allocations, we may have not yet been size allocated. Fri Dec 24 03:41:33 1999 Tim Janik * gtk/Makefile.am: reverted sopwith's changes to Makefile.am, the builddir != srcdir case was already handled fine, and his "fix" would produce multiple copies of the built sources. for development you just need a writable srcdir. December 20, 1999 Elliot Lee * gtk/Makefile.am: Fix builddir != srcdir for generation of gtktypebuiltins*.[ch] Thu Dec 2 10:59:14 1999 Owen Taylor * gdk/gdkdnd.c (xdnd_check_dest): Allow version >= 3, not just version == 3. We implement all 3 + most of 4 - (we don't support matching text/plain;charset=iso-8859-1 to a dest that expects text/plain). We'll still advertise 3 to be safe, but any client implementing version >= 3 must interoperate with 3. Tue Nov 16 10:15:54 1999 Owen Taylor * gtk/gtkitemfactory.c (gtk_item_factory_parse_path): If translation does not include a '/', use entire translation instead of crashing. Mon Nov 15 17:17:51 GMT 1999 Tony Gale * docs/gtkfaq.sgml: s/gtk_main_iteration/g_main_iteration/ Sat Nov 13 22:30:29 GMT 1999 Tony Gale * docs/gtkfaq.sgml: threads example from Erik Mouw. New question on GtkLabel background colors. * docs/gtk_tut.sgml: - Correct the example code callback function definitions. - Update the gtkdial example code, from Frans van Schaik. - Update setselection.c to current API. - Merge the various versions of this document. * examples/Makefile examples/*/*.c: Update to code listed in tutorial. Fri Nov 12 22:24:14 MET 1999 Sven Neumann * gdk/gdkinputcommon.h * gdk/gdkinputxfree.h: Call XFreeDeviceState() on results of XQueryDeviceState(). (Ported from HEAD) Wed Nov 10 17:26:49 GMT 1999 Tony Gale * gtk/gtkclist.c: Fix off-by-one bug in parameter check. Sun Oct 31 22:21:11 1999 Tim Janik * docs/gtk_tut.sgml: s/gtk_accel_group_attach/gtk_window_add_accel_group/. Sat Oct 30 13:17:18 BST 1999 Tony Gale * docs/gtkfaq.sgml: FAQ update Sat Oct 30 09:09:09 1999 Owen Taylor * gtk/gtkselection.c (gtk_target_list_remove): Use g_list_remove_link, not g_list_remove. [ From Geert Bevin ] Sun Oct 24 07:41:40 1999 Tim Janik * gtk/gtkclist.c (real_undo_selection): commented out g_print() statement upon unselection (how the heck did that slip in?). Sat Oct 23 03:03:08 1999 Tim Janik * gtk/gtktext.c (gtk_text_freeze): (gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling in frozen state (and aparently crashes). patch provided by Anders Melchiorsen . Sat Oct 23 02:53:20 1999 Tim Janik * fix insensitive default/focus widget activation, reported by Matt Goodall . * gtk/gtkwindow.c (gtk_window_key_press_event): (gtk_window_activate_default): (gtk_window_activate_focus): return handled=FALSE for actiavtion of insensitive default widgets. return handled=TRUE for activation of insensitive focus widgets. don't activate in either case. Tue Oct 19 09:55:08 1999 Owen Taylor * gtk-config.in (lib_gtk): Switch order of @x_cflags@ and $glib_cflags to match library order and in the theory that an old version of GLib is more likely to be in the include directory for X then vice-versa. (Bug #2776) Tue Oct 19 09:46:49 1999 Owen Taylor * gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE to determine the locale for fontsets, not LC_MESSAGES; the user may want English messages with a handling for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR will still be broken) (Bug #2891) Tue Oct 19 20:36:42 1999 Changwoo Ryu * gtk/gtkrc.ko: Fixed the wrong number of "*"'s. Tue Oct 19 12:15:13 1999 Changwoo Ryu * gtk/gtkrc.ko: Changed the Korean default fontset. Fri Oct 8 10:55:51 CDT 1999 Shawn T. Amundson * Released GTK+ 1.2.6 Fri Oct 8 02:32:47 1999 Owen Taylor * gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug where when scrolling to the left or top double exposes were done, causing major slowdowns. Thu Oct 7 18:31:55 1999 Owen Taylor * gtk/gtkrc.c (gtk_rc_init): Always normalize codeset names to lowercase and alphanumeric, before looking them up. * gtk/Makefile.am: Install codeset variant gtkrc files with normalized names. Thu Oct 7 22:52:42 1999 Tim Janik * gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even popup menus when the menu is already visible, but its parent is still hidden, (happens after tornoff window got hidden). Thu Oct 7 11:09:55 1999 Owen Taylor * gtk/Makefile.am (install-data-local): Fix a typo where gtkrc.vi_VN.tcvn5712 wasn't getting deleted, causing error messages on install. Thu Oct 7 11:03:06 1999 Owen Taylor * gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw the handle as well, since we now sometimes ignore exposes on the handle while resizing. Wed Oct 6 18:02:31 1999 Owen Taylor * gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid extra g_free introduced in one of the last one or two commits. Wed Oct 6 16:38:36 1999 Owen Taylor * gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files consistent, put each style that a gtkrc.* file creates in a unique namespace, remove old files before installing. Wed Oct 6 14:31:16 1999 Owen Taylor * gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when gtk_rc_init is called multiple times. (Yes, people who do that have bugs in their code.) Tue Oct 5 11:36:57 PDT 1999 Manish Singh * gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf. Remove it since it's generated by the Makefile anyway Tue Oct 5 02:43:41 1999 Owen Taylor * gdk/gdkinputcommon.h (gdk_input_device_new): Free device->info.axes for core pointer. Mon Oct 4 16:16:53 1999 Pablo Saratxaga * gtk/gtkrc.{bg,iso88591[345]}: add gtkrc files for some new charset encodings: iso-8859-13 (for Lithuanian), iso-8859-14 (used by celtic languages), iso-8859-15 (used in Estonia) and microsoft-cp1251 (used by Bulgarian). 1999-10-01 Kjartan Maraas * configure.in: Added "uk" to ALL_LINGUAS. Thu Sep 30 13:55:25 1999 Owen Taylor * gtk/testgtk.c (destroy_idle_test): Rename idle to idle_id, to deal with obsolete, broken C libraries. Wed Sep 29 15:41:08 1999 Owen Taylor * gtk/gtktreeitem.c (gtk_tree_item_size_allocate): Get rid of stupid C unsigned integer bug. (Bug #2440) 1999-09-28 Kjartan Maraas * configure.in: Added "ro" to ALL_LINGUAS. Mon Sep 27 02:50:15 1999 Owen Taylor * gtk/gtkvscale.c (gtk_vscale_draw): Don't add in allocation->x/y twice! * gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough() consistent with gtk_vscale_pos_trough(). Sun Sep 26 19:44:34 1999 Owen Taylor * gtk/gtkcontainer.c (gtk_container_queue_resize): We may be queueing a resize on a toplevel container between the time we show it and when we map it. So, we need to test GTK_WIDGET_VISIBLE() for toplevels, and only use GTK_WIDGET_DRAWABLE() for child windows. Thu Sep 23 20:11:38 CDT 1999 Shawn T. Amundson * Released GTK+ 1.2.5 Fri Sep 24 02:00:21 1999 Tim Janik * configure.in (GTK_VERSION): changed version from Gtk+-1.2.5-pre2, to Gtk+-1.2.5, interface age 0, binary age 5. Thu Sep 23 16:41:03 1999 Owen Taylor * gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS (fixes bug #2144) Fri Sep 24 00:51:45 1999 Tim Janik * gtk/gtkcontainer.c (gtk_container_queue_resize): check for container DRAWABLE (instead of VISIBLE), so we don't queue resizes on non-toplevel containers. Thu Sep 23 17:59:59 1999 Tim Janik * gdk/gdkevents.c (gdk_event_translate): grr, even if Gdk doesn't handle CreateNotify itself, still put out a debuging message for --gdk-debug=events. made the ReparentNotify debugging message more verbose. wrap xcoords translation for ConfigureEvents into an error trap, a destroy event may already be pending, and in that case, the actuall coordinate values are not at all critical. Mon Sep 20 13:17:39 1999 Pablo Saratxaga * configure.in,po/pt_BR.po: added Portuguese Brazilian file from Alex Sandro Queiroz e Silva Mon Sep 20 01:21:53 1999 Tim Janik * released Gtk+-1.2.5-pre2, interface age 0, binary age 5. Sun Sep 19 18:13:31 1999 Owen Taylor * gtk/gtkselection.[ch]: Make the data argument const guchar *. Sat Sep 18 22:24:15 1999 Owen Taylor * gdk/gdkcc.c: Stop leaking the color_hash all over the place. Simplify and improve the logic. Sat Sep 18 21:27:40 1999 Owen Taylor * gtk/gtkwindow.c: Try to behave sensibly if the focus widget is the window itself. (Should we allow this at all?) Fri Sep 17 09:57:15 1999 Tim Janik * gtk/gtkwidget.c (gtk_widget_set_sensitive): * gtk/gtknotebook.c (gtk_notebook_set_scrollable): * gtk/gtknotebook.c (gtk_notebook_set_show_border): * gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args in prototypes and implementations consistent (Tomas Ogren). * gdk/gdk.h, gdk/gdkcolor.c: make return types (gint or gboolean) for prototypes and function implementations consistent (reported by Tomas Ogren). * gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag before the widget is unparented (reported by damon). * gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char, since we provide unsigned data anyways. Thu Sep 16 21:32:01 1999 Owen Taylor * gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay the call to gtk_tooltips_layout_text() until later. * gtk/gtktooltips.c (gtk_tooltips_draw_tips): Call gtk_widget_ensure_style() before using the style. Wed Sep 15 02:52:19 1999 Owen Taylor * gtk/gtkwidget.c (gtk_widget_event): Added workaround for old widgets that don't propagate draws to all children. (Namely gnome-dock for gnome-libs <= 1.0.16) Tue Sep 14 19:37:53 1999 Tim Janik * configure.in (GTK_VERSION): slight version increment to 1.2.5-pre2. Tue Sep 14 19:22:19 1999 Tim Janik * gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent for a redraw but just the widget that requested the resize. Tue Sep 14 18:29:47 1999 Tim Janik * gtk/gtkcontainer.c: added new widget level method gtk_container_set_reallocate_redraws() and a GtkContainer flag reallocate_redraws : 1 to reflect the setting, exported this through the argument system as a boolean ::reallocate_redraws. * gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws on the widget because the allocation changes, do so as well for widget->parent if the parent has reallocate_redraws set to TRUE. with that containers requesting reallocation redraws get automatically redrawn if their children changed allocation (this unfortunately affects also other children that didn't change allocation, but we cannot work around that before 1.3). Tue Sep 14 18:23:01 1999 Tim Janik * gdk/gdkevents.c (gdk_event_translate): tell if expose events have send_event set in debugging output. (gdk_compress_exposures): default initialize the event so we don't operate on bogus values (namely send_event). * gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width _and_ height are >0 (not _or_). * gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize() instead of gtk_container_queue_resize(), which is a core gtk internal function (must have been on crack when i queued that). * gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so we can check more reliably if we want to discard expose events. * gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING flag. * gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes, we simply trust these events. for deciding whether to discard exposes, check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING. Mon Sep 13 15:01:21 1999 Owen Taylor * gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore queues of areas that are completely off screen. * gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken logic for handleboxes. * gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity check on width/height. Mon Sep 13 02:22:47 1999 Tim Janik * gtk/Makefile.am: backed out Raja's recent VPATH build "improvements", we are fine with using $@ the way we do (if we actually encounter brokeness with $@ in VPATH builds because of additional path prefixes, we need to use $(@F) actually). Mon Sep 13 01:34:53 1999 Tim Janik * gtk/gtksignal.c: renamed two variables, hopefully didn't introduce short lived bugs, that would allow language bindings to do surgeries to our guts. 1999-09-12 Raja R Harinath * configure.in (wctype): Fix AC_DEFINEs. Fri Sep 10 21:31:00 1999 Pablo Saratxaga * po/et.po,configure.in: added Estonian language file * po/el.po: added Greek file from gtk+ HEAD cvs Fri Sep 10 15:22:50 1999 Owen Taylor * gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo where comparison was being done against an uninitialized value causing intermittant results depending on compiler flags. Also make it clearer that we aren't ever initializing the child as 0x0 (though this will be caught in gtk_widget_size_allocate()) Fri Sep 10 10:06:56 1999 Owen Taylor * gtk/gtkwindow.c (gtk_window_set_transient_for): Move gtk_window_unset_transient_for() call after we do checks involving the old transient parent. [ From Lance Capser ] Wed Sep 8 07:13:29 1999 Tim Janik * configure.in: fixed "GNU Make" check to pass with new make version 3.77.95. 1999-09-07 Raja R Harinath * gtk/Makefile.am (gtk.defs): Go back to using `touch' to create an empty file. Mon Sep 6 00:11:56 1999 Lars Hamann * gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has no children. (Reported by: Chris Rogers ) 1999-09-03 Raja R Harinath * gtk/Makefile.am (gen_sources): Improve VPATH builds. `$@' is valid only in the build dir, not after we've done `cd $srcdir'. Also use `test -f' instead of less portable `test -e'. Fri Sep 3 17:20:57 CDT 1999 Shawn T. Amundson * Released GTK+ 1.2.5-pre1 (test release) Fri Sep 3 15:59:56 1999 Owen Taylor * gtk/gtktext.c (correct_cache_insert): Rewrite for simplicity, and hopefully correctness. (Fixes bug #1322, which was a segfault when on some insertions with the properties around the insertion set up just wrong.) * gtk/gtktext.c (gtk_text_adjustment): When we receive a "changed" signal, clamp the new value to the adjustment bounds to avoid segfaulting if someone tries to change the adjustment to a bogus value. (Bug #1795) Thu Sep 2 16:33:59 1999 Owen Taylor * gdk/gdkwindow.c: When we receive an unexpected destroy notify on one of our windows, don't just warn about it, also mark our windows as destroyed. * gtk/gtkmain.c: Ignore unexpected destroy notifies for children, for toplevel windows handle them like delete_event. * gtk/gtkplug.c: Add an unrealize handler so that we unref plug->socket_window when we are done with it. Fri Sep 3 14:52:54 1999 Owen Taylor * gtk/gtktext.c (clear_area): Fix stupid signedness problem that was causing background to sometimes be misaligned. Fri Sep 3 12:26:33 1999 Owen Taylor [ Fixes pointed out by Ettore Perazzoli ] * gtk/gtkmenu.c (gtk_menu_position): Make sure we never position menus with negative x, y, since gtk_widget_set_uposition() can't handle that. * gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Modify the positioning code a bit so that we always put the top-left corner onscreen. (This is for UI reasons, gtk_menu_position() now takes care of gtk_widet_set_uposition() brokeness.) Fri Sep 3 16:04:41 1999 Tim Janik * gtk-config.in (--version): don't echo @GTK_VERSION@, but @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.@GTK_MICRO_VERSION@, so the AM_PATH_GTK() macros don't get confused by the -pre1. Fri Sep 3 03:06:30 1999 Tim Janik * configure.in: changed version number to 1.2.5-pre1, interface age 0, binary age 5. we still require Glib-1.2.4 though. * gtk/Makefile.am: fixed up things for -jx, x > 1. * NEWS: updates for 1.2.5. Sun Sep 5 08:48:51 1999 Owen Taylor * gtk/gtkwidget.c (gtk_widget_modify_style): Ref the RC style that is passed in. The lack of the ref before was a bug. If people worked around this bug, this will introduce a slight memory leak in their code. The code should typically look like: rc_style = gtk_rc_style_new (); [...] gtk_widget_modify_style (widget, rc_style); gtk_rc_style_unref (rc_style); * gtk/gtkwidget.c (gtk_widget_modify_style): Reset the style if it was already set. * gtk/gtkwidget.c (gtk_widget_set_name): Only set the style if it was set before. Sun Sep 5 08:10:53 1999 Owen Taylor * gdk/gdkfont.c (gdk_font_hash_insert): Add name => font and name => fontset hashes. The name => fontset hash is a _big_ win since we weren't previously caching fontsets at all and loading fontsets is expensive. The name => font hash is less of a win, but it does save us from doing repeated XQueryFont calls on the same font. * gdk/gdkprivate.h (struct _GdkFontPrivate): Add a names list so we can remove font/fontset from hash. Thu Sep 2 19:02:37 1999 Owen Taylor * gdk/gdkproperty.c (gdk_atom_intern): Remove useless and slightly confusing test. [ XInternAtom (,,TRUE) will never return None ]. * gtk/testgtk.c (main): Add a check to see if we are being run from the correct directory and to quit nicely if we are not. * gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function static. * configure.in (REBUILD): Change check for perl5 to check explicitely for v >= 5.002. (5.001 does not work with our scripts.) Thu Sep 2 23:00:03 1999 Tim Janik * gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS. * gtk/gtkwindow.c: queue resizes unconditionally (gtk_widget_queue_resize will figure what to do if the window is not realized). (gtk_window_move_resize): only recenter the window for GTK_WIN_POS_CENTER_ALWAYS. (gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in the same way as GTK_WIN_POS_CENTER. Thu Sep 2 22:39:27 1999 Tim Janik * gtk/gtkwindow.c (gtk_window_reposition): check for the last position with (!(info->last_flags & GDK_HINT_POS)) instead of (!info->last_flags & GDK_HINT_POS). * gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and new_height unconditionally, because we use these values even if !default_size_changed && !hints_changed. comented the (default_size_changed || hints_changed) case with respect to resize rejects from the window manager. * gtk/gtkwindow.c (gtk_window_move_resize): save info->last values in the zvt condition hack, since this includes the window hints, set the hints after the handling_resize case. * gtk/gtkwindow.c (gtk_window_show): constrain the default size that a window is initially shown with to the geometry. Thu Sep 2 07:38:56 1999 Tim Janik * gtk/gtkwindow.c (gtk_window_move_resize): s/size_changed/default_size_changed/g so i know what's really going on (frying brain on smaller flame now). Thu Sep 2 05:47:47 1999 Tim Janik * gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if we have size_changed upon handling_resize. this is a gross workaround for the broken zvt widget and should be removed in 1.3 again (search for FIXME). Owen provided an accurate comment for this: /* We could be here for two reasons * 1) We coincidentally got a resize while handling * another resize. * 2) Our computation of size_changed was completely * screwed up, probably because one of our children * is broken. It's probably a zvt widget. * * For 1), we could just go ahead and ask for the * new size right now, but doing that for 2) * might well be fighting the user (and can even * trigger a loop). Since we really don't want to * do that, we requeue a resize in hopes that * by the time it gets handled, the child has seen * the light and is willing to go along with the * new size. (this happens for the zvt widget, since * the size_allocate() above will have stored the * requisition corresponding to the new size in the * zvt widget) * * This doesn't buy us anything for 1), but it shouldn't * hurt us too badly, since it is what would have * happened if we had gotten the configure event before * the new size had been set. */ Sat Sep 4 08:39:26 1999 Owen Taylor * gdk/gdkwindow.c (gdk_window_set_geometry_hints) gdk/gdkwindow.c (gdk_window_set_hints): Don't omit setting the properties if flags == 0 - there may be an existing set of properties there already. (Very old bug. Would it be better to delete the property instead?) * gdk/gdkselection.c (gdk_selection_property_get): Fix spelling error in comment. Wed Sep 1 20:46:11 1999 Owen Taylor * gtk/gtkrc.c: deal properly with the fact that RC style lists may include rc styles more than once. * gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed unused static function. * gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a stack of directories of RC files currently being parsed and implicitely add them to pixmap path. This fixes a bug where the directory would get appended then overwritten by pixmap_path declarations. (bug #1462, from Peter Wainright ) * gtk/gtkthemes.c (gtk_theme_engine_unref): Call theme's exit function. (Patch from Peter Wainwright, bug #1454) * gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy): Add a destroy() handler to take care of removing group for menu item. (Fixes bug #1197) * gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko in warning message. Wed Sep 1 21:27:42 1999 Tim Janik * gtk/gtkwindow.c (gtk_window_move_resize): don't require a server roundtrip to figure window's width and height, since we know that anyways from widget->allocation. Wed Sep 1 14:05:30 1999 Owen Taylor * gdk/gdkimage.c (gdk_image_new): Use gdk_error_trap_push() to avoid stomping over gdk_error_warnings. * gdk/gdkimage.c (gdk_image_new): compute image->bpp as (bits_per_pixel + 7) / 8. This gives the same result as before for multiples of 8, but actually a "reasonable" value for 1bit or 4bit displays. Wed Sep 1 12:37:44 1999 Owen Taylor * gtk/gtkwindow.c (gtk_window_move_resize): Compute the hints after we request the new size. Wed Sep 1 10:38:37 1999 Owen Taylor * gtk/gtkwindow.c (gtk_window_compute_hints): Removed GTK_WIDGET_REALIZED() assertion - we can compute the hints before we are realized. * gtk/gtkwindow.c (gtk_window_move_resize): Reorder hint changing so that we have a value of hints_changed when we decide whether to constrain the window size. * gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix. * gtk/gtkwindow.c (gtk_window_constrain_size): cleanups, change back to G_MAXINT. Wed Sep 1 14:26:45 1999 Pablo Saratxaga * po/da.po,configure.in: aded danish file from Birger Langkjer Wed Sep 1 06:54:59 1999 Tim Janik * gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize new GtkWindowGeometryInfo, so fields like GdkGeometry geometry contain uncluttered values. (gtk_window_compute_hints): simply assert that window is realized and that geometry_info is valid, since we rely on this anyways. (gtk_window_constrain_size): major cleanups to the code. if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height for the base size, instead of the minimums. use 32767 as max width and height (like in gtkwindow.c) instead of G_MAXINT. Wed Sep 1 04:41:25 1999 Tim Janik * cleaned up the GtkContainer.need_resize flag handling mess, we only need to force resize requests when we were prematurely realized, or our widget tree was modified when we were temporarily hidden. handling these cases directly upon showing the window (i.e. while the GdkWindow is still unmapped) avoids the need to wait for a configure event response and therefore makes the GUI more snappier and avoids blank windows during the roundtrip. * gtk/gtkwidget.c: (gtk_widget_hide): (gtk_widget_show): don't queue resizes on toplevels, they know how to deal with matters. * gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize flag directly for not visible resize containers and spare us unecessary signal emissions. * gtk/gtkwindow.c: (gtk_window_realize): if we need to enforce premature size allocation, queue a container resize so we are correctly resized later on. (gtk_window_init): (gtk_window_size_request): don't freak around with the ->need_resize flag, gtk_container_queue_resize() will care about that. (gtk_window_show): handle initial resizing issues here, we can handle matters better in this place, especially since we know that our GdkWindow is still unmapped. (gtk_window_move_resize): don't care about ->need_resize at all. handle size changes properly that occoured while we waited for a configure event. Tue Aug 31 15:58:46 1999 Owen Taylor * gtk/gtkwidget.c (gtk_widget_set_uposition): * gtk/gtkwindow.[hc] (gtk_window_reposition): Move the hint setting code from gtk_widget_set_uposition to here; set the hints so that we respect any previously set geometry hints. * gtk/gtkwindow.c (gtk_window_compute_reposition): Don't change the window hints here or move the window here, let that happen in gtk_window_move_resize(). Tue Aug 31 06:58:52 1999 Tim Janik * gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due to already queued resizes (and therefore redraws) on a widget, check its anchestry as well. * gtk/gtkcontainer.c: (gtk_container_queue_resize): clear resize widgets for resize containers before aborting prematurely. this is especially important for toplevels which may need imemdiate processing or their resize handler to be queued. (gtk_container_dequeue_resize_handler): added new internal function for gtkwindow.c. * gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a configure event, take possible changes in window position into account as well. if we request a new window size, queue up a resize handler that will last until the configure event response arrives. combined the ->need_resize case (initial show) with the general size (hints) changed case and added even more comments. if !auto_shrink, only revert to the old allocation if the new size is smaller than the current allocation. Tue Aug 31 11:55:20 1999 Owen Taylor * gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy, gtk_window_set_geometry_hints gtk_window_set_default_size): When hints are set, queue a resize so that the hints will be eventually reset on the toplevel. * gtk/gtkwindow.c (gtk_window_show): Use gtk_window_compute_default_size(). Clear the need_resize flag on the initail map so that we don't unnecessarily trigger the resize code. * gtk/gtkwindow.c (gtk_window_move_resize): Split apart into separate functions. Compare the hints we are setting with what we set last time so that we can accurately tell when we need to reset the hints. * gtk/gtkwindow.c (gtk_window_compute_default_size): New function to figure out the size from requisition and default_size. * gtk/gtkwindow.c (gtk_window_constrain_size): Function from fvwm to constrain a size to the geometry hints. * gtk/gtkwindow.c (gtk_window_compare_hints): New function to compare two sets of geometry hints. * gtk/gtkwindow.c (gtk_window_compute_hints): Renamed from gtk_window_set_hints(), just compute the hints, don't set them. * gtk/gtkwindow.c (gtk_window_compute_reposition): Move code from gtk_window_move_resize() to separate function, rationalize a bit. Tue Aug 31 13:05:03 1999 Owen Taylor * gtkrc.h: Move the ref_count member out of the GtkRcStyle structure into a new private structure. * gtkrc.c: Split GtkRcStyle into public/private. In the private part, add a list of pointers to the RcStyle lists this RcStyle participates in. * gtkrc.c: When a RcStyle is free, remove all lists referencing it from the realized_style_ht hash, and free those lists. * gtk/gtkrc.c (gtk_rc_clear_styles): Don't call gtk_rc_init(), since that adds the default styles to the list of parsed RC files again. * gtk/gtkrc.c: Use gtk_rc_style_find() consistently. Mon Aug 30 19:00:00 1999 Pablo Saratxaga * gtk/gtkfontsel.c: little i18n patch backported from gtk+ 1.3.0 ( now all font properties showing in the font selector are translatable) * po/*.po: get the corresponding stringsfrom gtk+ 1.3.0 Sun Aug 29 13:38:59 BST 1999 Tony Gale * docs/gtkfaq.sgml: Minor FAQ Update Sat Aug 28 14:34:37 BST 1999 Tony Gale * docs/gtkfaq.sgml: FAQ update Thu Aug 26 14:14:42 1999 Tim Janik * gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity checks that ensure that a widget's allocation is at least 1 in width and height. (GNOME note: this doesn't affect old panel code anymore, because GtkSocket will request width and height of at least 1 since Fri Jul 23). * gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been allocated yet (happens if the user realizes the window prematurely), size request and allocate it. (gtk_window_size_allocate): guard against guint underflows. Wed Aug 25 19:01:36 1999 Lars Hamann * gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs in gtk_built_sources, so gtk.defs gets built prior to all other sources. Wed Aug 25 15:45:46 1999 Tim Janik * configure.in: evaluate $PERL for the perl version check. added --disable-rebuilds to give the user an option to completely disable any source autogeneration rules. Mon Aug 23 15:05:17 CDT 1999 Shawn T. Amundson * Released GTK+ 1.2.4 Mon Aug 23 23:16:14 1999 Tim Janik * configure.in: evaluate $ac_make when checking for GNU Make. Mon Aug 23 19:11:17 1999 Tim Janik * gtk/Makefile.am: invoke indent on gtkmarshal.*. rewrote source generation rules, use COPYING as oldest source tag for a piggyback rule to generate all sources from (don't touch it ;). major cleanups, strip spaces on build rules for GNU Make. * gtk/genmarshal.pl: don't operate on hardcoded filenames but take source and target files from commandline arguments. don't invoke indent. * gdk/Makefile.am: minor cleanups, strip spaces on build rules for GNU Make. * docs/Makefile.am: added generation.txt. * Makefile.am: require automake 1.4, build README from README.in and INSTALL from INSTALL.in in dist-hook. * README.in: * INSTALL.in: new files to autogenerate README and INSTALL from. * gtk/COPYING: * gdk/COPYING: new files containing the GNU LESSER GENERAL PUBLIC LICENSE. * configure.in: figure wether we have GNU Make, version update to Gtk+ 1.2.4, interface age 2, binary age 4. * NEWS: updates. * docs/generation.txt: minor additions/corrections. Sat Aug 21 14:07:36 1999 Lars Hamann * gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize notebook after switch to avoid drawing problems. (Bug#856 Reported by: Theodore Roth ) (gtk_notebook_pages_allocate): don't map not visible tab_labels, show them instead. (Bug#1805 Reported by: Dave Cole ) Wed Aug 18 09:20:10 1999 Tim Janik * gtk/gtkwindow.c: we use window->need_resize from configure_event now, to indicate that the gtkwindow should keep its allocation (e.g. because the user resized the window through window manager handles). resize_count is now reliably used to figure whether we got the allocation we requested from the window manager. configure events get queued as resizes now, the real stuff (size computation and allocation) now only goes on in gtk_window_move_resize(). GtkWindow's requisition now contains its *real* requisition (like all other widgets), *not* taking usize into account. geometry_info->last_{width|height} is now updated from set_hints() only so it always contains the last hints we set for the window manager. made some event handlers return TRUE instead of FALSE. the overall code should be much more straight forward now, and the significant code portions are accompanied by comments now. (gtk_window_set_hints): removed requisition argument and made it fetch the requisition through gtk_widget_get_child_requisition. we also don't move the gdkwindow here anymore, gtk_window_move_resize() does that now. (gtk_window_show): ensure that the widget is realized before calling gtk_container_check_resize() (and thus gtk_window_move_resize()), also ensure that we got properly size requested and allocated before realization. (gtk_window_configure_event): ignore plain window moves, or reallocate the widget tree through the resize queue otherwise. (gtk_window_move_resize): mostly rewrote this function to figure window manager hints more reliably, coalesce window moves and resizes to reduce configure events and do actuall size allocations. Tue Aug 17 07:43:04 1999 Tim Janik * gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets that have a resize pending, because a redraw is already queued for them. * gdk/gdkevents.c (gdk_event_translate): give a debugging note when discarding configure events. * gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal hack to clear resize_widgets. * gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets for resize containers prior to size allocation. (this is also a bit ugly, but avoids side effects for stopped emissions and is thus more reliable). (gtk_widget_unparent): removed disconnect call for clear_resize_widgets. * gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this function from gtk_tooltips_expose, as we connect to ::expose_event *and* ::draw now. 1999-08-18 Federico Mena Quintero * gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity checks. (gtk_target_list_unref): Likewise. * gdk/gdkpixmap.c (gdk_pixmap_unref): g_return_if_fail() the refcount is greater than zero. * gdk/gdkwindow.c (gdk_window_unref): Likewise. * gdk/gdkfont.c (gdk_font_unref): Likewise. * gdk/gdkgc.c (gdk_gc_unref): Likewise. * gdk/gdkdnd.c (gdk_drag_context_unref): Likewise. * gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise. Tue Aug 17 15:47:07 1999 Owen Taylor * gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar): guard against division by zero. (Fixes bug #1339) Tue Aug 17 10:56:49 1999 Owen Taylor * gtk/gtkentry.c (gtk_move_{forward,backward}_word): Prevent the trivial leak of information of allowing word motion when the entry is not visible. Tue Aug 17 10:28:52 1999 Owen Taylor * gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate modality to error dialog as well as confirmation dialogs. (Bug #1803, reported by Rosanna Wing Sze Yuen) Wed Aug 11 13:38:26 BST 1999 Tony Gale * docs/gtkfaq.sgml: FAQ Update Wed Aug 11 01:04:57 1999 Owen Taylor * gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor tree->view_lines. (gtk-guy-990611-3.patch: Guy Harris ) * gtk/Makefile.am (install-data-local): Solaris apparently has various troubles with ln -f; use rm first instead. (gtk-guy-990611-2.patch: Guy Harris ) * gdk/gdkproperty.c (gdk_property_get): Fix assumption that format 32 => sizeof(item) == 4. It really is sizeof(long). 1999-07-30 Raja R Harinath * gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir, use `cp' followed by `rm' (the `rm' was already there). July 30, 1999 Elliot Lee * configure.in: Fix autoconf warnings about cross compilation by trying to provide sane defaults for AC_TRY_RUN. * docs/Makefile.am: Tell distcheck how to generate the .gif files. * gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir), put them into $(srcdir) when generated. Also add a dependency of gtksignal.h on gtkmarshal.h for -j builds. * gtk/gtk(dnd,style,gamma).c: Minor warning fixes. Wed Jul 28 09:29:19 1999 Owen Taylor * gtk/gtkmain.c (gtk_main_iteration_do): Added missing GDK_THREADS_{LEAVE,ENTER} pair. (From Paul Fisher ) Fri Jul 23 01:00:15 1999 Tim Janik * gtk/gtksocket.c (gtk_socket_size_request): asure that the requested width and height are always >0 (owen). Fri Jul 23 00:00:47 1999 Tim Janik * gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent change that assured that a widget's allocated with and height are always >1, since this breaks *buggy* panel code. unfortunately this back-breaks the gimp's color selector. * gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our allocation is always >0 in width and height, before sending the configure event; this is a *gross* hack to get the gimp back to work. * marked both cases with TODO-1.3 Wed Jul 21 15:47:39 1999 Owen Taylor * gtk/gtktext.c: Don't display wrap indicators when text is not editable and word wrap is on. Wed Jul 21 08:21:40 1999 Tim Janik * gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case option menus here as they are not derived from menu shell, assure that the option menu has a menu we can add items to. Tue Jul 20 23:29:48 1999 Tim Janik * gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation-> width/height to (gint) before calculations and check against < 0 to avoid guint wraparounds. Sun Jul 18 00:35:49 1999 Tim Janik * gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated width and height is never zero. sanity check both dimensions against 32767 and issue a warning if the allocation is greater than that. Fri Jul 16 22:20:21 PDT 1999 Manish Singh * ltconfig * ltmain.sh: upgrade to libtool 1.3.3 Thu Jul 8 11:30:18 1999 Owen Taylor * INSTALL: Indicate that the --with-glib= configure time flag is unsupported. * configure.in: Some small fixups for libgno Wed Jul 7 15:03:30 1999 Owen Taylor * gtk/gtkmain.c (gtk_events_pending): Unlock around call to g_main_pending() as well. Wed Jul 7 14:59:01 1999 Owen Taylor * gtk/gtkmain.c (gtk_main_iteration): Unlock around call to g_main_iteration() - since that will regrab GTK+ lock to process events. Mon Jul 5 20:36:03 1999 Owen Taylor * docs/generation.txt: Added a file that gives documenation about the autogeneration process for various autogenerated files. Thu Jul 1 15:01:55 1999 Owen Taylor * gtk/gtkwindow.c - Regularize with the rest of GTK+ by making widget->requisition not reflect the set_usize() - Always recompute geometry hints, then check if they changed before sending them to the X server. The previous checks for changes would fail in a number of circumstances. Thu Jul 1 11:55:59 1999 Owen Taylor * gtk/gtkstyle.c: Include for strcmp(). Wed Jun 30 19:26:36 1999 Owen Taylor * gtk/gtkdnd.c: - Code cleanups - Instantaneously update on modifier key presses - Allow cancellation of the drag with Escape. Tue Jun 29 23:02:42 1999 Owen Taylor * gdk/gdk.c (gdk_x_error / gdk_x_io_error): Don't core dump at all on X IO errors, only core dump if --enable-debug for X errors. Tue Jun 29 17:04:09 1999 Owen Taylor * gtk/testgtk.c (create_handle_box): Set the policy to auto_shrink - otherwise the appearance is rather strange when flipping between horizontal and vertical. Tue Jun 29 15:59:25 1999 Owen Taylor * configure.in (LIBS): Look for libgmodule in the right location. Mon Jun 28 09:29:52 1999 Tim Janik * gtk/gtkwindow.c: add ::default_width and ::default_height arguments. (gtk_window_set_default_size): don't change a value if it's < 0. queue a resize. Sun Jun 27 11:00:33 1999 Tim Janik * gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts. Mon Jun 28 12:08:25 1999 Owen Taylor * gtk/gtkfilesel.c (cmpl_completion_fullname): Don't add an extra "/" when concating "/" + filename. (From Matt Grossman ) Mon Jun 28 10:57:12 1999 Owen Taylor * gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask for fg_gc if we set it for drawing pixmap. Thu Jun 24 17:06:23 1999 Tim Janik * gdk/gdkevents.c (gdk_event_translate): removed old ""Got event for unknown window:" message. disabled ConfigureNotify discarding code, because it led to events being processed out of order. Thu Jun 24 12:22:02 1999 Tim Janik * gdk/gdkglobals.c: preinitialize gdk_error_code to 0. * gdk/gdkevents.c (gdk_event_send_client_message_to_all_recurse): since we export this function, supress error warnings and don't reset the error code in the first half of this function. * gdk/gdk.c (gdk_x_error): set gdk_error_code to the actuall X error code (instead of just -1) so gdk_error_trap_pop() reveals something actually informative about the error that happened. * gdk/*.c: don't rely on gdk_error_code being -1 if an error occoured, but just gdk_error_code != 0. Thu Jun 24 11:50:07 1999 Tim Janik * gdk/gdkevents.c (gdk_event_apply_filters): advance the filter list pointer *before* invoking the filter function, so we at least don't crash if a filter is removed that is currently executed. window filters *really* need to be made truely reentrant at some point. Wed Jun 16 20:28:34 1999 Tim Janik * gdk/gdkevents.c (gdk_event_translate): don't segfault for window==NULL in ConfigureNotify. Mon Jun 14 11:10:15 1999 Tim Janik * gdk/gdkevents.c (gdk_event_translate): print the atom name in the PropertyNotify debug messages. Thu Jun 17 13:57:31 1999 Owen Taylor * docs/gtk_tut.sgml: Removed references to code examples in my directory on gtk.org as they should all be in the tutorial now. * docs/gtk_tut.sgml: Added sources for dial-test and scribble-xinput programs that were previously missing. Tue Jun 15 12:45:12 1999 Owen Taylor Fixes from Peter Wainwright * gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is already set, call old engine's destroy function and unref the old engine. Thu Jun 10 17:59:38 1999 Tim Janik * gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize. Wed Jun 9 15:13:16 1999 Tim Janik * gtk/gtkaccelgroup.h: mark certain functions as internal. Wed Jun 9 13:48:28 1999 Tim Janik * gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the expand behaviour changed. * gtk/gtklabel.c (gtk_label_set_pattern): (gtk_label_set_justify): (gtk_label_set_line_wrap): don't bother invoking queue_clear, the reallocation does that for us, always free_words so the upcoming resize will relayout the label's contents. Wed Jun 9 12:50:48 1999 Tim Janik * applied argument implementation patches from Elena Devdariani . * gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size, ::space_style, ::relief * gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size * gtk/gtkpreview.c: ::expand * gtk/gtkpaned.c: ::handle_size, ::gutter_size * gtk/gtknotebook.c: ::homogeneous * gtk/gtklabel.c: ::wrap * gtk/gtklist.c: ::selection_mode * gtk/gtkhandlebox.c: ::handle_position, ::snap_edge * gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y * gtk/gtkcolorsel.c: ::update_policy, ::use_opacity * gtk/gtkclist.c: ::sort_type * gtk/gtkcheckmenuitem.c: ::active, ::show_toggle * gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child Fri Jun 4 00:08:59 1999 Owen Taylor * TODO: Added entry about menu keyboard navigation, removed some finished items. Tue Jun 1 23:38:38 1999 Owen Taylor * gtk/gtkstyle.c: Removed ill-thought-out part of last comment. Tue Jun 1 23:30:09 1999 Owen Taylor * gtk/gtkstyle.c (gtk_style_attach): Get the reference counting right when we have to attach a new style for a different visual. (Chi-Deok Hwang ) * gtk/gtkstyle.c: Documented the refcounting peculularities of gtk_style_attach. 1999-06-01 Tim Janik * gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid window types. * examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead of GTK_TOPLEVEL for creating the window. 1999-06-01 Tim Janik * gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is the last argument (reported by Per Winkvist). Mon May 31 00:11:24 1999 Owen Taylor * acinclude.m4: Standardize on func_dgettext not func_gettext, so that the checks for dgettext actually are paid attention to. Sat May 29 11:17:29 PDT 1999 Manish Singh * docs/Makefile.am: add Changes-1.2.txt to EXTRA_DIST * acinclude.m4 * config.guess * config.sub * ltconfig * ltmain.sh: upgrade to libtool 1.3.2 Tue May 25 13:13:12 1999 Owen Taylor Fixes for invisible XOR lines (Frank Loemker ) * gtk/gtkclist.c (gtk_clist_realize): Always use a non-zero pixel for GDK_XOR. * gtk/gtkvpaned.c gtk/gtkhpaned.c: Use GDK_INVERT instead of GDK_XOR. Wed May 12 21:56:40 1999 Lars Hamann * gtk/gtkclist.c (adjust_adjustments): signal emit value_changed signals if h/voffsets differ from adjustment values. Reportet by Jerome Bolliet Mon May 10 22:20:06 CDT 1999 Shawn T. Amundson * GTK+ is as easy as 1.2.3... Mon May 10 04:20:41 1999 Tim Janik * gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate ::selection-done emissions up to the topmost menu shell. Fri May 7 10:15:14 1999 Owen Taylor * gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset the user data on the window before destroying it. * gtk/gtknotebook.c (gtk_notebook_unrealize): Add an unrealize handler to take care of destroying notebook->panel properly. (Bug #1198 - Morten Welinder ) * gtk/gtktext.c (expand_scratch_buffer): Fix reversal of g_new and g_realloc to stop memory leak. (Actually, we could just use g_realloc(), but I'm not 100% sure that is portable). (Bug #1196 - Morten Welinder ) Wed May 5 22:51:06 1999 Owen Taylor Patch from Sung-Hyun Nam * gdk/gdkim.c: Fix cut-and-paste errors for x/y and PreeditAttributes/StatusAttributes. Wed May 5 22:24:21 1999 Owen Taylor * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Change G_MAXINT to 2^16 to alleviate overflow problems in various window managers. Wed Apr 21 00:42:08 1999 Owen Taylor * gtk/gtkplug.h: Removed stray GtkPlugButton declaration. * gdk/gdkfont.c (gdk_text_measure): Fix the return value for fontsets. * gtk/gtkbutton.c (gtkbutton_expose): Fix warning with bin/button confusion. Thu May 6 04:53:26 1999 Tim Janik * gtk/testgtk.c: in the ItemFactory test, link radio items together, and show how preselection of radio items is done. Sun May 2 13:31:14 1999 Tim Janik * gtk/gtktreeitem.c (gtk_tree_item_set_subtree): * gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert): * gtk/gtktoolbar.c (gtk_toolbar_insert_element): * gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1): * gtk/gtkscrolledwindow.c (gtk_scrolled_window_add): * gtk/gtktable.c (gtk_table_attach): * gtk/gtklist.c (gtk_list_insert_items): * gtk/gtkmenushell.c (gtk_menu_shell_insert): * gtk/gtknotebook.c (gtk_notebook_insert_page_menu): * gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add): * gtk/gtkbin.c (gtk_bin_add): * gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end): * gtk/gtkfixed.c (gtk_fixed_put): * gtk/gtklayout.c (gtk_layout_put): general fixups to container_add logic. always realize child if child->parent is realized, only map the child and queue a resize if child and child->parent are both visible. Fri Apr 30 09:02:28 1999 Tim Janik * gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall instead of gtk_container_foreach to walk and unrealize children, so composite children get also unrealized. (gtk_widget_real_show): don't call gtk_widget_map() if we don't need to. (gtk_widget_map): assert that the widget is visible (basic constrain). (gtk_widget_real_map): assert that the widget is realized (basic constrain). Fri Apr 29 00:53:20 1999 Tim Janik * gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak. Wed May 5 12:42:01 1999 Owen Taylor * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Initialize size_hints.x and size_hints.y because kwm brokenly pays attention to them. (Bug #1181 - Lars Heete ) Wed May 5 11:38:56 1999 Owen Taylor * gdk/gdkrgb.c (gdk_rgb_choose_visual): Free the return value of gdk_list_visuals(). (Bug #1193 - Morten Welinder ) Wed May 5 10:47:54 1999 Owen Taylor * configure.in (LIBS): Add $INTLLIBS into $LIBS directly, rather than repeating the checks for gettext. * INSTALL: Added information about gettext and NLS support. * acinclude.m4 (LIBM): Check for dgettext, not just gettext. This should hopefully fix things wrt systems with old versions of GNU gettext installed. Tue May 4 11:12:56 PDT 1999 Manish Singh * gdk/gdkim.c (gdk_im_real_open): cast the return value of XSetIMValues to (void *) when comparing to NULL, to workaround the problem of some compilers barfing since older X headers don't have the prototype for it. Tue May 4 09:32:08 1999 Owen Taylor * gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc file for iso-8859-2 locales. * configure.in (ALL_LINGUAS): ALL_LINGUAS update. Tue Apr 27 16:38:32 1999 Owen Taylor * gtk/Makefile.am: Fix typo of static_sources for static_SOURCES. (Pointed out by andy@rz.uni-karlsruhe.de and others). Remove some suspicious and useless lines. Tue May 4 08:44:08 1999 Owen Taylor * gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use width,height = 0, 0 to mean - here to edge of window, instead of -1, -1, since the former is all we support. Tue May 4 08:34:43 1999 Owen Taylor * gtk/gtkmain.c (gtk_main): Correctly free list nodes when removing from quit_functions list. Mon Apr 19 10:11:12 1999 Owen Taylor * gdk/gdkcolor.c (gdk_colormap_new): Fix memory leak for pseudocolor where colormap->colors was double allocated. * gdk/gdkcolor.c (gdk_colormap_alloc1): Store the color value in the hash table with the pixel filled in so when we do later hash table lookups, the color value is correct. Sun May 2 15:29:45 PDT 1999 Manish Singh * gdk/gdkdraw.c (gdk_draw_lines): check private->destroyed before making the call Sat May 1 11:04:12 PDT 1999 Manish Singh * acinclude.m4 * config.guess * config.sub * ltconfig * ltmain.sh: upgrade to libtool 1.3 Tue Apr 27 14:17:16 1999 Tim Janik * gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable. Tue Apr 27 18:23:35 1999 Owen Taylor * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): When redrawing characters on non-visible entry, use appropriate '*' character. (Bug #1130 - Jean-Marc Jacquet ) Tue Apr 27 11:17:35 1999 Owen Taylor * gdk/gdkdnd.c (xdnd_set_{targets,actions}): Fix leak pointed out by Morten Welinder . Tue Apr 27 01:31:40 1999 Lars Hamann * gtk/gtkclist.c (drag_dest_cell): compute destination cell from drag coordinates. (gtk_clist_drag_data_received) (gtk_clist_drag_motion): use drag_dest_cell. * gtk/gtktree (drag_dest_cell) (gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise. (Bug #1129) Wed Apr 21 21:26:11 1999 Tim Janik * gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize translate_* fields. (gtk_item_factory_finalize): invoke translate_notify independant from translate_data. (gtk_item_factory_set_translate_func): likewise. (gtk_item_factory_destroy): only remove ifactory pointer from those widgets that belong to us (stupid me). Wed Apr 21 14:20:22 1999 George Lebl * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the default filter from the list Mon Apr 19 12:05:31 1999 Owen Taylor * gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of rc_style list when lookup succeeeds. 1999-04-18 Tomas Ogren * gtk/gtkrc.c: Add a / before the directory name to keep directory names from eachother. (Already fixed in 1.3.x) Fri Apr 16 20:41:43 PDT 1999 Manish Singh * gdk/gdk.c: #include "gdkkeysyms.h" for gdk_XConvertCase #defines * gtk/gtkfontsel.c (gtk_font_selection_create_xlfd): use g_strdup_printf instead of calcing the length separately Thu Apr 15 01:11:24 1999 Lars Hamann * gtk/gtkctree.c (resync_selection): * gtk/gtkclist.c (resync_selection): fixed undo_selection bug. * gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection bug. Tue Apr 13 17:14:28 CDT 1999 Shawn T. Amundson * Released GTK+ 1.2.2 Tue Apr 13 02:49:33 1999 Owen Taylor * gdk/gdkwindow.c: removed some silly #ifdef HAVE_CONFIG that we don't do in many other places. (Fixing duplicate #include of config.h) * gdk/gdkevents.c: include gdkinput.h _after_ config.h. Otherwise, #ifndef XINPUT_NONE check in the latter doesn't work. (Bug #546) Sun Apr 11 15:08:27 1999 Tim Janik * configure.in: bumped version number to Gtk+ 1.2.2, interface 0, binary 2. * NEWS: updates. Sun Apr 11 14:38:03 1999 Tim Janik * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): check for color "None" case insensitive. Fri Apr 9 19:22:19 1999 Owen Taylor * gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c: Add some missing GDK_THREADS_ENTER()/LEAVE around timeouts. (Patches from Sebastian Wilhelmi ) Thu Apr 8 20:10:33 1999 Tim Janik * gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate() rather than emit_by_name. * gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference on the widget across multiple signal emissions. (gtk_editable_delete_text): same here. (gtk_editable_class_init): set widget_class->activate_signal after editable_signals[ACTIVATE] has been created. Wed Apr 7 22:59:47 1999 Owen Taylor * gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp position here prematurely -- we might not have the right ->min_position and ->max_position yet. Tue Apr 6 16:38:51 1999 Owen Taylor * gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request): Add error traps so if the other end of the connection dies, we survive. * gtk/gtkselection.c (gtk_selection_notify): Clean up properly when selection property retrieval fails. * gtk/gtkselection.c (gtk_selection_request): Correctly reject SelectionRequest notifies where the handler returns no data. Tue Apr 6 12:24:21 1999 Owen Taylor * gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight when we've previously highlighted. * gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't emit two "drag_leave" signals for Motif drops. * gtk/gtkdnd.c (gtk_drag_source_handle_event): Send back the correct status messages when dropping from Motif onto a proxy window that is rejecting the drop. * gdk/gdkdnd.c (gdk_drag_motion): Separate out the dest_xid field into two fields - one for the window to send in messages, one to indicate the last looked up window for caching purposes. This is needed, so that Leave messages get the correct window. Mon Apr 5 17:11:57 1999 Owen Taylor * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): Check explicitly for the string "None" - it is in the XPM spec and some servers treat unknown colors in odd ways (like asking the user!) Mon Apr 5 13:21:30 1999 Owen Taylor * gdk/gdkevents.c (gdk_event_check, gdk_event_prepare): Fix warning created by people mucking around with the gsource API. * gdk/gdkevents.c (gdk_io_invoke, gdk_input_add_full): Change mapping between GIOCondition and GdkInputCondition to match the way the Linux kernel does it. This should fix problems where closed pipes were no longer signalling GDK_INPUT_READ on systems with a native poll(). Thu Apr 1 16:58:10 PST 1999 Manish Singh * gdk/gdkevents.c: made "->" into a "." of previous change so it compiles * gtk/gtkfontsel.c: added braces enclosing an if-else construct * autogen.sh: add --enable-maintainer-mode * configure.in: set ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" Thu Apr 1 18:41:25 1999 Owen Taylor * gdk/gdkevents.c (gdk_compress_exposures): Set the window field of the event structure before calling user filters. Wed Mar 24 23:03:49 CST 1999 Shawn T. Amundson * Released GTK+ 1.2.1 * docs/gtk-config.1.in: docs/Makefile.am: configure.in: gtk-config is now generated. * docs/gtk-config.1: Removed, now generated. 1999-03-31 Federico Mena Quintero * gdk/gdk.c (gdk_init_check): Use False as the last argument to XInternAtom() here. This is a particularly Old And Nasty(tm) bug. Sat Mar 27 23:32:13 1999 Tim Janik * gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal() to compare two argument values. added gtk_arg_to_valueloc() to set a variable from an arg through its location (pointer). * gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected as gfloat*, uchars are collected as guchar*, ints are collected as gint*, etc... Mon Mar 29 17:45:47 1999 Owen Taylor * gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c: Include instead of . * gtk/gtkstyle.c: Fix double include of gtkthemes.h (actually, a lot more duplicate includes occur if you trace through the sequence of #include's) gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu Mon Mar 29 17:31:52 1999 Owen Taylor * gdk/gdkim.c (gdk_mbstowcs): Free the value of the intermediate text property - prevents major memory leak when gdk_use_mb. gtk-d3august-990311-0: Bj|rn Augustsson Mon Mar 29 17:02:58 1999 Owen Taylor Patches from Akira Higuchi gtk-a-higuti-990322-[0-3] * gdk/gdkfont.c (gdk_text_extents_wc): Make work when sizeof(wchar_t) != sizeof (GdkWChar) * configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS that was causing -DX_LOCALE not to work. * gtk/gtkrc.c (gtk_rc_init): X_LOCALE will never have LC_MESSAGES defined * gdk/gdk.c (gdk_init_check): Remove --xim-preedit and --xim-status from argv properly. * gdk/gdkim.c (gdk_ic_real_new): Add a gdk_flush() so that the client window is present on the X server before we pass it to the input method. Tue Mar 9 10:46:49 1999 Owen Taylor * gdk/gdkdnd.c (motif_find_drag_window): Fix bug where if --display is specified on the command line, than the drag window will not be created on that display. Tue Mar 9 10:38:24 1999 Owen Taylor * gdk/gdkproperty.c (gdk_atom_intern): Fixed bug where lookups with only_if_exists == TRUE were inserting bogus values into the atom cache. Thu Mar 25 12:38:31 1999 Tim Janik * gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from g_get_home_dir() (gtk-pmc-990123-0.patch.gz). * gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/ left/right as well (gtk-michael-980726-0.patch.gz). * gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/ for pointer values, use gchar instead of char. fixed uline allocation leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem chunks instead of G_ALLOC_ONLY. (gtk_label_size_request): always alter requisition as passed and leave widget->requisition alone. (gtk_label_set_text): allow NULL strings. (gtk_label_new): likewise. Wed Mar 24 23:03:49 CST 1999 Shawn T. Amundson * Released GTK+ 1.2.1 * INSTALL: README: sanity_check: Updated. * docs/gtk-config.1.in: docs/Makefile.am: configure.in: gtk-config is now generated. * docs/gtk-config.1: Removed, now generated. Wed Mar 24 09:24:03 1999 Tim Janik * gtk/gtkdrawingarea.[hc]: type/macro fixups. Mon Mar 22 05:51:34 1999 Tim Janik * gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible *and* mapped (i.e. drawable). (gtk_bin_expose): only send exposes to drawable children. * gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable. (gtk_box_expose): only send exposes to drawable children. * gtk/gtkhscale.c (gtk_hscale_draw): * gtk/gtkvscale.c (gtk_vscale_draw): hm, this is an ugly one. we first compute the size of our trough area here (window relative) and then check intersection with the draw_area which is parent relative because we're a NO_WINDOW widget, so we need to offset the trough area by allocation.x and allocation.y before the check. (this must not be done for the background area though, since that's already computed parent relative). Mon Mar 22 00:41:39 1999 Lars Hamann * gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary, unrealize title buttons. Fri Mar 19 16:45:27 PST 1999 Manish Singh * acinclude.m4 * config.guess * config.sub * ltconfig * ltmain.sh: upgrade to libtool 1.2f * autogen.sh: libtool is not required to autogen gtk+ * acconfig.h: remove WITH_SYMBOL_UNDERSCORE (not explictly needed) Fri Mar 19 00:00:22 1999 Lars Hamann * gtk/gtkclist.c (gtk_clist_column_title_passive) (gtk_clist_column_title_active): only connect/disconnect to GtkWidgetClass::event to block mouse events. * gtk/gtkclist.c (vertical_timeout) (horizontal_timeout): zero initialize event, removed superfluous gdk_window_get_pointer call * gtk/gtklist.c (gtk_list_vertical_timeout) (gtk_list_horizontal_timeout): removed superfluous gdk_window_get_pointer call Wed Mar 17 09:00:00 1999 Tim Janik * plugging problems reported by "Bruce Mitchener, Jr." due to a purify session. * gtk/gtkstyle.c: (gtk_style_ref): (gtk_style_unref): assert ref_count to be > 0. * gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize the requisition. (gtk_clist_set_shift): likewise. * gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the adjustments. * gdk/gdkselection.c (gdk_selection_property_get): first XFree(t), then reset it to NULL. * gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the event before sending it and set send_event to TRUE (which needs to be done for *all* synthesized events). (gtk_list_vertical_timeout): likewise. * gdk/gdkcolor.c: (gdk_colors_free): (gdk_colormap_free_colors): use colormap->colors[in_pixels[i]] as the key for g_hash_table_remove() in both functions, this prevents us from accessing possibly uninitialized portions of a GdkColor structure where we are only interested in its pixel value. * gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory leaks. * gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event to TRUE when synthesizing events. Wed Mar 17 00:44:23 1999 Tim Janik * configure.in: bumped version number to Gtk+1.2.1, interface 0, binary 1. * NEWS: updates. * gtk/gtkfeatures.h.in: added GTK_CHECK_VERSION(major,minor,micro) macro to test for specific gtk versions, e.g. #if GTK_CHECK_VERSION (1,2,1) gtk_menu_ensure_uline_accel_group (menu); #endif /* Gtk+1.2.1 */ this macro will return whether the Gtk+ header files are from version major.minor.micro or _newer_, as opposed to gtk_check_version() which requires an exact match for binary compatibility. Tue Mar 16 17:43:33 1999 Tim Janik * gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the item factory class has been created. (gtk_item_factory_parse_rc): likewise. * gtk/gtkmenu.c: keep proper references for old_active_menu_item. (gtk_menu_reparent): unset the usize of the new parent, so the menu can sanely be size requested and we don't get nasty screen artefacts upon next reparentation. (gtk_menu_motion_notify): set send_event to TRUE if we synthesize an enter notify. only synthesize enter notifies if the pointer really is inside the event window. (gtk_menu_popdown): use gtk_menu_shell_deselect(). (gtk_menu_popup): move the background setting stuff into gtk_menu_tearoff_bg_copy() so it can be called from other places as well. * gtk/gtkmenushell.c (gtk_menu_shell_button_press): use gtk_menu_shell_select_item() to select the new item. (gtk_menu_shell_deselect): export this function, so gtkmenu.c can do the right thing for deselection as well. Sat Mar 15 20:10:33 1999 Tim Janik * gtk/gtkwidget.[hc]: (gtk_widget_accelerators_locked): return whether a widget's accelerators are locked. * gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or existing accelerators if the widget's accelerators are locked. Sat Mar 14 19:44:05 1999 Tim Janik * gtk/gtkitemfactory.[hc]: allow managing of foreign menu items. * gtk/gtkmenu.c: truely forward key press and key release events to the menu widget from the toplevel or tearoff window. we can't simply connect to that, we need to stop further processing of the events as well. Sat Mar 13 13:14:17 1999 Tim Janik * gtk/gtkmenu.c: (gtk_menu_key_press): pass event->keyval, event->state to gtk_accelerator_valid, instead of event->keyval twice. refuse to install single letter accelerators for menus that use single letter shortcuts. * gtk/gtkitemfactory.c (gtk_item_factory_create_item): use gtk_menu_ensure_uline_accel_group(). * gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group() which will always return an uline accel group, made gtk_menu_get_uline_accel_group() return NULL if the group isn't yet created. Mon Mar 15 01:03:27 1999 Lars Hamann * gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag. * gtk/gtkclist.c (gtk_clist_column_title_passive): Leave button sensitive, trap button_press, button_release, motion_notify, enter_notify and leave_notify events instead. (gtk_clist_column_title_active): disconnect event handler. (gtk_clist_drag_data_get): fixed memory leak. Reported by Guillaume Laurent Mon Mar 15 03:39:47 1999 George Lebl * gtk/gtkdnd.c: (gtk_drag_highlight) swap the gtk_drag_highlight_expose and gtk_drag_highlight_paint since it was connecting a void function to expose_event and the int returning function to the draw signal Wed Mar 10 23:49:55 1999 Lars Hamann * gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few width/height mixups. * gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal if needed. Wed Mar 10 02:07:31 1999 Tim Janik * merged from 1.3: 1999-03-09 Federico Mena Quintero * gtk/gtkstyle.c (gtk_default_draw_handle): Significantly reduced the number of calls to gdk_draw_point() (and thus to X) by clipping the points by hand. * gtk/gtkhandlebox.c (draw_textured_frame): Actually make use of the clip parameter. (gtk_handle_box_paint): Only paint the handle if the expose area intersects it. Wed Mar 10 00:11:32 1999 Tim Janik * gtk/testgtk.c (create_item_factory): unref the item factory after window's destruction. * gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference count on the menu shell around the menu item's activation, since the signal emission may cause menu shell destruction. * gtk/gtkitemfactory.c: the previous code leaked one accel group per menu. we use gtk_menu_get_uline_accel_group() now to fix that, and with that also create the underline accelerator group of the menus only if required (i.e. an underline accelerator has been specified). (gtk_item_factory_construct): (gtk_item_factory_create_item): removed code that would create an extra accel group for the menu (and leak references). (gtk_item_factory_create_item): adapted the underline accelerator installation code to properly feature gtk_menu_get_uline_accel_group(). * gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive menu->accel_group, this may return NULL if the accelerator group hasn't been set yet. added gtk_menu_get_uline_accel_group() to retrive the underline accelerator group of the menu, this will be created on demand and proper care is taken about its reference count. * gtk/gtkitemfactory.h: * gtk/gtkitemfactory.c: dumped the approach of keeping a widgets by action list on the factory since the factory<->widget destroy negotiation didn't work and would be hard to get going at all. instead we keep a list of GtkItemFactoryItem items on the factory (GtkItemFactoryItems are persistant throughout a program's life time). also, i removed the static const gchar *key_* variables, and made them inline strings (they weren't actually used anyways). (gtk_item_factory_add_item): update ifactory->items. (gtk_item_factory_destroy): destroy ifactory->items (and remove the item factory pointer from the remaining ifactory widgets). (gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem list to find the widget. (gtk_item_factory_get_item): new function that works around gtk_item_factory_get_widget() limitations, this function will only return menu items, even for entries. Tue Mar 9 01:01:28 1999 Tim Janik * gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our font hash table, if we have a GdkFontPrivate entry for this font already, simply increment its reference count, provided by Olaf Dietsche . * gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix provided by Olaf Dietsche . Sun Mar 7 06:13:29 1999 Tim Janik * gtk/gtkcontainer.c: (gtk_container_add_with_args): (gtk_container_addv): (gtk_container_add): before adding a child to a conatiner, make sure it is (default) constructed, this is neccessary because under certain circumstances the child will get relized and mapped immediatedly, in which case it has to be constructed already. Mon Mar 1 17:58:21 1999 Tim Janik * gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal values > 1 as TRUE also. Wed Feb 24 05:27:44 CST 1999 Shawn T. Amundson * Released GTK+ 1.2.0 * AUTHORS: updated Wed Feb 24 05:26:20 CST 1999 Shawn T. Amundson * gtk/gtkitemfactory.h: added a dummy gpointer to GtkItemFactoryClass for Tim Janik. Mon Feb 22 21:22:11 1999 Owen Taylor * gtk/gtkcontainer.h gtk/gtkwidget.h: Added some padding to class structures to allow addition of signals without breaking binary compatibility. Thu Feb 25 13:38:38 1999 Tim Janik * gtk/gtkscrolledwindow.c (gtk_scrolled_window_size_request): still request the extra width or height if the corresponding scrollbar is already visible (the change from 09:50 needs to apply to policy == GTK_POLICY_AUTOMATIC only). Thu Feb 25 11:27:36 1999 Tim Janik * TODO: updates, i left the text widget related portions in there, to serve as a guide line for things to watch out for when it gets reimplemented. Thu Feb 25 09:50:38 1999 Tim Janik * gtk/gtkscrolledwindow.c (gtk_scrolled_window_size_request): don't add extra width or height if the requested size is mandatory (i.e. set through child->usize). Thu Feb 25 02:13:20 CST 1999 Shawn T. Amundson * gtk/gtkmenu.[ch]: New function gtk_menu_reorder_child() from Tim Janik. Thu Feb 25 00:48:51 1999 Owen Taylor * gtk/gtkfontsel.c: Don't access *bitmapped_sizes if nbitmapped_sizes == 0. (Pointed out by zucchi@zedzone.fsi.com.au (Michael Zucchi)) Wed Feb 24 23:12:09 1999 Owen Taylor * gtk/gtkwidget.h gtk/gtkclist.c: Make prototypes for drag_data_get and drag_data_received handlers match the types used for gtk_singal_new; time needs to be a uint, not a uint32. Wed Feb 24 20:34:59 1999 Owen Taylor * README: Changed bug reporting instructions to describe using the GNOME bug tracking system. Wed Feb 24 19:08:51 1999 Owen Taylor * gtk/gtkclist.c (draw_cell_pixmap): Unset the clip mask for the GC if we set it. (Patch from Lars Hamann ) Thu Feb 24 23:58:44 1999 Tim Janik * gtk/gtksignal.c (gtk_signal_handler_pending_by_id): added function to check if a specific signal handler connection exists (similar to gtk_signal_handler_pending_by_func). and yes, this is a neccessary addition, since without this function, signal handlers can not be (un)blocked or disconnected in a generic fashion without producing g_warnings(). made gtk_signal_get_handlers() an inline function since it's used in a lot of places, especially within signal emission. Wed Feb 24 19:35:15 1999 Tim Janik * gtk/gtktext.c (gtk_text_key_press): if the widget is not editable, don't silently eat up GDK_Return, GDK_Home and GDK_End, return FALSE instead so the user can still hook up key bindings. Wed Feb 24 11:19:12 1999 Tim Janik * gtk/gtkwidget.c (gtk_widget_size_request): warn about &widget->requisition, even for toplevels. * gtk/gtkwindow.c (gtk_window_move_resize): request size into an automatic variable and check if our size has changed. when we decide to reallocate everything, we need to resize our own GdkWindow as well. * gtk/gtkmain.c: * gtk/gtkobject.c: hack time, make --gtk-debug=objects work even after gtk_type_init(), this is to "fix" gnome's arg parsing oddities. * gtk/gtktypeutils.h: don't segfault in GTK_CHECK_CLASS_TYPE and GTK_CHECK_TYPE upon NULL pointers. * gtk/gtklayout.c: removed bogus prototypes of gtk_layout_gravity_works, gtk_layout_set_static_gravity, gtk_layout_add_child_cb and gtk_layout_remove_child_cb to shut up compiler. * gtk/Makefile.am: added an empty rule gtkrc: : so make doesn't try to "update" gtkrc from gtkrc.c. Wed Feb 24 05:53:15 CST 1999 Shawn T. Amundson * gtk/Makefile.am: removed gtkrc rule added by Sergey Panov, because GTK+ no longer built. We don't need to install an empty gtkrc anyway. Wed Feb 24 01:22:39 CST 1999 Shawn T. Amundson * *.[ch]: Added notice to look in AUTHORS and ChangeLog files for a list of changes. Tue Feb 23 17:52:37 1999 Tim Janik * gtk/gtkitemfactory.c (gtk_item_factory_create_item): fix implicit branch creation, we need the *real* parent path for this and gtk_item_factory_parse_path() only returns the parent path with "_?" stripped off. 1999-02-23 Pavel Machek * gtk/gtkentry.c (gtk_entry_finalize): trivial bugfix Mon Feb 22 19:06:30 1999 Owen Taylor * gdk/gdkdnd.c (xdnd_send_*): When sending events to windows with a proxy, set the window field in the sent event to the original window, not to the proxy. (This gives consistency with Motif, and also provides information to the destination that it wouldn't have otherwise). * gtk/gtkdnd.c: Fixed some refcount leaks for windows. * gdk/gdkdnd.c (xdnd_send_xevent): When sending Xdnd event to the root window, set the event mask to ButtonPressMask. Hopefully, this should give us compatibility with kfm, if it uses the Qt style of root window drops. Mon Feb 22 08:45:10 GMT 1999 Tony Gale * docs/gtk_tut.sgml: - Complete the ProgressBar API - Fix the CList example code * examples/clist/clist.c, examples/progressbar/progressbar.c: Update from tutorial Sun Feb 21 17:44:52 1999 Owen Taylor * gtk/testgtkrc: Removed check-y/check-n backgrounds - the effect looked like a bug. Sun Feb 21 17:14:44 1999 Owen Taylor * gdk/gdkwindow.c (gdk_window_set_geometry_hints): Always set the max width or height to at least 1, since 0 triggers bugs in some window managers. (The window "pops out" of the frame in fvwm) Sun Feb 21 16:16:22 1999 Owen Taylor * gtk/gtkscrolledwindow.c gdk/gdkfont.c gdk/gdkim.c: Changed warnings from g_message() to g_warning(). * gdk/gdkim.c (gdk_ic_destroy): Changed g_print to g_message within GDK_NOTE() * gtk/gtkcolorsel.c gtk/gtkhandlebox.c: Removed some leftover debugging printfs. Sun Feb 21 15:59:55 1999 Owen Taylor * gdk/MwmUtil.h gdk/gdkwindow.c: Account for the fact that Xlib expects format == 32 to be a long, even on 64-bit architectures. [ patch from George Lebl (jirka@5z.com) ] Sun Feb 21 14:46:02 1999 Owen Taylor * gtk/gtkmain.c (gtk_init_check): gdk/gdk.c (gdk_init_check): Added initialization variants that return a status instead of dying. Sun Feb 21 14:21:46 1999 Owen Taylor * gtk/gtkwindow.c: removed debugging statements about embedded XID's. They could have been moved to the new PLUGSOCKET debug key, but they weren't really useful anyways. * gdk/gdk.h: Added gdk_error_trap_push/pop to provide a clean interface to the gdk_error_code functionality of trapping X errors. * gtk/gtkplug.c gtk/gtksocket.c: Add error traps around accesses to foreign windows. Sun Feb 21 15:37:25 1999 Tim Janik * gtk/gtkwindow.h: marked gtk_window_set_focus, gtk_window_set_default, gtk_window_remove_embedded_xid and gtk_window_add_embedded_xid as internal functions. Sun Feb 21 11:39:06 1999 Owen Taylor * gtk/gtktext.c (find_line_containing_point): Revise algorithm for scrolling backwards. This one might actually work with one-line-high Text widgets. * gtk/gtkmain.c: Removed a misplaced comment, a few formatting cleanups. Sat Feb 20 20:59:25 1999 Tim Janik * gtk/gtkwindow.c: hm, set_modal doesn't really work with random gtk_grab_add/gtk_grab_remove calls. either the window user uses the set_modal interface or he places grab_add/grab_remove on his own. (gtk_window_set_modal): enforce modality state either way. (gtk_window_hide): revert previous change. Sat Feb 20 20:04:48 1999 Tim Janik * gtk/gtkcalendar.c (gtk_calendar_button_press): increment years and months by two not three on double clicks, patch provided by Nick Lamb . Sat Feb 20 19:44:36 1999 Tim Janik * gtk/gtkwindow.c: added ::modal argument. (gtk_window_hide): reset window->modal from the current grab state (this is only relevant when grab_add/grab_remove is called on the window by bypassing gtk_window_set_modal). (gtk_window_remove_embedded_xid): (gtk_window_add_embedded_xid): don't use g_print() but g_message() within #ifdef G_ENABLE_DEBUG. when the hack got these functions added (ChangeLog doesn't know them)? Fri Feb 19 14:59:45 EST 1999 Sergey Panov * gtk/gtkrc,gtk/gtkrc.ja, gtk/gtkrc.ko, gtk/gtkrc.ru: Collecttion of the locale dependent gtkrc files and * gtk/Makefile.am: patched to get that collection installed in to $(prefix)/etc/gtk/ Fri Feb 19 17:52:28 1999 Tim Janik * gtk/gtksignal.h: grouped function names into application-level, widget-level and non-public. * gtk/gtktreeitem.c (gtk_tree_item_size_request): use auto pix_requisition instead of item->pixmaps_box->requisition. Thu Feb 18 17:26:09 1999 Owen Taylor * gtk/gtkwidget.c (gtk_widget_queue_clear_area): When queueing clears relative to widget->window, actually store widget->window so we know that the coordinates are window-relative. Thu Feb 18 11:46:57 1999 Owen Taylor * gtk.m4: Fix glib_config_args gtk_config_args confusion. (pointed out by Roland Dreier ) * gtk/gtksocket.c gtk/gtkmain.c gtk/gtkdebug.h (gtk_socket_filter_func): Move the plug-socket debugging code to a new "plugsocket" debug keys from the previous hardcoded DPRINTF. Thu Feb 18 00:54:46 1999 Tim Janik * gtk/gtkclist.c: added widget arg ::titles_active. Thu Feb 18 00:27:46 1999 Tim Janik * gtk/gtkwidget.c (gtk_widget_queue_clear_area): only translate widget relative coordinates to window relative if the widget is not a toplevel (i.e. it has ->parent != NULL), otherwise the area size gets screwed up for toplevels. Tue Feb 16 14:25:44 CST 1999 Shawn T. Amundson * INSTALL README configure.in gtk+.spec docs/gtk-config.1: version = 1.1.16 * Makefile.am: removed colorsel example since it doesn't actually exist. * Released GTK+ 1.1.16 Mon Feb 15 23:55:27 1999 Owen Taylor * gtk/testgtk.c (create_text): Use a ScrolledWindow test how Text widgets work within ScrolledWindow. (POLICY_AUTOMATIC drew very badly, so it uses POLICY_ALWAYS for the vscrollbar) * gtk/gtktext.c (gtk_text_unrealize): Free the cache in the unrealize handler. Some code in gtktext.c assumes that if text->line_start_cache is non-NULL, the widget is realized. We'll recompute it again anyways if we later re-realize. Fri Feb 12 15:47:20 1999 Owen Taylor * gtk/gtkcalender.c gtk/gtkentry.c gtk/gtkhandlebox.c gtk/gtknotebook.c gtk/gtktext.c gtk/gtkviewport.c gtk/gtkwidget.c: When setting styles, remove unecessary explicits draws and clears. * gtk/gtkrange.c: Ugly fix so the steps get the correct background. Mon Feb 15 22:55:50 1999 Owen Taylor * NEWS: Updated for 1.1.16. Mon Feb 15 19:36:57 1999 Owen Taylor * gtk/gtklabel.c (gtk_label_finalize): Free label->label_wc. Mon Feb 15 18:02:22 1999 Owen Taylor * gtk/gtkdnd.c: Some coding style fixups. * gtk/gtkdnd.c (gtk_drag_set_icon_pixmap): Set a flag so that we destroy the icon window that we created when the drag ends. Thu Feb 11 18:43:12 1999 Owen Taylor * gtk/gtkbindings.c (gtk_binding_set_add_path): When we find a match, stop searching. (Because we assume pspec != NULL in the search). Wed Feb 10 01:18:22 1999 Owen Taylor * gtk/gtkhandlebox.c (gtk_handle_box_draw_ghost): Fix up painting of "ghosts". * gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Add double-click reattachment. v * gtk/gtkhandlebox.c: Grab on widget->window, not on handlebox->bin_window. This means we don't have to worry about ungrabbing while reparenting. Don't make a GTK+ grab - that wasn't necessary. * gtk/gtkhandlebox.c: Only compute the root -> desk offset once, when starting the drag, instead of continuously. This should solve the *Bad Window* errors that were occurring because of race conditions with the WM. * gtk/gtkhandlebox.c: Completely reworked the the logic of reattachment. We introduce the concept of the "snap edge", which is an edge that needs to be aligned for reattachmed. We set a reasonable default from handlebox->handle_position, but an application might want to change this in some circumstances. * gtk/gtkhandlebox.[ch]: Add settors: gtk_handle_box_set_handle_position (); gtk_handle_box_set_snap_edge (); Mon Feb 15 11:13:01 1999 Owen Taylor * gtk/gtkwindow.c (gtk_window_set_focus): gtk/gtkwidget.c (gtk_widget_real_grab_focus): If the focus widget is the same, but does not currently have the focus, call gtk_window_set_focus(). This is needed so that click focusing with GtkPlug works correctly. Mon Feb 15 07:45:28 1999 Tim Janik * configure.in (--enable-debug): default to yes for development trees. Fri Feb 12 00:08:01 1999 Lars Hamann * gtk/gtklist.c (gtk_list_remove_items_internal): don't autoselect focus_row in case of GTK_SELECTION_EXTENDED * gtk/testgtk.c : few changes in list example. * gtk/gtklistitem.c (gtk_list_item_class_init): * gtk/gtkctree.c (gtk_ctree_class_init): * gtk/gtkclist.c (gtk_clist_class_init): fixed indentation, removed unused key bindings Wed Feb 10 01:02:46 1999 Lars Hamann * gtk/gtkclist.c (real_remove_row): * gtk/gtkctree.c (gtk_ctree_remove_node): don't autoselect focus_row in case of GTK_SELECTION_EXTENDED * gtk/testgtk.c : few changes in clist/ctree examples. Wed Feb 10 15:49:16 1999 Tim Janik * gtk/gtkwindow.c (gtk_window_class_init): * gtk/gtkctree.c (gtk_ctree_class_init): applied patch from Paolo Molaro to fix GTK_TYPE_POINTER args of ::tree_collapse and ::set_focus signals. * docs/gtk_tut.sgml: s/menufactory/itemfactory, minor fixups to the item factory example. Wed Feb 10 11:05:53 1999 Owen Taylor * gtk/gtkdnd.c: Reverted coding style "fixups" Wed Feb 10 10:43:50 1999 Owen Taylor * gdk/gdkwindow.c (gdk_window_set_icon, gdk_window_set_group): Supplement the existing WMNormalHints, don't overwrite them. Wed Feb 10 08:35:36 1999 Tim Janik * gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar): asure that ->value_buf always points to an allocated area. (gtk_color_selection_drag_end): new function hooked up to drag_end to destroy the drag_window. * gtk/gtkdnd.c: some coding style fixups. Wed Feb 10 06:47:17 1999 Tim Janik * gdk/gdkwindow.c: various indentation fixes. * gdk/gdkevents.c: coding style fixups. NULL initialize event_func, event_notify and event_chunk. (expose_predicate): made this function static. (gdk_event_handler_set): perform destroy notification even if no event_func is set. * gdk/gdkrectangle.c (gdk_rectangle_union): added g_return_if_fail statements. Sun Feb 7 19:49:21 1999 Owen Taylor * gtk/gtkwindow.c (gtk_window_move_resize): Fixed some bugs with set_default_size. Sat Feb 6 13:23:51 1999 Owen Taylor * docs/Changes-1.2.txt: Added information about the change to gtk_widget_size_request(). * gtk/gtkentry.c: Call gtk_widget_get_child_requisition explicitely since we differentiate between the usize set by the user and what we got. (Ugh) * gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition): New function to return the effective size of a widget as it looks to its parent. * gtk/gtkwidget.c (gtk_widget_size_request): Leave widget->requisition set to exactly what the widget asked for, and then make a copy of that into the requisition argument. Allow a NULL requisition argument, and, if G_ENABLE_DEBUG, warn if requisition == &widget->requisition. * gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c gtklayout.c gtklist.c gtklistitem.c gtkmenu.c gtkmenubar.c gtkmenuitem.c gtknotebook.c gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c Avoid calling gtk_widget_size_request with requisition == widget->requisition; use gtk_widget_get_child_requisition to get the size of children. Tue Feb 9 19:49:46 1999 Owen Taylor * configure.in (LDFLAGS): Removed extraneous line that crept in in previous commit. Tue Feb 9 19:39:32 1999 Owen Taylor * gtk/gtkentry.[ch] gtk/gtkeditable.h: Moved entry->visible into editable class. (Leave it behind deprecated for compatibility) * gtk/gtkeditable.c: If not editable->visible, return *'s for clipboard and selection. Tue Feb 9 19:11:43 1999 Owen Taylor * gtk/gtkstyle.c (gtk_style_new): If we can't find helvetica, fall back to "fixed". If we can't find "fixed", exit cleanly. Tue Feb 9 16:03:44 1999 Owen Taylor * acconfig.h configure.in: Rename XIM_INST_IS_MISSING_OR_STRANGE to USE_X11R6_XIM * Conditionalize destroy callbacks with USE_X11R6_XIM. Tue Feb 9 15:35:13 1999 Owen Taylor * gtk/gtklabel.c (gtk_label_style_set): Added a style_set() function so that word lengths get recomputed on style change. Mon Feb 8 21:00:20 1999 Lars Hamann * gtk/gtkclist.c (CLIST_OPTIMUM_SIZE): changed to 64 (gtk_clist_draw_focus) (hadjustment_value_changed) (draw_row): few fixes to respect GTK_CAN_FOCUS flag. * gtk/gtkctree.c (draw_row): respect GTK_CAN_FOCUS flag. Mon Feb 8 19:22:27 GMT 1999 Tony Gale * example/colorsel/*: missing from the CVS for some reason Mon Feb 8 13:08:51 GMT 1999 Tony Gale * examples/Makefile: add SpinButton example Mon Feb 8 12:50:06 GMT 1999 Tony Gale * docs/gtk_tut.sgml: - Heavily edited GtkCombo section initially from Christopher T. Lansdown . - Cleanups and some glib stuff from David Wheeler * Makefile.am: update to include the latest Tutorial examples. Sat Feb 6 11:20:16 1999 Owen Taylor * gtk/gtkwidget.c (gtk_widget_idle_draw): Add the entire draw_data_list back to the free list, not just the last element. Sat Feb 6 00:21:14 1999 Lars Hamann * gtk/gtkctree.c (draw_row): * gtk/gtkclist.c (draw_row) (new_column_width) (scroll_horizontal) (title_focus): search last visible column instead of using clist->columns. Fri Feb 5 13:23:50 1999 Owen Taylor * gdk/gdkwindow.c (gdk_window_move_resize): Adjust saved positions of children when resizing a guffaw_gravity = TRUE window. * gtk/gtkdnd.c (gtk_drag_highlight): Rework the highlighting so that it is done in callbacks for draw and expose. This should solve problems with multiple highlights for the same GdkWindow. * gtk/gtkdnd.c (gtk_drag_highlight): Fix bug where the highlight was being drawn with an incorrect width/height for !NO_WINDOW widgets. Tue Feb 2 11:06:02 1999 Owen Taylor * gtk/gtkrange.c (gtk_range_style_set): Fixes to account for the changed structure of the windows of range widgets. 1999-02-05 Owen Taylor * gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate): Don't assume any more that the gtkwidget.c code will queue a redraw on us during a size_allocate - queue clear/draws as appropriate for our groove. 1999-02-04 Christopher Blizzard * gtk+.spec (Packager): Change my email address. Thu Feb 4 05:42:34 CST 1999 Shawn T. Amundson * INSTALL NEWS README configure.in gtk+.spec docs/gtk-config.1: version=1.1.15 * Makefile.am: example files where incorrect for menu directory. * Released GTK+ 1.1.15 Wed Feb 3 17:29:57 PST 1999 Manish Singh * gtk/gtkclist.h: spelling fix in comment from joey@kuolema.Infodrom.North.DE (Martin Schulze) Tue Feb 2 12:39:42 1999 Owen Taylor * gtk/gtkdnd.c: Make sure we set the icon window position before it is shown to prevent annoying flicking to 0,0. Make it consistent that info->cur_x/y do not include info->hot_x/y displacement. Tue Feb 2 08:59:16 GMT 1999 Tony Gale * docs/gtk_tut.sgml: new sections on Layout and SpinButton [nice widget] * examples/spinbutton/*: example code Mon Feb 1 19:25:54 1999 Owen Taylor * docs/gtk-config.txt (testinput_SOURCES): Put in some information about 'gtk-config --libs gthread'. * docs/Changes-1.2.txt: Updated section on threads. Tue Feb 2 00:28:44 1999 Lars Hamann * gtk/gtkctree.c (gtk_ctree_insert_node): in case of GTK_SELECTION_BROWSE select first inserted row. (resync_selection): select rows in correct order. * gtk/gtkclist.c (real_insert_row): in case of GTK_SELECTION_BROWSE select first inserted row. (resync_selection): select rows in correct order. * gtk/gtklist.c (gtk_list_end_selection): select rows in correct order. Mon Feb 1 16:47:55 1999 Owen Taylor * gtk.m4: Pass gthread on to gtk-config. * configure.in gtk-config.in: Support gthread flag to add thread cflags/libraries into the output of gtk-config. Mon Feb 1 15:14:56 1999 Owen Taylor * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): Fixed problem with uints resulting in huge child allocations. Mon Feb 1 14:54:28 1999 Owen Taylor * gtk/gtklabel.c (gtk_label_expose): Cast uints to ints in geometry calculations. This should prevent FP exceptions on FreeBSD when quantities become negative. [ Actually, this is probably a workaround with a gcc bug with handling of bitfields, according to Ben Jackson ] Mon Feb 1 13:35:14 GMT 1999 Tony Gale * examples/Makefile: update to new examples * examples/menu/itemfactory.c: I must have forgotten to 'cvs add' this file Mon Feb 1 09:16:03 GMT 1999 Tony Gale * docs/gtk_tut.sgml: - Complete documentation of Label widget API - New sections for the following: * Arrows * Alignment * Button Boxes * Viewports * examples/arrow/*, examples/buttonbox/*, examples/label/* - New code examples Fri Jan 29 09:44:37 GMT 1999 Tony Gale * examples/fixed/*, examples/frame/* - Examples from the Tutorial Fri Jan 29 09:18:41 GMT 1999 Tony Gale * docs/gtk_tut.sgml: - New sections on the Fixed and Frame containers - Rearrange the Containers section so the easier ones are first - Move the List widget section to an appendix Thu Jan 28 12:14:12 GMT 1999 Tony Gale * docs/package_tutorial.sh: script to convert and package up the tutorial - stick it here so I don't lose it when I accidentally delete it again. Thu Jan 28 10:16:28 GMT 1999 Tony Gale * docs/gtk_tut.sgml: - Replace all uses of deprecated functions. - Replace menufactory example with itemfactory example from Nick Scott - Minor bug fixes in the examples. 1999-01-28 Sebastian Wilhelmi * gdk/gdkim.c: s/XIM_INSTANTIATE_IS_MISSING_OR_STRANGE/XIM_INST_IS_MISSING_OR_STRANGE/ Thu Jan 28 01:57:06 CST 1999 Shawn T. Amundson * INSTALL NEWS README configure.in gtk+.spec docs/gtk-config.1: version=1.1.14 * Released GTK+ 1.1.14 Thu Jan 28 01:34:29 1999 Owen Taylor * gtkfontsel.c gtkcolorsel.c: When translating N_() strings, use _(), not gettext(), since we really need to call dgettext(). Wed Jan 27 20:51:25 PST 1999 Manish Singh * acinclude.m4: Xsed isn't valid here, don't use it * ltmain.sh * ltconfig: better file magic regexp for Linux libs Wed Jan 27 23:05:55 1999 Owen Taylor * gtk/gtklayout.[ch] (gtk_layout_realize): Move gravity_works back to a static global variable, since it is a global constant, and this way we keep structure sizes uniform. Wed Jan 27 22:59:07 1999 Owen Taylor * gtk/Makefile.am (static_SOURCES): Move gtkintl.h from $source_headers to $static_sources since it should not be installed. Wed Jan 27 22:51:23 1999 Owen Taylor * gdk/gdkevents.c (expose_predicate): Allow exposure compression across GravityNotify events to improve the appearance of a GTK+ window unshading. Wed Jan 27 21:56:07 1999 Owen Taylor [ patch from Takashi Matsuda ] * acconfig.h configure.in gdk/gdkim.c: Add configure flag for disabling XRegisterIMInstantiateCallback(), default it to off for Solaris. Always try to open the input method immediately, and only if that fails, register than instantiate callback. * gtk/gtkentry.c: Some tweaks to make sure that we only get and set the IC attributes when appropriate. Wed Jan 27 20:08:54 1999 Owen Taylor * gtk/gtkfilesel.c (open_user_dir): Patch from Sebastian Wilhelmi to use g_get_home_dir() instead of calling getpwuid() ourselves. Wed Jan 27 20:06:06 1999 Owen Taylor * gtk/gtklayout .c (gtk_layout_adjustment_changed): Removed some g_print()'s Wed Jan 27 18:57:57 1999 Owen Taylor * gdk/gdk.h gdk/gdkdnd.c: Change signatures for gdk_drag_begin() and gdk_drag_motion() so that the set of possible actions is passed on each motion, not just at the beginning of the drag. We do this so that we can restrict the set of possible drag events when the user presses a modifier key during a drag. * gdk/gdkdnd.c: Send a motif Operation-changed message when the set of possible actions change, as well as when the suggested action change. * gdk/gdkdnd.c: Change the XdndActionList whenever the set of actions change. * gdk/gdkdnd.c: Add a filter to catch changes to the XdndActionList property for the source widget. * gtk/gtkdnd.c: Change the set of possible actions when the user presses Control, Shift, or Control-Shift, to only include the corresponding action. * gtk/gtkdnd.c (gtk_drag_button_release_cb): Disconnect button signals before we possibly free info structure. Wed Jan 27 18:40:50 1999 Owen Taylor * gtk/gtkmain.c (gtk_main_do_event): Hack scrollwheel support into the eventloop, by treating button 4-5 presses on scrolled windows and scrollbars specially. Put it here to keep the ugliness small and confined. (We need to intercept the normal propagation in any case to have this work reliably right now, since some subwidgets will trap the button presses) * gtk/gtkviewport.c (gtk_viewport_realize): Select for BUTTON_PRESS to support the above hack. Tue Jan 26 14:02:50 1999 Owen Taylor * gdk/gdkwindow.c (gdk_window_show/hide): Remove TimJ's checks for already being mapped or hidden. See the ICCCM's section on state changes for why this is a bad idea. Wed Jan 27 17:05:40 1999 Owen Taylor * Separate out GLIB_LIBS and GLIB_DEPLIBS. This may fix the --with-glib option. GLIB_LIBS are the libs to link example programs against, while GLIB_DEPLIBS are dependency libraries. Wed Jan 20 11:19:00 1999 Owen Taylor * gtk/gtklabel.c: Use floor() instead of truncating to integer values so we get translation invariance. * gtk/gtklayout.c (gtk_layout_size_allocate): Set upper and lower values for adjustments in size_allocate(). * gdk/gdkwindow.c gdk/gdk.h gdk/gdkprivate.h: New function gdk_window_set_static_gravities() to set up a window for guffaw scrolling. * gdk/gdkwindow.c (gdk_window_internal_destroy): Set flags indicating destroyed state before cleanup. * gtk/gtkprivate.h gtk/gtkwidget.c: Add a new private flag IS_OFFSCREEN. If set, this indicates to GTK+ that the widget is not to be considered viewable regardless of its map state. Queued draws on offscreen widgets are suppressed. Added new function static gtk_widget_is_offscreen() to check this flag on a widget and its ancestors. * gtk/gtklayout.[ch]: Major revisions. - Use gdk_window_set_static_gravities to set static gravity on all child windows, and thus avoid having to create a window for NO_WINDOW children. - Adjust allocations of children as we scroll them so queued draws work correctly. - Don't allocate our children directly in a put() or move(); just queue a resize() like every other widget. * gtk/testgtk.c: Make the arrows on the scrollbars work, create a larger and more demanding test. Wed Jan 27 09:19:07 1999 Tim Janik * gdk/gdkcolor.c (gdk_colormap_unref): assert ref_count>0. Mon Jan 25 20:05:22 1999 Owen Taylor * gtk/gtkwidget.c (gtk_widget_set_{visual,colormap}): New functions to set the colormap or visual of an existing widget. These functions should not be called on a widget that has previosly been realized. * gtk/gtkcolorsel.c (gtk_color_selection_dialog_init): Set the visual and colormap on the toplevel dialog, then push them for the child widgets. As opposed to push/pop in _new(), this way, things will work properly with gtk_widget_new(). Mon Jan 25 19:41:56 1999 Owen Taylor * gtk/gtknotebook.c (gtk_notebook_page_allocate): Queue a redraw on the tab area when a tab changes size. (Includes improvements from Lars Hamann) Mon Jan 25 19:00:13 1999 Owen Taylor * gtk/gtkcolorsel.c (gtk_color_selection_value_events): Back out the last solution to updating problem. And try a different one that is less dependent on the state of the widget. Just redraw the value_marker when it gets mapped. Somebody needs to analyze this widget more carefully and figure out when it should be setting the contents of the previews with more care. Mon Jan 25 17:48:03 1999 Owen Taylor * gtk/gtkcolorsel.c: Removed some GTK_WIDGET_DRAWABLE() tests - we need to update the value bar's contents even when the widget is unmapped. Mon Jan 25 15:47:46 1999 Owen Taylor * acinclude.m4 (ac_result): Don't define ENABLE_NLS unless we have a working NLS. (This should keep libintl.h from being included when it doesn't exist). Mon Jan 25 11:05:10 1999 George Lebl * gtk/gtkbutton.c: set RECEIVES_DEFAULT on init, and a button press on the widget doesn't grab default anymore * gtk/gtkcheckbutton.c,gtk/gtkoptionmenu.c,gtk/gtkradiobutton.c: unset RECEIVES_DEFAULT on init * gtk/gtkwidget.[ch]: add a RECEIVES_DEFAULT flag to widget flags * gtk/gtkwindow.c,gtk/gtkplug.c: on pressing , activate the focused widget if it is a RECEIVES_DEFAULT widget, no matter what the current default_widget is * gtk/gtkwindow.c: on focus change, migrate the HAS_DEFAULT flag to CAN_DEFAULT widgets if they RECEIVE_DEFAULT as well or migrate it back to the default_widget if the focus widget doesn't "RECEIVE_DEFAULT" Sun Jan 24 18:09:24 1999 Owen Taylor * gdk/gdkdnd.c (motif_read_initiator_info): Byteswap the MotifInitiatorInfo structure _before_ using it. Sun Jan 24 12:17:39 1999 Owen Taylor * gdk/gdkcolor.c (gdk_colormap_real_destroy): Fix reversed assertion. (Pointed out by Austin Donnelly ) * gtk/gtkruler.c (gtk_ruler_expose): Remove unecessary and harmful call to gtk_paint_box(). We are going to paint onto the backing store later anyways. Sat Jan 23 11:15:39 1999 Owen Taylor * gdk/gdkdnd.c (gdk_window_register_dnd): X expects longs, not uint32 for XChangeProperty, when format == 32. * gdk/gdkdnd.c (motif_read_initiator_info): Byte-swap the MotifInitiatorInfo structure if necessary. * gdk/gdkdnd.c: When extracting and constructing Motif DND messages, don't use data.s[], data.l[] since on 64bit architectures, these won't necessarily be in the same place with data.b[]. * gtk/testdnd.c (target_drag_drop): Return TRUE for drag_drop within the drop zone. * gtk/gtkdnd.c (gtk_drag_dest_handle_event): Only send a XmTRANSFER_FAILURE if no drop site is found, not on every drop! Fri Jan 22 19:22:39 1999 Owen Taylor * gtk/gtkeditable.c: Add flags field to GtkTargetEntry table. * gdk/gdkwindow.c (gdk_window_is_viewable): Treat foreign windows as always viewable, since we can't track their map-state reliably without speed problems. (Fixes problem where updating didn't occur properly within GtkPlug) Sat Jan 23 13:41:00 1999 Jeff Garzik * gtk/gtkctree.c (tree_delete): Don't search selection list twice. (real_select_row): Remove extra ';', add default for clarity. Sat Jan 23 01:44:43 1999 Lars Hamann * gtk/gtkspinbutton.c (gtk_spin_button_get_value_as_int) (gtk_spin_button_get_value_as_float): removed extra gtk_spin_button_update calls again. * gtk/gtkclist.c (gtk_clist_unmap): unblock dnd signal handler if neccessary * gtk/gtknotebook.c (gtk_notebook_button_press): grab_focus before switch_page (gtk_notebook_set_shape): don't use cur_page if it's NULL. Fri Jan 22 12:20:54 1999 Jeff Garzik * gtk/gtktooltips.c: Fix recent change to match existing coding style. Fri Jan 22 07:33:44 1999 Tim Janik * gtk/gtkvscale.c (gtk_vscale_pos_trough): take value_spacing into account for GTK_POS_LEFT. * gtk/gtkradiobutton.c (gtk_radio_button_set_group): use gtk_toggle_button_set_active () to set the new state. (gtk_radio_button_new): only _set_group if group != NULL. (gtk_radio_button_clicked): reference the widget. (gtk_radio_button_init): make radio buttons active upon startup. Thu Jan 21 17:13:12 1999 Jeff Garzik * gtk/gtkselection.c: (gtk_selection_property_notify): Check args for NULL. (gtk_selection_default_handler): Replace manual list count with call to g_list_length. Remove signedness of temp var 'count' to agree with usage. Slight spacing adjustment for readability. * gtk/gtkbox.c, gtk/gtklayout.c, gtk/gtkselection.c: Init a few ptrs to NULL, to quiet warnings. Thu Jan 21 16:03:02 1999 Owen Taylor * gtk/gtkbutton.c (gtk_button_expose): Code cleanup. * gtk/gtktreeitem.c: Add a paint routine, fix up bugs in drawing where if the expose area was contained completely in the right side of the tree the background wasn't redraw, etc. * gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug in clipping draw regions while propagating them upwards. Thu Jan 21 12:20:51 1999 Owen Taylor * gtk/gtkcolorsel.c (gtk_color_selection_dialog_new): Pushing and popping the visual/cmap in the init() function does no good, because the window itself needs to be create with that visual/cmap. So do it in the new() function instead. This will require people doing gtk_widget_new() to do the push/pop themselves, but I don't see any way around it other than digging in and tweaking the window widget's colormap and visual ourselves, which is highly non-kosher, but would be safe... Thu Jan 21 16:04:35 1999 Timur Bakeyev * gtk/gtkrc.c (gtk_rc_init): It was reported by Owen Taylor , that LC_ALL produce unparsable garbage on some glibc'ed systems and HP/UX. So, falling to LC_CTYPE. Thu Jan 21 02:11:44 1999 Owen Taylor * Set and read the XdndActionList property defined in the Xdnd spec. We do this always, not just for XdndActionAsk like the spec says, but if we don't find it, we fall back to actions = suggested_action, which is compatible with the language of the spec. Thu Jan 21 01:15:28 1999 Jeff Garzik * gdk/gdkdnd.c (gdk_drag_context_unref): Move not-null assertion before pointer de-ref. * gdk/gdkevents.c (gdk_event_queue_find_first): Fix infinite loop bug. Someone should look at this further to make sure the events_pending tests are correct. Thu Jan 21 00:44:47 1999 Owen Taylor * gtk/gtkdnd.c (gtk_drag_dest_drop): Default handling for drops should be keyed on GTK_DRAG_DEFAULT_DROP not GTK_DRAG_DEFAULT_MOTION. Wed Jan 20 21:52:51 1999 Jeff Garzik * gtk/gtkclist.c (real_remove_row): Don't search entire row list twice for element being removed. * gtk/gtkmenushell.c (gtk_menu_shell_insert): Replaced hand-coded implementation of g_list_insert with call to g_list_insert. * gtk/gtktooltips.c (gtk_tooltips_destroy_data, gtk_tooltips_layout_text): tooltipsdata->row test not-null test now properly encompasses both g_list_* calls. Thu Jan 21 02:47:36 1999 Lars Hamann * gtk/gtknotebook.c (gtk_notebook_focus): few cleanups. (gtk_notebook_key_press): call select page function for GDK_DOWN key in case of tab_pos == TOP. Changed other positions accordingly. Wed Jan 20 19:57:14 1999 Owen Taylor * gtk/gtkdnd.c (gtk_drag_begin): Start off with the cursor for "no drop" since if we'll get a status if we are over a drag window, but none if we aren't over one. 1999-01-20 Jeff Garzik * gtk/gtkcombo.c (gtk_combo_entry_key_press): Free 'nprefix', closing a memory leak. Spaced out the code a bit to make it more readable. * gtk/gtkhbox.[ch] (gtk_hbox_new), gtk/gtkvbox.[ch] (gtk_vbox_new): Change 'homogenous' arg from gint to gboolean. * gtk/gtktogglebutton.[ch]: New function gtk_toggle_button_get_active(). 1999-01-20 Federico Mena Quintero * gtk/gtkdnd.c (gtk_drag_get_event_action): Allow button 2 to act as GDK_ACTION_ASK. Also, allow MOD1 to specify GDK_ACTION_ASK only if that action is enabled in the actions argument. 1999-01-20 Raja R Harinath * configure.in (gtklocaledir): New variable. Define to $prefix/$DATADIRNAME/locale. This will point to the directory where po/Makefile actually installs the message translation tables. * gtk/Makefile.am (INCLUDES): Define GTK_LOCALEDIR to $(gtklocaledir) rather than $prefix/share/locale. Wed Jan 20 21:07:45 1999 Timur Bakeyev * gtk/gtkrc.c (gtk_rc_init): There are some systems, that lacks of LC_MESSAGES in locale.h. As a last resort for such systems, set locale according to LC_ALL. Wed Jan 20 13:06:51 1999 Owen Taylor * gtk/gtktext.[ch] (clear_[focus_]area): Instead of drawing a background pixmap in with gdk_draw_pixmap(), set it as a tile pixmap for a GC. This should speed up things considerably and also will hide a bug where text->first_onscreen_ver_pixel is being corrupted, causing the bg pixmap drawing code to generate graphics exposes. Tue Jan 19 22:15:10 1999 Lars Hamann * gtk/gtklist.c (gtk_list_button_press): only call grab_add if pointer_grab succeeds. (gtk_list_unmap): remove pointer/widget grabs if needed. (gtk_list_signal_focus_lost): removed. (gtk_list_focus) (gtk_list_set_focus_child): set last_focus_child. (gtk_list_remove_items_internal) (gtk_list_clear_items): unset undo_focus_child if neccessary. In case of SELECTION_BROWSE/EXTENDED select a new item if selection is empty. Tue Jan 19 00:21:15 1999 Tim Janik * gtk/gtkcompat.h: add compatibility define for gtk_ctree_set_reorderable. Tue Jan 19 00:02:10 1999 Lars Hamann * gtk/gtkctree.c (gtk_ctree_node_set_row_data_full): add a sanity check [from Todd Dukes ] Mon Jan 18 22:54:11 1999 Lars Hamann * gtk/gtkclist.c (gtk_clist_button_press): only call grab_add if pointer_grab succeeds. (gtk_clist_unmap): remove pointer/widget grabs if needed. Mon Jan 18 15:46:14 1999 Owen Taylor * gtk/gtklabel.c (gtk_label_init): Initialize label->label_wc. (We allocate labels from a memchunk) Mon Jan 18 18:53:08 1999 Tim Janik * gtk/gtkscale.c (gtk_scale_set_digits): CLAMP digits into a meaningfull range (we need to stay below a certain limit anyways to avoid string buffer overflows). * gtk/gtkvscale.c (gtk_vscale_pos_background): fixed up background area calculations for GTK_POS_RIGHT and GTK_POS_BOTTOM. * gtk/gtkhscale.c (gtk_hscale_pos_background): likewise. (gtk_hscale_draw_value): safety CLAMP the value's x position for GTK_POS_TOP and GTK_POS_BOTTOM, so we don't paint strings outside of our allocation. * gtk/gtkscale.c: implemented GtkScale::digits, GtkScale::draw_value and GtkScale::value_pos arguments. Mon Jan 18 14:26:17 1999 Owen Taylor * docs/Changes-1.2.txt: Some editing, a little more detail. Mon Jan 18 13:25:14 1999 Owen Taylor * gtk/gtkmenu.[ch]: Added gtk_menu_set_title() to set the title of a menu in the torn-off state. * gtk/gtkthemes.c (gtk_theme_engine_get): When loading of theme engine fails, just warn and do without - don't error out. * gtk/gtkmain.c (gtk_check_version): s/to/too/. Mon Jan 18 01:21:03 1999 Lars Hamann * gtk/gtkctree.c (draw_row): fixed auto resize bug. Sun Jan 17 17:35:28 CST 1999 Shawn T. Amundson * Released GTK+ 1.1.13 * README: INSTALL: docs/gtk-config.1: ver=1.1.13 Mon Jan 18 00:22:54 1999 Lars Hamann * gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_button_release): block drag source signal handler during column resizes. (gtk_clist_set_column_visibility): resize clist if needed. (gtk_clist_map): raise resize windows to make resize cursor visible again. Sun Jan 17 22:47:15 1999 Tim Janik * gtk/gtkwidget.[hc]: * gtk/gtkspinbutton.[hc]: * gtk/gtkscrolledwindow.[hc]: * gtk/gtkprogressbar.[hc]: * gtk/gtkpreview.[hc]: * gtk/gtkobject.[hc]: * gtk/gtkentry.[hc]: * gtk/gtkctree.[hc]: * gtk/gtkcontainer.[hc]: * gtk/gtkclist.[hc]: removed deprecated functions: gtk_clist_set_border, gtk_container_block_resize, gtk_container_unblock_resize, gtk_container_need_resize, gtk_ctree_set_reorderable, gtk_ctree_show_stub, gtk_ctree_set_use_drag_icons, gtk_entry_adjust_scroll, gtk_object_class_add_user_signal, gtk_preview_put_row, gtk_progress_bar_construct, gtk_scrolled_window_construct, gtk_spin_button_construct, gtk_widget_freeze_accelerators, gtk_widget_thaw_accelerators. * gtk/gtkcheckmenuitem.c: removed binary variant of gtk_check_menu_item_set_state, this is still defined in gtkcompat.h though. * docs/Changes-1.2.txt: removed section about gtk_idle_remove_by_data vs. gtk_timeout_remove_by_data, we actually don't even provide a gtk_timeout_remove_by_data() function. added a table with removed functions and their replacements. * NEWS: updates for 1.1.13. Sun Jan 17 17:56:33 1999 Owen Taylor Patch from Felix Bellaby * gdk/gdk.c: Use XmbSetWMProperties to set the class/command on the loader window so that the client machine is also set in the same place. (For X11R5 sesssion management compatibility) * gdk/gdk.c: (gdk_set_sm_client_id) Implementation of function to set the session manager client ID. * gdk/gdkwindow.c (gdk_window_new): Set WM_CLIENT_LEADER propertiy on all windows pointing back to GDK's leader window. Sun Jan 17 12:01:57 1999 Owen Taylor * gtk/gtkrc.c (gtk_rc_style_init): Allow a bg_pixmap of "", as there was no way to set the background on all widget but some widgets. This is important because Text widgets with background images are slow and possibly ugly. 1999-01-17 Nat Friedman * gtk/gtkscrolledwindow.c (DEFAULT_SCROLLBAR_SPACING): New macro. Changed the spacing from 5 to 3. * gtk/gtkmenubar.c (BORDER_SPACING): Changed the extra spacing on the menubar from 2 to 0. Sun Jan 17 11:51:17 1999 Owen Taylor * gtk/gtktext.c (gtk_text_move_cursor): Fix typo [ gtk-mailund-990116-0: Thomas Mailund Jensen ] Sun Jan 17 11:15:05 1999 Christopher Blizzard * gtk+.spec: Update to version 1.1.13, change packager address. Sun Jan 17 14:52:29 1999 Tim Janik * gtk/gtkcompat.h: * gtk/gtkcheckmenuitem.[hc]: deprecated gtk_check_menu_item_set_state, people should use gtk_check_menu_item_set_active instead. * gtk/testgtk.c: s/gtk_check_menu_item_set_state/gtk_check_menu_item_set_active/. Sun Jan 17 05:19:14 1999 Tim Janik * configure.in: incremented version number to 1.1.13, bin age 0, interface age 0. * gtk/gtkmain.c (gtk_idle_remove_by_data): use g_idle_remove_by_data to remove idles, so `data' cannot conflict with other sources. * gtk/gtkcompat.h: define gtk_style_apply_default_pixmap here. * gtk/gtkstyle.[hc]: removed gtk_style_apply_default_pixmap. (struct _GtkStyle): reordered GtkStyleClass*klass; member. Sat Jan 16 19:42:48 1999 George Lebl * gtk/gtktooltips.c: for NO_WINDOW widgets, add their allocation.y to the position of the tooltip. This fixes tooltip positioning problems with some widgets such as a checkbox. Sat Jan 16 14:01:53 1999 Stuart Parmenter * gtk/gtklayout.c (gtk_layout_put): check for child widget being NULL Sat Jan 16 05:02:22 1999 Lars Hamann * gtk/gtkclist.c (gtk_clist_button_press): fixed double click bug. Fri Jan 15 19:16:42 1999 Tim Janik * gtk/Makefile.am: define GTK_DISABLE_COMPAT_H for compilation of gtk code. * gtk/gtkrc.c (gtk_rc_style_unref): added an assertment. * gtk/gtkcompat.h: * gtk/gtklabel.h: don't provide compatibility defines if GTK_DISABLE_COMPAT_H is defined. * gtk/gtkstyle.h: * gtk/gtkstyle.c: coding style, indentation and alignment fixups. (gtk_draw_string): (gtk_paint_string): (gtk_draw_polygon): (gtk_style_set_background): fixed assertments. (gtk_default_draw_ramp): (gtk_default_draw_cross): (gtk_default_draw_oval): issue warnings since these functions aren't yet implemented. * gdk/gdkwindow.c: (gdk_window_hide): only unmap window if already mapped. (gdk_window_show): only map window if !mapped. (gdk_window_internal_destroy): destroyed windows can't be mapped. * gtk/gtkwidget.c (gtk_widget_event): don't ignore expose events just because a resize is queued on a widget, we rely on the expose events now. Fri Jan 15 10:22:21 1999 Owen Taylor * gtk/gtkwidget.c (gtk_widget_class_init): nparams for selection_get should be 3, not 2. [ From Damon Chaplin ] * gtk/gtkeventbox.c (gtk_event_box_paint): Add a paint routine so queued redraws work inside event boxes. Thu Jan 14 17:47:37 1999 Owen Taylor * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): Only redraw character under cursor when not displaying highlighted selection. * gdk/gdkrgb.c (gdk_rgb_init): Add in a cast to gpointer to make IRIX cc happy. Thu Jan 14 12:29:50 1999 Owen Taylor * gtk/gtkcheckbutton.c (gtk_check_button_draw): Restructure the drawing code to remove a bit of duplication - and to remove a call to gtk_widget_draw_focus() that queues a redraw when an expose occurs. * gtk/gtklabel.c (gtk_label_expose): Fix up handling of ypadding. * gtk/gtknotebook.c (gtk_notebook_draw): If we redraw the whole widget, also redraw the corresponding areas of the child widget. (have_visible_child still has some problems) * gdk/gdkpixmap.c: Change some g_new's to g_new0 so that fields unused for pixmaps get initialzized sanely. * gdk/gdk.h gdk/gdkwindow.c gdk/gdkprivate.h: Add new calls gdk_window_is_visible() and gdk_window_is_viewable() and a mapped flag to the window private structure. * gtk/gtkbin.c gtk/gtkclist.c gtk/gtkfixed.c gtk/gtkitem.c gtk/gtklayout.c gtk/gtklist.c gtk/gtkmenushell.c gtk/gtknotebook.c gtk/gtkpaned.c gtk/gtktree.c gtk/gtktreeitem.c gtk/gtkviewport.c: Map windows after mapping children. * gtk/gtkwidget.c (gtk_widget_clip_rect): Handle rectangles completely clipped away correctly. * gtk/gtkwidget.c (gtk_widget_idle_draw): Don't call gtk_widget_draw if width or height is 0. * gtk/gtkwidget.c (gtk_widget_idle_draw): Don't rely on GTK_REDRAW_PENDING after we've cleared it. (This was causing draw-combining to not happen at all). * gtk/gtkbin.c gtk/gtkscale.c: Remove uneccessary calls to gtk_widget_queue_draw() when mapping. Thu Jan 14 11:29:53 1999 Owen Taylor * gtk/gtkdnd.c (gtk_drag_get_event_action): Make MOD1-drag also do action ask. * gtk/gtkdnd.c (gtk_drag_button_release_cb): Send the button-release event we simulate to get grabs released, with a window of GDK_ROOT_PARENT instead of the actual widget. This is a bad hack in some sense, but seems to work nicely. (It's sort of like what you would if you grabbed on button press, then the user released outside of the widget.) Thu Jan 14 20:29:16 1999 Owen Taylor * gtk/gtkstyle.[ch] (gtk_style_apply_default_background): Change copy_area => !set_bg. Use tile instead of gdk_window_copy_area when drawing without !set_bg. This does mess up timj's neat check-button example, but is consistent with how we interpret background pixmaps everywhere else in the default scheme. Restructure code for clarity. Thu Jan 14 19:19:51 1999 Owen Taylor * gdk/gdkevents.c: Do all event processing in dispatch() instead of prepare() and check(). Wed Jan 13 22:34:29 1999 Owen Taylor * gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkhandlebox.c gtk/gtkframe.c gtk/gtk[hv]box.c gtk[hv]paned.c gtk/gtklist.c gtkmenu.c gtkmenuitem.c gtkmenubar.c gtknotebook.c gtk/gtkscrolledwindow.c gtk/gtktable.c gtk/gtktree.c gtk/gtktreeeitem.c gtk/gtkviewport.c Fix up comparisons of signed and unsigned ints to avoid assigning negative widths/heigths. Wed Jan 13 21:18:41 1999 Owen Taylor * acinclude.m4 (ac_result): Unset CATOBJEXT so that the macros and Makefiles correctly handle disabling NLS when no gettext is found. Wed Jan 13 20:14:32 1999 Tim Janik * gtk/gtkarg.c (gtk_arg_copy): in comparisions with GTK_TYPE_STRING, use the fundamental type to catch GTK_TYPE_IDENTIFIER as well. * gtk/gtkmenushell.c: (gtk_real_menu_shell_activate_current): (gtk_menu_shell_button_release): asure that we only activate sensitive menu items, reported by Dave Cole . Wed Jan 13 13:28:00 1999 Tim Janik * gtk/gtkwidget.c: eliminate queue_clears or queue_draws where we know that expose events will be generated. (gtk_widget_map): only queue_draw for NO_WINDOW widgets. (gtk_widget_unmap): only queue_clear_child for NO_WINDOW widgets. (gtk_widget_size_allocate): we don't need a queue_clear on changing allocations of !NO_WINDOW widgets, we do still need a full redraw for them though. * gtk/gtklabel.c (gtk_label_set_text): check whether the new string actually differs from the original. Tue Jan 12 22:50:44 PST 1999 Manish Singh * acinclude.m4 * ltconfig * ltmain.sh: upgrade to libtool 1.2d (with fixes for irix6 and osf) Tue Jan 12 18:30:51 1999 Owen Taylor * gtk/testdnd.c (label_drag_data_received): Add a drag_data_received handler for the label. Tue Jan 12 15:01:50 1999 Owen Taylor * gdk/gdkevents.c: Removed the putback_events queue, since it was causing problems with event ordering - just keep a single queue. If we need it, we can add priorities to events. * gdk/gdkevents.c: Annotate events with flags - we allocate a GdkEventPrivate structure in gdk_event_new() and use these flags to mark an event being translated as "pending" - I.e., not yet ready to be dequeued. So we can put the event on the queue and get the order of the events right. (This solves the double-click problems) * gdk/gdk.h gdk/gdkevents.h: Add gdk_event_peek() to get a copy of the next event on the event queue. * gtk/gtkmain.c (gtk_main_do_event): Use gdk_event_peek() to check the next event without causing event queue reordering. Tue Jan 12 15:41:20 1999 Owen Taylor * gtk/gtklabel.c (gtk_label_expose): Minor fix to handling of misc->[x/y]pad Tue Jan 12 14:31:43 1999 Owen Taylor * gtk/gtkstyle.[ch] (gtk_style_apply_default_pixmap): Add back as wrapper function to restore source/binary compatibility. grrrr. Tue Jan 12 13:47:07 1999 Tim Janik * reworked the redrawing heuristics somewhat, this fixed a bunch of existing redrawing problems and majorly reduces overall redrawing needs during normal operation. basically we now only queue redraws when neccessary and much rely on the draw_area coalescing code in gtkwidget.c to optimize the queued portions. widgets will now upon reallocation only get redrawed if their allocation has changed. upon hide/show only the area allocated by the child will be queued for the parent, this has the side effect that parents which change their appearance in dependance on the numer of visible children have to keep track of their children's visiblity and eventually fully redraw themselves. this is a minor constrain with great benefits in terms of redraw reduction, and only got triggered by the notebook widget. * gtk/gtkwidget.c: (gtk_widget_queue_clear): don't bother if width and height == 0. (gtk_widget_queue_clear_child): new static function to queue a redraw of the area obscured by a child on a parent. (gtk_widget_queue_resize): queue_clear the widget if it is drawable. (gtk_widget_show): queue resize on the widget before showing. (gtk_widget_hide): queue resize on the widget after hiding. (gtk_widget_map): queue_draw the widget after mapping. (gtk_widget_unmap): queue_clear_child the widget. (gtk_widget_size_allocate): queue_clear_child and queue_draw if the widget's allocation changed. (gtk_widget_unparent): queue_clear_child so the parent redraws obscured portions. (gtk_widget_real_show): (gtk_widget_real_hide): (gtk_widget_real_map): (gtk_widget_real_unmap): (gtk_widget_real_size_allocate): don't bother with redraw queueing, descendants that override these functions don't do either and we handle all redrawing/resizing related stuff before or after the signal emission now. * gtk/gtkcontainer.c: (gtk_container_resize_children): don't bother about redrawing anymore since gtk_widget_size_allocate handles that for us now. * gtk/gtknotebook.h: * gtk/gtknotebook.c: added a flag have_visible_child to indicate whether we need to draw non child related portions at all, e.g. shadows etc. (gtk_notebook_draw): if have_visible_child changed, do a full paint instead of updating a small area only. Mon Jan 11 20:44:35 1999 Tim Janik * gtk/gtkstyle.c: changed gtk_style_apply_default_pixmap to gtk_style_apply_default_background which takes an extra argument copy_area to determine NO_WINDOW widget pixmap copying. changed callers accordingly. * gtk/gtktogglebutton.c: (gtk_toggle_size_allocate): (gtk_toggle_button_expose): (gtk_toggle_button_paint): avoid messing with our parent's window if toggle_button->draw_indicator == TRUE and we are a NO_WINDOW widget. * gtk/gtkcheckbutton.c (gtk_real_check_button_draw_indicator): draw the draw_indicator with GTK_STATE_ACTIVE if the toggle button is active. * gtk/check-n.xpm: * gtk/check-y.xpm: * gtk/testgtkrc: set pixmaps for ACTIVE and NORMAL check button bg_pixmaps. Mon Jan 11 23:52:58 1999 Lars Hamann * gtk/gtklist.c (gtk_list_signal_drag_begin) (gtk_list_drag_begin): end drag selections if necessary. * gtk/gtkspinbutton.c/h (gtk_spin_button_update): made function public. Manually force synchronization of spin button text and adjustment value. Mon Jan 11 15:23:32 1999 Tim Janik * gtk/gtktogglebutton.c: eliminated some queue_draws when invoking gtk_widget_set_state, since that cares about redrawing already. some code cleanups. * gtk/gtktogglebutton.[hc]: * gtk/gtkfontsel.c: * gtkgamma.c: s/gtk_toggle_button_set_state/gtk_toggle_button_set_active/ since set_state is already taken by gtkwidget.h. * gtk/gtkcompat.h: #define gtk_toggle_button_set_state gtk_toggle_button_set_active. * gtk/gtkstyle.c: some indentation cleanups. Mon Jan 11 15:12:33 1999 Tim Janik * gtk/gtktogglebutton.c (gtk_toggle_button_set_mode): take previous visibility state into account when unrealizing. Mon Jan 11 10:45:28 1999 Owen Taylor * gtk/gtkdnd.c: Only remove handlers for motion/button_release at drop, remove "selection_get" handler later. Mon Jan 11 13:31:49 1999 Tim Janik * gtk/gtktypeutils.[hc]: removed Paolo Molaro's type creation hooks again, since they 1) don't care about infinite recursion (likely to achive), 2) we are in feature freeze for 1.2. this definitely deserves a sane implementation in 1.3 though (but without a hook return value, without seq_id hackery and with recursion checks). Mon Jan 11 13:18:37 1999 Tim Janik * gtk/gtkwindow.c: (gtk_window_key_release_event): (gtk_window_key_press_event): only pass key events to the focus widget if it is sensitive. * gtk/gtkmenuitem.c (gtk_menu_item_select_timeout): don't popup the submenu if it isn't sensitive. (gtk_menu_item_paint): state_type doesn't need to be reset to GTK_STATE_INSENSITIVE if the widget is insensitive anyways. * gtk/gtkcontainer.c (gtk_container_real_focus): * gtk/gtklist.c (gtk_list_focus): * gtk/gtkmenushell.c (gtk_menu_shell_move_selected): * gtk/gtknotebook.c (gtk_notebook_focus): s/GTK_WIDGET_SENSITIVE/GTK_WIDGET_IS_SENSITIVE/ since a widgets sensitivity is determined through the parent as well, GTK_WIDGET_SENSITIVE is only of interest inside gtkwidget.c, everywhere else GTK_WIDGET_IS_SENSITIVE (widget) needs to be used to check for sensitivity. * gtk/gtkaccelgroup.c (gtk_accel_group_activate): don't activate object if it is an insensitive widget. Mon, 11 Jan 1999 08:09:08 +0100 Paolo Molaro * gtk/gtktypeutils.[ch]: add gtk_type_{add,remove}_creation_hook(). You can have a notification when a type is created. 1999-01-11 Tim Janik * gtk/gtkmain.c (gtk_propagate_event): added an assertement. Sun Jan 10 14:45:37 1999 Owen Taylor * gtk/gtktext.c (text_properties_equal): Fixed cut and paste bug when comparing text property bg colors. [ Matt Aubury ] 1999-01-10 Tim Janik * gtk/gtksignal.c (gtk_signal_lookup): if the lookup failed, try to initialize the object class and reattempt the lookup, reported by Paolo Molaro . Sat Jan 9 17:36:20 1999 Owen Taylor * configure.in (ALL_LINGUAS): Added cs to ALL_LINGUAS. Sat Jan 9 17:27:49 1999 Owen Taylor * gtk/gtkfilesel.c (gtk_file_selection_populate): Mark another string for internationalization. [ Stanislav Brabec ] Sat Jan 9 14:02:08 1999 Owen Taylor * gtk/gtktooltips.c (gtk_tooltips_force_window): Set name "gtk-tooltips" on tip window so that a style can be set for tooltips. Fri Jan 8 19:00:17 1999 Owen Taylor * gdk/gdkdnd.c (gdk_window_cache_filter): Fixed some list-manipulation breakage. * gdk/gdkdnd.c (gdk_window_cache_destroy): Free window cache structure. * gtk/gtkdnd.c (gtk_drag_set_icon_pixmap): Set an event mask on the drag window so clicking on it doesn't pop up root menus, etc. * gtk/gtkdnd.c (gtk_drag_button_release_cb): Remove signal handlers at button release. Fri Jan 8 00:42:00 1999 Lars Hamann * gtk/gtkspinbutton.c (gtk_spin_button_get_value_as_int) (gtk_spin_button_get_value_as_float): call gtk_spin_button_update before returning a value * gtk/gtkclist.c (gtk_clist_motion): don't allow 'drag selections' if clist is a drag source. (gtk_clist_drag_begin): remove pointer grabs, end ongoing selections. * gtk/gtkctree.c (remove_grab): copy of clist function. (gtk_ctree_drag_begin): let clists drag_begin method set the source info struct. Thu Jan 7 19:10:21 1999 Owen Taylor * gtk/gtkviewport.c (gtk_viewport_style_set): Fixes to drawing the background of the bin window so that clearing and redrawing of child widgets work properly. * gtk/gtkwidget.c (gtk_widget_idle_draw): Juggle around data so that if somebody triggers more redraw queuing from a expose_event handler, it doesn't confuse the heck out of GTK+. (But is highly liable to cause an infinite loop...) Thu Jan 7 12:31:41 1999 Owen Taylor * gtk/gtkselection.c (gtk_target_list_unref): Fix some more memory leaks. Wed Jan 6 23:14:19 1999 Lars Hamann * gtk/gtkctree.c (gtk_ctree_drag_motion): fix for dnd bug reported by Bertrand Guiheneuf. Don't return FALSE if source widget != dest. widget. Wed Jan 06 10:04:12 1999 Tristan Tarrant * configure.in,po/it.po: added Italian translations Tue Jan 05 21:18:00 1999 George Lebl * gtk/gtkmenu.c,gtk/gtkmenuitem.c,gtk/gtkeditable.c: free the event that was returned to us by gtk_get_current_event Tue Jan 5 19:01:18 1999 Owen Taylor * gtk/gtkcolorsel.c (gtk_color_selection_dialog_init): Push GdkRGB's visual and colormap around the color selection dialog so that the window and the previews have the same colormap. If an app adds things to the colorsel dialog, it will have to take care of them itself. Tue Jan 5 15:03:47 1999 Owen Taylor * gtk/gtkmain.c (gtk_propagate_event): Make gtk_propagate_event() non-static, we need it in gtkdnd.c so that the button-release we synthesize gets propagated correctly. * gtk/gtkdnd.c: Use gtk_propagate_event() so release gets to a GtkList. But we can't really get this right without access to the windows event masks and doing X-style propagation ourselves. Tue Jan 5 12:40:57 1999 Owen Taylor * gtk/gtkpreview.c: Add a size_allocate() routine and set the size of the preview window equal to the area we are going to draw on, instead of the entire allocation. Do this to avoid having to set a parent-relative background. Tue Jan 5 11:51:32 1999 Owen Taylor * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): When redrawing the under-cursor character, don't redraw the terminating NULL. [ From: dov@imagic.weizmann.ac.il (Dov Grobgeld) ] Tue Jan 5 11:31:55 1999 Owen Taylor * gtk/gtkselection.c (gtk_target_list_unref): Free memory allocated for target lists. * gtk/gtkdnd.c (gtk_drag_drop_finished): Release selections before destroying info structure. * gdk/gdkdnd.c gdktypes.h (gdk_drag_get_protocol): Add new value GDK_DRAG_PROTO_NONE, use it for non-drag targets, to quiet Purify. * gdk/gdkdnd.c (gdk_window_register_dnd): Set size of property properly. Mon Jan 4 03:45:42 CST 1999 Shawn T. Amundson * Released GTK+ 1.1.12 * INSTALL: NEWS: README: configure.in: gtk+.spec: docs/gtk-config.1: gtk/gtkfeatures.h.in: version=1.1.12 1999-01-04 Sung-Hyun Nam * configure.in (ALL_LINGUAS): Added 'ko'. Sun Jan 3 17:41:22 1999 Lars Hamann * gtk/gtkctree.c (real_tree_expand): fixed auto_resize bug Sat Jan 2 03:54:30 1999 Tim Janik * gdk/gdk.h (GDK_PRIORITY_EVENTS): make this G_PRIORITY_DEFAULT. * gdk/gdkevents.c (gdk_events_init): add the source and the poll fd with a priority of GDK_PRIORITY_EVENTS. 1999-01-02 Jeff Garzik * configure.in, config.h.in, gdk/gdkimage.c: Removed features.h test. * gdk/gdkdnd.c: Guard public functions against NULL pointer derefs. Fri Jan 1 18:41:09 PST 1999 Manish Singh * gdk/gdk.c * gdk/gdkinputnone.h * gtk/gtkruler.c: casts to get rid of const warnings * gtk/Makefile.am: fix gtktypebuiltins.h dependencies, and do a cmp so people don't whine about rebuilds * gtk/gtknotebook.c: use g_snprintf on translated strings, so we don't get buffer overflows * gtk/gtkrc.c: use g_strdup_printf instead of g_malloc/sprintf Plug some memleaks. 1999-01-01 Jeff Garzik * configure.in, config.h.in: Check for features.h. * gdk/gdkevents.c (gdk_event_put, gdk_events_queue): Fixed bug in linked list append logic by replacing hand-coded logic with a call to g_list_append. Bug found by tml. * gdk/gdkimage.c: 'gcc -ansi -pedantic' on GNU/Linux spews warnings and errors in sys/ipc.h, including one specific admonishment to use _SVID_SOURCE or _XOPEN_SOURCE. Manually defined the latter, and included features.h if present to obtain the necessary side-effects. * gtk/gtkclist.c, gtk/gtkeditable.c: Eliminates comma-after-final-element warnings. * gtk/gtkfontsel.c (gtk_font_selection_init): Fixed bug where an intl string was declared as _("x") in local var initializer. 1998-12-31 Jeff Garzik * gtk/gtklabel.c (gtk_label_split_text_wrapped): word->space is now initialized correctly. Reported by Chi-Deok Hwang . 1998-12-30 Miguel de Icaza * gtk/gtkmain.c (gtk_main_do_event): Fix memory leak. gdk_event_put would make a copy of next_event, and next_event was not being freed. Wed Dec 30 18:39:21 CST 1998 Shawn T. Amundson * Released GTK+ 1.1.11 * INSTALL: NEWS: README: configure.in: gtk+.spec: docs/gtk-config.1: gtk/gtkfeatures.h.in: version=1.1.11 1998-12-29 Owen Taylor * gdk/gdkim.c (gdk_wcstombs): Fixed off-by-one error when computing length. Thu Dec 24 14:35:48 1998 Jeff Garzik * gdk/gdkevents.c, gdk/gdkim.c, gdk/gdkrgb.c, gdk/gdkwindow.c, gtk/gtkprogressbar.c: Pull in string.h for various mem*() and str*() functions, in an autoconf-friendly way. Thu Dec 24 12:40:45 1998 Jeff Garzik * gdk/gdkfont.c: removed unused var * gdk/gdkim.c: 64-bit cast * gtk/gtkaccelgroup.c: point to const data * gtk/gtkdnd.[ch]: (gtk_drag_dest_set, gtk_drag_source_set): Made const-correct. * gtk/gtkfontsel.c: kill uninitialized var warning * gtk/gtkselection.[ch]: (gtk_target_list_new, gtk_target_list_add_table, gtk_selection_add_targets): Made const-correct. * gtk/testgtk.c: 64-bit cast Thu Dec 24 03:16:52 CST 1998 Shawn T. Amundson * INSTALL: NEWS: README: configure.in: gtk+.spec: docs/gtk-config.1: gtk/gtkfeatures.h.in: version=1.1.10 Wed Dec 23 20:31:40 1998 Owen Taylor * gtk/gtklabel.c: Fix problem where empty labels were getting a requisition height of zero, and trailing newlines were being ignored. Wed Dec 23 13:58:14 1998 Owen Taylor * gtk/gtklabel.c (gtk_label_parse_uline): label->label should be the mb text _after_ removing the underlines, not before. * gtk/gtkmenu.c: Reverted Elliot's tearoff-menu-item title hack. If it deserves being done, it deserves being done right. 1998-12-23 Elliot Lee * gtk/gtkmenu.c: Allow programmer to gtk_object_set_data(obj, "GtkTearoffMenuItem_window_title", ..) on a GtkMenuItem and have it be recognized. If we're getting the title out of the GtkLabel, then remove all underscores. Tue Dec 22 17:01:43 1998 Owen Taylor * gtk/gtkdnd.c (gtk_drag_dest_handle_event): Request XmTRANFER_FAILURE on Motif drops not within a drop zone. I don't know why this is necessary, but it is. * gdk/gdkdnd.c (gdk_drop_reply): Fixed error where Motif flag field in response was getting wrong values. Tue Dec 22 15:55:39 1998 Owen Taylor * gtk/gtkoptionmenu.c (gtk_option_menu_button_press): Return TRUE for button press events we handle. (Allows option menus in radio buttons to work...) Tue Dec 22 14:50:25 1998 Owen Taylor * gtk/gtkdnd.c (gtk_drag_find_widget): Optimization - when we've already found a widget, skip all checks for subsequent children. * gtk/gtkdnd.c (gtk_drag_find_widget): Checked for !MAPPED, not !VISIBLE, since a widget (like a notebook page), can be VISIBLE, but !REALIZED or !MAPPED. * gtk/gtkdnd.c (gtk_drag_find_widget): Use forall(), not foreach(). Mon Dec 21 22:01:49 1998 Lars Hamann * gtk/gtkclist.c (gtk_clist_motion): fixed column resize bug Sun Dec 20 04:48:59 1998 Tim Janik * gdk/gdk.h (GDK_PRIORITY_EVENTS): export the priority at which events are processed. * gtk/gtk[main|signal|container].[ch]: removed deprecated _interp variants: gtk_container_foreach_interp, gtk_idle_add_interp, gtk_timeout_add_interp, gtk_signal_connect_interp. Sat Dec 19 18:45:30 PST 1998 Shawn T. Amundson * configure.in: added sv to ALL_LIGNUAS Sat Dec 19 22:49:40 1998 Tim Janik * gtk/gtktypeutils.c (gtk_type_query): eek, fixed an embarrasing bug that caused this function to always return NULL (noticed by marius vollmer). Sat Dec 19 17:28:30 1998 Owen Taylor * configure.in: Don't add the gthread libs to GLIB_LIBS either, or -lgthread -lpthread will get pulled into all applications because of shlib deps. * gtk/gtkmain.h gtk/gtkwidget.c gtk/gtk gdk/gdk: Use GLIB's priority #define. Revise scale of priorities. Sat Dec 19 03:44:29 PST 1998 Manish Singh * gtk/gtkmain.c: always run a g_main_iteration, even if there are no active main loops. This fixes the gimp splash screen. Sat Dec 19 05:37:51 1998 Tim Janik * gtk/gtklabel.c (gtk_label_expose): removed return_if_fail (label->words != NULL) since that's a valid case when the label is empty, or just default constructed. fixed indentation prototype arguments and braces in some places. also, pointer comparisions and initializations are done with NULL not 0, there's a reason GLib defines NULL. * gdk/gdkevents.c (gdk_events_pending): return (queued_events || putback_events) so this again returns whether events are pending, not whether other sources like idles are pending. * gtk/gtkmain.c (gtk_main_iteration_do): (gtk_main_iteration): return whether the loop is done, not whether something got dispatch to restore the original behaviour (yosh: this fixes code like in GleSelector). Fri Dec 18 19:20:45 PST 1998 Manish Singh * gtkbutton.[ch] * gtktogglebutton.c: s/(enter|leave)_button/$1/g, since pthreads.h no longer conflicts Sat Dec 19 01:56:13 1998 Lars Hamann * gtk/gtkclist.c (gtk_clist_button_press): fixed GDK_2BUTTON_PRESS bug. Fri Dec 18 15:30:43 PST 1998 Manish Singh * configure.in: add ja to ALL_LINGUAS Fri Dec 18 15:19:54 1998 Owen Taylor * gtk/gtksocket.c (gtk_socket_filter_func): Marked plug window as destroyed before destroying the window. Fri Dec 18 14:17:14 1998 Owen Taylor * gtk/gtkmenu.c (gtk_menu_popup): Set the usize on the tearoff window so when we reparent the window out, the window doesn't shrink down. 1998-12-18 Sebastian Wilhelmi * configure.in: do not export the glib flags for thread support to gtk-config. Fri Dec 18 01:32:59 1998 Tim Janik * gtk/gtkmain.c (gtk_main): added gdk_flush() after g_main_run(), so we get the original behaviour back, i.e. the event queue needs to be flushed after a main loop has been quitted. (gtk_main): add/remove the current main loop to/from the main loop before/after init/quit functions have been exected to preserve the original gtk_main_quit() behaviour. Thu Dec 17 23:48:29 1998 Tim Janik * gdk/gdkevents.c (gdk_events_init): changed argument order in call to g_main_add_poll() to match recent glib changes. Thu Dec 17 20:33:28 1998 Owen Taylor * gtk-config.in: Add @INTLLIBS@. gtk-scier-981116-0.patch Sean Cier ) ] * gtk/gtkcolorsel.c gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkgamma.c gtk/gtkinputdialog.c gtk/gtknotebook.c gtk/gtkrc.c gtk/gtkthemes.c gtk/gtktipsquery.c: Applied parts of gtk-egger-981215-1 [ Daniel Egger ] marking additional strings for internationalization. * po/nl.po: Added Dutch translation from Paul Siegmann . Thu Dec 17 18:25:52 1998 Owen Taylor * gtk/gtkdnd.c (gtk_drag_drop_finished): Remove the info tag from the context so if the source unexpectedly responds in the future, we do nothing properly. Thu Dec 17 18:24:41 1998 Owen Taylor * gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate): Handle the case where one side of the the pane is empty. * gtk/gtkfilesel.c (gtk_file_selection_init): Set dir_title before using it. (Pointed out by Lavoie Philippe ) Thu Dec 17 10:53:20 1998 Owen Taylor * gtk/gtklabel.c (gtk_label_set_text): Free previous label->label_wc. * gtk/testgtkrc: Leave font, not fontset commented in by default. 1998-12-17 Sebastian Wilhelmi * gdk/gdkim.c: Define gdk_use_mb outside USE_XIM guard. Removed unnecessary USE_XIM guard inside another. Made gdk_use_mb static. Compile gdk_set_locale also if not USE_XIM. Thu Dec 17 00:26:01 1998 Shawn T. Amundson * Released GTK+ 1.1.9 * INSTALL: NEWS: README: configure.in: gtk+.spec: gtk/gtkfeatures.h.in: docs/gtk-config.1: version=1.1.9 Wed Dec 16 21:20:00 PST 1998 Manish Singh * autogen.sh: rm -rf intl breaks --disable-nls, put it back * gtkbutton.[ch] * gtktogglebutton.c: s/(enter|leave)/$1_button/g. Digital: 1 GTK+: 0 (for now) Wed Dec 16 22:38:22 CST 1998 Shawn T. Amundson * gdk/gdkevents.c: updated call to g_main_add_poll instead of g_main_poll_add Wed Dec 16 23:32:05 1998 Owen Taylor * gtk/gtklabel.c (gtk_label_expose): Remove unnecessary cast. Wed Dec 16 22:50:52 1998 Owen Taylor * gdk/gdk.c gdk/gdkim.c: Check for broken glibc 2.0 mb functions, and avoid them. Wed Dec 16 16:57:55 1998 Owen Taylor * gdk/gdkevents.c (gdk_events_queue): Don't call XPending() if we have putback events. Wed Dec 16 16:04:41 1998 Owen Taylor * gtk/gtklabel.c (gtk_label_expose): Do nothing on empty string, quietly. Wed Dec 16 15:36:19 1998 Owen Taylor * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): Redraw the character under the cursor when removing the cursor. Wed Dec 16 13:06:17 1998 Owen Taylor * gdk/gdk.[ch] gtk/gtkmain.[ch] gtk/gtkprivate.h: Move main thread lock back to GDK - we need it there for locking when translating events. Rename things appropriately. Wed Dec 16 11:44:21 1998 Owen Taylor * gtk/gtkrange.c (gtk_range_expose): Fix a x/y typo. Wed Dec 16 10:20:27 CST 1998 Shawn T. Amundson * Released GTK+ 1.1.8 * ChangeLog: INSTALL: README: gtk+.spec: docs/gtk-config.1: version=1.1.8 1998-12-16 Sebastian Wilhelmi * gdk/gdkglobals.c: Define gdk_xim_ic only, if USE_XIM is defined. Wed Dec 16 07:03:32 1998 Tim Janik * gtk/gtkwidget.h: * gtk/gtkwidget.c: s/USER_DRAW/APP_PAINTABLE/. provided gtk_widget_set_app_paintable() which users can use to make a widget paintable for the application. changed other files accordingly. Wed Dec 16 05:26:32 1998 Tim Janik * configure.in: version bump to 1.1.8, binary age 0, interface age 0, depend on GLib 1.1.8. * gdk/gdkprivate.h: * gdk/gdkglobals.c: removed last Gdk threads specific bits. * gtk/gtkmain.c (gtk_init): s/g_thread_supported/g_thread_supported()/. * gtk/gtkprivate.h: changed GTK_THREADS_ENTER and GTK_THREADS_LEAVE to function macros GTK_THREADS_ENTER() and GTK_THREADS_LEAVE(). honour G_THREADS_ENABLED in the definition of GTK_THREADS_ENTER() and GTK_THREADS_LEAVE(). changed callers accordingly. Tue Dec 15 21:26:26 CST 1998 Shawn T. Amundson * autogen.sh: warn if glib.m4 or gettext.m4 are not found in aclocal's directory. Tue Dec 15 21:36:14 1998 Owen Taylor * gtk/testgtk.c (create_layout): Create buttons, not combos again. 1998-12-15 Joel Becker * autogen.sh: reordered gettextize and aclocal, because gettextize was messing up aclocal.m4. Tue Dec 15 22:30:44 1998 Lars Hamann * gtk/gtkclist.h : removed clist flag : GTK_CLIST_DRAG_SELECTION added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS, GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT (GtkCListDragPos) : new enum for DND (GtkButtonAction) : new enum of possible mouse button actions (struct _GtkCList): added button_actions array. Added drag_button and click_cell struct, to store cell and mouse button of last button_press_event (struct _GtkCListClass): new class method draw_drag_highlight. (gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) : new functions. Moved from gtkctree.h. Now clist is reorderable as well. (gtk_clist_set_button_actions) new function to customize mouse button actions. * gtk/gtkclist.c: (gtk_clist_drag_begin) (gtk_clist_drag_motion) (gtk_clist_drag_leave) (gtk_clist_drag_end) (gtk_clist_drag_drop) (gtk_clist_drag_data_get) (gtk_clist_drag_data_received) : new dnd widget methods to implement clists reorderability via DND (remove_grab) : new function. remove mouse grab if necessary. (draw_drag_highlight) : new method. Draw dnd highlight depending on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT (gtk_clist_class_init): added object args "reorderable" and "use_drag_icons" (gtk_clist_button_press) (gtk_clist_button_release) : use button_actions array to decide which action to perform. (gtk_clist_motion) : start reorder operation if necessary. * gtk/gtkctree.h : (struct _GtkCTree): removed drag_icon, icon_widht, icon_height, drag_row, drag_source, drag_target, reorderable, use_icons, in_drag, drag_rect (gtk_ctree_set_reorderable) : deprecated function. use gtk_clist_set_reorderable instead. (gtk_ctree_set_use_drag_icons) : deprecated function. use gtk_clist_set_use_drag_icons instead. * gtk/gtkctree.c : (gtk_ctree_class_init): removed object args "reorderable" and and "use_drag_icons" (draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor) (tree_toggle_selection) (set_mouse_cursor) : removed (draw_drag_highlight) : new clist method. replacement for draw_xor_line and draw_xor_rect functions (check_drag) renamed check_cursor function (gtk_ctree_drag_begin) (gtk_ctree_drag_motion) (gtk_ctree_drag_data_received) : new dnd methods to implement ctrees reorderability via DND (gtk_ctree_button_release) (gtk_ctree_button_motion) : removed. * gtk/testgtk.c: (create_clist) : added new reorderable toggle button Tue Dec 15 19:50:41 1998 Owen Taylor * gtk/gtkctree.c gtk/gtkclist.c gtk/testgtk.c: Use base[NORMAL] instead of bg[PRELIGHT] so CLists now can be used in detergent commercials. Tue Dec 15 16:54:09 1998 Owen Taylor * gtk/gtklabel.h: Moved gtk_label_set() compatiblity define from to for compatibility. 1998-12-15 Jeff Garzik * configure.in, gdk/Makefile.am, gtk/Makefile.am: Removed last remaining thread-related configure bits that have been moved into GLib. 1998-12-15 Elliot Lee * gdk/gdkevents.c: Use G_IO_ERR|G_IO_HUP|G_IO_NVAL as the mask for checking for GDK_INPUT_EXCEPTION events. 1998-12-15 Martin Baulig * acinclude.m4: Make the gettext check for for libc5 systems. * autogen.sh: Not running gettextize fails on a fresh CVS checkout and we'll get a lot of bug reports tomorrow, so I add it back. * acinclude.m4: Rename AM_GNU_GETTEXT_GTK to AM_GTK_GNU_GETTEXT and AM_WITH_NLS_GTK to AM_GTK_WITH_NLS to avoid this ugly automake warnings. Tue Dec 15 16:06:15 1998 Owen Taylor * acinclude.m4: Provide a hacked version of the gettext macros that never use the included gettext. * Makefile.am configure.in: Remove references to intl/ * autogen.sh: Don't run gettextize. Tue Dec 15 14:30:35 1998 Owen Taylor * gdk/gdk.h gdk/gdkfonts.c: Added gdk_text_extents_wc() * Patch from Jonathan Blanford to add line wrapping to label. (Based on patch from Jeff Dairiki gtk-dairiki-971208-0) - Adds new function gtk_label_set_line_wrap() - implement GTK_JUSTIFY_FILL. - rename gtk_label_set to gtk_label_set_text() add gtk_label_set() to gtkcompat.h. * Use an internal wc representation in the label, so that we handle underlining and line breaks correctly for multi-byte strings. Tue Dec 15 13:32:28 1998 Owen Taylor * gtk/gtkwidget.h: Added GTK_USER_DRAW flag. * gtk/gtkwindow.c: Honor GTK_USER_DRAW flag. * gtk/gtkdrawwindow.c gtk/Makefile.am: Removed GtkDrawWindow, which GTK_USER_DRAW obsoletes. Tue Dec 15 11:37:05 1998 Owen Taylor * gtk/gtkmain.c: Fixed up some warnings. Tue Dec 15 10:32:01 1998 Owen Taylor * gtk/gtk{h,v,}paned.{c,h}: Add new functions gtk_paned_set_position(), gtk_paned_pack1/2(). The latter take a shrink and resize parameters, that allows setting minimum sizes and getting 'relative' resizing. Tue Dec 15 10:26:23 1998 Owen Taylor * gdk/gdkevents.c: Keep separate putback_events and queued_events queues so that we get both FIFO and preemptive behavior for gdk_event_put(). Tue Dec 15 09:22:44 1998 Owen Taylor * gtk/gtkrc.c (gtk_rc_init): Removed unused variable, fixed minor memory leak. * gdk/gdk.c: Fixed another merge problem. Tue Dec 15 08:53:38 1998 Owen Taylor * gdk/gdk.c (gdk_get_display): Remove gdk_signal, which crept back in in last commit. Tue Dec 15 01:38:53 1998 Owen Taylor * gtk/Makefile.am: Commented out testthreads from the build process, since we won't have any idea how to create a thread. * configure.in (LIBS): use glib-config ... gthread so we always build a thread-compatible library. * gtk/gtkaccellabel.c gtk/gtkclist.c gtk/gtkcolorsel.c gtk/gtkcombo.c gtk/gtkcontainer.c gtk/gtkentry.c gtk/gtklist.c gtk/gtkmenuitem.c gtk/gtknotebook.c gtk/gtkrange.c gtk/gtkselection.c gtk/gtkspinbutton.c gtk/gtktext.c gtk/gtktooltips.c gtk/gtkwidget.c: Add GTK_THREADS_ENTER/LEAVE pairs around timeouts and idles to account for the fact that they are no longer called within the GTK+ lock. * gtk/gtkprivate.h: Added definitions for locking the main GTK+ mutex. * gtk/gtkmain.c: Re-implement the main loop in terms of the GLib main loop. * gdk/gdk.h gdk/gdkthreads.c gdk/Makefile.am: Removed threading functionality, as it seems better to subsume GDK within the GTK+ lock than vice-versa. * gdk/gdkevents.c: New file, containing event handling bits from gdk.c. * gdk/gdkevents.c: Implement event source for GDK events. * configure.in gdk/gdkevents.c: Removed attempts to subtract base_id, which were already non-functional. Mon Dec 14 23:05:20 PST 1998 Manish Singh * acconfig.h * configure.in: removed IPC_RMID_DEFERRED_RELEASE check * gdk/gdk.c: remove signal handlers, since we do an IPC_RMID after XShmAttach, and nobody complained Tue Dec 15 02:27:42 MET 1998 Sven Neumann * po/de.po: Replaced the crappy german po-file with a valid one. Mon Dec 14 16:10:05 1998 Owen Taylor * gtk/gtkrc.c (gtk_rc_init): Append locale-specific suffixes to default rc file names, and look these up in addition to the base filename, to facilitate having the correct fontset per-locale. move $(sysconfdir)/gtkrc to $(sysconfdir)/gtk/gtkrc * gtk/gtkitemfactory.[ch] (gtk_item_factory_set_translate_func): New function to set a function to translate menu paths. * gtk/gtkrc.c (gtk_rc_add_initial_default_files): Free results of g_strsplit(). 1998-12-14 Nuno Ferreira * configure.in (ALL_LINGUAS): Added 'pt'. * po/pt.po: Added Portuguese translation. Mon Dec 14 20:04:31 1998 Stefan Jeske * gtk/gtkspinbutton.c: Only call gtk_spin_button_update if the spinbutton is editable. Mon Dec 14 12:24:13 1998 Owen Taylor * HACKING: Added gettext-10.35 * autogen.sh: Run gettextize. Wed Dec 9 16:29:06 1998 Owen Taylor Applied gtk-egger-981010-[12] [ Daniel.Egger@t-online.de (Daniel Egger) ] * gtk/gtkintl.h: New file - defines for localization. * gtk/gtkfilesel.c gtk/gtkinputdialog.c: Mark strings for internationalization. * gtk/gtkmain.c: call bindtextdomain * po/ - directory for translations. Initially includes German translation. Mon Dec 14 02:42:11 1998 Tim Janik * gtk/gtkwidget.c: made GtkWidget::grab_focus a RUN_LAST and RUN_ACTION signal. moved stuff from gtk_widget_grab_focus() into gtk_widget_real_grab_focus() so a signal is always emitted if the focus is grabbed on a widget. Mon Dec 14 02:13:01 1998 Tim Janik * gtk/gtkmenuitem.c: fixed submenu popup timeouts, we decide whether or not to delay the submenu popup from a menu item deselection time stamp. the code looks even more hackish than before, but in practice "feels" very well. 1998-12-13 Federico Mena Quintero * gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus" signal for widgets. When the signal is emitted, the widget will grab the focus. This is needed to let the user press an accelerator key in a dialog box and have the corresponding widget be focused. * gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus" signal. The default handler is simply gtk_widget_grab_focus(). Sun Dec 13 22:15:48 GMT 1998 Tony Gale * docs/gtk_tut.sgml: Update the following sections to the current API: - Container Widgets - CList Widget - List Widget - Tree Widget Sat Dec 12 19:11:35 1998 Tim Janik * gtk/gtkmenuitem.c: made GtkMenuItem::activate a GTK_RUN_ACTION signal. * gtk/gtkbutton.c: made GtkButton::clicked a GTK_RUN_ACTION signal. * gtk/gtkfeatures.h.in: define GTK_HAVE_FEATURES_1_1_8. Sat Dec 12 17:46:55 1998 Owen Taylor * gtk/gtklayout.c (gtk_layout_unrealize): Mark child->window as destroyed so we don't destroy it again. Sat Dec 12 17:18:32 1998 Owen Taylor * gdk/gdkfont.c (gdk_text_extents): Corrections to computation of extents of text from a font set. (from Chi-Deok Hwang ) and Akira Higuchi ) Fri Dec 11 08:59:12 1998 Owen Taylor * gtk/gtklistitem.c (gtk_list_item_style_set): * gtk/gtklist.c (gtk_list_style_set): Added "style_set" handlers. Fri Dec 11 05:49:30 1998 Owen Taylor * gtk/gtkclist.c (gtk_clist_style_set): Add in a "style_set" handler so that the background of the clist changes with the theme. Thu Dec 10 22:02:49 CST 1998 Shawn T. Amundson * Released GTK+ 1.1.7 * INSTALL: NEWS: README: configure.in: gtk+.spec: gtk/gtkfeatures.h.in: docs/gtk-config.1: Version to 1.1.7 Thu Dec 10 20:48:19 PST 1998 Manish Singh * gtk/gtkclist.c: avoid void pointer math * gtk/gtkhscale.c * gtk/gtkhscrollbar.c * gtk/gtkvscale.c * gtk/gtkvscrollbar.c: removed trailing , from enums * gtk/gtksignal.c: can't use enums as a bitfield type, use guint * gtk/testgtk.c: removed C++ comment added by owenpoo Thu Dec 10 21:48:34 1998 Owen Taylor * gtk/gtkdnd.[ch]: Added gtk_drag_source_unset() Thu Dec 10 20:42:22 1998 Owen Taylor * gtk/gtkdnd.c (gtk_drag_dest_handle_event): Use gdk_window_get_origin() instead of gdk_window_get_position, because get_position is unreliable for plugs. This is a bad hack, maybe we need GDK_WINDOW_PLUG? Thu Dec 10 17:58:49 GMT 1998 Tony Gale * docs/gtk_tut.sgml: - re-write the GtkProgressBar section to the 1.1 API. - add an Appendix listing all the signals (apologies to TimJ for taking so long in using his hard work in automating the extraction - thanx Tim). * examples/*: bring them all upto the tutorial versions Thu Dec 10 02:21:16 1998 Jeff Garzik * gtk/testdnd.c: use g_snprintf, eliminate need for string.h * gtk/testrgb.c: include string.h, for strlen Wed Dec 9 17:39:26 1998 Owen Taylor * configure.in: Add a case for success in test for XUnregisterIMInstantiate, to prevent screwing up $LIBS. Wed Dec 9 13:06:31 1998 Sebastian Wilhelmi * gdk/gdkim.c (gdk_ic_new,gdk_ic_{set,get}_attr): Fixed argument list and return type for non-XIM fallback. * configure.in: Only build XIM-support if available. Wed Dec 9 12:23:30 1998 Owen Taylor * gtk/testselection.c (main): Add in missing 'flags' field to target list. * gdk/gdkproperty.c (gdk_atom_intern): Actually add the atoms to the local cache. Wed Dec 9 04:57:31 PST 1998 Manish Singh * gdk/gdkprivate.h: put text after #endif in comment * gdk/gdktypes.h: change whitespace in enum to shut up makeenums.pl * gtk/testdnd.c: #include Mon Dec 7 10:27:09 1998 Owen Taylor * gtk/gtkwidget.c: Destroy widgets _after_ propagating unrealize signals through the widget heirarchy. This is unpleasant, as it causes more X traffic, but is necessary, because we have to clean up our Input Contexts before destroying the X windows. (from matsu-981109-0.patch) Mon Dec 7 10:18:18 1998 Owen Taylor Applied gtk-a-higuti-981202-0 : [ a-higuti@math.sci.hokudai.ac.jp (Akira Higuchi) ] * gdk/gdk.h gdk/gdk.c (gdk_mbstowcs): New function. Nearly equals to mbstowcs, but implemented by a combination of Xlib functions, so it works even with X_LOCALE. (gdk_wcstombs): New function. (g_mbtowc): Removed. No longer needed. * gdk/gdk.h gdk/gdkfont.c gdk/gdkdraw.c: Added _wc() variants to gdk_text_width(), gdk_char_width(), gdk_draw_text(), * gdk/gdki18n.h (mblen, mbtowc, wctomb, mbstowcs, wcstombs, wcslen, wcscpy, wcsncpy): Removed. No longer needed. (iswalnum): Removed. (gdk_iswalnum): New macro. (gdk_iswspace): New macro. * gdk/gdktype.h (GdkWChar): New typedef. * gtk/gtkentry.h, gtk/gtkentry.c There are many changes according to the change of the internal representation of text, from multibyte string to wide characters. * gtk/gtkprivate.h, gtk/gtkmain.c Removed the variable gtk_use_mb and related codes. * gtk/gtkspinbutton.c Some changes according to the change of type of entry->text. * gtk/gtktext.h, gtk/gtktext.c Changed the internal representation of text. We use GdkWchar if a fontset is supplied. If not, we use guchar to save memory. Tue Dec 1 15:20:39 1998 Owen Taylor * gdk/gdkwindow.c (gdk_window_new): When creating a window with a specified non-system visual, use a matching colormap. Mon Nov 30 11:50:13 1998 Owen Taylor * gdk/gdk.c gdk/gdkim.c gdk/gdkprivate.h gdk/gdk.h gdk/gdktypes.h gtk/gtkeditable.c gtk/gtkmain.c gtk/gtkentry.c gtk/gtktext.c: Applied matsu-981109-0 [ matsu@arch.comp.kyutech.ac.jp (Takashi Matsuda) ] - Change system of setting input method values from varargs to a structure, similar to GC's or window attributes. - Various fixes to event handling. Also: * gdk/gdkim.c: Split of input method stuff into a separate source file. * Remove GdkIM typedef, change everything from GdkIC to GdkIC * to be consistent with the rest of GTK. Wed Dec 9 00:41:41 1998 Owen Taylor * gtk/gtkrc.c (gtk_rc_add_initial_default_files): Allocate correct amount of memory for strings. Tue Dec 8 18:29:05 CST 1998 Shawn T. Amundson * Released GTK+ 1.1.6 * NEWS: updated * gtk/Makefile.am: gtk/testgtk.c: gtk/gtkrc.h: gtk/gtkrc.c: Read in default files. Wed Dec 9 00:49:12 1998 Tim Janik * gtk/gtktypeutils.h: * gtk/gtktypeutils.c: added gtk_type_query() which returns a newly allocated structure holding certain type specific informations. fixed the big bunch of `discards const' warnings with the initialization of enum/flags values. Tue Dec 8 15:10:17 1998 Owen Taylor * gtk/gtkwindow.c (gtk_window_transient_parent_realized): Fixed order of arguments to gdk_window_transient_for(). Tue Dec 8 18:02:57 GMT 1998 Tony Gale * examples/Makefile: simple top level Makefile that invokes all the sub-directory Makefiles. 1998-12-08 Andrew T. Veliath * gtk/testgtk.c: Functions to test the toolbar space style. * gtk/gtktoolbar.c: Add a private GtkToolbarChildSpace subclass of GtkToolbarChild to hold allocation. Set default space style to GTK_TOOLBAR_SPACE_EMPTY, define SPACE_LINE_* for separator fraction defaults. (gtk_toolbar_paint_space_line): New function; paints the separator line, using "toolbar" as the detail. (gtk_toolbar_expose): (gtk_toolbar_draw): Handle CHILD_SPACE when style is set to SPACE_LINE. (gtk_toolbar_size_allocate): Store space allocations. (gtk_toolbar_insert_element): If we are a space, allocate and initialize a GtkToolbarChildSpace instead of a GtkToolbarChild. (gtk_toolbar_set_space_style): New function. * gtk/gtktoolbar.h: Add GtkToolbarSpaceStyle, with styles of EMPTY and LINE. Add prototype for gtk_toolbar_set_space_style. Mon Dec 7 16:03:55 1998 Owen Taylor * gtk/gtkthemes.h: Remove random unnecessary includes of standard headers. 1998-12-07 Damon Chaplin * gtk/gtkfontsel.c (gtk_font_selection_select_best_style): made sure we only try to match styles which are currently shown. (gtk_font_selection_init): set the notebook tabs homogeneous and set the border, so we don't need to set the size explicitly (bad for i18n). Used the clist auto-resize feature for the font and style lists on the main page and all the filters. Used padding for the 'Reset Filter' button instead of spaces around it (bad for i18n). (gtk_font_selection_find_font): when searching for a font, if we can't match both the family and foundry, we return any font where just the family matches. (The foundry can even be '*'.) (gtk_font_selection_show_available_styles): (gtk_font_selection_realize_list): don't set the style clist row colours (for the charset rows) until the clist is realized, since we use the clist style's insensitive colours. Mon Dec 7 13:38:06 1998 Owen Taylor * gdk/gdkimage.c (gdk_image_new): Use IPC_RMID _after_ doing XShmAttach. This should work everywhere, and avoid the need for signal handlers or configure checks. Thu Dec 3 19:58:45 1998 Owen Taylor * gtk/gtkinputdialog.c: Use _add_with_viewport() for scrolled window contents. 1998-12-07 Federico Mena Quintero * gtk/gtkpaned.h (struct _GtkPaned): Removed the unused cursor field in the structure. Mon Dec 7 15:15:06 GMT 1998 Tony Gale * docs/gtk_tut.sgml: Start mass update for GTK 1.1 * examples/extract.sh: Look for the best version of awk * examples/extract.awk: Fix FD leak * example/base: minimal example from Tutorial Mon Dec 7 01:29:27 1998 Owen Taylor * gtk/gtkwindow.c: New functions gtk_window_set_transient_for() - set up a "transient for" relationship. gtk_window_set_default_size() - set the initial size of a window distinct from its minimum size. gtk_window_set_geometry_hints() - Allow the user to set minimum, maximum sizes, aspect rations, and gridded geometry, possibly all with respect to a subwidget of the window. These interfaces are still a wee bit experimental. * gdk/gdk.c: Added gdk_window_set_transient_for(), gdk_window_set_geometry_hints(), and gdk_window_set_role(). * gdk/gdktypes.h: Added new types for find-grained specification of WM hints. * gtk/testgtk.c: Various changes to tests to test the above new functions. * gtk/gtkfontsel.c: Squash a few 'const' warnings. * gtk/gtktogglebutton.c (gtk_toggle_button_realize): Restored call to gtk_style_set_background() to prevent egregious flashing to black. Mon Dec 7 03:52:01 1998 Tim Janik * gtk/gtksignal.c (gtk_handlers_run): when marshalling connect_object signals, don't pass the data pointer twice, but swap it with the object pointer (proposed on Nov 30 1998 on gtk-devel-list). Mon Dec 7 03:08:39 1998 Tim Janik * gtk/gtktypeutils.h: * gtk/gtktypeutils.c: reverted Marius's change to expose the type systems internal type info data to the user. if such functionality is required we should provide wrapping accessors, ala gtk_signal_query(). also the GtkTypeInfo structures are dynamically allocated memory portions, so only the type system is really allowed to access that stuff. * gtk/gtksignal.c (gtk_signal_connect_by_type): reverted marius change, since it destroys the possibility to implement automatic marshaller lookups some day, and it also disables third party code's ability to connect to any signal. Mon Dec 7 01:32:18 1998 Tim Janik * gtk/gtkfilesel.c (gtk_file_selection_key_press): always intercept the Tab key on the entry. the focus shouldn't get lost even if completion is attempted from an empty entry, since an empty entry string does indeed have a valid completion meaning (complete all). (gtk_file_selection_init): cast the gchar array parameter in calls to gtk_clist_new_with_titles() to quit compiler warnings. (check_dir): the no_stat_dirs struct must not be const, since we do indeed modify its contents. * gtk/testgtk.c (event_watcher): adapted prototype to fit new emission hook semantics. * gtk/gtksignal.h: * gtk/gtksignal.c: changed emission allocation, so we don't use a doubly linked list but link ourselfs (singly linked). changed emission hooks, they get the emision parameters passed as well now and are emitted during the actuall signal emission (after the RUN_FIRST class method, but prior to RUN_FIRST handlers). the existing restrictions do still apply to signal emission hooks, i.e. an emission may not be stopped or restarted from an emission hook. due to possibly huge perfomance impacts, frequent use of emision hooks is also not recommended. (gtk_signal_next_and_invalidate): added an assertments which explicits what the code assumes anyways: a maximum amount of 65535 signals. * gtk/gtkcontainer.h: deprecated gtk_container_foreach_interp(), gtk_container_foreach_full() should be used instead. * gtk/gtkmain.h: deprecated gtk_timeout_add_interp and gtk_idle_add_interp, since we provide _full variants. * gtk/gtksignal.h: deprecated gtk_signal_connect_interp(), we provide gtk_signal_connect_full() for long enough now. 1998-12-06 Marius Vollmer * gtk/gtksignal.c (gtk_signal_newv): Allow a NULL marshaller. (gtk_signal_connect_by_type): Allow only no_marshal handlers to connect to signals with a NULL marshaller. * gtk/gtktypeutils.c (gtk_type_get_info): New. gtk/gtktypeutils.h (gtk_type_get_info): New prototype. Sun Dec 6 14:27:35 1998 Stefan Jeske * gtk/gtkspinbutton.c (gtk_spin_button_draw_arrow): Grey out arrows if wrap == FALSE and interval borders are reached. Sat Dec 5 21:07:09 1998 Owen Taylor * gtk/gtkaspectframe.c (gtk_aspect_frame_size_allocate): Fixed long-standing typo in aspect ratio computation code. (pointed out by Sebastian Rittau ) Fri Dec 4 01:20:06 1998 Lars Hamann * gtk/gtkclist.c (gtk_clist_button_release): call toggle_row with valid row numbers only (toggle_row): check if clist_row != NULL Fri Dec 4 00:50:12 1998 Lars Hamann * gtk/gtkctree.c (gtk_ctree_export_to_gnode): fixed for-loop. * gtk/gtkclist.c (gtk_clist_set_column_visibility) (gtk_clist_column_titles_active) (gtk_clist_column_titles_active) (gtk_clist_column_title_passive) (gtk_clist_column_title_active): few additional tests whether column->button != NULL Thu Dec 3 16:49:18 1998 Owen Taylor * gtk/gtkdnd.c (DROP_ABORT_TIME): Changed to 5 min from 10 seconds, so it doesn't abort while users have an ACTION_ASK menu up. * gtk/gtkdnd.c: Hide the icon window between sending a a drop event to the destination and displaying the snapback animation, so that it doesn't hang around during ACTION_ASK. Thu Dec 3 16:37:42 1998 Owen Taylor * gtk/gtkclist.c (get_cell_style): Use GTK_STATE_INSENSITIVE for the foreground of cells for CLists in the insensitive state, instead of GTK_STATE_PRELIGHT. Thu Dec 3 06:20:59 1998 Tim Janik * gtk/gtkwindow.c: moved checks upon focus setting from gtk_window_real_set_focus to gtk_window_set_focus, so we don't emit the signal if unneccessary. * gtk/gtkwidget.c (gtk_widget_grab_focus): clear up the old focus containers when grabbing focus on a new widget. this is based on a patch from Alexis Mikhailov, submitted to gtk-list on 4 Nov 1998. * gtk/gtkclist.c (gtk_clist_focus_out): set CLIST_CHILD_HAS_FOCUS flag, so we take the buttons into consideration upon the next focus request. * gtk/gtkcontainer.c (gtk_container_set_focus_child): fixed an assertment. Wed Dec 2 17:45:21 CST 1998 Shawn T. Amundson * gtk/gtkpixmap.c: Fixes for low-color displays and a slight enhancement for true-color displays. * INSTALL: README: configure.in: gtk+.spec: docs/gtk-config.1: up to version 1.1.6 Wed Dec 2 01:36:49 PST 1998 Manish Singh * gtk/gtkfeatures.h.in: lets #define GTK_HAVE_FEATURES_1_1_6 before we release it this time Wed Dec 2 01:39:02 1998 Tim Janik * gtk/gtknotebook.h: * gtk/gtknotebook.c: s/gtk_notebook_nth_page/gtk_notebook_get_nth_page/. * incremented version number to 1.1.6 and made Gtk dependant on GLib 1.1.6. * gtk/gtkwidget.h (struct _GtkRequisition): changed width and height from guint16 to gint16, since sizes bigger than 32767 are not supported anyways, and aritmethics with intermediate negative values are possible now. Tue Dec 1 00:00:04 1998 Tim Janik * gtk/gtkscrolledwindow.c: implementation of GTK_POLICY_NEVER functionality, added rationales on the policy and size requisition handling at the top. (gtk_scrolled_window_size_request): we assume a default minimum for our child's width and height if [hv]scrollbar_policy != GTK_POLICY_NEVER, except when the user specified the dimension explicitely. (gtk_scrolled_window_size_allocate): do not show scrollbars if [hv]scrollbar_policy == GTK_POLICY_NEVER. * gtk/gtkviewport.c (gtk_viewport_size_request): report the real size we require (including the child). * gtk/gtkclist.c: (gtk_clist_size_request): report the real size required. * gtk/gtkenums.h (enum GtkPolicyType): added GTK_POLICY_NEVER. * gtk/gtkobject.c (gtk_object_init_type): object_type doesn't need to be a static variable. Mon Nov 30 22:41:25 1998 Tim Janik * gtk/gtkclist.h: * gtk/gtkclist.c: * gtk/gtkviewport.h: * gtk/gtkviewport.c: * gtk/gtktext.h: * gtk/gtktext.c: * gtk/gtklayout.h: * gtk/gtklayout.c: * gtk/gtkwidget.h: * gtk/gtkwidget.c: * gtk/gtkscrolledwindow.h: * gtk/gtkscrolledwindow.c: s/scroll_adjustements/scroll_adjustments/ s/scroll_adjustments/set_scroll_adjustments/g Tue Dec 1 22:45:58 1998 Lars Hamann * gtk/gtkclist.h (struct _GtkCListClass): new class method/signal row_move. * gtk/gtkclist.c (gtk_clist_row_move): new public function. emit a row_move signal (real_row_move): move source_row to dest_row (gtk_clist_swap_rows): use gtk_clist_row_move calls. (gtk_clist_columns_autosize): resize all columns to their optimal width * gtk/gtkctree.c (real_row_move): use gtk_ctree_move to move entire sub-tree. * gtk/gtknotebook.c (gtk_notebook_nth_page): get nth page widget. Tue Dec 1 02:40:22 PST 1998 Manish Singh * configure.in * gdk/Makefile.am * gtk/Makefile.am: Put -DFOO stuff into Makefile.am INCLUDES. Separate vars for each, for granularity. Tue Dec 1 02:19:54 1998 Tim Janik * gtk/gtkenums.h: fixed a stupid error of mine about the run type values. 1998-11-30 Elliot Lee * {gdk,gtk}/*.c: Make read-only data structures "static const" to allow them to be shared, mainly including (but not limited to) the GtkTypeInfo structures for each class. * gtk/gtkfilesel.c: Add /net to the "leave me alone" directory listing. Mon Nov 30 12:17:10 1998 Jeff Garzik * gtk/gtksignal.c: Surround debug variable with #ifdef to silence gcc. * gtk/gtknotebook.c (gtk_notebook_reorder_child): Added initializer to quiet gcc warning. Added assertion to check for null pointer deref. Mon Nov 30 10:11:29 1998 Tim Janik * gtk/testgtkrc: merged testgtkrc with the pre-themes one, removed system specific includes. * gtk/gtksignal.c: asured that stop and restart emissions are also checked and processed for not connected objects. fixed up restart emission administration. invoke emission hooks after emission, hooks are not supposed to muck around with the current emission, and may also not cause emission restarts. fixed up stop emission administration. Mon Nov 30 06:20:36 1998 Tim Janik * gtk/testgtk.c: added an event watcher for enter/leave based on signal emission hooks. * gtk/gtkobject.c (gtk_object_class_init): made GtkObject::destroy a GTK_RUN_NO_HOOKS signal. * gtk/gtksignal.h: * gtk/gtksignal.c: implemented emission hooks, new hooks can be added to a signal with gtk_signal_add_emission_hook or gtk_signal_add_emission_hook_full, and can be removed again with gtk_signal_remove_emission_hook. * gtk/gtkenums.h: remove GTK_RUN_MASK, since it doesn't represent an appropriate mask for signal runtypes for a long time now. added GTK_RUN_NO_HOOKS value, which is used to flag signals that do not allow the running of signal hooks. 1998-11-26 Michael Krause * gtk/gtknotebook.c (gtk_notebook_switch_page): made 'page_num' argument a gint: switch_page signal delivers valid page numbers again. Sun Nov 29 06:12:01 1998 Tim Janik * gtk/gtkscrolledwindow.c (gtk_scrolled_window_set_[hv]adjustment): set composite names. * gtk/gtktypeutils.c (gtk_type_unique): removed default initialization check, people must use gtk_type_init(). fixed up type allocation for foreign fundamentals. * gtk/gtkwidget.h: * gtk/gtkwidget.c: added gtk_widget_set_composite_name() which is meant for internal use by containers, that want to assign specific composite names to their composite children. added gtk_widget_get_composite_name() which will return a newly allocated string, containing the composite name of a widget. valid composite names can only be retrived from widgets that have a parent assigned and are flagged as GTK_COMPOSITE_CHILD. * gtk/gtkcontainer.h: * gtk/gtkcontainer.c: added a new function gtk_container_child_default_composite_name() which will return a newly allocated string, holding the composite name of a containers child. a default implementation is provided which will compose the composite name out of the widgets type and its sequential children id. this implementation can be overidden through a new class function *(composite_name)(). Sat Nov 28 10:57:59 1998 Owen Taylor * gtk/gtkwindow.c (gtk_window_expose_event): Removed bogus expose_event handler - we had two expose_event handlers! Sat Nov 28 03:13:42 1998 Tim Janik * gtk/gtkscrolledwindow.h: * gtk/gtkscrolledwindow.c: changed scrolled window inheritance, it inherits from GtkBin now. * gtk/gtkbin.c (gtk_bin_unmap): removed superfluous check for visibility of child. (gtk_bin_draw): removed superfluous check for GTK_WIDGET_DRAWABLE(). added check so a child gets only drawn if it's visible. * gtk/gtkwidget.h: * gtk/gtkwidget.c: removed gtk_widget_draw_children(). * gtk/gtkstyle.h: * gtk/gtkstyle.c: rmoved gtk_reset_widget_shapes. * gtk/gtkwidget.h: * gtk/gtkwidget.c: removed crufty relict: gtk_widget_is_child(). added internal function gtk_widget_reset_shapes() from gtkstyle.c. * gtk/gtkrc.h: * gtk/gtkrc.c: (gtk_rc_find_pixmap_in_path): removed bogus gscanner argument, changed callers. * gtk/gtkmenufactory.c: GtkMenuFactory is deprecated for a long time, it will issue a warning now. * gtk/gtkcompat.h: new file to #define aliases for historic function names. * changed 8 function names for consistency and provided aliases to keep source compatibility in gtkcompat.h: (gtk_accel_label_get_accel_width): renamed from gtk_accel_label_accelerator_width (gtk_container_set_border_width): renamed from gtk_container_border_width (gtk_notebook_get_current_page): renamed from gtk_notebook_current_page (gtk_packer_configure): renamed from gtk_packer_set_child_packing (gtk_paned_set_gutter_size): renamed from gtk_paned_gutter_size (gtk_paned_set_handle_size): renamed from gtk_paned_handle_size (gtk_scale_get_value_width): renamed from gtk_scale_value_width (gtk_window_set_position): renamed from gtk_window_position * renamed a few recently added funtions for consistency: (gtk_notebook_get_tab_label): renamed from gtk_notebook_query_tab_label. (gtk_notebook_get_menu_label): renamed from gtk_notebook_query_menu_label. (gtk_progress_configure): renamed from gtk_progress_reconfigure. Fri Nov 27 18:57:20 PST 1998 Manish Singh * gtk/gtkscrolledwindow.c (gtk_scrolled_window_add_with_viewport): check for existing viewport first, and don't add one if there already is one Sat Nov 28 00:06:49 1998 Tim Janik * gtk/gtkwidget.h: * gtk/gtkwidget.c: deprecated gtk_widget_freeze_accelerators and gtk_widget_thaw_accelerators, we provide gtk_widget_lock_accelerators and gtk_widget_unlock_accelerators. * gtk/gtklayout.h: * gtk/gtklayout.c: implemented incremental freezing facility. * gtk/gtktext.h: * gtk/gtktext.c: implemented incremental freezing facility. * gtk/gtkenums.h: * gtk/gtkaccelgroup.h: moved enum GtkAccelFlags into this place. * gtk/gtkentry.h: * gtk/gtkentry.c: deprecated gtk_entry_adjust_scroll(). * random GtkType, macro and indentation fixes. Fri Nov 27 22:50:15 1998 Tim Janik * gtk/gtkclist.h: * gtk/gtkclist.c: implemented incremental freezing facility, added a new class member (*refresh)() which takes over the thaw functionality. the clist FROZEN flag got removed on the way. * gtk/gtkctree.c: adaptions to feature the clist refresh functionality and incremental freezing. * gtk/gtkcalendar.c: implemented incremental freezing facility. Fri Nov 27 11:41:27 1998 Raph Levien * gdk/gdkinputcommon.h (gdk_input_common_init): Fixed it so that it still includes the core pointer in gdk_input_devices even if the XInput extension is not present in the X server. Fri Nov 27 12:17:15 1998 Owen Taylor * gtk/gtkdnd.[ch] (gtk_drag_get_source_widget): New function to get the source widget of a drag. * gtk/gtkdnd.[ch]: Target flags GTK_TARGET_SAME_[WIDGET/APP] to restrict certain targets to the same widget or to the same application. * gtk/testdnd.c: Test gtk_drag_get_source_widget(). Thu Nov 26 19:11:46 1998 Lars Hamann * gtk/gtk-boxed.defs (GtkCTreeNode): define GtkCTreeNode as boxed type * gtk/gtkctree.c (gtk_ctree_class_init): use GTK_CTREE_NODE_TYPE instead of GTK_TYPE_POINTER in signal definitions. (patch from James Henstridge ) Thu Nov 26 18:48:44 1998 Lars Hamann * gtk/gtkclist.c (set_cell_contents) * gtk/gtkctree.c (set_cell_contents): call column_auto_resize only if auto.resize == TRUE * gtk/gtknotebook.c (gtk_notebook_set_shape) (gtk_notebook_expose): don't draw tab, if show_tabs == FALSE (bug reports from Alexis Mikhailov / Dave Cole) (gtk_notebook_focus_changed) (gtk_notebook_draw_focus): draw only the focus rectangle, not the hole tab. Thu Nov 26 03:18:08 1998 Tim Janik * gtk/gtkclist.h: * gtk/gtkctree.h: * gtk/gtkclist.c: * gtk/gtkctree.c: reverted bogus and undocumented!!! changes from Jay Cox (98/11/23 13:53:26) which `const' qualified char* arrays. * gtk/maketypes.awk: changed underline substitution, so we get GTK_TYPE_CTREE_POS instead of the broken GTK_TYPE_C_TREE_POS. * gtk/makeenums.pl: likewise. * gtk/gtkctree.c: adapted type names accordingly. Tue Nov 24 11:31:06 1998 Owen Taylor * docs/Changes-1.2.txt: Edited section on the ScrolledWindow. * gtk/gtklayout.c (gtk_layout_set_[hv]adjustment): Remove some code duplication. * gtk/gtklayout.[ch] Fixed mapping and unmapping of child windows and child widgets when scrolling greater than 32k pixels. * testgtk.c: Modified layout test to test scrolling over long distances. * gtk/gtkplug.c: Added a few blank lines. Tue Nov 24 11:11:05 1998 Owen Taylor * gtk/gtklayout.[ch]: Fixed up copyright message. * gdk/gdkrgb.c (DM): Make the dither matrix constant so it can be shared. * gtk/gtkdnd.c: Make cursor bitmaps const. * gdk/gdk.h gdk/gdkpixmap.c: Added const to gdk_pixmap/bitmap_create_from_data. Tue Nov 24 07:46:09 1998 Tim Janik * docs/Changes-1.2.txt: added a section on scrolled windows and scrollable widgets. 1998-11-24 Andrew T. Veliath * gtk/gtktoolbar.c (gtk_toolbar_insert_element): Include radio buttons when setting relief for button items. (gtk_toolbar_set_button_relief): Same. 1998-11-23 Jeff Garzik * gdk/Makefile.am, gtk/Makefile.am: Removed DEFS "+=" mess that breaks recent automakes. INCLUDES is the correct way to add to CFLAGS from Makefile.am. * gdk/gdk.c, gdk/gdkglobals.c, gdk/gdkimage.c, gdk/gdkinput.c, gdk/gdkpixmap.c, gdk/gdkthreads.c, gdk/gdkwindow.c, gdk/gxid_lib.c, gtk/fnmatch.c, gtk/gtkclist.c, gtk/gtkmain.c, gtk/testthreads.c: Include "config.h" instead of "../config.h". Now that DEFS works again, automake will automatically pass us the location of config.h in -I. Mon Nov 23 22:10:09 1998 Owen Taylor * gtk/Makefile.am gtk/gtk.h gtk/gtklayout.[ch] gtk/gtkplug.[ch] gtk/gtksocket.[ch] gtk/gtk.h: Added layout widget for scrolling arbitrarily big areas. Added plug/socket widgets for interprocess embedding. These widgets still, at some point, need to be made more pure in their use of GDK, as opposed to raw X. * gtk/testgtk.c: Added test for layout widget. 1998-11-23 Jeff Garzik * gtk/gtkclist.c: (gtk_clist_swap_rows): Bugfix from Brandon Long - do the right thing with first and last, which are the absolute values of row arguments row1 and row2. Mon Nov 23 04:24:55 PST 1998 Manish Singh * gtk/gtkprogress.c: (gtk_progress_set_adjustment): make a saner default adjustment (from 0 to 100) instead. I'm not sure if this is the correct level for the fix, but gtk_progress_bar_new()'s original default behavior is restored. 1998-11-23 Martin Baulig * gtk/gtkfeatures.h.in (GTK_HAVE_FEATURES_1_1_5): Define this so we can check for latest GTK features. 1998-11-23 Havoc Pennington * gtk/gtktoolbar.c: (gtk_toolbar_set_relief): (gtk_toolbar_insert_element): When setting relief, also affect toggle buttons. Sun Nov 22 20:37:06 PST 1998 Manish Singh * gtk/gtkobject.h: remove extraneous comma Mon Nov 23 05:21:50 1998 Tim Janik * gtk/gtkcontainer.c: (gtk_container_add_with_args): (gtk_container_addv): (gtk_container_add): removed assertements for constructed containers again, since this essentially breaks the "child" arg. * gtk/gtktooltips.c (gtk_tooltips_force_window): fixup the draw_window reference count, we don't need to reference toplevels that already have destroy notifiers. * gtk/gtkscrolledwindow.c: check for the composites existance in _forall since we might not be already constructed. Sun Nov 22 14:34:58 CST 1998 Shawn T. Amundson * Released GTK+ 1.1.5 * configure.in: require GLib 1.1.5 Mon Nov 23 03:21:17 1998 Tim Janik * gtk/gtktext.c (gtk_text_destroy): disconnect hadj & vadj, not 2 * hadj. (gtk_text_finalize): only unref the current_font if we have been realized. Sat Nov 21 18:41:13 CST 1998 Shawn T. Amundson * configure.in: INSTALL: NEWS: README: gtk+.spec: docs/gtk-config.1: Version incremented to 1.1.5 Sun Nov 22 16:21:28 1998 Tim Janik * gtk/gtkprogress.c: added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode. * gtk/gtkprogressbar.c: added construct arg ::adjustment. added args ::bar_style, ::orientation, ::discrete_blocks, ::activity_step, ::activity_blocks. (gtk_progress_bar_new): (gtk_progress_bar_new_with_adjustment): use gtk_widget_new(). (gtk_progress_bar_construct): deprecated. * gtk/gtkvscrollbar.c: (gtk_vscrollbar_draw_step_back): (gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for gtk_paint_arrow, to be consistent with hscrollbar. * gtk/gtktext.c added construct args ::hadjustment, ::vadjustment. added args ::line_wrap, ::word_wrap. (gtk_text_class_init): added scroll_adjustments signal. (gtk_text_new): use gtk_widget_new. (gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments, so we don't screw the reference counts and don't leave signals connected. (gtk_text_destroy): disconnect adjustments signals. (gtk_text_finalize): unref adjustments. * gtk/gtkctree.c: added construct args ::n_columns and ::tree_column. added args ::indent, ::spacing, ::show_stub, ::reorderable, ::use_drag_icons, ::line_style and ::expander_style. (gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is deprecated now. * gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag. * gtk/gtkclist.c: removed ::vadjustment and ::hadjustment args, introduced ::scroll_adjustments signal. added ::shadow_type, ::selection_mode and ::row_height args. added n_columns construct arg. (gtk_clist_construct): call gtk_object_constructed(). (gtk_clist_set_row_height): if height is passed as 0, revert to automatic height calculation. (gtk_clist_destroy): before unrefing the adjustments, disconnect our signal handlers. Fri Nov 21 22:34:58 1998 Tim Janik * gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct like gtk_object_new. (gtk_widget_destroy): assert that we only destroy constructed widgets. * gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY to identify args that may only be used for construction. GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction time. * gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct at the end if the object is not fully constructed. (gtk_object_newv): likewise. (gtk_object_destroy): assert that we only destroy constructed objects. (gtk_object_init): setup GTK_CONSTRUCTED from the objects real klass. (gtk_object_default_construct): new function to complete default construction of an object by applying missing construtor args with default values of 0, 0.0 or NULL. (gtk_object_constructed): new function to mark an object as being constructed (used from within constructors). * gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer so it is immediatedly available for the caller. * gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to the object initilizer (GtkObjectInitFunc takes a second arg now, the real klass), and asure that object initializers may temporarily alter the class pointer. Fri Nov 20 08:00:30 1998 Tim Janik * gtk/testgtk.c: change all occourances of gtk_container_add ( scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...) for widget!=(clist, ctree, text, viewport). * gtk/gtkcombo.c: (gtk_combo_init): use gtk_scrolled_window_add_with_viewport() to add children to the scrolled window. * gtk/gtkscrolledwindow.h: * gtk/gtkscrolledwindow.c: changed scrolled_window->viewport to scrolled_window->child, and use gtk_widget_scroll_adjustements() to set the scroll adjustments for the widget, we do not create an additional viewport anymore. added ::hadjustment and ::vadjustment constructor args. (gtk_scrolled_window_new): use gtk_widget_new() to create the widget. (gtk_scrolled_window_set_hadjustment): (gtk_scrolled_window_set_vadjustment): new functions that superceed gtk_scrolled_window_construct. (gtk_scrolled_window_construct): deprecated this function. * gtk/gtkhscrollbar.c: * gtk/gtkvscrollbar.c: * gtk/gtkhscale.c: * gtk/gtkvscale.c: support a constructor arg "::adjustment", and use gtk_widget_new() for the widget creation. * gtk/gtkrange.c: added ::update_policy arg. (gtk_range_set_adjustment): if adjustment is passed in as NULL, create a default adjustment so this function can be used for derived widgets that depend on the adjustment's existance. (gtk_range_destroy): disconnect the adjustment signal, so we don't get called after we got destroyed, we don't destroy the adjustment in here, because it might have been provided from another widget. * gtk/gtkviewport.c: introduced ::scroll_adjustments signal. (gtk_viewport_destroy): same as gtk_range_destroy. * gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy. * gtk/gtkwidget.h: * gtk/gtkwidget.c: changed gtk_widget_activate() to return a gboolean, indicating whether this widget supports activation. added gtk_widget_scroll_adjustements() to set the scrolling adjustments of a widget. Wed Nov 19 01:22:42 1998 Tim Janik * gtk/gtkoptionmenu.c: (gtk_option_menu_remove_contents): (gtk_option_menu_update_contents): removed gtk_container_[un]block_resize() pairs. * gtk/gtknotebook.h: * gtk/gtknotebook.c: removed the tab_border field, since it shouldn't be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a wrtie-only argument. * *.c: made deprecated functions issue a message: gtk_clist_set_border, gtk_container_block_resize, gtk_container_unblock_resize, gtk_container_need_resize, gtk_object_class_add_user_signal, gtk_spin_button_construct, gtk_scrolled_window_construct. removed non-functional functions: gtk_container_disable_resize, gtk_container_enable_resize, gtk_clist_set_policy. Wed Nov 18 22:54:36 1998 Tim Janik * gtk/gtkbox.c (gtk_box_init): * gtk/gtkdrawingarea.c (gtk_drawing_area_init): * gtk/gtkeventbox.c (gtk_event_box_init): * gtk/gtkfixed.c (gtk_fixed_init): * gtk/gtkframe.c (gtk_frame_init): * gtk/gtkhandlebox.c (gtk_handle_box_init): * gtk/gtkpacker.c (gtk_packer_init): * gtk/gtkmisc.c (gtk_misc_init): * gtk/gtkpreview.c (gtk_preview_init): * gtk/gtkprogress.c (gtk_progress_init): * gtk/gtkprogressbar.c (gtk_progress_bar_init): * gtk/gtkseparator.c (gtk_separator_init): * gtk/gtktable.c (gtk_table_init): * gtk/gtkviewport.c (gtk_viewport_init): * gtk/gtkalignment.c (gtk_alignment_init): removed setting of the GTK_BASIC flag. * gtk/gtkwidget.h: * gtk/gtkwidget.c: removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic. * miscellaneous GtkType and macro fixups. Sat Nov 21 18:53:13 1998 Owen Taylor * gdk/gdkwindow.c (gdk_window_get_deskrelative_origin): Fixed so it at least works with window managers other than Enlightenment, though it probably needs to be removed altogether. 1998-11-21 Andrew T. Veliath * gtk/gtkhandlebox.[ch]: Add shadow_type and gtk_handle_box_set_shadow_type function (plus a GtkHandleBox::shadow arg) to allow configuration of shadow in the bin window. Thu Nov 19 23:47:38 CST 1998 Shawn T. Amundson * gtk/gtkcalendar.c: Fix for marking days from Dan Reish . Thu Nov 19 00:15:27 1998 Lars Hamann * gtk/gtkctree.c (gtk_ctree_node_nth): return the nth GtkCTreeNode in row_list. (from Samuel Solon ) * gtk/gtkclist.c (gtk_clist_get_column_title): return column title (gtk_clist_get_column_widget): return column widget Wed Nov 18 11:54:57 1998 Owen Taylor * gtk/gtkdnd.c (gtk_drag_find_widget): Accept drops that are sent to a toplevel but are not within the toplevels bounds. * gdk/gdkdnd.c gdk/gdk.h: Added support for a XdndProxy atom which proxies the drag to another window. 1998-11-17 Federico Mena Quintero * gtk/gtkpaned.h (struct _GtkPaned): Removed the cursor field, now that it is not needed. Tue Nov 17 1998 The Rasterman * gdk/gdk.h, gdk/gdkwindow.c: Added gdk_window_get_deskrelative_origin function to correctly determine gdk window position relative to its "root window" - contains check for an Enlightenment virtual root window. * gtk/gtkhandlebox.c: changed gdk_window_get_origin -> gdk_window_get_deskrelative_origin to get the origin of dragged handleboxes correctly. Now it works correctly with E. Tue Nov 17 1998 Tuomas Lukka * gtk/gtktypeutils.c: Fix vital bug where LOOKUP was used when getting types even though we were not using real type names, just the index. This caused random crashes when more than 256 types were defined. 1998-11-17 Martin Baulig * gtk/genmarshal.pl: Put output files in the current directory and not in the $(srcdir) since the VPATH is ignored for built sources. Tue Nov 17 01:37:53 PST 1998 Manish Singh * gtk/genmarshal.pl * gtk/Makefile.am: check for unchanged autogenerated files, so we don't rebuild everything just for adding a new function Mon Nov 16 19:19:00 CST 1998 Shawn T. Amundson * gtk/gtkpixmap.h gtk/gtkpixmap.c: Pixmaps now grey out when insensitive, code thanks to GNOME stock by Eckehard Berns. New function gtk_pixmap_set_build_insensitive to provide ability to turn this off. Tue Nov 17 00:06:29 1998 Lars Hamann * gtk/gtknotebook.h (struct _GtkNotebook): new flags : homogeneous; new guints : tab_hborder, tab_vborder; marked tab_border deprecated (struct _GtkNotebookPage): new flags : expand, fill, pack * gtk/gtknotebook.h/c (gtk_notebook_set_homogeneous_tabs): new function. set homogeneneous tabs (gtk_notebook_set_tab_border): set tab_h/vborder to tab_border (gtk_notebook_set_tab_hborder): new function. set tab_hborder (gtk_notebook_set_tab_vborder): new function. set tab_vborder (gtk_notebook_query_tab_label): new function. get tab_label widget. (gtk_notebook_set_tab_label): new function. set tab_label widget. (gtk_notebook_set_tab_label_text): new function. set tab_label text. (gtk_notebook_query_menu_label): new function. get tab_label widget. (gtk_notebook_set_menu_label): new function. set tab_label widget. (gtk_notebook_set_menu_label_text): new function. set tab_label text. (gtk_notebook_set_tab_label_packing): new function. set tab_label fill, expand, fill_type (gtk_notebook_query_tab_label_packing): new function. get tab_label fill, expand, fill_type (gtk_notebook_real_page_position): return logic page number (gtk_notebook_search_page) search next/prev logic page (gtk_notebook_update_labels): set logic page number. (gtk_notebook_page_compare): renamed gtk_notebook_find_page (gtk_notebook_set/get_child_arg): new args CHILD_ARG_TAB_EXPAND, CHILD_ARG_TAB_FILL, CHILD_ARG_TAB_PACK (gtk_notebook_button_press) (gtk_notebook_key_press) (gtk_notebook_focus) (gtk_notebook_pages_allocate) (gtk_notebook_calc_tabs) (gtk_notebook_switch_focus_tab) use gtk_notebook_search_page (gtk_notebook_page_allocate): fixed allocation bug (gtk_notebook_set/get_arg): new args TAB_HBORDER, TAB_VBORDER. (gtk_notebook_init): unset GTK_NO_WINDOW flag (gtk_notebook_size_request): check whether page->child is visible. changes due to tab h/vborder, homogeneous tabs (gtk_notebook_paint): don't draw invisible tabs (gtk_notebook_switch_page): calculate page_num if it's less than 0 (gtk_notebook_append_*) (gtk_notebook_prepend_*) (gtk_notebook_insert_page): removed sanity checks * gtk/testgtk.c (create_notebook): extended Notebook sample a bit. Mon Nov 16 15:10:33 1998 Owen Taylor * gtk/gtktext.c: Optimizations for [advance/decrement]_mark_n. (gtk-mailund-980718-0, Thomas Mailund Jensen ) * gtk/gtkfixed.c: Removed gtk_fixed_umap, which was broken. (GtkWidget's default unmap handler should work fine). Pointed out by Patrice Fortier Mon Nov 16 00:59:26 PST 1998 Manish Singh * gtk/gtkmenubar.[ch]: added shadow_type setting and gtk_menu_bar_set_shadow_type function to allow shadow configurability for menubars * gtk/gtkviewport.h: use GtkShadowType enum instead of generic guint Mon Nov 16 00:17:53 1998 Tim Janik * gtk/gtktypeutils.c (gtk_type_new): relookup type node after class creation and parent class' object initializer. 1998-11-13 Federico Mena Quintero * gtk/gtkpaned.c (gtk_paned_realize): Destroy the cursor after we have assigned it to the window -- there is no point in keeping it around. (gtk_paned_unrealize): No need to destroy the cursor here. * gtk/gtkpaned.h (struct _GtkPaned): Removed the cursor field, as it is not needed. Fri Nov 13 11:22:38 1998 Owen Taylor * gdk/gdkpixmap.c: New function gdk_pixmap_foreign_new(). (gtk-blizzard-981005-0. Christopher Blizzard * gtk/Makefile.am: Added rules to generate an empty GTK+ theme called "Default" upon installation. * gtk/gtkrc.c (gtk_rc_parse_style): Fix inheritance of fonts and fontsets. (gtk-matsu-980924. Takashi Matsuda matsu@arch.comp.kyutech.ac.jp) * gtk/gtkmain.c: Change test to detect glibc's utf8 based mb* functions to be more specific. * gtk/gtkwindow.[ch] gtk/gtkfixed.c: Indentation cleanups. Fri Nov 13 16:43:36 1998 Lars Hamann * gtk/gtktogglebutton.c (gtk_toggle_button_realize): don't show event_window (gtk_toggle_button_map) (gtk_toggle_button_unmap): show/hide event_window if draw_indicator is set (gtk_toggle_button_set_mode): Thu Nov 12 15:33:54 PST 1998 Manish Singh * gtk/gtkitemfactory.c: cast NULL to GtkItemFactoryCallback to ensure proper type (SunPro cc complains) * gtk/gtklist.c: removed bogus '*' from "*GTK_CONTAINER_CLASS" * gtk/gtktogglebutton.c: use our own draw method so we get proper redraws on active state Thu Nov 12 00:26:13 1998 Lars Hamann * gtk/gtkstyle.c (gtk_default_draw_box_gap): use GtkPositionType defines. * gtk/gtknotebook.c (gtk_notebook_draw_tab): fixed gap_side for GTP_POS_RIGHT Wed Nov 11 19:54:58 1998 Lars Hamann * gtk/gtkscrolledwindow.c (gtk_scrolled_window_class_init) (gtk_scrolled_window_set_arg) (gtk_scrolled_window_get_arg): added ARG_WINDOW_PLACEMENT * gtk/gtkclist.c (size_allocate_columns): resize column if column button > column width and auto_resize is set (real_clear) (column_auto_resize) (gtk_clist_optimal_column_width): consider column button width of auto resized columns (gtk_clist_parent_set): removed * gtk/gtkctree.c (gtk_ctree_insert_node): call column_auto_resize. (auto_resize_columns): auto_resize all columns (real_tree_collapse) (gtk_ctree_remove_node): call auto_resize_columns (column_auto_resize): respect column button width of auto resized columns 1998-11-10 Martin Baulig * gtk/gtkfeatures.h.in (GTK_HAVE_FEATURES_1_1_4): Define this so we can check for latest GTK features. Mon Nov 9 00:39:20 1998 Lars Hamann * gtk/gtkenums.h : new enum GtkCornerType * gtk/gtkscrolledwindow.h (struct _GtkScrolledWindow): added window_placement. * gtk/gtkscrolledwindow.c (gtk_scrolled_window_set_placement): new method to set window_placement. (gtk_scrolled_window_viewport_allocate) (gtk_scrolled_window_size_allocate): few changes due to window_placement. * gtk/testgtk.c (remove_selection): fixed while loop. Sat Nov 7 21:55:00 PST 1998 Manish Singh * gtk/gtkclist.c: check if column[i].button is valid before calling gtk_widget_intersect on it in gtk_clist_draw * gtk/gtkdnd.c: removed unused variable empty_bits * gtk/gtkrc.c: we should use gslist_* functions with GSLists... * gtk/gtktypeutils.[ch]: makes more send for gtk_type_is_a to return a boolean (thanks to Elrond for noticing this) 1998-11-07 Jay Cox * gtk/gtkwindow.c: forward declaration for gtk_window_paint * gdk/gdkxid.c: declare xid_ht static * examples/*/Makefile: get the link ordering right. Sat Nov 7 16:31:56 1998 Stefan Jeske * gtk/gtkclist.c (gtk_clist_realize): Set background of title button window to GTK_STATE_NORMAL instead of GTK_STATE_SELECTED to avoid ugly flicker. Fri Nov 6 23:29:40 1998 Lars Hamann * gtk/gtkclist.c (real_clear) (adjust_adjustments): resize clist if adjustments are NULL and list size has changed (gtk_clist_size_request): return real list requsition, if adjustments are NULL. (size_allocate_columns): use button->requisition.with, if column width is not set. (list_requisition_width): new function. return full list width. (gtk_clist_set_hadjustment) (gtk_clist_set_vadjustment): do not auto create adjustments. (gtk_clist_motion) (move_vertical) (move_horizontal): check adjustment != NULL. Thu Nov 5 12:06:16 1998 Owen Taylor * gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue a clear/redraw, not just a redraw, so the focus gets undrawn properly. * gtk/gtktogglebutton.c (gtk_toggle_button_unrealize): Chain to gtk_widget_unrealize() instead of duplicating code. Wed Nov 4 14:34:51 1998 Owen Taylor * gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed last vestiges of old DND. Tue Nov 3 12:27:52 1998 Owen Taylor * gtk/gtkentry.c: Restored inner border to entries, erase cursors to background image. Fri Oct 30 12:09:21 1998 Owen Taylor * gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() - it was identical to paint_flat_box(). * gtk/gtkstyle.c: Coding style fixups. * gtk/gtkwindow.c (gtk_window_move_resize): removed useless test. * gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c: Change 'side' for paint_[box/shadow]_gap and paint_extension to be GtkPositionType instead of a random int. * gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use "frame" as detail - an aspectframe should draw identical to a frame. Tue Oct 27 09:58:11 1998 Owen Taylor * gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed from combine_child_shapes(). * gdk/gdkwindow.c: Merge propagate_shapes() and propagate_combine_shapes() to remove code duplication. Thu Nov 5 14:31:57 PST 1998 Manish Singh * gdk/gdk.c: sometimes we get a KeyRelease before a KeyPress in gdk_event_translate, and the USE_XIM buffer isn't allocated yet. So allocate some mem if it's not already done. * clist scrollbar merges from HEAD Tue Nov 3 13:16:36 PST 1998 Manish Singh * gtk/Makefile.am: remove explict -ldl, gmodule takes care of that * gtk/gtkdnd.c: start TARGET_MOTIF_SUCCESS from 0x40000000 instead of 0x80000000, so we stay within the bounds of a postive signed int (it broke some compilers) * gtk/gtkmenushell.c * gtk/gtkoptionmenu.c: merges from HEAD to make option menus work when some of the menuitems are hidden * gtk/gtkthemes.h: don't include dlfcn.h explictly, gmodule takes care of that * gtk/gtkwidget.c: add a dummy continue after the line label next_rect, since some compilers don't like label: } Sun Nov 1 20:05:55 PST 1998 Manish Singh * Okay, so we need the X11R6 keysyms so programs don't have to worry about them. They don't conflict anyway. Reverted the #ifdef changes to gtk/*.c * gdk/Makefile.am: remove the BUILT_SOURCES rule, and make a special rule for them (X-derived-headers) Sun Nov 1 05:30:32 PST 1998 Manish Singh * gdk/Makefile.am: changed the awk scripts to generate gdkcursors.h and gdkkeysyms.h into sed scripts, since the awk scripts weren't portable, and we really shouldn't be using awk anyway. * makecursors.awk * makekeysyms.awk: bye bye * gtk/gtkaccelgroup.c * gtk/gtkclist.c * gtk/gtknotebook.c * gtk/gtkwindow.c: don't use X11R6 keysyms if they aren't there Sat Oct 31 15:22:14 PST 1998 Manish Singh * gdk/Makefile.am: do the same built sources trick for gdkcursors.h and gdkkeysyms.h. Remove those files from CVS. Sat Oct 31 14:44:01 PST 1998 Manish Singh * gdk/gdk.c: move prototype of gdk_wm_protocols_filter outside of the USE_XIM #ifdef * gtk/Makefile.am: cause the built sources to be rebuild when possible, even with --include-deps. Slightly different from timj's fix, to avoid circular dependency with gtkmarshal.c * autogen.sh * gtk/gtkclist.[ch] * gtk/gtkctree.c * gtk/gtkfontsel.[ch] * gtk/gtklist.c * gtk/gtklistitem.c * gtk/gtkobject.[ch] * gtk/testgtk.c: merges from HEAD * gtk/gtkmenubar.c * gtk/gtkradiomenuitem.c * gtk/gtktreeitem.c: cleanups Wed Oct 28 23:32:19 PST 1998 Manish Singh * gdk/gdkrgb.c: Oops. s/BIGENDIAN/BIG_ENDIAN/ Wed Oct 28 19:04:49 PST 1998 Manish Singh * configure.in: AIX has libpthreads, to make sure you can have more than one thread. Also add -D_THREAD_SAFE, and reorder configure.in so CFLAGS doesn't get clobbered when we actually want to modify it * gdk/gdkimage.c: initialize the bpp and byte_order fields properly in gdk_image_get * gtk/testdnd.c: removed unused variable "buf" Mon Oct 26 16:46:15 1998 Owen Taylor * gtk/gtkcontainer.c (gtk_container_unregister_toplevel): remove_link(), not remove() Thu Oct 22 02:27:30 PDT 1998 Manish Singh * gdk/gdkrgb.c: use glib endian stuff * configure.in: don't need to check for endianness anymore * gtk/gtkstyle.h: removed #pragma }, causing a silly warning Wed Oct 21 17:44:27 1998 Owen Taylor * gtk/gtkwindow.c (gtk_window_read_rcfiles): Reset all toplevel widgets, not toplevel windows. (I.e., plugs should be reset) * gtk/gtkwindow.c (gtk_window_read_rcfiles): Yes, we _do_ need to notify the other toplevels - by the time the get the client messages, the RC file dates will have been updated. * gtk/gtkcontainer.h: Added a function call to list every toplevel widget. * gdk/gdk.c (gdk_event_send_client_message_to_all_recurse): Don't send client messages to _every_ window on display! Tue Oct 20 16:21:04 1998 Owen Taylor * gtk/gtkdnd.c (gtk_drag_source_event_cb): Don't start drags when dragging across widgets, only in drags starting in widget. Tue Oct 20 15:59:49 1998 Owen Taylor * gtk/gtkdnd.c (gtk_drag_source_info_destroy): Emit "drag_end" signal at end of drag. Tue Oct 20 13:07:54 1998 Owen Taylor * gtk/gtkwindow.c (gtk_window_read_rcfiles): Look for "gtk-embedded" data currently set by GtkSocket, and use that to forward client message on to embedded windows. Only reset our own toplevel - the others will handle themselves. (Now that GtkMenus live in GtkWindows) Mon Oct 19 16:40:40 1998 Owen Taylor * gdk/gdkdnd.c (get_client_window_at_coords_recurse): Modify client window finding code so that it works with WM's other than fvwm. Sun Oct 18 22:48:27 1998 Owen Taylor * gtk/gtkdrawwindow.c (gtk_draw_window_get_type): Added the "GtkDrawWindow" class, which is a descendent of the Window class which leaves its background alone. Essentially, a toplevel drawing area, though it does allow adding a child. Sat Oct 17 00:40:51 1998 Owen Taylor * gtk/gtkrc.c (gtk_rc_style_init): Duplicate bg_pixmap_name when merging RC styles. Report new share/themes path for themes directory. Deref theme engines when appropriate. * gtk/gtkclist.c: Set all backgrounds in _style_set(). Make sure that pixel for xor_gc is never 0. * gtk/gtkctree.c: Choose colors for plus/minus more carefully, in a hopefully style-independent fashion. (Still needs a bit more work) * gtk/gtkwidget.c: Don't send expose events to widgets which are about to be resized and redrawn. (Needs a bit more thought.) * gtk/gtknotebook.c (gtk_notebook_draw_tab): Avoid drawing on tabs for newly allocated, un-sized pages - we'll get the size wrong. Thu Oct 1 17:38:07 1998 Owen Taylor * gtk/gtkwidget.c (gtk_widget_redraw_queue_remove): Fixed up stupidities in last commit. Thu Oct 1 14:25:43 1998 Owen Taylor * gtk/gtkwidget.c: When handling queued resizes, account for handleboxes, where the widget heirarchy is different than the window heirarchy by just queueing a resize on the entire handlebox if the detached child is changed. - Remove widgets from the redraw queue when reparenting, even if not unrealizing. We queue a resize/redraw in any case. Mon Sep 28 21:07:01 EDT 1998 The Rasterman * gtk/gtkstyle.c: added check to see if the widget has been shaped byt the app via gtk_widget_shape_combine_mask and if it has does not reset the shape on theme change. Tue Sep 15 11:30:03 1998 Owen Taylor * gtk/gtkfilesel.c: Keep a list of directories in which we never want to stat the entries (like /afs), and assume everything in those directories is a subdirectory. - When following a path, try to open components even when we don't find them in their parent's directory to support automounters. Fri Sep 11 15:36:33 1998 Owen Taylor * gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully now at least compiles again. * gdk/gdk.c (gdk_event_translate): Don't pass events on destroyed widgets to the gdk_input layer. Thu Sep 3 19:45:34 1998 Owen Taylor * gtk/gtkthemes.c: Use g_module instead of dlopen() Thu Sep 3 19:30:11 1998 Owen Taylor * gtk/gtktooltips.c (gtk_tooltips_expose): Check if we've changed widgets since the expose event was queued. Mon Aug 31 15:33:13 1998 Owen Taylor * gtk/gtkstyle.h (struct _GtkStyle): Reordered a bit to restore approximate bin compatibility with the non-themes branch. (This does break bin compat within the themes branch.) Sun Aug 30 16:48:27 1998 Owen Taylor * gtk/gtklabel.c (gtk_label_set): Eliminate a gdk_window_clear_area() that snuck in with the menu underlines merge. Mon Aug 24 23:37:26 1998 Owen Taylor * gtk/gtktext.c: Fixed some remaining background drawing, merges from main branch, cleanups. Mon Aug 24 10:55:51 1998 Owen Taylor * gtk/gtknotebook.c (gtk_notebook_draw_tab): Don't dereference NULL focus tab. * gtk/gtkscale.c (gtk_scale_[un]map): Add map/unmap functions since we need to both show/hide and queue a redraw. (There's some duplication of drawing here, we probably should only be queuing a redraw on the "value" portion of the scale.) Fri Aug 21 19:02:30 1998 Owen Taylor * gtk/gtkrange.[ch] gtk/gtkhscale.c gtk/gtkvscale.[ch]: Fit scales into the theme-drawing framework. We do this by making them, like check/radio-buttons, no-window widgets with subwindows. We then move the value by calling gtk_widget_queue_clear() and only redraw the value in our draw() / expose() handler. A virtual function clear_background is added which queues a clear on the "background" portion of the widget. Fri Aug 21 13:04:27 1998 Owen Taylor * gtk/gtktext.c (mark_bg_gc): Make background colors work again. (We can't always paint the background with a paint() function - only do that for selected text) Mon Aug 17 20:31:01 1998 Owen Taylor * gtk/gtktearoffmenuitem.c gtk/gtkclist.[ch] gtk/gtkctree.[ch] gtk/gtklabel.c gtk/gtkmenu.c: Merges from main branch. * Makefile.am (SRC_SUBDIRS): Removed themes from SRC_SUBDIRS. the themes can't be built as part of the same build since they depend on gdk_imlib. Fri Aug 14 12:44:30 1998 Owen Taylor * gtk/gtkthemes.c (gtk_theme_engine_get): Removed sample engine code from gtkthemes.c. * configure.in ltconfig.in ltmain.sh gdk/Makefile.am gtk/Makefile.am gtk/ - Upgrade to libtool-1.2b + patch to add shared library dependencies for Linux. (Needs to be extended to other platforms where they are safe) - Check for -ldl so this branch should build on all platforms, though themes will work on all platforms they could work on. - Use -version and -release simultaneously: sonames stay as they are in the current scheme, but -lgtk-1.1 changes to -lgtk. - Added in extra -l flags to library LDFLAGS so we get shared library dependencies against X libs and -ldl. (But not libgtk against libgdk or libglib yet, since dependencies against uninstalled libraries aren't portable) Fri Aug 21 16:10:38 EDT 1998 The Rasterman * gtkrc.c - added api calls to find module and theme paths from gtk. nuked gtk_install_prefix global. Fri Aug 21 12:36:46 EDT 1998 The Rasterman * fixed gtk_install_prefix global. Thu Aug 20 19:27:49 EDT 1998 The Rasterman * added gtk_install_prefix global const variabel to find where gtk is installed. Thu Aug 20 18:27:29 EDT 1998 The Rasterman * added ~/.gtk/lib/themes/engines/ to the default searchpath for gtk theme engines Thu Aug 20 18:27:29 EDT 1998 The Rasterman * made gtkrc scanner append dir that gtkrc is read from to pixmap path. Mon Aug 10 23:03:55 1998 The Rasterman * Fixed minor problem in gtkhandlebox.c with drawing, and some notebook stuff. Also pixmap theme is now "clean" again. Mon Aug 10 23:03:55 1998 Owen Taylor * gtk/gtkwidget.c (gtk_widget_clip_rect): Fixed up queued area resizing once more. Mon Aug 10 23:09:30 EDT 1998 * Added a few drawing fixes for notebook and other widgets. finished pixmap theme up to the level that can be supported so far. (need to add path discovery 9ie where is the rc fiel from - add to pixmap path so we can get theimages from there too). then we can package themes. After that need to add to theme seartch path stuff in users home dir. Thu Aug 6 16:49:25 1998 Owen Taylor * gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a drawing area, draw in an expose handler. * gtk/gtknotebook.c (gtk_notebook_expose): Check for empty current page. Wed Aug 5 16:13:15 1998 Owen Taylor * gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved creation of GC's so that they will be set before they are used for map events (why are they used there?) * gtk/gtkwidget.c: Fixed mistake that caused widgets to be queued in multiple times in the queue. Wed Aug 5 14:23:52 1998 Owen Taylor * gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set clip rects (or do anything) for shadow_none. Wed Aug 5 13:14:57 1998 Owen Taylor * gtk/gtkbutton.c (gtk_button_paint): Restored paint function. Yes, it was needed. draw() and expose() are _not_ identical. Sat Aug 1 17:44:31 EDT 1998 EDT 1998 The Rasterman * Wheeeeeeeeeeeeeeee fixed radiobittons to work in gimp again. Fri Jul 31 19:45:12 EDT 1998 The Rasterman * YES YES YES YES YES clist borders work again! YES! YES YES! gimme more baby oooh yeah more more MORE YES YES. Fri Jul 31 19:45:12 EDT 1998 The Rasterman * hopefully fixed problem wiht togglebuttons acting like radiobuttons in gtktogglebutton.c Thu Jul 30 23:36:46 EDT 1998 The Rasterman * fixed another drawing buglet in the frame drawing code (actually in the clearing code but anyway in gtkstyle.c) Thu Jul 30 19:23:48 EDT 1998 The Rasterman * Fixed warning from colorsel widget... Thu Jul 30 19:10:42 EDT 1998 The Rasterman * Fixed defautl drawing code to no longer clobber the original style pixmap bgs as it did and added a helper funciton og gtkstyle.c to help with this. Thu Jul 30 18:09:21 1998 Owen Taylor * gtk/gtkrc.c gtk/gtkstyle.c: More mm fixups * gtk/gtktooltips.c: Pass a widget (the window) to the drawing function instead of the GtkTooltips. Thu Jul 30 17:27:10 1998 Owen Taylor * gdk/gdkwindow.c: Abstract out checking for shape extension into a function. * gtk/gtkwindow.c: Fix up gtk_window_expose()/draw(). Remove extra callls to gtk_window_draw(). Thu Jul 30 11:18:43 1998 Owen Taylor * gtk/gtkstyle.c gtk/gtkrc.c: Memory management fixups. * themes/th_main.c: Moved messages around so they are printed before destroying strings. Wed Jul 29 16:56:07 1998 Owen Taylor * gdk/gdk.c: Fairly simple implementation of expose compression. (No GraphicsExpose compression yet, always compress with the equivalent of XtCompressMultiple - no compression of Expose events across non-Expose events) * gdk/gdk.h gdk/gdkrectangle.c: gdk_rectangle_union() Find rectangle bounding two rectangles. * gtk/gtkstyle.c: Set clip rects for a few extra GC's in gdk_default_draw_shadow() Wed Jul 29 16:03:20 EDT 1998 The Rasterman * Fixed drawing functions to handle switching themes on the fly gracefully and look decent. Tue Jul 28 22:52:10 EDT 1998 The Rasterman * Added all the theme drawing code to all widgets, fixed up minor nigglies in some widgets when it comes to themes, seem to be running into some funky behavior with clipping rects in GC's. Too many files to list here. (all files that now use gtk_paint_* are affected). Tue Jul 28 22:49:16 1998 Owen Taylor * themes/th_main.c themes/th_draw.c gtk/testgtkrc: Set up the demo theme so it is loaded from the RC file. * themes/th_draw.c: Alleviate the hardcoded paths a wee bit. (use $HOME/themes/) * gtk/gtkthemes.[ch] gtk/gtkmain.c: Load engines specified in the RC file via dlopen() Tue Jul 28 20:30:56 1998 Owen Taylor Internal handling of styles and RC styles pretty much completely reworked for Theme work. * gtkthemes.[ch]: - Added routines for virtualization of RcStyle and Style handling. - Temporary "sample" inline theme-engine. (Does nothing but print out a few messages. * gtkrc.[ch] - Made GtkRcStyle public, added flags to tell if particular colors have been set. - RC Styles are "transparent", and the final style for a widget is the composition of all matching styles - Added pointer to GtkThemeEngine, and gpointer engine_data to RC style and style. - Parse "engine" keyword, load the appropriate theme engine and call the engine's parser. * gtkstyle.[ch] - Keep a GtkRcStyle * in styles created from Rc Styles. - Load up images from RC file at style attachment time. - Call ->engine->foo() at appropriate times. - Don't use a GCache. All incarnations for a style are just linked together in a list, depend on the RC style code to find the existing copy. Tue Jul 28 14:41:54 1998 Owen Taylor * gtk/gtkwidget.[ch]: Added the concept of queued redraws of partial areas. This can be done either relative to the existing windows (gtk_widget_queue_clear[_area]()) or relative to the future allocation of the widget (gtk_widget_queue_draw[_area]). The initial implementation is pretty braindead, but can be improved. * gtk/gtkwidget.[ch]: Removed calls to gdk_window_clear_area() in favor of gtk_widget_queue_clear(). * gtk/gtklabel.[ch] gtk/gtkpixmap.[ch]: Removed needs_clear flags in favor of gtk_widget_queue_clear() Tue Aug 4 19:12:14 1998 Owen Taylor * gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up handling of partially clipped areas. Thu Nov 5 18:52:35 1998 Lars Hamann * gtk/gtkclist.h (struct _GtkCListClass) * gtk/gtkclist.c (gtk_clist_class_init): removed scrollbar_spacing. Thu Nov 5 16:00:32 1998 Lars Hamann * gtk/gtkclist.h (struct _GtkCList): removed vscrollbar, hscrollbar, vscrollbar_policy, hscrollbar_policy. added h/vadjustment. * gtk/gtkclist.c (gtk_clist_class_init): added new args types "hadjustment" & "vadjustment" (gtk_clist_set_arg) (gtk_clist_get_arg): new object class set/get_arg functions (gtk_clist_construct): don't create/adjust scrollbars. (gtk_clist_set_hadjustment) (gtk_clist_set_vadjustment): new functions to set h/vadjustments (gtk_clist_get_vadjustment) (gtk_clist_get_hadjustment): new functions to query h/vadjustments (create_scrollbars): removed. (create_adjustments): replacement for create_scrollbars (gtk_clist_new): call gtk_clist_new_with_titles (gtk_clist_new_with_titles): don't warn on titles == NULL (move_horizontal): use CLAMP instead (gtk_clist_set_policy): deprecated method. use gtk_scrolled_window_set_policy instead. (vadjustment_value_changed): use clist->vadj. (adjust_scrollbars): renamed to adjust_adjustments (adjust_adjustments): former adjust_scrollbars (gtk_clist_destroy): unref adjustments (gtk_clist_size_allocate) (gtk_clist_map) (title_focus) (gtk_clist_unmap) (gtk_clist_size_request) (gtk_clist_focus) (gtk_clist_size_allocate) (gtk_clist_forall): don't use scrollbars (gtk_clist_thaw) (real_insert_row) (real_remove_row) (gtk_clist_set_row_height) (real_resize_column): call adjust_adjustments (gtk_clist_moveto): return if clist has no adjustments yet. (gtk_clist_parent_set): new GtkWidget::parent_set function. Autogenerate h/vadjustments if needed. (move_horizontal) (move_vertical): some cleanups * gtk/gtkviewport.c (gtk_viewport_set_arg) (gtk_viewport_new): call only gtk_viewport_set_h/vadjustment and let these functions do the work. (gtk_viewport_set_hadjustment) (gtk_viewport_set_vadjustment): generate a new adjustment if needed * gtk/gtkscrolledwindow.h ((struct _GtkScrolledWindow): use a guint bitfield for h/vscrollbar_policy and h/vscrollbar_visible * gtk/gtkscrolledwindow.c (gtk_scrolled_window_adjustment_changed): queue_resize if visibility of scrollbars changes (gtk_scrolled_window_remove): only call container_remove with scrolled_window->viewport automatically if viewport was autogenerated (gtk_scrolled_window_add): add widget as scrolled_window->viewport. auto create a viewport only if widget does not take h/vadjustments. (gtk_scrolled_window_construct): don't generate a viewport automatically. (gtk_scrolled_window_forall): call callback with viewport in any case (gtk_scrolled_window_set_arg): call gtk_container_add in case of ARG_VIEWPORT (gtk_scrolled_window_size_allocate) (gtk_scrolled_window_size_request) (gtk_scrolled_window_map) (gtk_scrolled_window_unmap): check viewport != NULL * gtk/testgtk.c (create_ctree) (export_ctree) (create_clist): use a scrolled_window in conjunction with clists/ctrees * gtk/gtkfilesel.c (gtk_file_selection_init): use a scrolled_window in conjunction with clists * gtk/gtkfontsel.c (gtk_font_selection_init): use a scrolled_window in conjunction with clists Wed Nov 4 21:52:57 1998 Lars Hamann * gtk/gtkctree.c (gtk_ctree_unlink): fix focus_row adjustment (gtk_ctree_remove_node): select focus_row if needed (cell_size_request): only get pixmap size if pixmap != NULL Wed Nov 4 04:30:37 1998 Tim Janik * gtk/gtkwidget.c: added a bunch of checks for widget != NULL and GTK_IS_WIDGET (widget): Wed Nov 4 02:02:07 1998 Lars Hamann * gtk/gtkclist.c (real_remove_row) (sync_selection): set correct focus_row after a remove_row call. Sun Nov 1 21:00:06 GMT 1998 Austin Donnelly * gtk/gtkoptionmenu.c * gtk/gtkmenushell.c: make option menus work when some of the menuitems are hidden - previously, option menu would popup too high. 1998-10-31 Raja R Harinath * gtk/gtkfeatures.h.in: Remove `#pragma }'. * gdk/gdki18n.h: Update to use new `glib' widechar defines. * configure.in (CFLAGS): Don't use test -z "echo .. | grep". Use case instead. (wchar.h, wctype.h, iswalnum): Duplicate widechar tests from `glib'. (GDK_WLIBS): New variable. Lists extra libraries needed to use widechar functions. * gtk-config.in (--libs): List $GDK_WLIBS, too. Sat Oct 31 03:11:57 CST 1998 Shawn T. Amundson * Released GTK+ 1.1.3 * INSTALL: * NEWS: * README: * gtk+.spec: * docs/gtk-config.1: updated for v1.1.3 * Makefile.am * sanity_check * docs/Makefile.am: Includes new 'make release' as well as 'make sanity'. Also handles html and text creation from html, and puts them into the distribution * docs/Makefile.sgml: removed, similar functionality is now in the Makefile.am file * docs/.cvsignore: ignore html and text directories * docs/glib.texi: removed (now in glib dist) Fri Oct 30 20:02:36 1998 Lars Hamann * gtk/gtklist.c (gtk_list_remove_items_internal): free undo_un/selection, unselect list_item before disconnect signal functions (gtk_list_destroy): removed. gtk_list_shutdown clears the list already (gtk_list_signal_item_select) (gtk_list_signal_item_deselect) (gtk_list_signal_item_toggle) (gtk_list_signal_scroll_horizontal) (gtk_list_signal_toggle_focus_row) (gtk_list_signal_select_all) (gtk_list_signal_unselect_all) (gtk_list_signal_undo_selection) (gtk_list_signal_start_selection) (gtk_list_signal_end_selection) (gtk_list_signal_toggle_add_mode) (gtk_list_signal_scroll_vertical) (gtk_list_signal_extend_selection) (gtk_list_signal_focus_lost): new functions. These functions are signal connected to inserted list_items, to handle key bindings and GtkItem::de/select/toggle signals. * gtk/gtklistitem.c (gtk_list_item_class_init): added missing gtk_object_class_add_signals call. (gtk_list_item_toggle_focus_row) (gtk_list_item_select_all) (gtk_list_item_unselect_all) (gtk_list_item_undo_selection) (gtk_list_item_start_selection) (gtk_list_item_end_selection) (gtk_list_item_extend_selection) (gtk_list_item_scroll_horizontal) (gtk_list_item_scroll_vertical) (gtk_list_item_toggle_add_mode): removed. These functions are handled via connected gtk_list_signal_* functions now Fri Oct 30 05:24:43 1998 Tim Janik * gtk/Makefile.am: cause the built sources to be rebuild when possible, even with --include-deps: $(libgtk_la_SOURCES): $(BUILT_SOURCES) Fri Oct 30 01:56:08 1998 Tim Janik * gtk/gtkobject.c (gtk_object_remove_no_notify): renamed from gtk_object_data_set_destroy to fit the gtkobject.h API. * applied patch from Damon Chaplin : * gtk/gtkfontsel.h: * gtk/gtkfontsel.c: Added support for an extra 'base' filter which an application can set to restrict the fonts available to the user (e.g. a terminal program only wants the user to be able to select fixed-width fonts). The type of font (bitmap/scalable/scaled bitmap) is now also a part of the filter, so that an application can request that only scalable fonts are shown. There are new functions to set the base & user filters. I've also stopped the up/down key press signals getting to the clists since the font selection widget handles them itself. It acted a bit strangely before. Sun Oct 25 20:27:02 1998 Tim Janik * gtk/gtkmain.c (gtk_init): support an environment variable GTK_MODULES= which takes a colon sperated list of module names automatically loaded at gtk_init() startup. Sun Oct 25 08:04:33 1998 Tim Janik * gtk/gtkwidget.c: added more g_return_if_fail() statements. Thu Oct 22 22:40:35 1998 Lars Hamann * gtk/gtkctree.c (gtk_ctree_destroy): removed. gtk_clist_destroy is sufficient Thu Oct 22 16:22:55 1998 Lars Hamann * gtk/gtkclist.c (COLUMN_FROM_XPIXEL): samll fix for invisible columns Thu Oct 22 02:29:53 1998 Tim Janik * gtk/gtkfilesel.h: GtkType and macro fixups * gtk/gtkfilesel.c (gtk_file_selection_complete): set a pattern for the file selection widget to try a completion on (set the initial filter). Wed Oct 14 14:34:04 1998 Tim Janik * gtk/gtkmain.c: implement idle functions via GHook. this gives a slight speed improvement and lessens code duplication. Tue Oct 20 14:53:28 1998 Owen Taylor * gtk/gtkdnd.c: Always send "drag_leave" to dests without GTK_DEST_DEFAULT_MOTION. Tue Oct 20 11:55:24 1998 Owen Taylor * gdk/gdk.c (gdk_event_translate): Handle DestroyNotify on destroyed windows so we clear the XID table properly. Finish up restructure of return value handling that was half-done before. Tue Oct 20 12:57:10 1998 Owen Taylor * gdk/gdk.c (gdk_send_clientmessage_to_all): Hunt the window tree more comprehensively, so that we find client windows hidden under non-toplevels. Tue Oct 20 12:43:04 1998 Owen Taylor * gtk/gtkselection.c (gtk_selection_data_set): Maintain the null-termintation guarantee, even when data = NULL, length = 0. (Warn on data = NULL, length > 0) Mon Oct 19 16:41:44 1998 Owen Taylor * gtk/gtkwidget.h (struct _GtkWidgetClass): Add in coordinates into function prototype for drag_data_received. Tue, 20 Oct 1998 11:33:10 +0200 Paolo Molaro * gtk/gtkdnd.h,gtk/gtkdnd.c: delete is a reserved word in c++. Mon Oct 19 23:44:41 1998 Lars Hamann * gtk/gtkclist.c: rearranged some functions (gtk_clist_set_column_auto_resize): new function. toggle auto_resize flag of column (gtk_clist_set_column_resizeable): if resizeable disable auto_resize (gtk_clist_set_border): deprecated function, use gtk_clist_set_shadow_type instead. (gtk_clist_set_shadow_type): replacement for gtk_clist_set_border (adjust_scrollbars): some cleanups (select_row) (unselect_row): removed. replaced by equivalent gtk_signal_emit calls (add_style_data): removed, use gtk_clist_style_set instead (gtk_clist_style_set): fill in size data, after style was set. (set_cell_contents) (gtk_clist_set_shift) (gtk_clist_set_row_style) (gtk_clist_set_cell_style): auto_resize columns if needed (column_auto_resize): resize column if needed for auto_resize (real_clear): disable auto_resize while list destroy (resize_column): removed * gtk/gtkctree.c : (gtk_ctree_remove_node) (gtk_ctree_set_line_style) (gtk_ctree_set_expander_style) (gtk_ctree_node_set_row_style) (gtk_ctree_node_set_cell_style) (set_cell_contents) (gtk_ctree_node_set_shift) (gtk_ctree_set_spacing) (real_tree_move) (gtk_ctree_set_indent) (gtk_ctree_insert_node) (real_tree_collapse) (real_tree_expand) (column_auto_resize): auto_resize columns if needed (gtk_ctree_collapse_recursive) (gtk_ctree_collapse_to_depth) (real_clear): disable auto_resize while processing the tree * gtk/testgtk.c (create_clist) (create_ctree): set auto_resize for one column Mon Oct 19 08:31:36 1998 Owen Taylor * gtk/gtkdnd.c (gtk_drag_selection_received): Fixed typo - look for right atom on transfer failures. Sun Oct 18 20:52:22 1998 Owen Taylor * gtk/gtkwidget.c gtkmarshal.list: Change signal for drag_data_get to match the use that was being made of it everywhere else... Sun Oct 18 18:16:39 1998 Owen Taylor * gdk/gdk.c gdkprivate.h: Added a modular client-message-filter mechanism, that is used for the DND messages. Removed all the old DND code. * gdk/gdkcolormap.c gdk/gdkcolormap.h: Add a function to get the visual of a given colormap. * gtk/gtkcolorsel.c: Conversion to new DND, drag a color-swatch. * gdk/gdk.h gdk/gdkdnd.c: The low-level X oriented portions of drag and drop protocols. Sending and receiving client messages, and navigating window trees. * gdk/gdkimage.c: added a gdk_flush() when destroying SHM images to hopefully make it more likely that X will gracefully handle the segment being destroyed. * gdk/gdkprivate.h gtk/gtkdebug.h: Add new DND debugging flags. * gtk/gtkeditable.[ch]: Updates for the selection handling changes. * gtk/gtkselection.[ch]: Added GtkTargetList, a refcounted data structure for keeping track of lists of GdkAtom + information. Removed selection_handler_add in favor of a "drag_data_get" signal. * gtk/gtkdnd.[ch] gtk/gtk.h: New files - highlevel (event loop dependent) parts of the DND protocols, display of drag icons, drag-under highlighting, and the "default handlers". * gtk/gtkinvisible.[ch]: New widget - InputOnly offscreen windows that are used for reliable pointer grabs and selection handling in the DND code. * gtk/testdnd.c: New test program for new DND. (Old DND tests in testgtk still need to be converted.) * gtk/testselection.c: Use the new selection API. * docs/dnd_internals: Start at describing how all the new code works inside. * docs/Changes-1.2.txt: New file describing source-incompatible changes in GTK+-1.2. Sat Oct 17 22:50:34 1998 Owen Taylor * gdk/gdkwindow.c (gdk_window_remove_filter): Free the right list node. * gdk/gdkwindow.c (gdk_window_init): Add gdk_root_parent to the XID table so we can receive events on it. Wed Oct 14 12:57:40 1998 Owen Taylor * gdk/gdk.c gdk/gdk.h (gdk_event_get_time): New function to get the timestamp from a generic event. Fri Oct 9 13:16:04 1998 Owen Taylor * gtk/gtkwidget.c (gtk_widget_add_events): Added function that safely adds additional events to a widget's event mask, even if the widget has previously been realized. (We can do this, but not remove events from the event mask). Fri Oct 2 17:35:35 1998 Owen Taylor * gdk/gdkproperty.c (gdk_property_get): Allow type == 0, for AnyPropertyType. Fri Oct 2 10:32:21 1998 Owen Taylor * gdk/gdkproperty.c (gdk_atom_intern): Add client-local hashing. Thu Sep 24 20:33:54 1998 Owen Taylor * gdk/gdk.c (gdk_event_send_clientmessage_toall): serial isn't a timestamp. Thu Sep 17 14:23:03 1998 Owen Taylor * gdk/gdk.c (gdk_event_translate): Removed printing of unknown window lookup warnings. (Made it a GDK_NOTE) - they happen in many circumstances. Tue Sep 8 12:38:43 1998 Owen Taylor * Call XFilterEvent() on events we get for unknown windows, since it may be the window Xlib uses to communicate with the IM. (From Yung-Ching Hsiao ) Tue Sep 1 10:53:52 1998 Owen Taylor * gtk/gtkprogress.c (gtk_progress_finalize): Unref the adjustment. Thu Aug 27 12:03:14 1998 Owen Taylor * gtk/gtksignal.c (gtk_signal_newv): Improve warning message for return_value + GTK_RUN_FIRST. 1998-10-18 Martin Baulig * gtk/gtktext.c (gtk_text_set_line_wrap): new function to toggle line wrapping like gtk_text_set_word_wrap () toggles word wrapping. Fri Oct 16 15:59:02 1998 Lars Hamann * gtk/testgtk.c (insert_row_clist) (create_clist): change a few cell styles of inserted row (change_style): change style of focus_row * gtk/gtkclist.c (gtk_clist_get_row_style) (gtk_clist_set_row_style) (gtk_clist_get_cell_style) (gtk_clist_set_cell_style): new functions to set/get row/cell styles. (gtk_clist_realize): attach row and cell style, allocate row colors. (gtk_clist_unrealize): detach row and cell styles. (get_cell_style): new function. get correct cell style. (draw_cell_pixmap): new function. (draw_row): draw cells with row or cell styles. (row_new): set cell and row styles to NULL. (row_delete): detach & unref cell and row styles. * gtk/gtkctree.c (ctree_detach_styles) (ctree_attach_styles): new functions to attach/detach styles and allocate colors. (gtk_ctree_realize) (gtk_ctree_unrealize): attach/detach cell and row styles of invisible nodes. (draw_cell_pixmap): new function. (get_cell_style): new function. get correct cell style. (gtk_ctree_draw_expander): new function. draw tree expander. (gtk_ctree_draw_lines): new function.draw tree lines. (draw_row): draw cells with row or cell styles. (row_new): set cell and row styles to NULL. (row_delete): detach & unref cell and row styles. (gtk_ctree_node_get_row_style) (gtk_ctree_node_set_row_style) (gtk_ctree_node_get_cell_style) (gtk_ctree_node_set_cell_style): Analogons of GtkCList functions (gtk_ctree_set_spacing): new function. set spacing between tree expander and cell contents (gtk_ctree_set_expander_style): new function. set expander style of ctree. (ctree_is_hot_spot): few changes due to draw_row modifications. Wed 14 Oct 1998 10:17:13 +0200 Paolo Molaro * gtk/gtkcombo.c: try completion on MOD1-TAB. Handle case when the combo->list is empty. Mon Oct 12 07:51:34 1998 Tim Janik * gtk/gtksignal.c (gtk_signal_handlers_destroy): only unref those handlers that have not yet been disconnected (finally managed to trigger the gtk_signal_handler_unref() paranoid warning). Sat Oct 10 03:37:50 1998 Tim Janik * gtk/gtkwidget.c (gtk_widget_get_arg): fixed default value for x, y, width and height which is -1 and not -2. Sat Oct 10 00:50:53 PDT 1998 Manish Singh * HACKING * autogen.sh: we need libtool 1.2b now Sat Oct 10 03:37:50 1998 Tim Janik * gtk/gtktable.c (gtk_table_set_child_arg): take the left, right, top and bottom attach arguments as mandatory and readjust the table size and opposing edge accordingly if required. this way the order in which the arguments are set doesn't matter. Thu Oct 8 15:53:59 1998 Owen Taylor * gtk/gtktypeutils.c (gtk_type_class_init): Fixed warning message to print out parent class name correctly. Thu Oct 8 07:07:10 1998 Tim Janik * gtk/gtkobject.h: * gtk/gtkobject.c: removed functions gtk_object_set_data_destroy and gtk_object_set_data_destroy_by_id. added functions gtk_object_remove_no_notify and gtk_object_remove_no_notify_by_id which will remove a certain data portion without invokation of its destroy notifier, this should only be used in very controled circumstances. Wed Oct 7 23:59:37 1998 Lars Hamann * gtk/gtkclist.c (gtk_clist_set_column_resizeable): added size_allocate_title_buttons call (gtk_clist_realize): changed initial column.window position Wed Oct 7 20:27:28 1998 Lars Hamann * gtk/gtkctree.h (struct _GtkCTree): removed xor_gc, use clists xor_gc instead * gtk/gtkctree.c (create_xor_gc): removed (gtk_ctree_button_press): set correct line_attributes for clist->xor_gc on drag start (gtk_ctree_button_release): reset clist->xor_gc Wed Oct 7 05:15:36 1998 Tim Janik * gtk/gtk*.h: * gdk/gdk.h: removed all occourances of #pragma } and #pragma { which were in place to fixup emacs' cc-mode indentation. putting (c-set-offset 'inextern-lang 0) into ~/.emacs is the proper way to achive this and doesn't produce problems for stupid pragma-related compiler bugs. ;) Wed Oct 7 00:59:46 1998 Lars Hamann * gtk/gtkclist.h: new signal GtkCList::resize_column. * gtk/gtkclist.c (draw_row): don't draw invisible columns (size_allocate_title_buttons) (size_allocate_columns): skip invisible columns (new_column_width): take min/max_width into account (gtk_clist_button_release) (gtk_clist_motion): changes due to changed new_column_width function (LIST_WIDTH): changed define to inline function. (real_resize_column): class function for resize_column signal (gtk_clist_motion): fixed autoscrolling for column resizes (gtk_clist_set_column_visibility): don't hide last visible column, changed visible arg to gboolean (gtk_clist_set_column_min_width)(gtk_clist_set_column_max_width): new functions : set min/max width of a column (gtk_clist_set_column_resizeable): new function : enable/disable column resize operations by mouse * gtk/gtkctree.c (draw_row): don't draw invisible columns (ctree_is_hot_spot): return FALSE if tree_column is invisible (draw_xor_line) (draw_xor_rect): draw full rectangle/line if tree_column is invisible (gtk_ctree_find_all_by_row_data) (gtk_ctree_find_all_by_row_data_custom): new function from Ronan Bourlier . Returns a GList of all GtkCTreeNodes with row->data == data. Tue Oct 6 14:05:00 1998 Tim Janik * gtk/testgtk.c (cb_tree_destroy_event): use g_free to free g_malloced memory (Martin Pool ). Mon Oct 5 15:26:30 1998 Raph Levien * gdk/gdkrgb.c (gdk_rgb_convert_0888_br): Fixed a few long's that should have been guint32. Thanks to Tristan Colgate for finding it. Sun Oct 4 22:47:22 CDT 1998 Shawn T. Amundson * gtk/gtkcalendar.h: gtk/gtkcalendar.c: More changes: - The day with focus is now seperated from the day selected - The day with focus has the xor's line around it - The selected day is now standard selected style - The week names and week numbers are now also drawn with selected style - Space now selects the day which has focus Sun Oct 4 17:55:52 CDT 1998 Shawn T. Amundson * gtk/gtkcalendar.h: gtk/gtkcalendar.c: Some significant changes, including: - No longer draw focus around entire widget, only around the day which has focus - Draw relief around entire widget like originally planned - Show header and day names by default - Move data private to the widget out of GtkCalendar struct and only point to it with a gpointer - Remove some old unused variables from GtkCalendar struct Sun Oct 4 17:45:43 BST 1998 Tony Gale * docs/gtk_tut.sgml: update I've had sat around: - Grammar patch from James R. Van Zandt - Range Widget update from David Huggins-Daines - New Toolbar section from Jacek Wojdel 1998-10-01 Martin Baulig * gtk/gtkclist.h (GtkCListColumn): Added `visible'. * gtk/gtkclist.c (gtk_clist_set_column_visibility): New function. Makes it possible to individually show and hide columns. (size_allocate_columns): Adapted to keep track of hidden columns. (size_allocate_title_buttons): Likewise. Sat Oct 3 17:54:48 1998 Tim Janik * gtk/gtkargcollector.c (GTK_ARG_COLLECT_VALUE): for unknown foreign fundamental types, collect an argument of the type returned from gtk_type_get_varargs_type(). removed the first macro argument which was just the same as the fundamental type of the *arg passed to the macro. * gtk/gtkarg.c (gtk_args_collect): * gtk/gtksignal.c (gtk_signal_collect_params): changed callers. * gtk/gtktypeutils.h: * gtk/gtktypeutils.c: new functions gtk_type_set_varargs_type() and gtk_type_get_varargs_type() to set and query the varargs collect type used for a fundamental type, registered outside of Gtk. * gtk/gtkmisc.c (gtk_misc_class_init): changed object arguments GtkMisc::xalign and GtkMisc::yalign from GTK_TYPE_DOUBLE to GTK_TYPE_FLOAT. * gtk/gtkframe.c (gtk_frame_class_init): changed object arguments GtkFrame::label_xalign and GtkFrame::label_yalign from GTK_TYPE_DOUBLE to GTK_TYPE_FLOAT. Sat Oct 3 01:25:24 1998 Lars Hamann * gtk/gtkctree.c (gtk_ctree_insert_gnode) (real_tree_collapse) (gtk_ctree_link) (gtk_ctree_unlink) (real_tree_expand): fixes for assignment errors with GTK_CTREE_NODE_NEXT/PREV (real_tree_expand) (real_tree_collapse): don't expand/collapse a leaf Fri Oct 2 16:10:36 1998 Tim Janik * gtk/gtktypeutils.c (gtk_type_enum_find_value): make sure we don't segfault when looking up a non-existant value name (reported by Pablo ). Thu Oct 1 10:40:20 1998 Tim Janik * gtk/gtkclist.h (gtk_clist_prepend): * gtk/gtkclist.c (gtk_clist_prepend): new function. (gtk_clist_insert): added g_return_val_if_fail() statements. accept a row parameter < 0 or > clist->rows to indicate append mode. (real_clear): first clean up all internal pointers and lists (e.g. clist->row_list or clist->rows), then delete the distinct rows. this is required because of destroy notifiers, we need to have all internal structures updated and be reentrant. * gtk/gtkcalendar.h: * gtk/gtkcalendar.c: removed the `gtk_calendar_' prefix from the GtkCalendarClass signal methods. GtkType and macro fixups, put `void' into () prototypes, avoid C++ style comments, indentation fixes, fixed some g_return_if_fail() statements. (gtk_calendar_paint_header): (gtk_calendar_paint_day_names): (gtk_calendar_paint_week_numbers): (gtk_calendar_paint_main): made these static functions. (gtk_calendar_select_month): (gtk_calendar_select_day): (gtk_calendar_mark_day): (gtk_calendar_unmark_day): (gtk_calendar_get_date): signedness corrections, use guints rather than gints. (gtk_calendar_size_request): removed unused variables. Wed Sep 30 13:11:09 1998 Tim Janik * gtk/gtkitemfactory.c (gtk_item_factory_add_item): list all widgets in the ->widgets_by_action list that have a callback defined (not only those with a callback_action!=0). Sun Sep 27 22:02:48 CDT 1998 Shawn T. Amundson * gtk/gtkcalendar.h: gtk/gtkcalendar.c: examples/calendar/gcalendar.c: remove HAVE_FEATURES stuff Sun Sep 27 02:18:06 CDT 1998 Shawn T. Amundson * gtk/gtkcalendar.h: gtk/gtkcalendar.c: examples/calendar: Added gtkcalendar widget and demo Sat Sep 26 06:15:34 1998 Tim Janik * gtk/gtkclist.c (gtk_clist_sort): (gtk_clist_clear): (gtk_clist_unselect_all): (gtk_clist_select_all): adde g_return_if_fail() statements. Sat Sep 26 04:46:22 1998 Tim Janik * configure.in: set binary age and interface age to 0. * gtk/gtkspinbutton.h: * gtk/gtkspinbutton.c: changed gtk_spin_button_construct to gtk_spin_button_configure. gtk_spin_button_construct is still defined as an alias for gtk_spin_button_configure for source compatibility, but actuall use is deprecated. typeness corrections, i.e. gint->gboolean and gint->guint. added object arguments: GtkSpinButton::value, GtkSpinButton::wrap, GtkSpinButton::shadow_type, GtkSpinButton::update_policy, GtkSpinButton::numeric, GtkSpinButton::snap_to_ticks, GtkSpinButton::adjustment, GtkSpinButton::digits and GtkSpinButton::climb_rate. GtkType and macro fixups. Sat Sep 25 23:33:55 1998 Tim Janik * gdk/gdkwindow.c (gdk_window_get_root_origin): new function to get the *real* geometry position of a window, taken possible window manager offsets into account. this has been succesfully tested with fvwm, fvwm-2, bowman, olwm, olvwm, twm, ctwm, mlvwm, windowmaker and enlightenment. it does fail though for amiwm which adds windows to a pseudo root window, and for icewm by a small offset because it defines the geometry position whithin its border. * gtk/testgtk.c: added "saved position" test to figure how gdk_window_get_root_origin() interacts with window managers (repopup this window to figure ;). Wed Sep 23 06:09:19 1998 Tim Janik * configure.in: update to Gtk+ version 1.1.3, binary age 1, interface age 1. * gtk/gtkobject.c (gtk_object_ref): (gtk_object_unref): check for ->ref_count to be greater than 0 (the existing code was buggy in letting ->ref_count==0 pass through and then failing the living_objs_ht assertion). * gtk/gtkclist.c (draw_row): fix chopping bug for right justified pixtext fields (Roman Pozlevich ). Mon Sep 21 23:53:18 CDT 1998 Shawn T. Amundson * Released GTK+ 1.1.2 Mon Sep 21 01:12:44 1998 Jay Cox (jaycox@earthlink.net) * gtk/Makefile.am: use $(PERL) instead of perl * gtk/gtkcolorsel.c: render properly in non-square aspect ratios. also much faster to render. Mon Sep 21 07:44:30 1998 Tim Janik * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate the required memory block, rather than allocating it newly from scratch and doing a full-blown block copy on it. Mon Sep 21 02:30:06 1998 Tim Janik * NEWS file update for upcoming release of Gtk+ version 1.1.2, binary age 0, interface age 0. * gtk/gtkmain.c (gtk_init): enforce gtk-modules to always be resident. Sun Sep 20 18:21:46 1998 Owen Taylor * ltmain.sh: Patch to libtool-1.2b to make --disable-static work. Sun Sep 20 09:52:39 1998 Owen Taylor * HACKING: indent other than GNU indent should be OK now. * gtk/genmarshal.pl gtk/Makefile.am: Call indent on file instead of piping through indent. If indent wasn't found in ./configure don't bother indenting at all. Fri Sep 18 19:11:10 1998 Owen Taylor * gdk/gdk.h: Add names to prototype for gdk_image_new_bitmap. Fri Sep 18 18:54:59 1998 Jay Cox (jaycox@earthlink.net) * gtk/Makefile.am: use $(AWK) instead of awk 1998-09-18 Raja R Harinath * gtk/Makefile.am (gdk_headers): Remove references to $(top_srcdir). (gtk.defs, gtktypebuiltins{.h,_vars.c,_ids.c,_evals.c}): Simplify. * gtk/makeenums.pl (parse_entries): Don't look for $srcdir. Fri Sep 18 19:58:24 1998 Tim Janik * gtk/gtkobject.h (struct _GtkObject): changed gpointer object_data; to GData*object_data to cure compiler warnings. Thu Sep 17 19:06:47 PDT 1998 Manish Singh * install-sh * missing * mkinstalldirs: updated to latest automake version 1998-09-17 Raja R Harinath * gtk/Makefile.am (source_headers): Move `gtkfeature.h' ... (gtkinclude_HEADERS): ... here. (gtk.defs): Pass `g' flag to sed, to replace all occurances. Thu Sep 17 10:49:51 1998 Raph Levien * HACKING: added GNU indent, as it is now required to successfully build gtk+. Should this be detected in autoconf, possibly? Tue Sep 15 14:57:30 1998 Owen Taylor * Makefile.am gtk-config.in l*: Update to libtool-1.2b, change library versioning scheme to drop LT_RELEASE from the -l line, while keeping it in the soname. Tue Sep 15 14:10:33 1998 Owen Taylor * configure.in Makefile.in: define a MAINT-like variable REBUILD which is set if Perl and awk are found, and autogenerated sources can be rebuilt. Remove the auto-generated sources from CVS. Add dependencies so that the autogenerated sources are rebuilt if the files they depend on change. (This unfortunately currently results in the entire gtk/ directory being rebuilt when any header changes. Moving all enums to gtkenums.h would fix this.) Thu Sep 17 05:12:48 1998 Tim Janik * gtk/gtkobject.h: added gtk_object_set_data_destroy and gtk_object_set_data_destroy_by_id functions to set the destroy function pointer for an existing data portion. * gtk/gtkobject.c: removed the GtkObjectData implementation and made all gtk_object_*data* functions use the GLib equivalents. 1998-09-16 Federico Mena Quintero * gtk/gtktoolbar.c (gtk_toolbar_insert_element): Test whether type is not equal to GTK_TOOLBAR_CHILD_RADIOBUTTON before checking that (widget != NULL), otherwise radio button insertion will not work -- the widget argument is NULL for the first radio button in the group. Tue Sep 15 13:09:24 1998 Owen Taylor * gdk/gdkimage.c (gdk_image_new): Reverted global changes of g_new to malloc(), added back in the one place where it actually mattered. #include . * gdk/gdkrgb.c: g_malloc() to malloc() as above. Tue Sep 15 11:30:03 1998 Owen Taylor * gtk/gtkfilesel.c: Keep a list of directories in which we never want to stat the entries (like /afs), and assume everything in those directories is a subdirectory. - When following a path, try to open components even when we don't find them in their parent's directory to support automounters. Tue Sep 15 11:06:13 1998 Owen Taylor * gtk/gtkwindow.c (gtk_window_move_resize): Don't request a new size from the WM if we asked for the same size before and our request was rejected. * gtk/gtkwindow.c (gtk_window_configure_event): If in response to a request, we get a configure event with unchanged dimensions, send a synthetic expose since ForgetGravity won't expose our window. Mon Sep 14 14:28:24 1998 Owen Taylor * gtk/gtktext.c (adjust_adj): Change the way we set the adjustments on resize so that it tries to keep the beginning of the text in approximately the same place. Removed assertion that the above change made invalid. Thu Sep 10 22:19:35 1998 Owen Taylor * gtk/gtktext.c: - Save first_cut_pixels when switching sizes, so that if we switch to the _same_ size, we don't move lines around. - Make sure that the text area always has a size of at least 1x1, then do all computations when realized. - When fetching lines in recompute_geometry, make sure we fetch enough lines to cover the screen. Mon Sep 14 21:47:35 CDT 1998 Shawn T. Amundson * gdk/gdkimage.c: changed g_new()s to malloc()s and g_free()s to free()s to avoid mixing g_new()s with free()s. X itself uses free() on some of the malloced memory. Sat Sep 12 10:44:06 1998 Owen Taylor * gtkfilesel.c: Maintain a list of directories like /afs we know contain only directories, and avoid stat'ing files in those directories. (Because stat'ing all files in /afs is extremely expensive) To support automounters, try to open directories, even if we couldn't find them when reading their parent directory. Thu Sep 3 10:29:03 1998 Owen Taylor * gtk.m4: Conditionalize check for GTK_MAJOR_VERSION, to allow the same gtk.m4 to work for 1.0.x and 1.1.x. Fri Sep 11 15:25:10 1998 Lars Hamann * gtk/gtkclist.c (gtk_clist_set_selectable): new function to set/unset the selectable flag of a single row. (gtk_clist_get_selectable): new function to get the state of the selectable flag * gtk/gtkctree.c (gtk_ctree_node_set_selectable) (gtk_ctree_node_get_selectable): clist analogons Thu Sep 10 17:04:03 1998 Raph Levien * gtk/testrgb.c (testrgb_rgb_test): Small changes to the test pattern. * gdk/gdkrgb.c (gdk_rgb_convert_gray4_pack): Fixed some alignment bugs in the 4bit gray cases. Wed Sep 9 02:48:44 PDT 1998 Manish Singh * configure.in: added -posix check for NeXTStep * gtk/testthreads.c: applied part of gtk-joke-980907-0 to use a unique buffer for each thread. * docs/gtk-config.1: clarified copyright Tue Sep 8 05:19:51 1998 Tim Janik * gdk/gdk.c (gdk_init): use g_atexit() instead of ATEXIT. * gtk/gtkmain.c (gtk_init): use g_atexit() instead of ATEXIT. * gtk/gtkobject.c (gtk_object_init_type): use g_atexit() instead of ATEXIT. * ltconfig: use GLib's ltconfig which honours lcc. Mon Sep 7 20:09:23 PDT 1998 Manish Singh * configure.in: comment the -std1 check and save LIBS properly Sun Sep 6 12:36:23 PDT 1998 Manish Singh * gtk/testrgb.c: #include Sat Sep 5 16:01:19 1998 Owen Taylor * gdk/gdkinputxfree.h gdk/gdk.c gdk/gdkinputgxi.h: When the pointer is grabbed on an input window, either explicitely, or through press-grab, and then grabbed on a non-input window, ungrab the devices. Sat Sep 5 07:13:19 1998 Tim Janik * gtk/gtktypeutils.h: don't include any gdk headers. added structure definitions for GtkTypeObject and GtkTypeClass, which cover the very basic fields of GtkObject and GtkObjectClass, which are actually used by the type system. * gtk/gtktypeutils.c: don't include gtkobject.h or gtkcontainer.h, we only refer to our own structures. improved class inheritance sanity checking a bit. * gtk/gtkobject.h: placed appropriate comments at the beginnings of the GtkObject and GtkObjectClass structures, which explain their relationship to GtkTypeObject and GtkTypeClass. * gtk/gtktypeutils.h: * gtk/gtkobject.h: moved GTK_STRUCT_OFFSET(), GTK_CHECK_CAST(), GTK_CHECK_CLASS_CAST(), GTK_CHECK_TYPE() and GTK_CHECK_CLASS_TYPE() macro definitions from gtkobject.h to gtktypeutils.h. * gtk/gtkobject.h: * gtk/gtkobject.c: removed gtk_object_check_cast() and gtk_object_check_class_cast() functions. to keep source compatibility, we can provide macro aliases for the corresponding gtk_type_* functions. but then again, people shouldn't have been using these functions anyways since they were part of Gtk's internal API. * gtk/gtktypeutils.h: * gtk/gtktypeutils.c: implemented gtk_type_check_object_cast() and gtk_type_check_class_cast() functions to check GtkTypeObject and GtkTypeClass types. Thu Sep 3 07:16:54 1998 Tim Janik * gtk/gtkctree.h: * gtk/gtkctree.c: `const' fixups. * gtk/gtkclist.h: * gtk/gtkclist.c: `const' fixups and some coding style adaptions. * gtk/gtkctree.c (gtk_ctree_insert_node): don't dereference *text if it is passed as NULL. Wed Sep 2 22:41:40 1998 Raph Levien * gdk/gdkrgb.c (gdk_rgb_select_conv): Fixed 32bpp image depth big-endian cases. Added a 4bpp packed gray mode (somewhat incorrectly hardwired to MSB), which should take care of Stric's hardware. Thu Sep 3 04:45:57 1998 Tim Janik * gtk/gtkaccelgroup.c (gtk_accel_group_add): plug another small GtkSIgnalQuery leak. Thu Sep 3 04:22:20 1998 Tim Janik * gtk/gtkmenushell.c (gtk_real_menu_shell_move_current): GTK_MENU_DIR_CHILD: check for the existance of menu_shell->active_menu_item before accessing its child. GTK_MENU_DIR_PREV: GTK_MENU_DIR_NEXT: if we haven't had an active item and still don't, make a default selection. Wed Sep 2 00:28:58 1998 Tim Janik * gtk/gtkwidget.c (gtk_widget_propagate_state): iterate the children with _forall for sensitivity changes and with _foreach on pure state changes. this fixes a lot of the old inclusions of internal widgets into _foreach calls. * gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall do the work. don't walk the subtrees of first level children. * gtk/gtktreeitem.c: provide a _forall implementation, which walks the subtrees as well for include_internals. * gtk/gtkmenuitem.c: provide a _forall implementation, which walks the submenus as well for include_internals. * gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and implemented gtk_scrolled_window_forall, which will iterate over the viewport and the scrollbars for gtk_container_forall or iterate over the viewports children for gtk_container_foreach. * gtk/gtktoolbar.c: * gtk/gtktable.c: * gtk/gtkpaned.c: * gtk/gtkpacker.c: * gtk/gtkmenushell.c: * gtk/gtklist.c: * gtk/gtkfixed.c: * gtk/gtkclist.c: * gtk/gtkbox.c: * gtk/gtkbin.c: * gtk/gtknotebook.c: removed the old gtk_*_foreach functions and provided gtk_*_forall. * gtk/gtknotebook.c: (gtk_notebook_real_switch_page): expose tabs. (gtk_notebook_page_num): new function to return the page number of a distinct child. (gtk_notebook_focus): minor fixups. foxus handling is still screwed under some circumstances. * gtk/gtktreeitem.c: (gtk_real_tree_item_select): (gtk_real_tree_item_deselect): major fixes. some general fixups wrt queue_redraw, and tree items not being NO_WINDOW widgets. * gtk/gtklistitem.c: (gtk_real_list_item_select): (gtk_real_list_item_deselect): (gtk_real_list_item_toggle): removed unneccessary queue_redraw calls. Wed Aug 30 09:42:07 1998 Tim Janik * gtk/gtkoptionmenu.c: allow optionmenus to have the focus and automatically popup the menu on space bar. Wed Aug 26 06:40:34 1998 Tim Janik * gtk/gtkcontainer.h: * gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class method), which acts similar to gtk_container_foreach(), but iterates over internal children. the GtkContainer::foreach signal vanished in favour of a new class method ->forall() that optionally includes internal widgets. * gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation but a _forall implementation, since all child widgets we have are internal ones. (column_button_create): set the parent window prior to gtk_widget_set_parent(). * gtk/gtkwidget.c: exchanged all calls to gtk_container_foreach() with gtk_container_forall(). * gtk/gtkwidget.h: * gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through the GtkWidget::composite_child argument. to have a widget created with the flag initially, two new functions got added to wrap a widgets creation: gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag(). Wed Aug 25 23:37:39 1998 Tim Janik * gtk/gtktooltips.h: * gtk/gtktooltips.c: exported gtk_tooltips_create_window() as gtk_tooltips_force_window(), so tooltips->tip_window can be accessed prior to the first tip being set. don't put an extra reference on the window, since it is a toplevel, it wont get destroyed from anywhere else. * overall macro and GtkType fixups. 1998-09-02 Federico Mena Quintero * gtk/gtkcolorsel.c: Replaced "foo == TRUE" and "foo == FALSE" constructs by more forgiving ones. (Does anyone else feel like the color selector need rewriting?). Tue Sep 1 10:53:52 1998 Owen Taylor * gtk/gtkprogress.c (gtk_progress_finalize): Unref the adjustment. * gtk/gtkmenu.c: Modified reference counting so that the reference count from the toplevel that the menu creates to the menu is invisible to the application. Mon Aug 31 21:36:31 1998 Raph Levien * gdk/gdkrgb.c (gdk_rgb_select_conv): Improved the 24bpp conversion selection logic, so Suns and other big-endian machines should get faster conv routines. This is also the point where 4bpp gray and 1bpp are checked in, although I wouldn't be surprised if 1bpp is a little buggy. This is synchronized with the 0.0.7 release of GdkRgb. * gtk/Makefile.am: * gtk/testrgb.c: Checked in testrgb.c to CVS, and made the appropriate change to the Makefile.am Mon Aug 31 15:18:19 1998 Raph Levien * gdk/gdkrgb.[ch]: Added a gdk_draw_rgb_image_dithalign function, which is good for images that scroll (makes the dither patterns align correctly) Sat Aug 29 14:50:56 PDT 1998 Manish Singh * gdk/gdkcolor.c: (gdk_colormap_new) (gdk_colormap_get_system): quell some warnings with g_hash_table_new * gtk/gtkaccelgroup.c (gtk_accel_group_add): free the GtkSignalQuery when we're done with it * gtk/itemfactory.c: (gtk_item_factory_from_path): (gtk_item_factory_create_item): free some strings * gtk/gtklabel.c: (gtk_label_finalize): free label->pattern when done (gtk_label_parse_uline): null terminate pattern string, delete some duplicated code * gtk/testthreads.c: add #include for sleep() Tue Aug 25 16:52:47 1998 Owen Taylor * gtk/gtktext.c (recompute_geometry): Make sure the mark we pass to line start is the beginning of a real line, not a wrapped one. Mon Aug 24 18:37:15 1998 Owen Taylor * gtk/gtktext.c: Reference count the fonts used in the text widget. * gdk/gdk.h gdk/gdkcolor.c: Rename the color allocation freeing functions to be more consistent, and more convenient; leave the old names in for backwards compatibility. * gdk/gdkcolor.c gdk/gdkprivate.h: Reference count the allocations in pseudo-color colormaps to greatly reduce calls to XAllocColor. Keep a per-colormap hashtable to speed up finding if there is an already-allocated matching color. * gdk/gdkcolor.c: Don't just match read the system colormap when the colormap is created, but synchronize our copy with the system colormap periodically. * gdk/gdk.c gdk/gdktypes.h gtk/gtkentry.c gtk/gtktext.c: Change XIM constants names to match GDK conventions * gtk/testinput.c: Allow the drawing area to get the focus. * gtk/testgtk.c: Change around the Text test to demonstrates multiple fonts, use more colors. * gtk/gtkwidget.c: Improve gtk_widget_get_colormap()/visual() so they work after a widget is unrealized. * gtk/gtktext.[ch]: Remove the requirement that the text widget be realized before adding text (!) Allocate colors ourself, instead of requiring the caller allocate them. Allow changing styles to work properly by keeping track of the values for a certain property are default or set explicitely. * gtk/gtkmenu.h: Added some comments. * gtk/gtkentry.c: Changes to match XIM constants. * gtk/gdk.h gdk/gdkwindow.c: Add gdk_drawable_set_data(), for adding keyed data to drawables. (Uses g_dataset internally) * gdk/gdkpixmap.c: Keep track of the colors we allocate, when creating an XPM - store them as user data for the GdkPixmap, so we don't leak colors when we create pixmaps from XPM's. Allocate memory for color information in large blocks instead of as many little pieces. Mon Aug 24 11:09:32 PDT 1998 Manish Singh * gdk/gdkrgb.c: removed some unused variables * gtk/gtkclist.c * gtk/gtkmain.c: #if 0'd out some unused code * gtk/gtkobject.c: check for NULL object hash table in gtk_object_debug Mon Aug 24 02:36:53 1998 Tim Janik * gtk/gtkarg.h: * gtk/gtkarg.c: * gtk/gtkwidget.h: * gtk/gtkwidget.c: * gtk/gtkobject.h: * gtk/gtkobject.c: * gtk/gtkcontainer.h: * gtk/gtkcontainer.c: (gtk_object_new): (gtk_object_set): (gtk_widget_new): (gtk_widget_set): (gtk_container_add_with_args): (gtk_container_child_set): begin the parameter elipsis (...) after the first argument name. this change is source compatible, since it was always required, even as NULL. (gtk_args_collect): (gtk_object_args_collect): (gtk_container_child_args_collect): changed prototypes to pass first_arg_name, also, pass va_list variable by value (portability concerns). callers changed. * gtk/gtkargcollector.c: implemented gtk_arg_collect_value() as a huge macro GTK_ARG_COLLECT_VALUE() . this is needed because we can't pass va_list variables by reference for portability reasons. Fri Aug 21 22:40:00 Raph Levien * gdk/gdkrgb.c: added calls to gdk_rgb_init in the get_cmap and get_visual calls, so that it gets implicitly initialized. Fri Aug 21 13:06:04 1998 Stuart Parmenter * gtk/gtkfeatures.h.in: added GTK_HAVE_FEATURES_1_1_2 for changes such as GtkCTree function name changes Fri Aug 21 02:31:26 1998 Tim Janik * gtk/gtkmain.h: * gtk/gtkmain.c (gtk_check_version): added a function to perform a binary version check, returning a static string for error descriptions, or NULL on success. Thu Aug 20 20:08:15 1998 Owen Taylor * gtk/gtktext.c ([un]draw_cursor): Check to see if we've computed our geometry yet, and if not, ignore the request. * gtk/gtktext.c (correct_cache_insert): Fiddled around some more. All the bug-test codes seem to work at once now. (fingers crossed...) Thu Aug 20 13:04:08 PDT 1998 Manish Singh * gdk/gdkrgb.c: silly visual fixes * gtk/testgtk.c: call gdk_rgb_init so color preview test actually works 1998-08-20 Federico Mena Quintero * gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Do not do anything if the event's window is not the bin window. (gtk_handle_box_motion): Likewise. 1998-08-19 Raph Levien * gtk/testgtk.c (create_color_preview): pushed the colormap and visual so it would work better with GdkRgb. 1998-08-19 Raph Levien * gdk/gdkrgb.c: fixed some bugs in the 565_d mode, and added a 4bpp static_color mode (for vga displays). Also fixed a '64' value in the dither matrix, which was causing one pixel out of 16k to be dithered wrong. * gtk/gtkpreview.{c,h}: Changed it to work with GdkRgb, gutting most of the contents. This is an API change - any apps that relied on the internal structure of GtkPreview will need some change - most notably in the use of reserved colors. The Gimp needed changes in this regard. Wed Aug 19 00:11:14 1998 Tim Janik * gtk/gtkmain.c (gtk_init): allow argument parsing in gtk without G_ENABLE_DEBUG being defined (specifically --gtk-module= and --g-fatal-warnings), noticed by miguel. Tue Aug 18 17:54:40 1998 Tim Janik * gtk/gtkrc.c (gtk_rc_parse_file): use g_get_current_dir() instead of getcwd(). * gdk/gdkprivate.h: * gdk/gdkglobals.c: * gdk/gdkwindow.c: * gdk/gdk.c: * gtk/gtkwindow.c: * gtk/gtkitemfactory.c: dropped gdk_progname, use g_get_prgname()/g_set_prgname() instead. * gtk/gtkselection.c: * gtk/gtkpreview.c: * gtk/gtkobject.c: * gtk/gtkmain.c: * gtk/gtktypeutils.c: indentation fixes due to g_message() use. * gdk/gdkrgb.c: exchanged occourances of g_print with g_message. Tue Aug 18 17:22:22 1998 Lars Hamann * gtk/gtknotebook.c (gtk_notebook_switch_focus_tab): * gtk/gtknotebook.c (gtk_notebook_update_labels): fix for sigsegv in case of show_tabs == NULL Tue Aug 18 03:54:43 1998 Tim Janik * gtk/gtkmain.c (gtk_init): restricted the --g*fatal-* arguments to --g-fatal-warnings again. this option now causes log levels of WARNING and CRITICAL to abort(). * gdk/gdk.c: * gdk/gdkdnd.c: * gdk/gdkcc.c: * gdk/gdkfont.c: * gdk/gdkwindow.c: * gdk/gdkvisual.c: * gtk/gtkwidget.c: * gtk/gtktypeutils.c: * gtk/gtktree.c: * gtk/gtkfontsel.c: * gtk/gtkmain.c: * gtk/gtkobject.c: * gtk/gtkpreview.c: * gtk/gtkselection.c: * gtk/gtktext.c: * gtk/gtktree.c: * gtk/gtktreeitem.c: did a global search&replace to substitute g_print() calls with g_message(). libraries shouldn't use printf(), g_print() or g_printerr() at all. a bunch of the replacements should probably be wrapped into the G{D|T}K_NOTE() macros, so they are special cased for debugging purposes in a sane way, avoiding all the nasty #ifdef DEBUG_MY_TEDDY things. * gdk/gdkdnd.c: added copyright notice. Mon Aug 17 17:28:00 Raph Levien * gdk/gdkrgb.c: Further speedups of the 565_d case. It's impressively fast now - about 4.65 Mpix/s on an IBM TP 600 running a PII 233. It's synced with the 0.0.5 release of GdkRgb. Tue Aug 18 00:29:13 1998 Lars Hamann * gtk/gtkclist.h: (struct _GtkCListClass): new class methods: (sort_list) (insert_row) (remove_row) (set_cell_contents) * gtk/gtkclist.c : (cell_empty) (cell_set_text) (cell_set_pixmap) (cell_set_pixtext): removed and replaced by (set_cell_contents) (set_cell_contents): function for class method set_cell_contents (real_insert_row): function for class method insert_row (real_remoce_row): function for class method remove_row (real_sort_list): function for class method sort_list (default_compare): fix to avoid problems with cell types != CELL_TEXT * gtk/gtkctree.h : (gtk_ctree_export_to_gnode): new function to export a ctree as gnode (gtk_ctree_node_is_visible): new function to return visibility state of a node (gtk_ctree_show_stub): new function to set visibility of root stub renamed functions : (gtk_ctree_insert) -> (gtk_ctree_insert_node) (gtk_ctree_remove) -> (gtk_ctree_remove_node) (gtk_ctree_find_glist_ptr) -> (gtk_ctree_find_node_ptr) (gtk_ctree_set_text) -> (gtk_ctree_node_set_text) (gtk_ctree_set_pixmap) -> (gtk_ctree_node_set_pixmap) (gtk_ctree_set_pixtext) -> (gtk_ctree_node_set_pixtext) (gtk_ctree_set_shift) -> (gtk_ctree_node_set_shift) (gtk_ctree_get_cell_type) -> (gtk_ctree_node_get_cell_type) (gtk_ctree_get_text) -> (gtk_ctree_node_get_text) (gtk_ctree_get_pixmap) -> (gtk_ctree_node_get_pixmap) (gtk_ctree_get_pixtext) -> (gtk_ctree_node_get_pixtext) (gtk_ctree_set_foreground) -> (gtk_ctree_node_set_foreground) (gtk_ctree_set_background) -> (gtk_ctree_node_set_background) (gtk_ctree_set_row_data) -> (gtk_ctree_node_set_row_data) (gtk_ctree_set_row_data_full) -> (gtk_ctree_node_set_row_data_full) (gtk_ctree_get_row_data) -> (gtk_ctree_node_get_row_data) (gtk_ctree_moveto) -> (gtk_ctree_node_moveto) (gtk_ctree_sort) -> (gtk_ctree_sort_node) (gtk_ctree_is_visibe) -> (gtk_ctree_is_viewable) * gtk/gtkctree.c : (cell_empty) (cell_set_text) (cell_set_pixmap) (cell_set_pixtext): removed and replaced by (set_cell_contents) (set_cell_contents): function for class method set_cell_contents (real_insert_row): function for class method insert_row (real_remoce_row): function for class method remove_row (real_sort_list): function for class method sort_list (default_compare): removed. CTree now also compares two GtkCTreeRows instead of two GtkCTreeNodes. (gtk_ctree_unlink): call gtk_ctree_collapse if parent is empty after unlinking the node (real_tree_expand) (real_tree_collapse): fix for refcounting of node pixmaps (set_node_info): call gtk_ctree_node_set_pixtext instead of manipulating the row itself * gtk/testgtk.c: use renamed functions of GtkCTree. new sample to show gtk_ctree_export_to_gnode and gtk_ctree_insert_gnode at work. Mon Aug 17 15:31:38 1998 Tim Janik * gtk/gtkmain.c: removed gtk_input_add_interp. * gtk/gtkeditable.c (gtk_editable_set_position): fixed bogus "return" keyword. (gtk_editable_get_event_time): fix default: case. * gtk/gtkclist.c (gtk_clist_swap_rows): fixes for lvalue casts. * gdk/gdkpixmap.c: made a bunch of unexported functions static. * gdk/gdkcolor.c: * gdk/gdkvisual.c: include "gdkx.h", since it exports prototypes of our functions. * various minor compilation cleanups, such as bogus commas in enums and similar things. Mon Aug 17 07:47:43 1998 Tim Janik * gtk/gtkmain.c (gtk_init): NULL terminate the arg list to g_strconcat() (thanx raph). Sun Aug 16 23:14:20 CDT 1998 Shawn T. Amundson * NEWS: updated for 1.1.2 * gtk+.spec: version = 1.1.2 Mon Aug 17 05:10:29 1998 Tim Janik * gtk/gtkmain.c (gtk_init): don't call module initializers multiple times. changed --gtk-with-module to --gtk-module at owen's request. Mon Aug 17 03:47:55 1998 Tim Janik * gtk/gtkmain.c (gtk_init): feature a new commandline option --gtk-with-module= that allows additional loading and initialization of modules (e.g. GLE). Mon Aug 17 01:40:00 1998 Tim Janik * configure.in: version bump to 1.1.2, binary age 0, interface age 0. pass "gmodule" to AM_PATH_GLIB, with that we require libgmodule.so now. * gtk/gtkmain.c (gtk_init): since glib's g_return*_if_fail macros log with G_LOG_LEVEL_CRITICAL now, i added "--g-fatal-checks", "--gdk-fatal-checks" and "--gtk-fatal-checks". that makes up six different *-fatal-* arguments now. this needs to be revised and compressed to a reasonable amount of arguments. Sun Aug 16 20:51:59 1998 Tim Janik * gtk/gtkmain.c (gtk_init): fatal warning option is split up now, "--g-fatal-warnings" causes fatal warnings in GLib, "--gdk-fatal-warnings" causes fatal warnings in Gdk, "--gtk-fatal-warnings" causes fatal warnings in Gtk. * gtk/Makefile.am: define G_LOG_DOMAIN for gtk. * gdk/Makefile.am: define G_LOG_DOMAIN for gdk. * gtk/testgtk.c: * gdk/gxid.c: we need ugly #undef G_LOG_DOMAIN at the start of these files currently, since automake doesn't support per target _CFLAGS yet. * configure.in: require GLib 1.1.3. Sat Aug 15 03:19:30 1998 John Ellis * gtk/gtkctree.[ch] (gtk_ctree_set_drag_compare_func): New function to set a callback to test if a node in drag can be dropped onto it's currrent location. * gtk/gtkctree.c (set_mouse_cursor),(check_cursor): New functions to change the pointer when a drag destination is not allowed. Thu Aug 13 21:06:00 1998 Raph Levien * gdk/gdkrgb.c: committing a patch by Ray Lehtiniemi that speeds up the 565_d case by about 25% total. Thanks Ray! Thu Aug 13 16:47:44 1998 Owen Taylor * Changed GtkSignalFunc back to () from (void). (again!) * Added file README.cvs-commits Thu Aug 13 09:11:11 BST 1998 Tony Gale * docs/gtk_tut.sgml: - Tidy up of the menufactory example from Andy Kahn - New section on Range Widgets from David Huggins-Daines - Started a new section on 'Advanced Event and Signal Handling' - used an email from Owen. - New appendix on Gdk Event Types - Added the tictactoe full example code to the 'Code Examples' appendix Tue Jul 21 12:42:01 1998 Owen Taylor * gdk/gdk.h gdk/gdkfont.c: Added gdk_text/string_extents() - to calculate all the metrics at once of a string, including things which weren't calculated before. * gtk/Makefile.am gtk/gtk.h gtk/gtktearoffmenu.[ch]: New MenuItem type, that when put as the first thing in a menu, makes the menu tearoff. Currently drawn as a dashed line. * gtk/gtkmenuitem.h gtk/gtkcheckmenuitem.c: Added a flag "hide_on_activate" to the MenuItem class structure to allow check and radio buttons to be changed with without hiding the menu. * gtk/gtkitemfactory.c: - Create a AccelGroup for each MenuShell we create. - If an '_' appears before a character 'c' in the path, then make 'c' an accelerator in the menu's accel group, and if the menuitem is menubar C an accelerator in the itemfactory's accel group. Double '__' inserts a literal '_' * gtk/gtklabel.[ch]: Add support for a pattern arg - which is a string. If an '_' appears in this string, the corresponding position in the label is underlined. Add gtk_label_parse_uline() convenience function which takes a string with embedded underlines, sets the pattern and label, and returns the accelerator keyval. * gtk/gtkmenu.[ch]: Make menus no longer a toplevel widget. Instead, they create a GtkWindow and add themselves to that. (When torn off, another new feature, they create another GtkWindow to hold the torn off menu) New function gtk_menu_set_tearoff_state() * gtk/gtkenums.h gtk/gtkmenushell.[ch] gtk/gtkenums.h: Added action signals for keyboard navigation of menus. * gtk/gtkmenushell.c: Key press handler which activates bindings for navigation, and accelerators, for handling underline accelerators. Exported functions to select and activate menu items in a menushell. * gtk/testgtk.c: Added a new "Item Factory" test which tests GtkItemFactory and the new keyboard navigation of menus. Tue Aug 11 20:52:58 1998 Tim Janik * gtk/gtktypeutils.c (gtk_type_class_init): relookup nodes after external functions have been called. also relookup nodes after this function has been invoked. Tue Aug 11 15:04:52 1998 Owen Taylor * gtk/gtktext.[ch]: Removed has_cursor, set the cursor beginning of Text when creating the Text widget. * gtk/testgtk.c: Grab the focus on the text widget so as to test out the above. Tue Aug 11 14:55:00 1998 Owen Taylor * gtk/gtkeditable.c: Reverted part of timj's change of Jul 16. ::changed is a notification signal and should have no default handler. A complete redraw of the Text widget does _not_ need to be done on every text insertion. Tue Aug 11 13:07:29 1998 Owen Taylor (gtk-abilleira-072198-patch) * gtk/gtkwindow.[ch]: Add gtk_window_set_modal() which sets a flag; when set the window does a gtk_grab_add() when the window is shown, and a gtk_grab_remove() when the window is hidden. * gtk/gtkfilesel.[ch]: Test if it is running in modal form and in that case will run "Create Dir","Delete File" and "Rename File" dialogs as modal too. * gtk/testgtk.c: Added a button with an example of creating modal dialog boxes. Including file selection and color selection standard dialogs. Tue Aug 11 00:44:47 1998 Owen Taylor * gtk/gtkhscrollbar.c gtk/gtkvscrollbar.c gtk/gtktoolbar.c: Removed CAN_FOCUS by default from scrollbars, button children of toolbar. (But not GTK_TOOLBAR_CHILD_WIDGET children) (Scrollbar definitely good change, toolbar bit more questionable) Tue Aug 11 17:49:33 1998 Tim Janik * examples/packbox/packbox.c: #include fixes (reported by Asbjoern Pettersen). Tue Aug 11 00:35:56 1998 Owen Taylor * gdk/gdkgc.c gdk/gdktypes.h: Applied gtk-pedersen-980727-0; added all logical operations to gc->function. Sun Aug 9 23:31:59 1998 Lars Hamann * gtk/gtkclist.c (adjust_scrollbars): Fix for resize bug. Call gtk_widget_size_allocate instead of gtk_widget_queue_resize if the visibility state of a scrollbar changes. Mon Aug 10 12:49:54 1998 Tim Janik * gtk/gtkhbbox.h: fixed an #include statement (reported by Eric Kidd). Thu Aug 6 22:37:21 1998 Stefan Jeske * gtk/gtkclist.c: Renamed my_merge and my_mergesort to gtk_clist_merge and gtk_clist_mergesort. :) 1998-08-06 Martin Baulig * gtk/gtkclist.c: Renamed `merge' -> `my_merge' and `mergesort' -> `my_mergesort'. Wed Aug 5 21:12:37 1998 Stefan Jeske * gtk/gtkenums.h: new enum GtkSortType. * gtk/gtkclist.h: * gtk/gtkclist.c: Added sorting capabilities to GtkCList. New APIs : gtk_clist_set_compare_func, gtk_clist_set_sort_column, gtk_clist_set_sort_type, gtk_clist_sort, gtk_clist_set_auto_sort. New internal functions : default_compare, merge, mergesort. (gtk_clist_append): This is just a wrapper for gtk_clist_insert now. (gtk_clist_insert): Modified to handle gtk_clist_append and the auto sort flag. Changed the return value from void to gint to return the row number where the element was actually inserted. (gtk_clist_swap_rows): Return immediately if auto sort flag is set. * gtk/gtkctree.h: * gtk/gtkctree.c: Removed the auto_sort flag, replaced ctree->node_compare with clist->compare all over the place, modified default_compare to match clist's needs. Removed API´s : gtk_ctree_set_auto_sort, gtk_ctree_set_compare_func. Removed GtkCTreeCompareFunc typedef. * gtk/testgtk.c: Modified clist/ctree samples to demonstrate sorting. The lists can be sorted by a column by clicking the corresponding title button. Tue Aug 4 22:02:49 PDT 1998 Shawn T. Amundson * Released GTK+ 1.1.1 Wed Aug 5 02:57:20 1998 Lars Hamann * gtk/gtkctree.h: * gtk/gtkctree.c: (gtk_ctree_find): changed to return a gboolean (gtk_ctree_insert_gnode): new function for recursive insertion of a GNode tree. (gtk_ctree_real_select_recursive): fix for extended selection (gtk_ctree_sort_recursive): in case node == NULL, sort root nodes too. (gtk_ctree_set_node_info) (set_node_info): few fixes for expanded flag Tue Aug 4 16:18:26 1998 Tim Janik * configure.in: version bump to 1.1.1, binary age 0, interface age 0. GLib version 1.1.1 is now required at minimum. * docs/Makefile.am: added gtk_tut_fr.sgml to EXTRA_DIST (french version of the Gtk+ tutorial, contributed by Eric Jacoboni . Mon Aug 3 19:24:48 1998 Owen Taylor * gtk/gtktext.c (gtk_text_forward_delete): Undraw the cursor before (possibly) deleting the cursor's text property. * gtk/gtktext.c (correct_cache_delete): More attempts to clean the line-start cache up after inserting a property. Among other things, make sure to fix up text->current_line, since it is used to refetch the changed lines. Tue Aug 4 10:59:19 1998 Owen Taylor * gtk/gtktable.[ch]: Empty rows/columns of the table should not have been marked as being able to shrink. (Fixes problem with shrinking scrollbarless GIMP canvases) 1998-08-03 Federico Mena Quintero * gtk/gtkctree.c (gtk_ctree_find_by_row_data_custom): New public function to find a row by its data pointer using a custom comparison function. Sun Aug 02 22:58:00 1998 George Lebl * gtk/gtkclist.c: draw the buttons during a "draw" as well, this fixes a bug when the whole widget is made non-sesitive the buttons weren't redrawn Mon Aug 3 00:04:09 1998 Lars Hamann * gtk/gtkclist.c (abort_column_resize): reset drag_pos after abort * gtk/gtkclist.c (gtk_clist_key_press): removed a few unneeded lines * gtk/gtkcombo.c (gtk_combo_list_key_press): fixed compiler warning Sun Aug 2 03:08:07 1998 Owen Taylor * gdk/gdkwindow.c (gdk_window_reparent): Change window_private->parent pointer when reparenting. Sat Aug 1 22:17:00 1998 Raph Levien * gdk/gdkrgb.c: made some minor config changes to unify GdkRgb with the standalone release. Fri Jul 31 20:45:07 1998 Lars Hamann * gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion) (gtk_clist_button_release) (new_column_width): Few fixes for column resize. Store resize column in clist->drag_pos. Thu Jul 31 15:18:36 1998 Lars Hamann * gtk/gtkctree.h * gtk/gtkctree.c * gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node to GtkCTreeNode *node. * gtk/gtklist.h : added extended selection mode and auto scrolling. (struct _GtkList): removed unneeded variables timer, button, selection_start_pos, selection_end_pos, scroll_direction, have_grab. Added new variables undo_selection, undo_unselection, last_focus_child, undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state, drag_selection, add_mode. New functions : (gtk_list_extend_selection), (gtk_list_start_selection), (gtk_list_end_selection), (gtk_list_select_all), (gtk_list_unselect_all), (gtk_list_scroll_horizontal), (gtk_list_scroll_vertical), (gtk_list_toggle_add_mode), (gtk_list_toggle_focus_row), (gtk_list_toggle_row), (gtk_list_undo_selection), (gtk_list_end_drag_selection) * gtk/gtklist.c : (gtk_list_enter_notify): removed, because auto scrolling now works with gtk_list_motion_notify New functions, needed for auto scrolling : (gtk_list_motion_notify) (gtk_list_move_focus_child) New functions for extended selection support : (gtk_list_set_anchor), (gtk_list_fake_unselect_all), (gtk_list_fake_toggle_row), (gtk_list_update_extended_selection), (gtk_list_focus_lost) (gtk_list_set_focus_child): modified gtk_container_set_focus_child function to support auto scrolling, and avoid out-of-sync errors in case auf GTK_SELECTION_BROWSE (gtk_list_focus): modified gtk_container_focus function to avoid out off sync errors in case auf GTK_SELECTION_EXTENDED * gtk/gtklistitem.h * gtk/gtklistitem.c : New signal functions for key binding support : (toggle_focus_row), (select_all), (list_item), (unselect_all) (list_item), (undo_selection), (start_selection), (end_selection) (extend_selection), (scroll_horizontal), (scroll_vertical), (toggle_add_mode) (gtk_list_item_realize): added GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK (gtk_list_item_draw_focus): modify gc if parent has add_mode set. * gtk/gtkcombo.c : (gtk_combo_popup_button_press): grab pointer for combo->list (gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB (gtk_combo_list_key_press): take care of which child HAS_GRAB (gtk_comb_init): don't connect combo->button with button_release_event Thu Jul 30 12:39:36 1998 Lars Hamann * gtk/gtkclist.c (gtk_clist_motion): removed a few unneeded lines Wed Jul 29 23:31:50 1998 Lars Hamann * gtk/gtkclist.c (gtk_clist_motion): column resize now works with horizontal autoscrolling, GtkCTree's 'reorder ability' now works with horizontal and vertical autoscrolling. Tue Jul 28 20:32:03 CDT 1998 Shawn T. Amundson * gtk/docs/man: new directory * gtk/docs/man/gtk_button.pod: new file, initial gtk_button man page Tue Jul 28 00:03:20 1998 Lars Hamann * gtk/gtknotebook.c (gtk_notebook_paint): small fix for border drawing bug Mon Jul 27 09:18:13 BST 1998 Tony Gale * docs/gtk_tut.sgml: GtkTree section from David Huggins-Daines , add a GtkText widget example * examples/text/* example/tree/* : new examples for the GtkTree and GtkText widgets * docs/gtk_tut.sgml: added an appendix to hold complete code examples that aren't in a full form elsewhere in the tutorial (e.g. scribble) Mon Jul 27 00:46:21 CDT 1998 Shawn T. Amundson * Released GTK+ 1.1.0 Mon Jul 27 04:18:26 1998 Tim Janik * gtkfeatures.h.in: revamped the definitions for 1-1-0, so that all the new API stuff is reflected in one #define GTK_HAVE_FEATURES_1_1_0. Mon Jul 27 03:11:20 1998 Tim Janik * gtk/gtkbindings.c (binding_compose_params): fixup, so that enum values are looked up. * gtk/gtktypeutils.h: * gtk/gtktypeutils.c: new functions gtk_type_flags_find_value and gtk_type_enums_find_value to lookup enum values. * gtk/gtkctree.h: * gtk/gtkctree.c: change enum name from GtkCTreeExpansion to GtkCTreeExpansionType. fixed signal creations to pass the enum types not just the base type GTK_TYPE_ENUM. * gtk/gtkclist.h: * gtk/gtkclist.c: fixed signal creations to pass the real enum types not just the base type GTK_TYPE_ENUM. Sun Jul 26 14:50:07 1998 Stefan Jeske * gtk/testgtk.c : Began cleanup, e.g. use gtk_widget_show_all instead of many gtk_widget_show's. Completely rewrote the button box sample (only one window now). Removed "miscellaneous" button. Sun Jul 26 14:48:14 1998 Stefan Jeske * gtk/gtkvbbox.c (gtk_vbutton_box_size_allocate): Fixed wrong allocation for GTK_BUTTONBOX_END. (allocation->x => allocation->y) Sun Jul 26 14:06:37 1998 Lars Hamann * gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_button_release) (abort_column_resize) (gtk_clist_key_press): fix for pointer grab * gtk/gtkctree.c (real_tree_select): added check to avoid double selected rows (gtk_ctree_button_press) (gtk_ctree_button_release): fix for pointer grab Sat Jul 25 13:16:00 1998 Damon Chaplin * gtk/gtkfontsel.c (gtk_font_selection_get_fonts): Fixed initialization problem - dirty memory could cause problems. Also checked that bitmapped fonts can be scaled when showing the available sizes. Sat Jul 25 02:25:03 1998 Lars Hamann * gtk/gtkctree.c (gtk_ctree_sort_recursive) (gtk_ctree_sort_recursive): test for node != NULL (gtk_ctree_is_visible) (gtk_ctree_realize) (gtk_ctree_unrealize) (gtk_ctree_last) : added sanity checks * gtk/gtkclist.c (gtk_clist_button_press): removed "no_focus_row" Fri Jul 24 18:15:49 1998 Lars Hamann * gtk/gtkclist.c (toggle_focus_row): mini code cleanup Fri, 24 Jul 1998 10:56:22 +0200 Paolo Molaro * gtk/gtkfeatures.h.in: added GTK_HAVE_ENUM_VALUE_STRUCT. Thu Jul 23 00:11:39 1998 Tim Janik * gtk/testgtkrc: introduce testbindings on C-1 for buttons, to check out binding priorities. someone should really write gtkrc-mode for emacs. * gtk/gtkwidget.c (gtk_widget_class_init): remove ugly bindings test. * gtk/testgtk.c (main): and move it here ;). this test says something on release of C-9. (this works only if the mouse pointer is on a spinbutton and there is no focus widget). * gtk/gtkrc.h: * gtk/gtkrc.c: export gtk_rc_parse_color, gtk_rc_parse_state and a new function gtk_rc_parse_priority to parse path priority types. export rc tokens. feature binding parsing. Wed Jul 22 23:41:17 1998 Tim Janik * gtk/gtkbindings.h: * gtk/gtkbindings.c: new function gtk_binding_parse_binding() to feature binding parsing in rc files. * gtk/gtkbindings.c (gtk_binding_set_new): bug fix. * gtk/gtkbindings.c (gtk_binding_pattern_compare): bug fix, we used to order the bindings with lowest priority first. Wed Jul 22 15:21:08 PDT 1998 Manish Singh * gdk/gdkrgb.c: actually builds and runs properly on big endian machines now, because we #include config.h. Also fixed up a compile error in the WORDS_BIGENDIAN case in gdk_rgb_convert_565_gray. I made the fix by looking at patterns in the other code; Raph can you verify this? * gdk/gdkthreads.c: #include to quell compiler warnings Wed Jul 22 23:00:44 1998 Lars Hamann * gtk/gtkctree.c (tree_select/unselect) (tree_expand/collapse) (tree_toggle_expansion) (real_select/unselect_row) (gtk_ctree_select/unselect) : few fixes for gtk_signal_emits Wed Jul 15 17:44:47 1998 Owen Taylor * gtk/gtktext.c (new_text_property): We free things from the text property MemChunk, so it needs to be G_ALLOC_AND_FREE. * Fix up line start cache when splitting a property during an insert. Wed Jul 15 21:15:52 1998 Owen Taylor * gtk/gtkwidget.c: restauration => restoration Thu Jul 16 20:11:36 1998 Owen Taylor * gdk/gdkxid.c (gdk_xid_table_lookup): If xid_ht hasn't been created yet, don't do the lookup. 1998-07-20 Raph Levien * gdk/gdkrgb.c: More cleanups in the config process. 1998-07-20 Raph Levien * gdkrgb.c: Fixed minor config bug preventing big-endian architectures from working. Tue Jul 21 06:32:43 1998 Stefan Jeske * gtk/gtkprogressbar.{c,h} gtk/testgtk.c: Fixed wrong size of activity indicator. It is settable now as a fraction of the total width/height using gtk_progress_bar_set_activity_blocks. Renamed gtk_progress_bar_set_number_of_blocks to gtk_progress_bar_set_discrete_blocks. Mon Jul 20 21:28:18 1998 Lars Hamann * gtk/gtkctree.c (gtk_ctree_post_recursive_to_depth) (gtk_ctree_pre_recursive_to_depth): new functions, recursive process tree to specified depth (gtk_ctree_expand_to_depth): expand tree to specified depth (gtk_ctree_collapse_to_depth): collapse all nodes with level >= depth Sun Jul 19 23:51:05 1998 Lars Hamann * gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case of GTK_CLIST_ADD_MOD * gtk/testgtk.c (add1000_clist): changed pixmap Sat Jul 18 22:59:04 1998 Tim Janik * gtk/gtkmain.h: * gtk/gtkmain.c: export gtk_binary_age and gtk_interface_age. * gtk/gtktypeutils.h: * gtk/gtkitemfactory.h: remove "void" from prototypes again. Sat Jul 18 00:54:01 1998 Lars Hamann * gtk/gtknotebook.c (gtk_notebook_set_child_arg): added support for CHILD_ARG_MENU_LABEL, CHILD_ARG_TAB_LABEL (gtk_notebook_get_child_arg): added support for CHILD_ARG_MENU_LABEL, CHILD_ARG_POSITION (gtk_notebook_reorder_child): new funktion to change position of a notebook page (gtk_notebook_draw_arrow): draw left/right arrow with GTK_SHADOW_ETCHED_IN if focus_tab is first/last tab. * gtk/gtkstyle.c (gtk_default_draw_arrow): added GTK_SHADOW_ETCHED_IN/OUT Sun Jul 19 12:19:16 1998 Stefan Jeske * gtk/gtkprogress.c gtk/gtkprogress.h gtk/gtkprogressbar.c gtk/gtkprogressbar.h gtk/Makefile.am gtk/gtk.h gtk/testgtk.c: Introduced generic GtkProgress widget. Derived GtkProgressBar from GtkProgress. Made GtkProgressBar much more flexible (see testgtk). Fri Jul 17 23:49:28 PDT 1998 Manish Singh * gtk/gtktypeutils.h * gtk/gtkitemfactory.h: explicitly specify void in prototype Fri Jul 17 17:54:02 1998 Lars Hamann * gtk/gtkclist.c (scroll_vertical): fix to avoid flicker at begin/end of list Fri Jul 17 05:30:47 1998 Tim Janik * gtk/gtksignal.c (gtk_handlers_run) (gtk_signal_real_emit): sropped the approach of copying all signal specific data into a GtkHandlerInfo structure. we rather keep the signal data on the stack in gtk_signal_real_emit and pass that over to gtk_handlers_run. this avoids multiple lookups of the signal pointer and works savely together with destroy notifiers of handlers. * gtk/gtkentry.c (gtk_entry_key_press): care for the posssibility that someone destroys the entry on the ::activate signal. Fri Jul 17 01:21:32 1998 Tim Janik * gtk/gtkarrow.c (gtk_arrow_expose): use misc->xpad for x calculation instead of ypad (typo). (gtk_arrow_set): clear all of the arrow's allocation (left a 1 pixel border around the allocation). (gtk_arrow_init): the static requisition needs to be setup in this function rather than gtk_widget_new(), so arrow creation works without the gtk_arrow_new() constructing. (gtk_arrow_expose): return TRUE, since we actually handled the expose. * gtk/gtkwidget.c (gtk_widget_real_size_request): provide a default implementation for GtkWidget::size_request, so size requisition for simple statically sized widgets like GtkArrow works. Thu Jul 16 14:16:16 PDT 1998 Manish Singh * gtk-config.in: minor changes to gtk-config: --cflags doesn't prepend -I@libdir@/glib/include anymore, since glib-config handles it; --libs strips out redundant -L's properly (there was code in there to do it before, but it didn't work) Thu Jul 16 18:24:41 1998 Tim Janik * gtk/gtknotebook.h: * gtk/gtknotebook.c: signdness corrections all ove the place. implementation of object arguments: GtkNotebook::enable_popup, GtkNotebook::tab_pos, GtkNotebook::tab_border, GtkNotebook::show_tabs, GtkNotebook::show_border, GtkNotebook::scrollable and GtkNotebook::page. begun implementation of child args, we have GtkNotebook::tab_label, but GtkNotebook::menu_label and GtkNotebook::position still lack the implementation. (gtk_notebook_remove_page): (gtk_notebook_current_page): allow negative indices (-1) as alias for the last page. * gtk/gtkentry.h: * gtk/gtkentry.c: GtkType and macro fixups. implementation of object arguments GtkEntry::max_length and GtkEntry::visibility. (gtk_entry_adjust_scroll): queue a redraw. * gtk/gtkeditable.h: * gtk/gtkeditable.c: GtkType und macro fixups. implementation of object arguments GtkEditable::text_position and GtkEditable::editable. new (action) signal GtkEditable::set_editable. provide a default handler for GtkEditable::changed that queues a redraw. * gtk/gtktext.h: * gtk/gtktext.c: GtkType und macro fixups. override GtkEditable:: set_editable. Thu Jul 16 14:42:11 1998 Lars Hamann * gtk/gtkctree.c (gtk_ctree_button_release): fix for sigsegv in case of drag_target == NULL * gtk/gtkclist.c (gtk_clist_button_press): fix for GTK_2/3BUTTON_PRESS. Clist did not emit an select_row signal in case of GTK_2/3BUTTON_PRESS. * gtk/gtkfilesel.c (gtk_file_selection_file_button, gtk_dir_selection_file_button): fix due to changes in clist's select_row signal. Thu Jul 16 01:27:15 1998 Tim Janik * gtk/gtkwidget.h: * gtk/gtkwidget.c (gtk_widget_set_usize): handle negative values similar to gtk_widget_set_uposition(). that is: -1=unspecified, -2=leave untouched. changed the width/height field of GtkWidgetAuxInfo to be gint16s rather than guint16s, since that's what the code expected (for a long time actually). * gtk/gtkviewport.c: added support for object arguments: GtkViewport::shadow_type, GtkViewport::vadjustment and GtkViewport::hadjustment. (gtk_viewport_add): chain gtk_bin_add. * gtk/gtkscrolledwindow.c: added support for object argument: GtkScrolledWindow::hscrollbar_policy, GtkScrolledWindow::vscrollbar_policy and GtkScrolledWindow::viewport. * gtk/gtkadjustment.h: * gtk/gtkadjustment.c: * gtk/gtkctree.h: * gtk/gtkclist.h: * gtk/gtkctree.c: * gtk/gtkclist.c: * gtk/gtkscrolledwindow.h: * gtk/gtkscrolledwindow.c: * gtk/gtkviewport.h: * gtk/gtkviewport.c: GtkType and macro fixups. Thu Jul 16 01:10:02 1998 Lars Hamann * gtk/gtkctree.h : * gtk/gtkctree.c : Added focus handling, horizontal and vertical autoscrolling, extended Selection Mode, key bindings Added gtk_ctree_toggle_expansion & gtk_ctree_toggle_expansion_recursive Changed gtk_ctree_scroll_to to gtk_ctree_moveto. Removed gtk_ctree_clear. * gtk/gtkclist.h : * gtk/gtkclist.c : Added focus handling, horizontal and vertical autoscrolling, extended Selection Mode, key bindings Wed Jul 15 12:39:27 1998 Raph Levien * This checkin integrates GdkRgb version 0.0.3 into the Gtk 1.1 source tree. For more information on GdkRgb, please see: http://www.levien.com/gdkrgb/ * gtk/gtkfeatures.h.in (GTK_HAVE_GDK_RGB): added this feature. It bothers me slightly that the feature is in gdk, and this file is in gtk, but it's probably ok. * gdk/gdk.h: Added an #include of * gdk/gdkrgb.c: * gdk/gdkrgb.h: Added this module. * Makefile.am (EXTRA_DIST): Added gdkrgb.c and gdkrgb.h files. * configure.in: added AC_C_BIGENDIAN test (needed by GdkRgb). Wed Jul 15 14:20:10 1998 Tim Janik * gtk/gtksignal.c (gtk_signal_real_emit): pass only the signal_id to this function. it needs to relookup the signal multiple times. this fixes spurious segfaults that could show up with signal intensive code, when classes are created during a pending emission (which is normal case). Tue Jul 14 19:12:12 1998 Tim Janik * gtk/gtkbutton.c (gtk_button_set_arg): don't destroy a buttons child if it isn't a label. Tue Jul 14 11:41:38 1998 Tim Janik * gtk/gtkdialog.h: * gtk/gtkseparator.h: * gtk/gtkhseparator.h: * gtk/gtkvseparator.h: macro and GtkType fixups. Tue Jul 14 06:25:46 1998 Tim Janik * gtk/testgtk.c (create_cursors): display the current cursor name. * gtk/gtktypeutils.h: * gtk/gtktypeutils.c (gtk_type_init_builtin_types): cleanups to the fundamental type definition. the GtkArg union now only covers the required storage types for argument values. adapted the GTK_VALUE_* macro set. handle GTK_TYPE_UCHAR. definiton of type set bounds macros. * gtk/gtkargcollector.c (gtk_arg_collect_value): clean ups of the code, fixed int/float collection. fixed a bug in the sanity checking code for GtkObjects. * gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixups of the argument collection code. * gtk/gtksignal.c (gtk_signal_collect_params): use the type set bounds macros when distinguishing the return type. Mon Jul 13 12:42:51 1998 George Lebl * gdk/gdkwindow.h: (gdk_window_reparent) check if old_parent_private is not NULL before trying to g_list_remove the child. A patch from Michael Lausch. Sun Jul 12 16:40:06 1998 Tim Janik * gtk/gtkargcollector.c (gtk_arg_collect_value): fix float argument collection (always casted to doubles upon argument passing). Sun Jul 12 05:59:26 1998 Tim Janik * gtk/gtktypeutils.c (gtk_type_new): call the base classes' object_init_func for derived objects with the object's ->klass field still pointing to the corresponding base class, otherwise overridden class functions could get called with partly-initialized objects. (change from Tero Pulkkinen ). Sun Jul 12 02:47:35 1998 Tim Janik * gtk/gtkobject.h: * gtk/gtkobject.c: (gtk_object_arg_get_info): new functions which wraps gtk_arg_get_info(). * gtk/gtkcontainer.h: * gtk/gtkcontainer.c: (gtk_container_child_arg_get_info): new function which wraps gtk_arg_get_info(). Fri Jul 10 13:29:53 1998 Tim Janik * gtk/gtkcontainer.c: (gtk_container_arg_get): (gtk_container_arg_set): * gtk/gtkobject.c: (gtk_object_arg_set): (gtk_object_arg_get): strictly check for the associated get/set arg functions. if an arg is readable or writable, the associated class functions *must* be provided. Fri Jul 10 09:37:50 1998 Tim Janik * gtk/gtkaccellabel.c (gtk_accel_label_accelerator_width): only take the padding into account if there is an accelerator. Fri Jul 10 05:51:44 1998 Tim Janik * gtk/gtkcontainer.c: (gtk_container_add_with_args): collect the arguments with gtk_container_child_args_collect, not through gtk_object_args_collect. (gtk_container_child_set): likewise. Fri Jul 10 04:20:35 1998 Tim Janik * gtk/gtktypeutils.h: * gtk/gtktypeutils.c: added a new internal type GTK_TYPE_IDENTIFIER which is derived from GTK_TYPE_STRING. * gtk/gtkbindings.c: reworked the argument type handling. Thu Jul 9 21:03:19 CDT 1998 Shawn T. Amundson * gtk/gtkpreview.c: add in just enough support for 1 or 4 bits so that it seems to allow normal operation in those modes, although you will only see black (GIMP toolbar now pops up, just don't create a new image and GIMP now works in 4 bit.) Thu Jul 9 20:20:04 CDT 1998 Shawn T. Amundson * gdk/gdkvisuals.c: 4 bit support, increased available_depths array, which was too low (?) Fri Jul 10 00:02:04 1998 Tim Janik * gtk/gtkcontainer.h: * gtk/gtkcontainer.c: deleted most of the argument handling code, since that is now implemented in gtkarg.c. similar to gtk_object_args_collect, we now export a new function gtk_container_child_args_collect(). for consistency with the object arguments, a few functions got renamed: gtk_container_child_arg_get -> gtk_container_child_get, gtk_container_child_arg_set -> gtk_container_child_set, gtk_container_child_arg_getv -> gtk_container_child_getv, gtk_container_child_arg_setv -> gtk_container_child_setv, gtk_container_add_with_argv -> gtk_container_addv. note, gtk_container_add_with_args() remained, because its equivalent would be gtk_container_add(,, ...) which would break all existing code. (gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type, we expect the `arg_name' argument to be a const static string now. (gtk_container_get_child_arg_type): function removed. Thu Jul 9 07:03:04 1998 Tim Janik * gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value(). this is a static inline function that collects command line arguments from a va_list. this file can just be included in all places that need this functionality. * gtk/gtkarg.h: * gtk/gtkarg.c: new files which implement most of the argument handling stuff from gtkobject.c. also collected a few more gtk_arg_* utility functions from else places. * gtk/gtkobject.h: * gtk/gtkobject.c: moved most of the argument handling code into gtkarg.c. we now export gtk_object_args_collect() as a non-public method with a blind va_list pointer. (gtk_object_add_arg_type): the `arg_name' argument is required to be a const static string now. (gtk_object_get_arg_type): function got removed. * gtk/gtkwidget.c: (gtk_widget_set): (gtk_widget_new): adaptions for gtk_object_args_collect(). * gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal fundamental type name so as to have a valid prefix, e.g. "bool"-> "gboolean", "string"->"GtkString" and somesuch, left "void" as is, though that should probably be something like GtkNone since the type itself is called GTK_TYPE_NONE. even the internal type names need to avoid name clashes and must live in their own namespace, several code portions rely on that. we should relly have typedefs such as typedef gchar* GtkString; so the fundamental type names can be used for code dumpers just like with all the Gtk/Gdk types. Wed Jul 8 15:31:28 1998 Tim Janik * gtk/gtkbutton.c: handle GTK_RELIEF_HALF, which was introduced to keep either GTK_STATE_NORMAL for relief buttons (GTK_RELIEF_NONE) or to still honour GTK_WIDGET_STATE(), e.g. for coloured buttons (GTK_RELIEF_HALF). (gtk_button_paint): set the background for prelighted buttons with GTK_STATE_NORMAL only if GTK_RELIEF_NONE. (gtk_button_draw_focus): if GTK_RELIEF_NONE, use GTK_STATE_NORMAL for the shadow type (otherwise we get strange shadows for coloured buttons). (gtk_button_set_relief): queue a redraw after changing the relief. (gtk_button_class_init): (gtk_button_set_arg): (gtk_button_get_arg): added object argument "GtkButton::relief". * gtk/gtkenums.h (enum): added GTK_RELIEF_HALF. Mon Jul 6 18:30:48 1998 Tim Janik * gtk/gtkbutton.h: * gtk/gtkbutton.c: GtkButtons are now derived from GtkBin. we mirror GTK_BIN (button)->child to button->child to keep source compatibility. * gtk/gtkoptionmenu.c: * gtk/gtkclist.c: * gtkcheckbutton.c: don't refer to button->child, but GTK_BIN (button)->child instead. Mon Jul 6 12:06:23 BST 1998 Tony Gale * docs/gtkfaq.sgml: update anon CVS info Sat Jul 4 13:16:24 1998 Tim Janik * gtk/*.c: changed reversed_[12] to reserved_[12] in gtk_*_get_type functions. * gdk/gdkwindow.c: * gdk/gdkvisual.c: check for some pointer values to be != NULL, prior to XFree() calls. 1998-07-03 Federico Mena Quintero * gtk/gtkfeatures.h.in: Added GDK_HAVE_FULL_CROSSING_EVENT, since I seem to have erroneously added it to gtkfeatures.h (not .h.in). Fri Jul 3 14:55:31 PDT 1998 Manish Singh * gtk/gtkfeatures.h.in: added GTK_HAVE_RELIEF_STYLE Wed Jul 1 20:58:46 1998 Tim Janik * gtk/gtkwidget.h: * gtk/gtkwidget.c: temporary implementation of action signal "debug_msg" * gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixed an off-by-one error that prevented signal to entry addition for signals with parameters. Wed Jul 1 10:05:36 PDT 1998 Manish Singh * ltconfig: fix for properly detecting shared lib support on SunPro cc (taken from libtool 1.2.a) Wed Jul 1 03:33:30 1998 Tim Janik * gtk/gtkrc.c: implementation of the "class" keyword for styles. Tue Jun 30 14:30:37 1998 Tim Janik * gtk/gtkrc.c: fixed lookup order for rc styles. the latest defined rc set pattern is favoured, this is needed for overriding of style patterns with subsequently parsed rc files. Tue Jun 30 12:45:19 1998 Tim Janik * gtk/gtkrc.c: code overhaul for simplicity and more descriptive error messages. Tue Jun 30 09:24:40 1998 Tim Janik * gtk/gtkaccelgroup.c (gtk_accelerator_parse): parse "" modifier as well. (gtk_accelerator_name): add "" to the accelerator name if neccessary. * gtk/gtkbindings.c (BINDING_MOD_MASK): take BINDING_MOD_MASK into account. * gtk/gtkwidget.c (gtk_widget_real_key_release_event): implemented default handler for key-release events, which checks for activation of GDK_RELEASE_MASK key bindings. * gdk/gdktypes.h (enum): added GDK_RELEASE_MASK to GdkModifierType. Mon Jun 29 13:39:45 1998 Tim Janik * gtk/gtkarrow.h: GtkType and macro fixups. * gtk/gtkarrow.c: widget argument implementation: "GtkArrow::arrow_type", "GtkArrow::shadow_type". Sun Jun 28 11:39:17 1998 Tim Janik * gtk/gtkalignment.h: * gtk/gtkbin.h: GtkType and macro fixups. * gtk/gtkalignment.c (gtk_alignment_class_init): widget argument implementation: GtkAlignment::xalign, GtkAlignment::yalign, GtkAlignment::xscale, GtkAlignment::yscale. Sun Jun 28 04:29:10 1998 Tim Janik * gtk/gtktypeutils.c (gtk_type_class_init): call the base class init fucntions from all parent types upon class initialization. * gtk/gtkcontainer.c: (gtk_container_get_type): announce gtk_container_base_class_init to the type system. (gtk_container_base_class_init): new function to feature base class initialization. (gtk_container_get_child_arg): (gtk_container_set_child_arg): call the GtkContainerClass get_child_arg and set_child_arg methods of the class indicated through the argument name. * gtk/gtkobject.c: (gtk_object_base_class_init): new function to feature base class initialization. (gtk_object_init_type): announce gtk_object_base_class_init to the type system. (gtk_object_class_init): setup the get_arg and set_arg pointers for GtkObjectClass. (gtk_object_setv): (gtk_object_getv): call the GtkObjectClass get_arg and set_arg methods, instead of bothering the type system with this. * gtk/gtkaccellabel.c: * gtk/gtkbutton.c: * gtk/gtkradiobutton.c: * gtk/gtktable.c: * gtk/gtktogglebutton.c: * gtk/gtktipsquery.c: * gtk/gtkbox.c: * gtk/gtkpacker.c: * gtk/gtkwidget.c: * gtk/gtkwindow.c: * gtk/gtkframe.c: * gtk/gtkmisc.c: * gtk/gtklabel.c: set the object_class->{g|s}et_arg pointers to the corresponding gtk_*_{g|s]et_arg functions and updated the gtk_*_get_type functions wrt GtkTypeInfo initialization. changed a lot of the set/get arg functions to take a GtkObject argument. gtk/gtkadjustment.c: gtk/gtkalignment.c: gtk/gtkarrow.c: gtk/gtkaspectframe.c: gtk/gtkbbox.c: gtk/gtkbin.c: gtk/gtkcheckbutton.c: gtk/gtkcheckmenuitem.c: gtk/gtkclist.c: gtk/gtkcolorsel.c: gtk/gtkcombo.c: gtk/gtkctree.c: gtk/gtkcurve.c: gtk/gtkdata.c: gtk/gtkdialog.c: gtk/gtkdrawingarea.c: gtk/gtkeditable.c: gtk/gtkentry.c: gtk/gtkeventbox.c: gtk/gtkfilesel.c: gtk/gtkfixed.c: gtk/gtkfontsel.c: gtk/gtkgamma.c: gtk/gtkhandlebox.c: gtk/gtkhbbox.c: gtk/gtkhbox.c: gtk/gtkhpaned.c: gtk/gtkhruler.c: gtk/gtkhscale.c: gtk/gtkhscrollbar.c: gtk/gtkhseparator.c: gtk/gtkimage.c: gtk/gtkinputdialog.c: gtk/gtkitem.c: gtk/gtkitemfactory.c: gtk/gtklist.c: gtk/gtklistitem.c: gtk/gtkmenu.c: gtk/gtkmenubar.c: gtk/gtkmenuitem.c: gtk/gtkmenushell.c: gtk/gtknotebook.c: gtk/gtkoptionmenu.c: gtk/gtkpaned.c: gtk/gtkpixmap.c: gtk/gtkpreview.c: gtk/gtkprogressbar.c: gtk/gtkradiomenuitem.c: gtk/gtkrange.c: gtk/gtkruler.c: gtk/gtkscale.c: gtk/gtkscrollbar.c: gtk/gtkscrolledwindow.c: gtk/gtkseparator.c: gtk/gtkspinbutton.c: gtk/gtkstatusbar.c: gtk/gtktext.c: gtk/gtktoolbar.c: gtk/gtktooltips.c: gtk/gtktree.c: gtk/gtktreeitem.c: gtk/gtkvbbox.c: gtk/gtkvbox.c: gtk/gtkviewport.c: gtk/gtkvpaned.c: gtk/gtkvruler.c: gtk/gtkvscale.c: gtk/gtkvscrollbar.c: gtk/gtkvseparator.c: updated the GtkTypeInfo initialization code to match the modified GtkTypeInfo structure. Sat Jun 27 23:23:27 PDT 1998 Manish Singh * gtk/testgtk.c: use rand() instead of random() for portability Sat Jun 27 22:42:28 PDT 1998 Manish Singh * configure.in * acconfig.h * gdk/gdk.c: use native Xlib XConvertCase if it's available Sat Jun 27 15:44:46 1998 Tim Janik * gdk/gdk.c (gdkx_XConvertCase): compatibility function to provide XConvertCase() functionality from X11R6 on X11R5 systems. Thu Jun 25 10:50:34 1998 Stefan Jeske * gdk/gdk.h gdk/gdkfont.c: Added functions gdk_text_height, gdk_string_height, gdk_char_height to retrieve the exact height of a text. Thu Jun 25 07:53:51 BST 1998 Tony Gale * docs/gtk_tut.sgml: add section on GtkCList widget, contributed by Stefan Mars * examples/clist/clist.c examples/clist/Makefile: example code for GtkCList widget from the Tutorial Wed Jun 24 16:38:02 1998 Tim Janik * gtk/gtkbin.c (gtk_bin_remove): do not avoid to queue for a resize if the container is not visible, we might be a toplevel! this holds for all other base container implementations as well, that are candidates to derive toplevels from. in general the resizing code will care about visibility itself. * gtk/gtkmenushell.c (gtk_menu_shell_remove): likewise. * gtk/gtkbox.c (gtk_box_remove): likewise. * gtk/gtkwindow.c (gtk_window_move_resize): save ->use_uposition around gtk_window_set_hints(), since we haven't calculated the new position yet. * gdk/gdkwindow.c (gdk_window_get_pointer): take care that *x, *y and *mask are alway initialized in a sane way, regardless of the return value. Wed Jun 24 14:14:32 1998 Tim Janik * gtk/gtkcontainer.c: new function gtk_container_child_arg_set, similar to gtk_container_child_arg_setv, but takes a variable argument list. new function gtk_container_get_child_arg_type, which is needed by gtk_object_collect_args. * gtk/gtkobject.c: changed prototype for gtk_object_collect_args, to take a function pointer to figure the argument type. adapted callers to pass gtk_object_get_arg_type. * gtk/gtkwidget.c: adapted gtk_object_collect_args callers to pass gtk_object_get_arg_type.. * gtk/gtkpacker.h: * gtk/gtkpacker.c: (gtk_packer_reorder_child): new function to change the packing order of a child. (gtk_packer_size_request): (gtk_packer_size_allocate): take container->border_width into acount. * gtk/gtkpacker.c: implemented widget arguments: "GtkPacker::spacing", "GtkPacker::border_width", "GtkPacker::pad_x", "GtkPacker::pad_y", "GtkPacker::ipad_x", "GtkPacker::ipad_y". implemented child arguments: "GtkPacker::side", "GtkPacker::anchor", "GtkPacker::expand", "GtkPacker::fill_x", "GtkPacker::fill_y", "GtkPacker::use_default", "GtkPacker::border_width", "GtkPacker::pad_x", "GtkPacker::pad_y", "GtkPacker::ipad_x", "GtkPacker::ipad_y", "GtkPacker::position". * gtk/gtkmisc.c (gtk_misc_set_arg): for padding args, set the padding, not the alignment. * gtk/gtkeventbox.h: * gtk/gtkeventbox.c: GtkType and macro fixups. * gtk/testgtk.c (entry_toggle_sensitive): new function to toggle sensitivity of an entry. * gtk/gtkstyle.c (gtk_style_new): support normal grey as default color for insensitive base and text. * gtk/gtkentry.c (gtk_entry_realize): set the window backgrounds widget state dependent. (gtk_entry_style_set): likewise. (gtk_entry_state_changed): set background color on state changes. (gtk_entry_draw_text): for non selected text, use state dependent colors. * gtk/gtktogglebutton.c: support for widget arguments "GtkToggleButton::active" and "GtkToggleButton::draw_indicator". Wed Jun 24 08:35:45 1998 Stefan Jeske * gtk/gtkspinbutton.c (gtk_spin_button_spin): Added compatibility code for 1.0.x-like parameters. Changed internal interface of gtk_spin_button_real_spin. Several fixes to avoid emission of "value_changed" where possible. Tue Jun 23 22:21:33 PDT 1998 Manish Singh * gtk-boxed.defs: s/GkWidget/GtkWidget/ Wed Jun 24 07:47:29 1998 Tim Janik * gtk/testgtk.c (create_idle_test): added a frame with radio buttons to select the resize_mode for the idle-labels container. * gtk/gtkframe.h: * gtk/gtkframe.c: GtkType and macro corrections. * gtk/gtkradiobutton.c (gtk_radio_button_set_arg): new function to support widget argument "GtkRadioButton::group". Tue Jun 23 08:01:09 1998 Tim Janik * gtk/gtkcontainer.c (gtk_container_set_resize_mode): queue a resize unconditionally if resize_mode has changed. * gtk/gtkscrolledwindow.c (gtk_scrolled_window_init): set GTK_RESIZE_QUEUE on the scrolled window. (gtk_scrolled_window_construct): set GTK_RESIZE_PARENT for the vieport. Tue Jun 23 04:20:30 1998 Tim Janik * gtk/gtkcontainer.h: * gtk/gtkcontainer.c: (GTK_IS_RESIZE_CONTAINER): new macro to find out if a given gtkobject is a container with resize_mode==GTK_RESIZE_PARENT. (gtk_container_queue_resize): new function to queue a container for a *size* reallocation (doesn't affect its position, and thus its parent is left untouched usually). (gtk_container_get_resize_container): new function to retrive the next most resize container which is not itself queued for a resize. (gtk_container_idle_sizer): new function to carefully process the container_resize_queue since it can change during invokation of gtk_container_check_resize(). (gtk_container_resize_children): total rework of this function to properly handle resize containers. makes a lot of assumptions whitch are stated in the comments. * gtk/gtkcontainer.c: (gtk_container_real_check_resize): only requeue ourselves if we are not a resize container. (gtk_container_clear_resize_widgets): care for automatic deletion of our resize_widgets list on size_allocate through a handler connection. * gtk/gtkwindow.c (gtk_window_shutdown): new functionm to reset the focus and default widget of a window, so to take the burden from gtk_widget_unparent. * gtk/gtkviewport.c: removed gtk_viewport_check_resize, which tried to be clever, but actually messed up the resize_children logic and caused unneccessary allocations on its whole branch. besides this, it messed up the display by not invoking a redraw after the allocation. * gtk/gtktable.c (gtk_table_set_child_arg): reverted recent change, so that it is the child again that is queued for a resize. (gtk_table_attach): likewise. (gtk_table_remove): likewise. 1998-06-22 Miguel de Icaza * gtk/gtkentry.h, gtk/gtkentry.c: Export the gtk_entry_adjust_scroll. Required if you change the cursor position and want to sync it up with your code (Midnight Commander gtk front end needs this). * gtk/gtktable.c: Deal with tables that have size 0, 0. Tue Jun 23 12:12:19 BST 1998 Tony Gale * examples/README.1ST: new file to explain how the code examples should be extracted from the tutorial. Mon Jun 22 18:43:11 1998 Lars Hamann * gtk/gtkctree.c (draw_row): added new "line style" GTK_CTREE_LINES_TABBED * gtk/gtkctree.c/h (gtk_ctree_find_glist_ptr): new function to search the glist pointer of an GtkCTreeRow 1998-06-21 Raja R Harinath * gtk/Makefile.am (gtk.defs,gtktypebuiltins*): Remove $(srcdir) from, and clean up, the dependencies. Generate to intermediate files to prevent problems with Ctrl-C. * gtk/genmarshal.pl: Generate `gtkmarshal.[ch]' in $srcdir. Fri Jun 19 14:46:56 1998 Stefan Jeske * gtk/gtkspinbutton.h gtk/gtkspinbutton.c gtk/testgtk.c: - Bug fix for precision problem causing occasional double emission of "value_changed" signal (hopefully works now). - API change (should be binary compatible) : new enum GtkSpinType; modified gtk_spin_button_spin to use it. Modified cursor example appropriately. To spin by something other than step_/page_increment, use gtk_spin_button_spin (spin, GTK_SPIN_USER_DEFINED, increment). - Made GTK_SHADOW_NONE the default. ;) - Fixed casting of GtkAdjustment* to GtkWidget* in gtk_spin_button_value_changed. Fri Jun 19 06:18:19 1998 Tim Janik * gtk/gtkcontainer.c (gtk_container_set_resize_mode): fail silently for toplevels. if resize_mode changes to GTK_RESIZE_PARENT, clear the resize widget list before queuing the container for a new reize. (gtk_container_need_resize): changed return value to FALSE, since this used to indicate that no further resizes are needed. (gtk_container_set_arg): (gtk_container_get_arg): (gtk_container_class_init): implemented GtkContainer::resize_mode argument. (gtk_container_resize_children): when we walk up the tree of a resize widget we need to stop if we are the current parent. * gtk/gtkwidget.c (gtk_widget_queue_resize): flag the resize child with GTK_RESIZE_NEEDED for container->resize_mode==GTK_RESIZE_IMMEDIATE. (gtk_widget_hide_all): retrive the toplevel widget from via gtk_widget_get_resize_container(). Thu Jun 18 23:08:36 1998 Owen Taylor * gtk/gtklist.c (gtk_list_button_press): Only respond to selection with button 1. This allows context-sensitive menus to work correctly. Fri Jun 19 03:29:04 1998 Tim Janik * gtk/gtkaccelgroup.c: * gtk/gtkbindings.c: * gtk/gtkcontainer.c: * gtk/gtkitemfactory.c: * gtk/gtkobject.c: * gtk/gtksignal.c: * gtk/gtkwidget.c: replaced some gtk_object_data_force_id with g_quark_from_static_string calls to save memory. * gtk/gtkobject.c (gtk_object_set_data_by_id_full): invoke the destroy function _after_ the new data has been setup. minor changes to object data functions to feature the GQuark type. Thu Jun 18 21:13:54 1998 Owen Taylor * gtk/gtkmain.c (gtk_init): Remove --g-fatal-warnings flag from argv. Thu Jun 18 20:22:28 1998 Owen Taylor * gtk/genmarshal.pl: Modified to be more idiomatic Perl, to be more readable perl, to spit out stuff that looks more like readable C, and to pipe output through indent so output looks a lot like readable C. No functional changes. Thu Jun 18 17:43:31 1998 Owen Taylor * gtk/gtkpixmap.[ch] (gtk_pixmap_set): Clear the background if necessary when switching to a masked pixmap. (Based on a patch from Ullrich Hafner ) Thu Jun 18 16:18:10 1998 Owen Taylor * gtk/gtkeditable.[ch]: Added action signals for keyboard bindings. (move_cursor, kill_word, etc, etc, etc). removed the time argument from gtk_editable_cut/copy/paste_clipboard (source but not binary incompatible...) Instead get time from gtk_get_current_event (). * gtk/gtktext.c gtk/gtkentry.c: Support the new editable signals. Thu Jun 18 02:52:09 1998 Owen Taylor Patches from Damon Chaplin : gtk/gtkfontsel.h: Fixed GtkFontSelectionClass - I forgot to change parent class to GtkNotebookClass when splitting the widget in two. Also updated some comments. gtk/gtkfontsel.c: Fixed bug when toggling 'Allow scaled bitmaps' button without a font selected. Fixed bug in set_font_name - I hadn't updated the code to search for the style in the font_style clist - it was still assuming the style row was equal to its index, but it isn't any more. Changed 'Reset' button on filter page to 'Clear Filter'. Deleted old code relating to the old 'Filter Fonts' toggle Updated some comments. Cleared 'Actual Fontname' if no font is set. gtk/testgtk.c: Fixed problem when 'OK' button is pressed - it was destroying the GtkFontSelection instead of the GtkFontSelectionDialog. Thu Jun 18 02:15:31 1998 Owen Taylor * gtk/gtkmain.c (gtk_init): Added --g-fatal-warnings flag to make all warnings fatal errors. * gtk/testthreads.c: moved include inside #ifdef USE_PTHREADS Thu Jun 18 01:37:31 1998 Owen Taylor * gtk/gtkenums.h gtk/gtkcontainer.[ch] gtk/gtkwidget.c gtk/gtkmenu.c gtk/gtkviewport.c gtk/gtkwindow.c: - Added new function gtk_container_set_resize_mode() for fine-grained control of where resize-queueing is done. - Removed GtkContainer::need_resize and GtkWindow::move_resize - Added GtkContainer::check_resize to replace need_resize. - Added function gtk_container_check_resize() to trigger queued resizes, and gtk_container_resize_children() to Figure which children need to be size-allocated. (logic moved from gtkwindow.c) - Reorganized code in gtkwindow.c - Set the resize-mode for viewports so that resizes within a viewport don't propagate out of it. 1998-06-18 Federico Mena Quintero * gtk/gtkfontsel.c: Use pointer<->int conversion macros to avoid warnings. * gtk/gtkaccellabel.c (gtk_accel_label_accelerator_width): Use g_return_val_if_fail, because the function *does* return a value. Thu Jun 18 03:30:06 1998 Tim Janik * gtk/gtkaccellabel.h: * gtk/gtkaccellabel.c: new function gtk_accel_label_accelerator_width to request the size of the accelerator portion of an accel label. (gtk_accel_label_size_request): don't request for the accelerators size. (gtk_accel_label_expose_event): only draw the accelerator if we got enough extra space. * gtk/gtkmenuitem.c (gtk_menu_item_size_request): request accelerator width from children. * gtk/gtkmenu.c (gtk_menu_key_press): when adding an accelerator to an object (after removal has been requested) check if there is still an accelerator remaining to avoid adding two accelerators on an object. this can happen for locked accelerators (or accelerator-frozen widgets). (gtk_menu_size_request): feature childrens accelerator width in size requests. * gtk/gtknotebook.c (gtk_notebook_menu_item_create): use gtk_widget_freeze_accelerators() for dynamically created menu items. * gtk/gtksignal.h: * gtk/gtksignal.c: new function gtk_signal_handler_pending_by_func() which will return a handler_id > 0 if the specified function is pending for `signal_id'. * gtk/gtkwidget.h: * gtk/gtkwidget.c: remove gtk_widget_stop_accelerator, which was just a signal handler function to stop accelerator addition. added gtk_widget_freeze_accelerators and gtk_widget_thaw_accelerators which will prevent (undo) any accelerators from being added to or removed from a widget. Wed Jun 17 21:59:09 1998 Stefan Jeske * gtkspinbutton.h gtkspinbutton.c testgtk.c: Changed GtkSpinButtonUpdatePolicy enum, added keyboard acceleration, new API gtk_spin_button_set_snap_to_ticks. Wed Jun 17 03:47:40 1998 Tim Janik * gdk/gdk.h: * gdk/gdkwindow.c: new function gdk_window_at_pointer() to retrive the current GdkWindow the pointer is on if there is any. * gtk/gtktable.c (gtk_table_init): preallocate a table with one row and one column, so we don't construction logic at all. changed a few (x < y - 1) to (x + 1 < y), to avoid failing evaluations due to unsigned int wraps. * gtk/gtkwidget.c (gtk_widget_set_parent): removed left over code portion, added an additional check for parent != widget. * more GtkType and macro fixups. 1998-06-16 Federico Mena Quintero * gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra "clip" parameter, which is the clipping rectangle to use. This eliminates the extremely annoying flicker when exposing parts of the handlebox. Tue Jun 16 14:08:08 PDT 1998 Manish Singh * gtk/gtktable.c: fix from TimJ for off-by-one error in table resizing Tue Jun 16 06:29:57 1998 Tim Janik * gtk/gtkcheckmenuitem.c (gtk_check_menu_item_set_state): check for != 0 on the argument. * gtk/gtktable.h: * gtk/gtktable.c: new function gtk_table_resize() which allowes shrinking and expanding of tables. implementation of widget arguments and child arguments. many signedness corrections. Mon Jun 15 04:15:03 1998 Tim Janik * gtk/gtkbox.c (gtk_box_set_child_packing): queue the resize for the box not only the child, otherwise we might end up taking away other childrens space after the resize. * gtk/gtkitemfactory.c (gtk_item_factory_parse_menu_path): if we parse an unknown menu path from any source, that path must always be flagged as "modified", since we don't really know whether it has its default value or not. * gtk/gtktree.c: * gtk/gtkpacker.c: * gtk/gtknotebook.c: * gtk/gtkmenushell.c: * gtk/gtklist.c: * gtk/gtkpaned.c: * gtk/gtkfixed.c: * gtk/gtkbutton.c: implement gtk_*_child_type functions. * gtk/gtkbox.h: * gtk/gtkbox.c: type corrections for expand, fill, padding and pack_type arguments. implemented child arguments. * more GtkType and macro fixups. Sun Jun 14 16:30:02 1998 Tim Janik * gtk/gtkcheckbutton.h: GtkType and macro fixups. * gtk/gtkclist.h: exported the prototypes for gtk_clist_get_vadjustment and gtk_clist_get_hadjustment. * gtk/gtkcontainer.c: implementation of children arguments, new class member functions (child_type), (get_child_arg) and (set_child_arg) plus a new field n_child_args. (gtk_container_child_type): new function which returns the type of a child that the container expects for its next addition. (gtk_container_add_child_arg_type): new function to introduce a new child argument at class creation time. (gtk_container_query_child_args): new function to query all child arguments that are supported by a container class. (gtk_container_child_arg_getv): new fucntion to retrive the value of a child argument. (gtk_container_child_arg_setv): new function to set a child argument for a certain container and child combination. (gtk_container_add_with_args): (gtk_container_add_with_argv): new functions to feature addition of a new child in combination with the setting of certain child arguments. * gtk/gtktypeuitils.c (gtk_type_class_init): feature initialization of GtkContainerClass.n_child_args, similar to the GtkObjectClass members. this should really be done through class cretion hooks some day. * gtk/gtkcontainer.c: changed type of border_width from gint16 to guint : 16. * gtk/gtkpacker.h: * gtk/gtkpacker.c: renamed all PadX and PadY to pad_x and pad_y to follow the gtk convention for lower case variable names (important for language wrappers and widget arguments), and made them guint : 16. * examples/packer/pack.c: adaptions for the case converted GtkPacker fields. Fri Jun 12 16:33:23 1998 Tim Janik * gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): do not change the character pair for single line comments. (gtk_item_factory_parse_rc): use the cpair_comment_signle specified in GtkItemFactoryClass. (gtk_item_factory_parse_rc_string): likewise. Mon Jun 15 23:39:44 1998 Owen Taylor * gtk/gtkfontsel.[ch] (gtk_font_selection_dialog_init): Moved font lists from the klass structure to a static structure in gtkfontsel.c; cleans up global the namespace. Mon Jun 15 22:16:10 1998 Owen Taylor * gtk/makeenums.pl (parse_entries): Fix (untriggered) bug with /*< skip >*/ and remove warning. Mon Jun 15 20:14:09 1998 Owen Taylor * gtk/Makefile.am: Made the gtkmarshal.* generation rules maintainer-only. Mon Jun 15 16:29:45 1998 Owen Taylor * gdk/gdktypes.h gdk/gdkprivate.h gtk/gtk*.h gtk/Makefile.am gtk/makenums.pl Removed out the G_ENUM/FLAGS mechanism in favor of a perl script that parses the standard headers (with occasional /*< nick=foo >*/ style overrides) and extracts the enumerations. gtk/maketypes.awk: Small improvments to the translation of names. (Avoid splitting gc into g_c_.) Mon Jun 15 16:25:44 1998 Owen Taylor * gtk/gtk.h gtk/gtkfontsel.[ch]: Damon Chaplin's Font selection widget. Mon Jun 15 15:58:34 1998 Owen Taylor * gtk/gtkentry.c: - Restored gtk_entry_adjust_scroll to static - Changed text positioning code so that we always display as large a portion of the text as possible. Mon Jun 15 15:42:12 1998 Owen Taylor * gtk/gtktext.c (gtk_text_finalize): Free internal structures of text widget. Also, unreference pixmaps when unrealizing. Sat Jun 13 19:14:39 1998 Owen Taylor * gdk/gdkinputcommon.h (gdk_input_device_new): Change 3.3.1 bug workaround to number keys starting at 1. Sat Jun 13 11:56:57 1998 Owen Taylor * docs/gtk_tut.sgml: Fixed urls for complete example source for scribble+widget-writing examples. Sat Jun 13 11:48:26 1998 Owen Taylor * gdk/gdkpixmap.c (gdk_pixmap_extract_color): Patch from Tom Bech , to handle color specs of the form c #abcdef [ more keys ] properly. Sat Jun 13 10:51:56 1998 Stefan Jeske * gtkspinbutton.h gtkspinbutton.c testgtk.c (gtk_spin_button_set_shadow_type): New API to set the shadow type of the arrow panel. Fri Jun 12 21:20:42 1998 Owen Taylor * gtk/gtkoptionmenu.c (gtk_option_menu_expose): Removed code for drawing the child in two places at once. Unfortunately, not only does it not work anymore (because reparenting has been fixed), but it also triggers reparent/expose loops in some cases. * gtk/gtkoptionmenu.c (gtk_option_menu_remove_contents): Removed an unecessary unrealize. Fri Jun 12 21:18:56 1998 Owen Taylor * gdk/gdkwindow.c (gdk_window_reparent): Update the old and new parents' child window lists properly. Fri Jun 12 09:24:47 1998 Tim Janik * gtk/gtkpacker.h: * gtk/gtkpacker.c: renamed enum GtkAnchor and GtkSide to GtkAnchorType and GtkSideType, to be consistent with the rest of Gtk's enum definitions. wrapped the enum definitions with the G_ eunm wrappers. spelled out the GTK_ANCHOR_* enum values, since single letters don't work out corectly as nick-names (left the old values as aliases). some signdness corrections (border-width, spacing), could stand more. Thu Jun 11 14:38:33 CDT 1998 Shawn T. Amundson * gtk/gtkpacker.c, gtk/gtkpacker.h, gtk/gtk.h, gtk/Makefile.am: Added gtkpacker * examples/packer/pack.c, examples/packer/Makefile: Added gtkpacker example Thu Jun 11 13:09:00 1998 Owen Taylor * gtk/gtktext.c (remove_cache_line): Fixed broken list-removal code. * gtk/gtktext.c: (gtk_text_delete_(forward/backward)_cahr) Check bounds before deleting. Wed Jun 10 23:21:33 1998 Owen Taylor * autogen.sh: Support ACLOCAL_FLAGS Wed Jun 10 20:54:37 1998 Owen Taylor * gtk-config.in: Added missing quotes. Wed Jun 10 18:44:22 PDT 1998 Manish Singh * gtk/gtkfeatures.in: #define GTK_HAVE_ACCEL_GROUP 1998-06-10 Raja R Harinath * acconfig.h (GTK_COMPILED_WITH_DEBUGGING): Renamed from G_COMPILED_WITH_DEBUGGING. * configure.in (fd_set): Explain check better. * acinclude.m4: New file. Contains `libtool.m4' from libtool-1.2, the version from which gtk+'s libtool forked. Needed for people who use post-1.2 alphas of libtool. Wed Jun 10 19:36:35 1998 Owen Taylor * glib/* Moved to glib module * INSTALL Makefile.am acconfig.h autogen.sh configure.in gtk-config.in gtk.m4 gdk/Makefile.am gtk/Makefile.am configuration changes for the above: - Use AM_PATH_GLIB by default to find glib; also accept a --with-glib option for using an uninstalled glib. - Put --enable-debug information into config.h so that we rebuild when it changes. (was in glibconfig.h) Wed Jun 10 22:23:27 1998 Lars Hamann * gtk/gtkctree.c (draw_row): adapted clist pixmap clipping * gtk/gtknotebook.h (struct _GtkNotebookClass): * gtk/gtknotebook.c (gtk_real_notebook_switch_page): added missing argument (according to Joseph Coleman's bug report) * gtk/gtknotebook.c (gtk_notebook_set_focus_child): new class function to fix notebook focus handling Wed Jun 10 12:57:03 1998 Owen Taylor * gdk/gdkcc.c glib/ghash.c glib/glib.h glib/gstring.c glib/gutils.c glib/testglib.c glib/gdataset.c gtk/gtkaccelgroup.c gtk/gtkmain.c gtk/gtksignal.c gtk/gtktext.c gtk/gtkbindings.c: renamed g_const_pointer => gconstpointer Wed Jun 10 06:25:17 1998 Tim Janik * gdk/gdk.c (gdk_init): prevent gdk_init() from segfaulting when invoked with (NULL, NULL); (this worked sometime ago). * gtk/gtktypeutils.h: * gtk/gtktypeutils.c: enum and flags type creation can now be done through gtk_type_register_enum() and gtk_type_register_flags(), which allow to specify the enum value arrays directly. the NULL terminated value arrays can be retrived through gtk_type_enum_get_values() and gtk_type_flags_get_values(); (gtk_type_children_types): new function to query derived types. 1998-06-09 Raja R Harinath * gtk/Makefile.am (gtkmarshal.c gtkmarshal.h): Pass $srcdir in environment to genmarshal.pl. (gtk.defs,gtktypebuiltins*): Add $(srcdir) where needed (in the rule), and removed it where not needed (in the dependencies). * gtk/genmarshal.pl: Look for `gtkmarshal.list' in $srcdir. Tue Jun 9 18:44:57 1998 Owen Taylor * gtk/gtkobject.c: Removed g_object_pointer_hash, which was just g_direct_hash. Mon May 25 19:54:20 1998 Owen Taylor * configure.in: x_libs=, not $x_libs=. Enough said. (Case only hit for --disable-xshm) Mon May 25 12:08:14 1998 Owen Taylor * configure.in (LDFLAGS): Add to $CFLAGS and $LDFLAGS when testing for X libraries, don't replace them. Because the user might have specified the path to the X libraries themself before running configure. * examples/**.c: Changed all gpointer * to gpointer 1998-06-09 Federico Mena Quintero * gtk/gtkhandlebox.h (struct _GtkHandleBox): Removed the fleur_cursor field. Now the cursor is created/destroyed on demand by the routines that need it. * gtk/gtkhandlebox.c (gtk_handle_box_button_changed): (gtk_handle_box_motion): The fleur cursor is created and destroyed only when needed. Tue Jun 9 09:57:09 1998 Tim Janik * gtk/gtktypeutils.h: * gtk/gtktypeutils.c: renamed the newly created gtk_enum_get_values and gtk_enum_set_values to gtk_type_enum_get_values and gtk_type_enum_set_values respectively, since they are actually type system features. * gtk/gtktypebuiltins_evals.c: oops, screwed the NULL termination with my last commit. ;) Tue Jun 9 01:57:23 1998 Tim Janik * gtk/gtkselection.h: * gtk/gtkselection.c: new functions gtk_selection_data_copy and gtk_selection_data_free. * gtk/gtkwidget.c (gtk_widget_class_init): fixed gtk_signal_new() call for "selection_received", which was completely bogus. * other fixups to gtk_signal_new() calls all over the place. * gtk/gtktypebuiltins.h: types as variables (formerly macros). * gtk/gtktypebuiltins_vars.c: type variable implementations. * gtk/gtktypebuiltins_ids.c: array entries for builtin type declarations. * gtk/gtktypebuiltins_evals.c: enum value arrays. * gtk/gtk-boxed.defs: gtk and gdk structure definitions, used to build gtk.defs. * gtk/gtk.defs: generated file with scheme syntax for type definitions of gtk and gdk structures and enums. * gtk/gtktypeutils.h: * gtk/gtktypeutils.c: reworked type ids, so they are variables not macros anymore (this fixes binary incompatibility with new enum definitions). * gtk/gtkwidget.c (gtk_widget_real_key_press_event): proccess possible key bindings for this widget. * gtk/gtkwindow.c (gtk_window_key_press_event): chain parent class' handler. * gtk/gtkobject.h: * gtk/gtkobject.c: removed gtk_object_class_new_user_signal_no_recurse() again. new functions gtk_object_class_user_signal_new () and gtk_object_class_user_signal_newv (), to feature the GtkSignalRunType flag on the signal creation. Mon Jun 8 20:52:21 1998 Tim Janik * gtk/gtkcontainer.h: new signal GtkContainer::set_focus_child. Mon Jun 8 02:52:37 1998 Tim Janik * gdk/gdkprivate.h: * gdk/gdktypes.h: * gtk/gtkprivate.h: * gtk/gtkwidget.h: * gtk/gtkobject.h: wrapped enum definitions with glib macros. * reworked enum value array generation code. gtk.defs is a generated file now. Sun Jun 7 14:34:31 1998 Tim Janik * gtk/gtkitemfactory.c (gtk_item_factory_create_menu_entries): feature check menu items in the compatibility code (this required me to remove the "" part from the menu item name, grrr). 1998-06-07 Marius Vollmer * gdk/gdk.h (gdk_color_copy, gdk_color_free): New prototypes. * gdk/gdk.c (gdk_color_copy, gdk_color_free): New functions. Sun Jun 7 10:53:02 1998 Tim Janik * gtk/gtkitemfactory.h: * gtk/gtkitemfactory.c: further additions to fit the gimp's code. additions to the dumping code to feature GtkPatternSpec. even found a bug to fix in the original code ;) Sun Jun 7 09:36:04 1998 Tim Janik * gtk/gtkitemfactory.c: support different types of callbacks, to maintain existing code. Sat Jun 6 06:01:24 1998 Tim Janik * gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment. * gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from, this should eventually be done by gentypeinfo.el somewhen. * gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays. * gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the enum values of an enum type. * gtk/gtk.defs: * gtk/gtkcurve.h: * gtk/gtkobject.h: * gtk/gtkprivate.h: * gtk/gtkwidget.h: * gtk/gtkenums.h: brought enum/flags definitions in sync, added a few more enum definitions for bindings and pattern matching. * some more macro and GtkType fixups in various places. * gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used as a key-release modifier for the binding system. Fri Jun 5 06:06:06 1998 Tim Janik * gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it was a stale list pointer that is already present in GtkMenuShell. * gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal GtkMenuShell::selection_done which is emitted after the menu shell poped down again and all possible menu items have been activated. Thu Jun 4 02:20:42 1998 Tim Janik * gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue before activation of the menuitem, so the menu is actually taken off the screen prior to any menu item activation. * gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation for NULL nodes. * gtk/gtkwidget.h: * gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop the emission of the "add-accelerator" signal on a widget. this is usefull to prevent accelerator installation on certain widgets. * gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu labels left justified, by setting their alignment. stop accelerator installation for the menu items, since we use dynamic menus. Wed Jun 3 06:41:22 1998 Tim Janik * gtk/gtkmenufactory.c: adaptions to use the new accel groups. people should *really* use GtkItemFactory. this is only for preserving source compatibility where possible, use of GtkMenuFactory is deprecated as of now. * gtk/gtkobject.h (gtk_object_class_add_user_signal): new function to create user signals of type GTK_RUN_NO_RECURSE. don't know why i missed this possibility when i added gtk_object_class_add_user_signal in late january. * gtk/gtkmain.c (gtk_init): ignore subsequent function calls. Sun May 31 07:31:09 1998 Tim Janik * gtk/gtkaccelgroup.h: * gtk/gtkaccelgroup.c: new implementation of the accelerator concept. * gtk/gtkaccellabel.h: * gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features display of the accelerators associated with a certain widget. * gtk/gtkitemfactory.h: * gtk/gtkitemfactory.c: new widget, item factory with automatic rc parsing and accelerator handling. * gtk/gtkmenu.c (gtk_menu_reposition): new function to care for positioning a menu. (gtk_menu_map): removed the allocation code. (gtk_menu_size_allocate): care for redrawing of children and resize our widget->window correctly. (gtk_menu_key_press): feature the new accelerator groups. * gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the submenu if neccessary. * gtk/gtkmenuitem.c: * gtk/gtkcheckmenuitem.c: * gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label() function variants. * gdk/gdk.c: (gdk_keyval_from_name): (gdk_keyval_name): new functions for keyval<->key-name associations. (gdk_keyval_to_upper): (gdk_keyval_to_lower): (gdk_keyval_is_upper): (gdk_keyval_is_lower): new functions to check/translate keyvalues with regards to their cases. Wed May 27 00:48:10 1998 Tim Janik * gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a widget's class path. (gtk_widget_path): new function to calculate a widget's name path. * gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up pattern matching, features reversed pattern matches. Thu Jun 4 12:12:11 BST 1998 Tony Gale * examples/extract.sh, examples/extract.awk: New files to automagically extract code examples from the tutorial. Tue Jun 2 20:04:45 1998 Lars Hamann * gtk/gtknotebook.c (gtk_notebook_page_select) (gtk_notebook_focus) * gtk/gtkcontainer.c (gtk_container_focus_move): reversed test sequence for GTK_WIDGET_CAN_FOCUS and GTK_IS_CONTAINER Tue Jun 2 13:04:06 BST 1998 Tony Gale * docs/gtk_tut.sgml: minor changes to support auto extraction of example code Mon Jun 1 12:47:56 BST 1998 Tony Gale * docs/gtk_tut_it.sgml: Update of Italian Tutorial to Tutorial of 24th May, from Daniele Canazza Fri May 29 13:53:57 BST 1998 Tony Gale * docs/gtk_tut.sgml: - new section on Events - change all delete_event callbacks to include a GdkEvent parameter - clean up the formatting * examples - helloworld.c, helloworld2.c, notebook.c, packbox.c, pixmap.c, progressbar.c, radiobuttons.c, rulers.c, table.c, wheelbarrow.c: change all delete_event callbacks to include a GdkEvent parameter. 1998-05-26 Federico Mena Quintero * gdk/gdktypes.h (GdkCrossingMode): New enumeration for the "mode" field of crossing events. (struct _GdkEventCrossing): Added the following fields: time, x, y, x_root, y_root, mode, focus, state. * gdk/gdk.c (gdk_event_translate): Fill in the new fields of the crossing event structure. * gtk/gtkfeatures.h (GDK_HAVE_FULL_CROSSING_EVENT): Annotate changes to the crossing event structure. Tue May 26 15:51:28 1998 Radek Doulik * gdk/gdk.c: include gdkx.h always (for GDK_ROOT_WINDOW) Sun May 24 12:11:38 BST 1998 Tony Gale * docs/gtk_tut.sgml: - GtkTooltips, update to current API - change all 'gpointer *data' to 'gpointer data' - other minor changes Sat May 23 21:54:05 1998 Owen Taylor * configure.in (LDFLAGS): Bomb out with a moderately helpful message if detection of X libraries fails. Sat May 23 18:57:06 1998 Owen Taylor [ Combination of: gtk-rrh-980412-0.patch (Raja R Harinath ) gtk-jbuhler-980516-0 (Jeremy Buhler ) ] * gdk/gdk.h gdk/gdkcc.c gdk/gdkfont.c gtk/gtkmain.c gtk/gtksignal.c gtk/gtktext.c: Fixups for warnings from adding const to type of GHashFunc, GCompareFunc * gtk/gtkcombo.c (gtk_combo_entry_key_press): Minor style/ ansi-warnings fixups. Sat May 23 17:48:58 1998 Owen Taylor * gtk/gtkeventbox.c (gtk_event_box_size_allocate): Locate child at (border_width,border_width), not (2*border_width,2*border_width). [ The border is _outside_ widget->window ] * gdk/gdk.[ch]: added gdk_screen_width_mm/gdk_screen_height_mm functions. [From: Alexander Larsson ] 1998-05-22 Miguel de Icaza * gtk/gtkfeatures.h.in: Define GTK_HAVE_RC_SET_IMAGE_LOADER, to be used in gnome-libs 1998-05-22 * gtk/gtkeventbox.c: Pass size_allocate on to the child regardless of whether it is visible or not. Also locate child at (border_width,border_width), not (0,0) Fri May 22 03:02:40 1998 Owen Taylor * gtk/gtkhandlebox.c: Added style_set handler. Fri May 22 02:55:57 1998 Owen Taylor [ From: Chris Lahey ] * gtk/gtkeditable.c, gtk/gtkeditable.h, gtk/gtktext.c, gtk/gtkentry.c: Added get_position, and set_position functions to get and set the cursor position. * gtk/gtkeditable.c: Restored "insert_text" and "delete_text" to signal status. Make GtkText do user-controlled insertion and deletion through the Editable widget so that these signals are properly emitted. * gtk/gtkentry.c: Changed gtk_entry_set_visibility to display asterisks instead of empty space when visible = FALSE) Fri May 22 08:51:10 CEST 1998 Paolo Molaro * gtk/gtkclist.c: use GTK_TYPE_GDK_EVENT in (un)?select_row signal. 1998-05-21 * gtk/gtkrc.[ch]: gtk_rc_set_image_loader() - allow apps to set a custom routine for loading images specified in gtkrc's. Tue May 19 23:41:04 1998 Owen Taylor * configure.in: Use pthread_attr_init() as a test function, since most of the rest of -lpthread is macros on DU4. Tue, 19 May 1998 09:03:03 +0200 Paolo Molaro * gtk/gtkcombo.c: implemented completion in the entry. 1998-05-18 * gtk/gtk{debug.h,signal.c,main.c}: Allow GTK_DEBUG=signals Mon May 18 04:01:41 1998 Tim Janik * gtk/gtkwidget.c (gtk_widget_class_init): changed "proximity-in-event", "drop-data-available-event", "drop-enter-event" and "drop-leave-event" to be of runtype GTK_RUN_LAST. * gtk/gtkcontainer.c (gtk_container_class_init): likewise for "need-resize". * gtk/gtktipsquery.c (gtk_tips_query_class_init): likewise for "widget-selected". Sat May 16 09:04:32 1998 Tim Janik * gtk/gtkfilesel.c (gtk_file_selection_key_press): g_strdup() the text retrived from GtkEntry. only intercept the Tab key if there was some text to complete. Fri May 15 21:16:54 1998 Owen Taylor Basic thread-awareness: * acconfig.h configure.in: New option --with-threads=[yes/posix/no] * gdk/Makefile.am gdk/gdkthreads.c: Added new functions gdk_threads_[init/enter/leave] for applications, plus gdk_threads_wake to wake the mainloop thread out of the select(). * gtk/Makefile.am: gtk/testthreads.c: Test program for threads Fri May 15 12:08:48 1998 Owen Taylor * gtk/testgtk.c (list_clear): Account for the fact that gtk_list_clear_items is not inclusive. (Clears [start, end)) Fri May 15 12:31:27 1998 rodo * gdk/gdk.c: include gdkkeysyms.h always Fri May 15 09:44:10 1998 Tim Janik * gtk/gtkwidget.h (struct _GtkWidgetClass): corrected returntype of the visibility_notify_event method and changed method order. 1998-05-14 * gtk/gtkwidget.[ch] Added visibility_notify_event to GtkWidget Thu May 14 03:04:43 1998 Tim Janik * gtk/gtk.defs: added GtkButtonBoxStyle and GtkOrientation definitions from Olli Helenius . * gtk/gtktypeutils.c (gtk_type_free): new function to take care about freeing types. (gtk_type_set_chunk_alloc): new function to allow allocation of new types from a mem_chunk of certain size (n_chunks==0 indicates allocation thorugh g_malloc). * gtk/gtkobject.c (gtk_object_finalize): free an object through gtk_type_free(). * gtk/gtkbutton.c (gtk_button_get_type): set chunk preallocation for GtkButtons to 16. * gtk/gtkmenuitem.c (gtk_menu_item_get_type): likewise (16). * gtk/gtklabel.c (gtk_label_get_type): likewise (32). Wed May 13 00:53:52 1998 Owen Taylor * gtk/gtktypeutils.c gtk/gtksignal.c gdk/gdkdnd.c: A few more GPOINTER_TO_UINT fixes. * gtk/gtksignal.c: Include for memset. Tue May 12 23:10:53 1998 Owen Taylor (Maximilian Bisani : gtk-bisani-980320-0) * gtk/gtkvruler.c gtk/gtkhruler.c gtk/gtkruler.h: Cleanups, comments and the ability to have rulers with a reversed direction. Tue May 12 19:37:55 1998 Owen Taylor * gtk/gtkrc.c (gtk_rc_parse_file): Fixed up a stat() that Sopwith missed when changing stat => lstat. Tue May 12 19:19:29 1998 Owen Taylor * gtk/gtkinputdialog.c gtk/gtkgamma.c gtk/gtkrc.c gtk/gtkcolorsel.c gtk/gtkclist.c gtk/testgtk.c: Use GPOINTER_TO_INT/GINT_TO_POINTER macros where appropriate. * gdk/gdk.c: Print sizeof() results as g_print("%ld", (glong)sizeof(foo)), to deal with sizeof() being long on Alpha's. * gtk/testgtk.c: include for strlen Tue May 12 16:56:35 1998 Owen Taylor (James A : gtk-jamesa-980511-4.patch) * gtk/gtkbbox.h gtk/gtkcolorsel.h gtk/gtkvbbox.h: Changed #include "gtkfoo.h" to #include * gtk/gtkwindow.[ch]: Added const to gtk_window_set_wmclass Tue May 12 15:16:10 1998 Owen Taylor (From: Christopher James Lahey ) * gtk/gtkbutton.[ch] gtk/gtkenums.h gtk/gtktoolbar.[ch] gtk/testgtk.c: Added 'relief' for buttons - they can be either GTK_RELIEF_NORMAL (old style), or GTK_RELIEF_NONE - no relief in the NORMAL state. Added gtk_toolbar_{set,get}_button_relief, which set/get the default relief for the toolbars buttons. Added an toggle for the toolbar test in testgtk.c. Tue May 12 00:24:59 1998 Owen Taylor * docs/gtk-config.1: Rewritten and hopefully improved. Mon May 11 20:26:39 PDT 1998 Manish Singh * docs/Makefile.am * docs/gtk-config.1: added man page for gtk-config by Ben Gertzfield 1998-05-11 Federico Mena Quintero * gtk/gtkpreview.c (gtk_preview_realize): Create the window using GtkPreview's visual and colormap, otherwise things can BadMatch. * gtk/testgtk.c (create_color_preview): (create_gray_preview): Removed pushing/popping of visual/colormap now that GtkPreview does things correctly. * gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel_frame): (gtk_color_selection_draw_wheel): Pick the style from the correct place (the colorsel->wheel_area widget) so that the GCs will match with where we are going to paint to. * gtk/testgtk.c (create_color_selection): Removed pushing/popping of visual/colormap now that GtkColorSelection does things the right way. Mon May 11 21:04:51 1998 Owen Taylor * gtk/gtkwindow.c (gtk_real_window_move_resize): Use the previously unused window->need_resize flag to mark if a window's descendents changed size while the window was not visible. In this case, when the window becomes visible, we reallocate everything, since we didn't keep track of what actually changed. (Fixes bug where changing the popdown strings of a combo to something of the same length caused them to blank out, as reported by Todd Dukes ) Tue May 12 02:31:57 1998 Tim Janik [security audit by Alan Cox] * gtk/gtkobject.c (gtk_object_get_arg_type): check for arg_name to not exceed maximum assumed size. * gtk/gtkmenufactory.c (gtk_menu_factory_create): check that `path' does not exceed maximum assumed size. (gtk_menu_factory_remove): likewise. (gtk_menu_factory_find_recurse): likewise. Mon May 11 23:53:38 1998 Tim Janik * gtk/gtkwidget.c (gtk_widget_queue_resize): queue the idle_sizer with GTK_PRIORITY_INTERNAL - 1, so widgets get first resized and then redrawn if that is still neccessary. don't allow queueing of already destructed objects. (gtk_widget_idle_sizer): proccess the resize queue in a save manner, so widgets which are in the queue can be destroyed safely, handle requeueing properly. (gtk_widget_idle_draw): proccess the redraw queue in a save manner, so widgets which are in the queue can be destroyed/unrealized safely. Mon May 11 17:54:44 BST 1998 Tony Gale * gtkfaq.sgml: add question on multi-threading, minor URL cleanups. Mon May 11 09:56:45 1998 Tim Janik * configure.in (cflags_set): preserve automake CFLAGS. * Makefile.am: fully rename the created libraries to libgtk-1.1.la and libgdk-1.1.la. this means we need to change certain portions of the Makefile.am on major/minor version bumps. * ltmain.sh: the -release option is not required anymore. * gtk/gtkobject.h (gtk_trace_referencing): compile time check the type of the first argument to be of type GtkObject. unconditionally compile this function. removed __GNUC__ dependancy of the gtk_object_ref and gtk_object_unref macro wrappers for this function. Mon May 11 02:31:19 1998 Tim Janik * gtk/gtkobject.h: * gtk/gtkobject.c: (gtk_object_data_try_key): (gtk_object_data_force_id): these are now macros substituting the old functions. we just use the corresponding g_dataset_* functions for key->id associations. (this is to assure unique key<->id associations). 1998-05-10 Stefan Jeske * gtk/gtkctree.c (gtk_ctree_is_visible): Changed return value to gboolean. * docs/gtk.texi (GtkCTree): Started documentation of GtkCTree. Sat May 9 20:11:20 1998 Owen Taylor * configure.in (LIBS): Try to figure out if this is Digital Unix and we need -std1 to get the right prototypes. Sat May 9 16:30:33 BST 1998 Tony Gale * docs/gtk_tut_it.sgml: update of Italian tutorial translation from Daniele Canazza Sat May 9 02:34:41 1998 Tim Janik * gtk/gtkfeatures.h.in: new file used as template for * gtk/gtkfeatures.h: new file to define macros indicating newly introduced features, such as GTK_HAVE_SIGNAL_INIT. * gtk/gtksignal.c: (gtk_signal_emitv_by_name): (gtk_signal_emitv): new functions to emit signals with an already provided parameter set. (provided by Kenneth Albanowski ). (gtk_signal_real_emit): prototype changes, so this functions always gets its parameters and signal structure as arguments. (gtk_signal_emit): provide the signal structure and parameter list for gtk_signal_real_emit. (gtk_signal_emit_by_name): likewise. Sat May 9 00:03:12 1998 Tim Janik * gtk/gtksignal.c (gtk_signal_handler_unref): reflect the presence of signal connections through unsetting GTK_CONNECTED. (gtk_signal_handler_insert): reflect the presence of signal connections through setting GTK_CONNECTED. (gtk_signal_real_emit): only check for handler emissions if the object has the GTK_CONNECTED flag set. (gtk_signal_handler_pending): don't check for pending handlers if the GTK_CONNECTED flag is not set for this object. * gtk/gtkobject.h (enum): new flag GTK_CONNECTED to indicate whether a GtkObject has signal handler connections. * gtk/gtkobject.c (gtk_object_real_destroy): only if GTK_CONNECTED is set for this object call gtk_signal_handlers_destroy(). * gtk/gtktypeutils.h (GTK_TYPE_IS_A): deprecated macro, since it caused multiple processing of macro args. * gtk/gtktypeutils.c: * gtk/gtkobject.c: * gtk/gtkwidget.c: * gtk/gtksignal.c: reverted GTK_TYPE_IS_A back to gtk_type_is_a. Fri May 8 21:31:50 1998 Owen Taylor * gtk/gtkwidget.c (gtk_widget_queue_draw): Free the draw-queue when we are done. (gtk_widget_queue_draw/_queu_resize): Always return FALSE and avoid having two idles at the same time. Fri May 8 21:04:00 1998 Owen Taylor * gtk/gtktext.c: Various fixes to make sure cache lines are freed if line_start_cache doesn't point to the beginning of the cache. Thu May 7 09:44:22 1998 Owen Taylor * style_set improvements for GtkText and GtkEntry Thu May 7 19:03:50 1998 Tim Janik * gtk/gtktypeutils.c (gtk_type_unique): asure that the type system has been initialized. Thu May 7 12:52:45 1998 Tim Janik * gtk/gtkobject.c (gtk_object_set_data_by_id_full): allocate object data chunks through a global object data structure list. unlink object data before invoking its destroy function. (gtk_object_finalize): slight modification to allow usage of object data during object finalization. Thu May 7 10:29:24 1998 Tim Janik * gtk/gtksignal.c (gtk_signal_newv): suport middle dashes ('-') in signal names, e.g. "signal-name" is now an alias for "signal_name". (gtk_signal_handler_new): allocate handlers through a global handler structure list, that's faster than memchunks. (gtk_emission_new): allocate emissions through a global emission structure list, that's faster than memchunks. Thu May 7 05:14:19 1998 Tim Janik * gtk-config.in (--libs): postfix -lg* libraries with LT_RELEASE. * ltmain.sh: added a new commandline flag -postfix similar to -release, but will immediately change the library name. * gdk/Makefile.am: * gtk/Makefile.am: specify -postfix and -version-info * configure.in: version bump to 1.1.0. added GTK_INTERFACE_AGE and GTK_BINARY_AGE. calculate LT_* variables for libtool. 1998-05-06 Federico Mena Quintero * gtk/gtkclist.c (draw_row): Fixed incorrect painting of row background (fg_set -> bg_set confusion). 1998-05-06 Stefan Jeske * gtk/testgtk.c (unselect_all): Removed code that caused an endless loop. Wed May 6 02:16:34 1998 Tim Janik * gtk/gtksignal.c: reimplemented the signal storage system to use a linear array rather than a hash table. be carefull *not* to keep any GtkSignal pointers across invokations of gtk_signal_next_and_invalidate() and therefore gtk_signal_new[v](). general code cleanups, made all allocations through memchunks. (gtk_signal_lookup): we now do the lookup of signals through a key_id for the signal names to avoid multiple hashing of the signal name on lookups for the several hirarchy levels of an object. Tue May 5 19:49:27 1998 Owen Taylor * gdk/gdkpixmap.c: Patches from Gordon Matzigkeit to speed things up and remove code duplication. Reintegrated buffer overflow patches, and added some extra paranoia. Tue May 5 17:04:14 1998 Owen Taylor * gdk/gdk.c (gdk_event_translate): A guint * was being passed where X expected a Keysym *, and keysyms are long's on Alpha Linux. This was causing segfaults in Xlib, apparently because of alignment. (Bug located by Juergen Haas ) Tue May 5 19:11:27 1998 Owen Taylor * gtk/gtkdrawingarea.c (gtk_drawing_area_realize): Always set GDK_EXPOSURE_MASK for DrawingAreas Tue May 5 14:32:37 1998 Owen Taylor * gtk/gtkwidget.[ch]: removed gtk_widge_propagate_default_style (superceded by RC file reparsing capabilities) * gtk/gtkwindow.c: Add handling for _GDK_READ_RFCILES client events. (Shouldn't be sent to the InputOnly leader, which it is now by gdk_event_send_clientmessage_toall * gtk/testgtk.c: Added extra button to rcfiles test to send out _GDK_READ_RCFILES events. Tue May 5 11:03:00 1998 Owen Taylor * gtk/gtkselection.c (gtk_selection_clear): Fixed reversed conditionals that caused segfault on some platforms. Tue May 5 00:44:47 1998 Owen Taylor * gtk/gtkcontainer.c (gtk_container_set_focus_[hv]adjustment): cast to GTK_OBJECT for gtk_object_ref. Tue May 5 15:33:27 1998 Tim Janik * gtk/gtkmain.c (gtk_init): added gtk_signal_init() to avoid repeatedly checking for signal initialization in gtksignal.c. * gtk/gtktypeutils.c (TYPE_NODES_BLOCK_SIZE): reseted this to 200 after a long debugging period ;) 1998-05-05 Stefan Jeske * gdk/gdkgc.c gdk/gdk.h gtk/gtkctree.c (gdk_gc_set_dashes): New function to wrap XSetDashes; modified gtkctree.c to use it. 1998-05-04 Federico Mena Quintero * configure.in: Added $x_libs in the other_libraries field in the check for XShapeCombineMask. Mon May 4 00:30:11 1998 Tim Janik * gtk/gtktypeutils.h (GTK_TYPE_IS_A): new macro to speedup gtk_type_is_a(). * gtk/gtktypeutils.c: reimplemented the type storage system to use a linear array rather than a hash table. it actually speeded up testgtk for a *considerable* amount. be carefull *not* to keep any GtkTypeNode pointers across invokations of gtk_type_node_next_and_invalidate() and therefore gtk_type_unique()! * gtk/gtkobject.h (GTK_IS_OBJECT_CLASS): new macro to test for the inheritance of a class pointer. (GTK_OBJECT): modifications for speedups. (GTK_IS_OBJECT): likewise. (GTK_OBJECT_CLASS): likewise. (suggested by owen). * gtk/gtkcontainer.h (GTK_IS_CONTAINER_CLASS): new macro. * gtk/gtkwidget.h (GTK_IS_WIDGET_CLASS): new macro. * gtk/gtk.defs (GtkTooltips): define GtkTooltips as object not as boxed, since its derivation changed 4 month ago ;(. showed up with the unique type name checking code in gtk_type_unique(). * random guint->GtkType and macro fixups. Sat May 2 23:14:34 1998 Owen Taylor * gtk/gtkcurve.c (gtk_curve_graph_events): Ignore Configure events that would result in a negative size. Sun May 3 14:55:34 1998 Owen Taylor * docs/gtkfaq.sgml (CPPFLAGS): Added a FAQ entry about "glibconfig.h" and another about writing another IRC client. Sat May 2 00:14:05 1998 Owen Taylor * gtk/gtkpreview.c (gtk_trim_cmap): Make sure the parameters to log are doubles. Digital Unix apparently is missing the argument in its prototype. Sun May 3 19:04:46 1998 Owen Taylor * gtk/gtklabel.c (gtk_label_state_changed): Don't force a clear until the widget is actually on screen. Sun May 3 21:32:35 1998 Owen Taylor * gdk/gdk.c (gdk_event_translate): Grab with OwnerEvents = False to make this consistent with the gtk-1-0 tree. Sun May 3 13:38:22 1998 Owen Taylor * configure.in acheader.h gdk/gdkwindow.c Check for Shape extension both on the client and server side. (And, more importantly, check for the shape extension so we may include -lXext even when compiling with --disable-xshm) Don't set override_redirect on all shaped windows. It isn't necessary. * gdk/gdkwindow.c: Set ->colormap to NULL for root and foreign windows. Use this to check if we need to get the colormap from X. Fri May 1 22:32:47 1998 Owen Taylor * gtk/gtkbutton.c (gtk_button_paint): Draw the areas between the default and the button always in GTK_STATE_NORMAL. * gtk/gtkrange.c (gtk_range_style_set): Added a style_set callback. Fri May 1 16:40:57 1998 Owen Taylor * gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpmp[_d]): Fix a buffer overflow on pixmaps that claim to have more than 31 characters per pixel. (gdk_pixmap_read_string): Don't wrap around strings longer than half of address space ;-) * gtk/gtk[vh]ruler.c gtk/gtkinputdialog.c: Expand some buffers that were used for printing integers. * */* (almost): Style: All int foo () { ... } changed to int foo (void) { ... } Even where there were proper prototypes elsewhere. * gdk/gxid.c (handle_claim_device): Some extra checks. It isn't safe against being fed bad X id's, but at least it should be safe against deleting all your files. Sun May 3 19:45:09 1998 Tim Janik * gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function to set the adjustments value when there is no current emission. [ Removed by mutual agreement owt 5/3/1998 ] * gtk/gtksignal.c: added new functions to retrive the number of existing emissions for a certain signal. (gtk_signal_n_emissions): new function. (gtk_signal_n_emissions_by_name): new function. Sun May 3 16:55:43 1998 Tim Janik * gtk/gtkcontainer.c (gtk_container_set_focus_child): new function to set the current focus_child of a container, does proper referencing and adjusts the vadjustment/hadjustment associated with the focus widget. * gtk/gtkwidget.c (gtk_widget_grab_focus): set the focused child on containers via gtk_container_set_focus_child. * gtk/gtknotebook.c: modifications to use gtk_container_set_focus_child where appropriate. * gtk/gtkcontainer.c (gtk_container_remove): removed unsetting of focus child since not every child removal goes through this function (this showed up after gtk_container_set_focus_child() started to reference the focus_child of a container). * gtk/gtkwidget.c (gtk_widget_unparent): moved unsetting the focus_child of a container from gtk_container_remove into this place. Sat May 2 22:33:45 1998 Tim Janik * gtk/gtksignal.c: added new functions to operate on intermediate function pointers. implemented incremental blocking. (gtk_signal_disconnect_by_func): new function. (gtk_signal_handler_block_by_func): new function. (gtk_signal_handler_unblock_by_func): new function Fri May 1 22:45:55 1998 Owen Taylor * gtk/gtkscrolledwindow.c (gtk_scrolled_window_size_allocate): Always show the scrollbars when the policy is GTK_POLICY_ALWAYS... Sat May 2 20:19:03 1998 Tim Janik * gtk/gtkadjustment.c (gtk_adjustment_set_value): only emit "value_changed" if we really passed a new value. (gtk_adjustment_changed): new function to emit the "changed" signal. (gtk_adjustment_set_value): new function to emit the "value_changed" signal. Fri May 1 12:28:35 1998 Owen Taylor * gtk/gtkcombo.c: Further changes to the way the window is popped up so that it will be compatible with auto-scrolling in the future. Fri May 1 20:25:29 1998 Tim Janik * gtk/gtkcombo.c (gtk_combo_popup_list): do not just return if the combo-list is empty since that will cause the combo to operate on a non existing GtkList window. (gtk_combo_get_pos): provide the combo list with a usfull default height if empty. (gtk_combo_popup_button_press): grab the focus. (gtk_combo_activate): grab the focus. Fri May 1 12:06:43 1998 Owen Taylor * gtk/gtkwindow.[ch] (gtk_widget_reset_rc_styles): New function to reset the RC styles for a heirarchy Clear the window background if necessary in gtk_window_style_set. * gtk/gtkrc.[ch]: New function gtk_rc_reparse_all() which rereads all previously read RC files. * gdk/gdkwindow.c gdk/gdk.h: New function gdk_window_get_toplevels(). (Should it just be called gdk_get_toplevels?) * gtk/testgtk.c: New test to reload RC files. Fri May 1 13:57:36 1998 Tim Janik * gtk/gtkclist.h: * gtk/gtkclist.c: prefixed all clist flags with GTK_ to avoid name clashes. redefined GTK_CLIST_SET_FLAGS and GTK_CLIST_UNSET_FLAGS as GTK_CLIST_SET_FLAG and GTK_CLIST_UNSET_FLAG to automatically add the GTK_ prefix (this solution involved less changes in the gtkclist.c code). added a GTK_CLIST_CONSTRUCTED flag to substitute the mem_chunk==NULL test in gtk_clist_construct. merged in changes from lars & stefan to support the derivation of GtkCtree. * gtkctree.h: * gtkctree.c: initial import of a tree widget derived from gtkclist, courtesy of Lars Hamann and Stefan Jeske , it just damn rocks! Fri May 1 10:05:44 1998 Tim Janik * gtk/gtklist.c (gtk_list_add): let gtk_list_append_items do the work for us. (gtk_list_insert_items): (gtk_list_remove_items_internal): (gtk_list_clear_items): remove a possible pointer grab, we might get thrown into a loop otherwise. (gtk_list_button_press): grab the pointer *before* selecting the child, because selection of items may cause the lists children to change, resulting in a grab release. (gtk_list_clear_items): use gtk_list_unselect_child() for unselection of children. (gtk_list_shutdown): remove all children from the list. (gtk_real_list_unselect_child): (gtk_real_list_select_child): *always* put our internal structures into sane state *before* signal emisions (i.e. list->selection updates prior to gtk_list_item_[de]select() calls). * gtk/gtkcombo.c (gtk_combo_init): adjust the scrollbar if the lists focused child walks out of the window. removed CAN_FOCUS for the combo arrow's button since it doesn't react to keyboard events ("clicked" connection is missing). Fri May 1 00:42:25 1998 Owen Taylor * gdk/gdkwindow.c (gdk_window_get_colormap): Fix up getting colormap for FOREIGN windows to go along with Raster's fix for visuals. Merges from gtk-1-0 =================== Thu Apr 30 23:32:51 1998 Owen Taylor * gtk/gtkscrolledwindow.c (gtk_scrolled_window_size_allocate): Check to catch the case when the viewport fits in either direction or both, instead of flip-flopping infinitely. Only show/hide the scrollbars once at the end. Thu Apr 30 21:56:07 1998 Owen Taylor * gtk/gtkscrolledwindow.c (gtk_scrolled_window_foreach): Include the scrollbars in the foreach call. (gtk-fortier-980405-0.patch; Patrice Fortier ). The notebook widget really should also include its tabs, but that might cause problems for programs if they Thu Apr 30 21:51:52 1998 Owen Taylor * gtk/gtkpixmap.c (gtk_pixmap_set): Only request a resize if the size actually changed. (gtk-johannes-980414-0.patch ; johannes@nada.kth.se (Johannes Keukelaar) ) Thu Apr 30 10:22:59 1998 Owen Taylor * glib/ltmain.sh glib/ltconfig glib/config.sub glib/config.guess: ltmain.sh ltconfig config.sub config.guess: Reverted back to libtool-1.2 (plus minor patches) so as not to force the issue for everyone else. Thu Apr 30 10:22:59 1998 Owen Taylor * glib/ltmain.sh glib/ltconfig glib/config.sub glib/config.guess: Updated to libtool 1.2a. * gtk/gtkclist.c: Draw the in-between lines with style->base instead of style->white. Wed Apr 29 15:46:13 1998 Owen Taylor * gdk/gdkprivate.h gdk/gdkwindow.c gdk/gdkpixmap.c: Cache the colormap and children of a window locally instead of fetching them from the server when needed. Huge performance difference for creating/destroying windows. * gtk/gtkstyle.c: Find the depth from the cached visual, instead of asking the server. * gtk.m4: Distribute the new version which tries to figure out what went wrong and give helpful error messages. * ltmain.sh ltconfig config.sub config.sh: Updated to libtool 1.2a * gtk/gtktext.c: Fixed a bug where the drawn level was being messed up when the text was scrolled during a deletion. Thu Apr 30 02:42:11 PDT 1998 Manish Singh * gtk/gtkfilesel.c: don't die when naughty people remove parts of the filesystem under you (fix from Josh) Thu Apr 30 09:49:14 1998 Tim Janik * gtk/gtkscrolledwindow.c (gtk_scrolled_window_foreach): check if the viewport already exists before iterating over it, maybe we haven't been constructed yet. Thu Apr 30 01:51:00 1998 Tim Janik * gtk/gtkbin.c (gtk_bin_add): made this function issue a warning if the GtkBin widget already has a child. * gtk/gtkbox.c (gtk_box_pack_{start|end}): check that child->parent == NULL; Tue Apr 28 22:13:54 1998 Owen Taylor * gtk/gtkselection.c (gtk_selection_clear): Only return FALSE when the clear event is been rejected, not when widget has already lost the selection. (Which should only happen when we are setting the selection to another widget ourself.) Fri Apr 24 19:07:32 1998 Owen Taylor * gtk/gtkfixed.c gtk/gtkpaned.c gtk/gtktable.c: Removed the "check visibility after gtk_widget_unparent" bug in hopefully the last three places. Tue Apr 28 15:46:41 1998 Tim Janik * gtk/gtkrc.c (gtk_rc_parse_statement): allow the inclusion of other rc-files. Mon Apr 27 15:11:52 1998 Tim Janik * gtk/gtkwidget.c (gtk_widget_grab_focus): only allow grabbing of focus for CAN_FOCUS widgets. * gtk/testgtk.c (create_scrolled_windows): feature h/v focus adjustments for the table. (create_list): feature automatic adjustment of the scrolled window to always contain the focused child. (create_main_window): keep the focussed button always inside of the scrolled windoww. * gtk/gtkcontainer.c (gtk_real_container_focus): set the h/v focus adjustments, to contain the allocation of the currently focused child. (gtk_container_set_focus_hadjustment): new functin to set the horizontal focus adjustment. (gtk_container_set_focus_vadjustment): new functin to set the vertical focus adjustment. * gtk/gtkadjustment.c (gtk_adjustment_clamp_page): new fucntion to clamp the currents adjustment page into a specific range. * random GtkType fixups for gtk_*_get_type() functions. Fri Apr 24 18:37:16 1998 Owen Taylor * gtk/gtktreeitem.c (gtk_tree_item_remove_subtree): Account for the fact that gtk_tree_item_remove_subtree will be called recursively. Handle removing a collapsed subtree. (From Andy Dustman ) * gtk/gtktree.c (gtk_tree_remove_items): Look for the root tree when removing items from a non-previously mapped tree. * gtk/testgtk.c: Added a remove_subtree button. Thu Apr 23 23:44:17 1998 Owen Taylor * gtk/gtkobject.c (gtk_object_finalize): Notify all weak references before object removing data. This change fixes a bug where removing the last weak references would cause it to be triggered. Wed Apr 15 20:42:46 1998 Owen Taylor * gdk/Makefile.am: Removed mostly useless dependency that was causing problems for SGI's make, when used with the 'make dist' form of GTK+. (Dependency caused dependencies to be redone when BUILT_SOURCES changed) Thu Apr 30 11:18:00 1998 Owen Taylor * gtk/gtkcombo.[ch]: Allow the user to use the popup list like a menu. * gtk/gtkmenuitem.c gtk/gtkitem.c: Moved enter/leave handlers to gtkitem.c so dragging can also work in lists. * gtk/gtklist.[ch]: Track child enter events and use those to allow dragging the selection. Thu Apr 30 11:16:06 1998 Owen Taylor * gtk/gtktext.c: Try enabling background pixmaps for editable text widgets. There is a bit of flashing, but not too bad. If you don't want the flashing, you can always not set a background pixmap. Wed Apr 29 15:46:13 1998 Owen Taylor * gtk/gtktext.c: Fixed a bug where the drawn level was being messed up when the text was scrolled during a deletion. 1998-04-28 Miguel de Icaza * gdk/gdk.c (gdk_event_translate): Random debugging fixed this bug: There is no need to set the ExposureMask in the XGrabPointer (this caused DnD programs to crash). Fri Apr 24 01:29:04 1998 Tim Janik * gtk/gtkaccelerator.h (struct _GtkAcceleratorTable): changed ref_count field to be of type guint. * gtk/gtkaccelerator.c (gtk_accelerator_table_unref): added check for ref_count>0; (gtk_accelerator_table_install): keep a per object list of accelerator tables that refer to this object. (gtk_accelerator_table_remove): remove the accelerator table from the per object list. (gtk_accelerator_table_clean): warn if there are any object references left in an accelerator table upon destruction. (gtk_accelerator_tables_delete): new function to delete object references from the accelerator tables associated with this object. * gtk/gtkwidget.c (gtk_widget_class_init): changed emission of GtkWidget::install_accelerator to GTK_RUN_LAST so the installation of an accelerator can be prevented by gtk_signal_emit_stop(). (gtk_widget_real_destroy): call gtk_accelerator_tables_delete (), so there are no stale pointers in accelerator tables left. 1998-04-22 Federico Mena Quintero * gtk/gtkbin.c (gtk_bin_remove): Remember whether the widget was visible before we unparent it. Wed Apr 22 04:15:26 1998 Tim Janik * gtk/gtkmain.c (gtk_handle_current_timeouts): prepend the running_timeouts list with the tmp_list link itself, not with a new GList structure pointing to our link. that would fill up memory and causes the GList.data fields of the running_timeouts list to point to GList structures and not GtkTimeoutFunction structures which is a *really* bad thing. (gtk_handle_current_idles): likewise (exchange "timout" with "idle" in the above entry ;). Sat Apr 18 22:18:12 1998 Tim Janik * gtk/gtkradiomenuitem.h: * gtk/gtkradiomenuitem.c (gtk_radio_menu_item_set_group): new function ala gtk_radio_button_set_group. (gtk_radio_menu_item_init): assure that we always have at least a group that points to self. * gtk/gtkradiobutton.c (gtk_radio_button_set_group): few cleanups and added g_return_if_fail() statements. (gtk_radio_button_init): assure that we always have at least a group that points to self. Fri Apr 17 03:05:05 1998 Tim Janik * ChangeLog split up into ChangeLog.pre-1-0 and ChangeLog. Wed Apr 15 05:13:09 1998 Tim Janik * gtk/gtklabel.c (gtk_label_size_request): corrected a brace position (Damon Chaplin), which i got wrong when applying Damon's patch the last time. Wed Apr 15 20:42:46 1998 Owen Taylor * gtk/gtkpreview.c (gtk_preview_get_visuals): Make sure that when we are running with a non-installed colormap, in 8-bit pseudo-color, we actually are using the system visual. (Fixes *Bad Match* errors on Digital Unix machines with multiple 8-bit pseudo-color visuals) 1998-04-14 Miguel de Icaza * gdk/gdkwindow.c (gdk_window_xid_at): Fix the problem introduced by whoever thought that randomly changing ints to unsigned int without reviewing the code was a good idea. It is, btw not mentioned in the ChangeLog as usual, but I know it was not Elliot the culprit this time. Mon Apr 13 19:16:22 PDT 1998 Shawn T. Amundson * Released GTK+ 1.0.0 070701000153bc000081a40000000a0000000a000000013d12d3980002bf5e0000008800000003000000000000000000000020ff35088dreloc/doc/gtk/ChangeLog.pre-1-0Mon Apr 13 19:16:22 PDT 1998 Shawn T. Amundson * Released GTK+ 1.0.0 Mon Apr 13 21:40:14 1998 Owen Taylor * gtk/gtktext.c (find_char_width): Don't read the character past the end of the text. * gtk/gtkrange.c (gtk_real_range_timer): If the mouse button has been released before the timer is activated, don't keep on scrolling. * gdk/gdk.c (gdk_event_translate): Filter subsequent configure events after we discard the first. Removed obsolete and sometimes very slow GdkOtherEvent. (Left in gdktypes.h with signal in GTK) Mon Apr 13 18:03:54 PDT 1998 Shawn T. Amundson * README: update address info to gtk.org for ftp and web sites. 1998-04-13 Federico Mena Quintero * gdk/gdkregion.c (gdk_region_polygon): New function; wrapper for XPolygonRegion(). * gdk/gdk.h: Added prototype for gdk_region_polygon(). * gdk/gdktypes.h (GdkFillRule): New enum type of fill rule for polygons. Mon Apr 13 15:04:26 1998 Michael K. Johnson * gtk/testgtk.c (create_clist): removed duplicate call to gtk_widget_set_policy. Mon Apr 13 05:03:11 1998 Tim Janik * gtk/gtkwindow.c (gtk_window_add_accelerator_table): check for accelerator table to be != NULL. (gtk_window_remove_accelerator_table): likewise. Sun Apr 12 19:35:09 PDT 1998 Shawn T. Amundson * INSTALL: typo, gtk-1.0.0 should be gtk+-1.0.0 * README: A little more intro on what gtk is... Sun Apr 12 22:43:22 1998 Owen Taylor * gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): An old allocation error. * gtk/gtkviewport.c (gtk_viewport_add): Don't map when adding a not-VISIBLE widget to a VISIBLE viewport. Sun Apr 12 18:54:29 PDT 1998 Shawn T. Amundson * Changed LGPL address for FSF in all .h and .c files Sun Apr 12 20:09:40 1998 Owen Taylor * gtk/gtklabel.[ch] (gtk_label_expose): Set a flag so instead of clearing the area in advance. That looked _really_ bad. * gtk/gtkcontainer.c (gtk_container_class_init): Changed "focus" to RUN_LAST. * gtk/gtkentry.c (gtk_entry_realize): Fixed place where allocation was used where requisition was meant. (Found by David J N Begley ) * gtk/gtkwindow.c (gtk_window_set_default): Fixed assertion in when setting default to NULL> ("Damon Chaplin" ) * gtk/gtkwidget.c (gtk_widget_unparent): Unset the default widget on the toplevel, if necessary. Sun Apr 12 02:04:21 1998 Owen Taylor * gtk/gtkpreview.c: Removed unecessary and harmful htons/ntohs when storing properties. (X does the byte swapping itself) Sat Apr 11 02:01:31 1998 Owen Taylor * gtk/gtktext.c (scroll_down): Removed incorrect part of assertion that was causing failures for scrolling a single line very short text widget. Sat Apr 11 01:41:55 1998 Owen Taylor * gtk/gtktext.c (expose_text): Fixed a sign problem (typedef gint guint!). Added some checks to make sure things are positive. Sat Apr 11 05:51:22 1998 Tim Janik * gtk/gtktooltips.c (gtk_tooltips_event_handler): don't shut down the tooltip on expose events. * gtk/testgtk.c (create_progress_bar): add an example tooltip. Fri Apr 10 00:10:16 1998 Owen Taylor * README/INSTALL: Extended for the 1.0 release. * TODO: Eliminated the "before 1.0" section Thu Apr 9 19:31:51 PDT 1998 Shawn T. Amundson * AUTHORS NEWS README configure.in gtk+.spec glib/configure.in: changes for 1.0.0 release. Thu Apr 9 18:36:31 1998 Owen Taylor * gtk/gtkmisc.c gdk/gdkwindow gtk/gtkentry.c gtk/testgtk.c: Picky --enable-ansi cleanups. * gtk/gtkstatusbar.c (gtk_statusbar_pop): Pop top message off _belonging_to_this_context_. (gtk-d4bjorn-980409-0) From "Damon Chaplin" * gtk/gtktable.c (gtk_table_size_request_pass3): Small fix to size requisition code. * gtk/gtknotebook.c: Make sure not to do things to page->tab_label if it doesn't exist. Thu Apr 9 14:24:35 1998 Owen Taylor (Found by Mattias.Gronlund" ) * gtk/gtkcurve.c (gtk_curve_interpolate): Added a missing g_free. * gtk/gtkcurve.c (gtk_curve_graph_events): Limits were off by one, resulting in writing past array bounds. Removed some unused code. * gdk/gdk.c (gdk_dnd_drag_begin): The event structure used for gdk_event_put should be a GdkEvent, not a subtype, since it will all be copied. * gtk/gtkcolorsel.c: Added a unrealize handler that unref's the GC's that were created. * gtk/testgtk.c (clist_warning_test): ref and sink child because it may never be added to anything. Wed Apr 8 20:50:02 1998 Owen Taylor * gtk/gtkwindow.c (gtk_window_set_hints): Removed unsed variables (gtk-jbuhler-980408-0) Wed Apr 8 17:27:40 1998 Owen Taylor * gtk/gtkwidget.c (gtk_widget_unparent): Make sure widgets get removed from the resize queue before the connection between them and the resize queue is broken by unparenting their parent. 1998-04-08 Miguel de Icaza * gdk/gdk.c (gdk_event_translate): During drag and drop, set the event mask at ButtonPress time to include ButtonPressMask and ButtonReleaseMask, otherwise, if the button is released, and we get a LeaveNotify event, it still thinks we are doing a drag. Tue Apr 7 22:45:37 PDT 1998 Shawn T. Amundson * Released GTK+ 0.99.10 Wed Apr 8 01:33:58 1998 Owen Taylor * gtk/gtkviewport.c (gtk_viewport_realize): Handle border width correctly on realize after allocate. Tue Apr 7 23:06:00 1998 Owen Taylor * Changes for GTK+ 0.99.10 * examples/find-examples.sh: Script to find all the files we need to distribute from the examples directory. Tue Apr 7 19:14:03 1998 Owen Taylor * gdk/gdkpixmap.c: Added maximum field widths to prevent possible '%s' scanf overflows. Replaced scanf("%c") with getc(), Don't interpret /*/ as a full comment. Use g_realloc/g_new. * gtk/gtkwidget.h gtk/gtkprivate.h: Changed all flag tests to check for ((GTK_WIDGET_FLAGS(widget) & FLAG) != 0) instead of (GTK_WIDGET_FLAGS(widget) & FLAG) * gtk/gtkfilesel.c: Use getwd() instead of getcwd() on SunOS, because getcwd() hangs up in a wait4(). (Found by David Monniaux ) - Check device/inode/mtime not just inode/mtime, when caching scanned directories. (From: scottk@ig.utexas.edu (Scott Kempf)) * gdk/gdkpixmap.c: Check for 0 width/height when creating pixmaps. * gtk/*.c: Global substitution of recently introduced "MAX (0," for allocations to "MAX (1,", since creating a backing pixmap with a zero width or height fails. * gdk/gdkwindow.c (gdk_window_new): Don't set all the WM properties for child windows. Don't set the base size, since the value we set will be taken as a minimum size. Wed Apr 8 00:00:48 1998 Tim Janik * gtk/gtklabel.c (gtk_label_expose): don't take '\n' into account for size computation (Damon Chaplin). * gtk/gtkvscale.c (gtk_vscale_draw_value): adjusted static snprintf() buffer size to 32 characters (Damon Chaplin). * gtk/gtkhscale.c (gtk_hscale_draw_value): likewise. * gtk/gtkmain.c (gtk_main_iteration_do): gdk_flush() the X-queue if iteration_done==TRUE since we will most likely not get invoked again (Marius Vollmer). Mon Apr 6 23:48:29 1998 Owen Taylor * gtk/gtkwindow.c (gtk_window_realize): Set the window hints on every map so that GTK_WIN_POS_MOUSE works correctly. 1998-04-06 Federico Mena Quintero * gtk/gtktable.h: * gtk/gtktable.c (gtk_table_set_homogeneous): Added function to set the homogeneous flag of the table (needed by derived widgets and such). 1998-04-03 Federico Mena Quintero * gtk/gtkradiobutton.h: Add prototype for gtk_radio_button_new_with_label_from_widget. Mon Apr 6 18:48:49 BST 1998 Tony Gale * docs/gtkfaq.sgml: more on GIMP (et al) configure problems. Mon Apr 6 08:05:23 1998 Owen Taylor * gtk/gtkbutton.c (gtk_button_paint): Take border in account properly. * gtk/gtktext.c (gtk_text_realize): Don't recompute geometry when creating with initial 1x1 geometry, since our calculations can't handle that. Leave text->line_start_cache NULL as sign we don't have a real geometry yet. * gtk/gtkentry.c (gtk_entry_motion_notify): Use the x value we get from gdk_window_get_pointer, not from event->x - since we always specify OwnerGrabButtonMask (why???), event->x can refer to another window. Mon Apr 6 08:08:49 BST 1998 Tony Gale * docs/gtk_tut.sgml examples/helloworld/helloworld.c: Change a missed "delete_event" return value description from TRUE to FALSE. Mon Apr 6 00:28:28 1998 Owen Taylor * gtk/gtkcontainer.c (gtk_container_focus_tab): Make tab key move in reading order (left-to-right top to bottom) - which might have been the original intended behavior modulo sorting bugs. * gtk-config.in: Never output -I/usr/include from --cflags Sun Apr 5 21:47:12 1998 Owen Taylor * gtk/gtkmenubar.c: Fixed bug where right justified menu would overlap last left justified item. Sun Apr 5 19:30:23 1998 Owen Taylor * gtk/gtkclist.c: Fixed assignment of adjustment->value to negative values. Moved a few other allocation type things around in ways that may or may matter. Fixed some allocation errors (scrollbars were overlapping main window). * gtk/gtkbutton.c (gtk_real_button_released): Small hack to keep button labels from vanishing when the invoked operation blocks. * gtk/gtkbox.c (gtk_box_remove): Assigning GTK_WIDGET_VISIBLE (widget) to a gboolean (char) is _bad_. GTK_VISIBLE == 256. Sun Apr 5 15:08:25 1998 Owen Taylor * gtk/gtkmain.c: Reverted broken implementation of removing the current timeout/idle. Substituted a (hopefully) functional one. Sun Apr 5 09:35:55 1998 Tim Janik * gtk/gtkmain.c (gtk_events_pending): take expired timeouts into account, otherwise things like e.g. spin-buttons don't work. also, count gtk_main_quit() as an event. Sun Apr 5 08:03:01 1998 Tim Janik * gtk/gtkspinbutton.c: fixed panel allocation and stacking order, fixed the base class realization. * gtk/gtkmisc.c: implemented widget arguments. * gtk/gtkentry.c: fixes in _realize to behave similar to _size_allocate. Sat Apr 4 12:23:23 BST 1998 Tony Gale * docs/gtk_tut.sgml: (gtk-crichton-980403-0) subsections on Aspect Frames and Paned widgets. * examples/paned examples/aspectframe: new examples Fri Apr 3 23:15:55 1998 Owen Taylor * gtk/gtktext.c: Test for need to recompute geometry with GTK_WIDGET_REALIZED(), not GTK_WIDGET_DRAWABLE(). 1998-04-03 Federico Mena Quintero * gtk/gtkhandlebox.c (draw_textured_frame): New function to draw a nifty "textured metal" frame. Could be useful in gtkstyle.c, maybe. (gtk_handle_box_paint): Paint a handle that does not make you puke when you look at it. Fri Apr 3 21:03:38 1998 Owen Taylor * gtk/gtktext.c (gtk_text_realize): Call recompute_geometry() upon realization, since it can't be done in the previous size_allocate. Fri Apr 3 20:36:52 1998 Owen Taylor * gdk/gdk.c gtk/gtkmain.c: Accept debug options in the form --g[td]k[-no]-debug=xxx as well Fri Apr 3 18:33:47 1998 Owen Taylor * gtk-config.in: Added flags --prefix[=dir] and --exec-prefix[=DIR] which allow querying and overriding the configured-in prefix and exec-prefix. * gtk.m4: Added configure flags --with-gtk-prefix= and --with-gtk-exec-prefix= to set the --prefix and --exec-prefix argumetns to gtk.m4 Fri Apr 3 17:14:55 1998 Owen Taylor * gdk/gdk.c: More extensive debugging output * gtk/gtkalignment.c gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtkclist.c gtk/gtkeventbox.c gtk/gtkhandlebox.c gtk/gtk[hv]box.c gtk/gtk[hv]paned.c gtk/gtklist.c gtk/gtkmenu.c gtk/gtkmenubar.c gtk/gtkmenuitem.c gtk/gtknotebook.c gtk/gtktable.c gtk/gtktree.c gtk/gtktreeitem.c gtk/gtkviewport.c Avoid assigning negative values to unsigned allocation.width and height * gtk/gtkwindow.c: Instead of realizing the widget, then size allocating, (resulting in XMoveResizeWindows for all children, do the size allocation first, then realize. In gtk_real_window_move_resize, combine move and resize into a single GDK/X call when possible. * gtk/gtkclist.c gtk/gtkdrawingarea.c: Remove assumption that the widget will be size allocated _after_ it is realized. * gtk/gtklist.c (gtk_list_motion_notify): Removed useless debugging message. Wed Apr 1 21:51:37 1998 Owen Taylor * gtk/gtkmain.c: return NULL for gtk_get_event_widget (NULL) * gtk/gtkentry.c: New algorithm to get more normal behavior with scroll_offset when changing fonts. Thu Apr 2 17:30:04 BST 1998 Tony Gale * examples/gtkdial/Makefile, examples/menu/Makefile, examples/tictactoe/Makefile : add correct dependencies Thu Apr 2 13:04:37 BST 1998 Tony Gale * docs/gtkfaq.sgml: add question on failing GIMP configure Tue Mar 31 15:41:57 PST 1998 Shawn T. Amundson * Makefile.am: * examples/*: added the rest of the tutorial examples Tue Mar 31 06:37:16 1998 Tim Janik * gtk/testgtk.c (create_cursors): forgot to set the initial `0' cursor. 1998-03-30 Miguel de Icaza * gdk/gdkdnd.c (gdk_dnd_display_drag_cursor): First fix: Move the window first, display it after (this removes one of the annoying flashing effects). Mon Mar 30 21:29:43 1998 Owen Taylor * gtk/gtkentry.c: Add a "style_set" callback, so the font can be changed at run time. (needed for GIMP text tool) Tue Mar 31 01:17:23 1998 Tim Janik * gtk/gtknotebook.c (gtk_notebook_menu_item_create): show the menu_label unconditionally (even if it is not a default label). (gtk_notebook_update_labels): if we have a tab_label, then use its label as the default menu_label. Mon Mar 30 16:35:57 1998 Owen Taylor * gtk/testgtk.c: Improved main loop test. (Quits main loop properly, makes it more obvious to the user what is going on) * gtk/gtkwidget.c (gtk_widget_unparent): Reset the allocation _after_ clearing the window. * configure.in: If can't find XShmAttach in Xext, check in XextSam (for AIX). * gtk/gtkmain.c (gtk_events_pending): Remember, small numbers are _high_ priority for idle queues. * gtk/gtkmain.c (gtk_handle_current_timeouts): Allow removing the currently running timeout. * gtk/testgtk.c (timeout_test): Use the right prototype for callback. Mon Mar 30 21:40:21 1998 Tim Janik * gtk/gtkclist.c (gtk_clist_row_from_ypixel): removed this function, it was unneeded and not exported. * gtk/gtkwidget.c (gtk_widget_ref) (gtk_widget_unref): don't check-cast the widgets to volatile GtkObjects (which was there for debugging purposes only). these functions should probably be macros, but that would break binary compatibility again, sigh. (gtk_widget_destroy): removed superfluous check-casts, since the neccessary checks are done in gtk_object_destroy anyways. this should be a macro as well but stays as a function for the above reasoonings. Mon Mar 30 17:21:27 BST 1998 Tony Gale * docs/gtk_tut.sgml: reflect the change of meaning of the delete_event return value Sun Mar 29 22:25:22 BST 1998 Tony Gale * docs/gtk_tut.sgml: more on the Text widget, update the tictactoe example to the current code Sun Mar 29 22:29:00 1998 Tim Janik * gtk/gtkspinbutton.[ch] gtk/testgtk.c (gtk_spin_button_set_wrap): Added wrapping capabilities to GtkSpinButton. New function : gtk_spin_button_set_wrap (Lars Hamann and Stefan Jeske). Sat Mar 28 21:18:42 1998 Owen Taylor * gtk/gtkcombo.c (gtk_combo_disable_activate): Disconnect from combo->entry, not combo. (From: Daniel Skarda <0rfelyus@atrey.karlin.mff.cuni.cz>) * gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpm): Deal better with xpm's with bad colors in them. Fri Mar 27 21:01:17 1998 Owen Taylor * gdk/gdk.c (gdk_event_translate): Don't call XTranslateCoordinates on a destroyed window. (Why do we do event processing at all on destroyed windows when we throw out the results?) * gtk/gtklabel.c: Clear the background when changing style/ state. Fri Mar 27 16:35:00 PST 1998 Shawn T. Amundson * Released GTK+ 0.99.9 * examples: added a couple more, fixed some Makefiles Fri Mar 27 17:58:41 1998 Owen Taylor * gtk/gtkhandlebox.c (gtk_handle_box_paint): Don't clear the window on an expose event. On draws, just clear the portion we are redrawing. * gdk/gdkfont.c (gdk_fontset_load): Corrected calculation of fontset ascent/descent. * gtk/gtkwidget.[ch]: Added new function to show a toplevel window and wait for it to be mapped, gtk_window_show_now () Fri Mar 27 08:51:17 PST 1998 Shawn T. Amundson * docs/Makefile.sgml: some stuff for doing plain text and postscript Fri Mar 27 00:13:18 1998 Owen Taylor * gtk/gtkmain.c (gtk_propagate_event): If the widget is _not_ a descendant of a Window widget, propagate key presses like other events. * gtk/gtkentry.c gtk/gtktext.c: Ignore multiple simultaneous button presses instead of treating subsequent presses as release/press pairs for tablet compatibility. * configure.in config.h.in: Removed inline checks, because they are duplicated in glib. * gtk/gtkwidget.c (gtk_widget_draw): When gtk_widget_draw () occurs with queued draw already in place, redraw _entire_ widget. (Pointed out by Tim Janik) Thu Mar 26 23:12:54 1998 Tim Janik * gtk/gtkmain.c (gtk_propagate_event): make a clear distinction between key press/release events, which will be sent to a widgets toplevel ancestor and be forwarded from there, and all other events that need to get propagated up the widget tree (pointed out by Owen Taylor). Thu Mar 26 21:37:57 1998 Tim Janik * gtk/gtkradiobutton.c (gtk_radio_button_draw_indicator): always display the correct active state. * gtk/gtkcheckbutton.c (gtk_real_check_button_draw_indicator): always display the correct active state. * gtk/gtkwidget.c (gtk_widget_set_arg): CAN_FOCUS and CAN_DEFAULT flag changes need to queue a resize. * gtk/gtkbutton.c (gtk_button_paint): take border_width into consideration for restrict area. * gtk/gtktogglebutton.c (gtk_toggle_button_class_init): enable the draw_default member of GtkButton, otherwise the diplay is messed up for CAN_DEFAULT toggles. (gtk_toggle_button_draw_focus): always display whether the toggle button is active or not. * gtk/gtkwidget.c (gtk_widget_set_state): (gtk_widget_set_sensitive): (gtk_widget_set_parent): (gtk_widget_propagate_state): take into consideration, whether we really want to change childrens states, or just restauration of old states. Thu Mar 26 15:33:50 1998 Owen Taylor * gtk/gtkwidget.c: When gtk_widget_draw() is called on a REDRAW_PENDING widget, draw it and remove it from the queue instead of doing nothing. * gtk/Makefile.am gdk/Makefile.am: Switch order of includes directories, to make doubly sure that wrong glibconfig.h isn't used. (See also glib/ChangeLog) * gtk/gtkentry.c (gtk_entry_draw_focus): Don't draw the cursor unless the entry is editable. (From: Stefan Jeske ) Thu Mar 26 08:31:58 1998 Tim Janik * gtk/gtkmain.c (gtk_propagate_event): do not propagate unhandled key events on widgets with parent==NULL twice. Tue Mar 24 14:59:50 1998 Tim Janik * gtk/gtkhandlebox.h: * gtk/gtkhandlebox.c: implemented new flag shrink_on_detach (TRUE by default) which will cause the handle boxes requisition to collapse in case the child is already detached. Tue Mar 24 00:17:42 1998 Owen Taylor * gtk/gtkcombo.c gtk/gtkmenu.c: Use reversed arrow for menus ala Motif (and fix Options menus, which had X cursor before), and show normal arrow when inside ComboBox. * gtk/gtkfilesel.c: Various memory leaks removed, as pointed out by Mattias.Gronlund" * docs/gtk_tut.sgml: Change compiling explaination to refer to gtk-config. (From: johannes@nada.kth.se (Johannes Keukelaar)) 1998-03-23 Federico Mena Quintero * gtk/gtkclist.c (gtk_clist_size_allocate): Fixed xthickness -> ythickness typo. Tue Mar 24 03:53:18 1998 Tim Janik * gtk/gtkbox.c (gtk_box_remove): save the widgets visibility flag for evaluation after the widget got destroyed, discovered by Johannes Keukelaar . 1998-03-23 Federico Mena Quintero * gtk/gtkclist.c (gtk_clist_set_row_data_full): Select the row which got its data changed, and not (0, 0). Mon Mar 23 18:19:42 1998 Owen Taylor * gtk/gtkmenu.c gtk/gtkmenushell.c: Instead of making an X grab when the button is released, grab immediately. This solves a problem where menus wouldn't pop down if the caller didn't have the BUTTON_RELEASE mask on their window, and and another where the X grab would be released prematurely. * gtk/gtklist.c gtk/gtktree.c: Do sanity checking on button presses to make sure they occurred in a child item. (From: "Damon Chaplin" ) * gtk/gtkmenushell.c: Do sanity checking on button press/releases. Handle button events on window widget descendents of menu items correctly. * gtk/gtkclist.c gtk/gtkbutton.c gtk/gtkviewport.c gtk/gtkeventbox.c: Make the window size allocated in _realize() match that in _size_allocate(). Take into account the border width in the draw() handler. Mon Mar 23 15:26:25 1998 Tim Janik * gtk/gtkentry.c (gtk_entry_append_text): check for text!=NULL. (gtk_entry_prepend_text): likewise. some else picky indentation fixes. Mon Mar 23 12:03:03 CST 1998 Shawn T. Amundson * examples/: added this directory with stuff from the tutorial, updated to compile and work with recent changes Mon Mar 23 01:04:51 1998 Owen Taylor * gtk/gtktext.[ch] testgtk.c: Added optional word wrap, controlled by new function gtk_text_set_word_wrap; and a check button in the Text test. * gtk/gtktext.c: First line wasn't getting updated properly when selection was removed. Sun Mar 22 23:33:50 1998 Owen Taylor * gtk/gtkentry.c (gtk_entry_insert_text): Fixed some problems with !gtk_use_mb introduced in the last change. Sun Mar 22 21:00:43 1998 Owen Taylor * gtk/gtkpaned.c: Fix so children don't get bogus draws. Mon Mar 23 01:08:30 1998 Tim Janik * gtk/gtkclist.c (gtk_clist_class_init): leave container_class->add and container_class->remove untouched if we don't implement them. * gtk/gtkcontainer.c (gtk_container_class_init): add missing NULL initialization for the class method (*foreach). implement a default handler to output a warning for (*add) and (*remove). Sun Mar 22 19:01:36 1998 Owen Taylor * gdk/gdkcolor.c: Fixes to allow GTK to work with colormaps that aren't 256 entries long. (colormap->colors is now dynamically allocated) Sun Mar 22 16:25:46 1998 Owen Taylor * gtk/gtkmain.c (gtk_init): fixes to locale checks * gtk/testgtk.c (create_dnd): Create the dnd icons separately to avoid strange interactions with shapes demo. * gtk/gtkentry.[ch]: - Limit the length of the text to 2048 to prevent long delays - Fix problems with buffer overruns - Draw only the onscreen portion of the text to prevent wrapping of shorts in the X drawing code. - Keep track of character positions and x-offsets to speed up algorithms. Sun Mar 22 11:37:51 CST 1998 Shawn T. Amundson * gtk/gtkcolorsel.c: * gtk/gtkfilesel.c: use button_box for buttons Sat Mar 21 19:07:01 1998 Owen Taylor * gtk/testgtk.c (dnd_drop): Don't respond to drops when grab is in effect. (workaround) * gdk/gdkfont.c (gdk_fontset_load): More details on error messages. * gdk/gdk.c: Translate va_list to XVaNestedList instead of just casting it. * gtk/gtkmain.c: Make temporary copy of string returned by setlocale, since it may be changed by subsequent calls. Sat Mar 21 22:54:31 1998 Tim Janik * gtk/gtkhandlebox.h: * gtk/gtkhandlebox.c: major overhaul of the code, fixed all known bugs (hopefully ;). Sat Mar 20 15:33:17 1998 Tim Janik * gtk/gtkwidget.c (gtk_widget_real_show): queue the resize for the parent. Thu Mar 19 02:00:50 1998 Tim Janik * gtk/gtkwidget.c (gtk_widget_unrealize): unset flags after emission, especially GTK_MAPPED, since that might not have been taken care of by an UNMAP emission. Sat Mar 21 10:39:02 CET 1998 Paolo Molaro * gtk/gtkcombo.[ch] "activate" signal can be disabled now Fri Mar 20 20:49:33 1998 Radek Doulik * gtk/gtktoolbar.c (gtk_toolbar_insert_element): changed packing in toolbar elements, so texts are always at the bottom Wed Mar 18 01:07:11 1998 Radek Doulik * gtk/gtkclist.c (gtk_clist_column_titles_show): test if clist->title_window exists before showing it, gtk_clist_column_titles_hide also fixed Thu Mar 19 16:40:47 PST 1998 Shawn T. Amundson * Released GTK+ 0.99.8 Thu Mar 19 16:28:48 CST 1998 Shawn T. Amundson * the Solaris ltconfig patch from draco Wed Mar 18 17:03:02 PST 1998 Manish Singh * gtk/gtkcolorsel.c: #define M_PI if it isn't already * gtk/testgtk.c: initialize transparent properly, to make purify happy Thu Mar 19 00:37:44 1998 Tim Janik * gtk/gtkscrolledwindow.c (gtk_scrolled_window_construct): perform the neccessary checks on funtion begin. use the scrolled_window that got passed to this function, and not a new one. Wed Mar 18 11:09:10 1998 Owen Taylor ( From: James Henstridge ) * gtk/gtkclist.c: Don't remove, then destroy labels in gtk_clist_set_column_[*], just remove them. * gtk/gtkmain.c (gtk_invoke_timeout_function): call marshal when appropriate, not function. Tue Mar 17 14:15:07 1998 Owen Taylor * gtk/testgtk.c (create_main_window): Alphabetize tests * gtk/gtk[hv]paned.c: Change division on resize if necessary to keep handle visible. * gtk/gtkgamma.c gtk/gtkcurve.c: Moved initialization into _init() functions. * gtk/gtkscrolledwindow.c: Added missing _construct() functions. Wed Mar 18 17:38:25 CET 1998 Paolo Molaro * gtk/gtkentry.[ch]: checked in gtk_entry_set_max_length (it truncates the texts if it's longer, now) Wed Mar 18 02:06:52 1998 Tim Janik * gtk/gtkcontainer.c (gtk_container_border_width): use the resize queue. * gtk/gtkwindow.c (gtk_window_set_arg): gtk_window_set_hints() after setting certain arguments, so they actually take affect. (gtk_window_set_policy): likewise. Tue Mar 17 22:45:39 1998 Tim Janik * gtk/gtkwidget.c (gtk_widget_get_arg): return real boolean values not just numbers. * gtk/gtktogglebutton.c (gtk_toggle_button_set_state): check state for != 0, otherwise we get strange results. Tue Mar 17 01:55:00 1998 Owen Taylor * gtk/gtkmain.c gtk/gtkentry.c: Try to guess if we can use the mb* functions safely. (For glibc, they do UTF-8). Heuristic is (X_LOCALE && locale != C/POSIX) || (mblen("\xc0", MB_CUR_MAX) == 1). (From: "Richard Lloyd" ) * gdk/gdk.c (gdk_ic_get_attr): Use an intermediate variable to avoid taking the address of the result of va_arg. * gtk/gtkentry.c gtk/gtkeditable.c gtkobject.c gtk/testselection.c: signedness fixups * gtk/gtkcontainer.c: Fixed implicit cast between gpointer and func pointer by changing. * gtk/gtkcombo.c, gtk/gtkentry.c, gtk/gtktext.c: static void forward declaration vs. void actual fixed * gtk/testgtk.c: Limit total number of tree items to 10,000 Mon Mar 16 21:14:52 1998 Owen Taylor * gdk/gdkvisual.c: Put visual names into #ifdef G_ENABLE_DEBUG gtk-jbuhler-980315-0.patch * gdk/gdkcc.c: Changed DEBUG => G_ENABLE_DEBUG, eliminate unused variable warnings. Tue Mar 17 16:19:47 1998 Tim Janik * gdk/gdk.c: * gdk/gdkvisual.c: changed some debugging messages to be prefixed by "Gdk:". * gtk/gtkwidget.c (gtk_widget_real_draw): applied gtk-shige-980317-0.patch.gz to set all event fields, but modified the event.send_event field to be set to TRUE, since the event is not really comming from the server. * gtk/gtkwindow.c (gtk_window_init): applied gtk-ograf-980317-1.patch.gz which cares about an initial setting of program name and program class. * gdk/gdk.c (gdk_init): applied gtk-ograf-980317-0.patch.gz, which strips leading pathnames from gdk_progname. Tue Mar 17 12:36:35 1998 Tim Janik * gtk/gtkstyle.c (gtk_default_draw_arrow): fixed a bug about drawing GTK_ARROW_LEFT, correction from Damon Chaplin . Tue Mar 17 02:02:02 1998 Miguel de Icaza * gdk/gdk.c (gdk_dnd_drag_leave): Use StructureNotifyMaskMask as the mask, as this enables an application listening to those events to catch the root events. Thanks to Maciej for pointing us in the right direction. (gdk_dnd_drag_enter): Likewise. (gdk_dnd_drag_leave): Likewise. * gdk/gdkwindow.c (gdk_window_dnd_data_set): Likewise. Mon Mar 16 22:31:02 1998 Federico Mena * gdk/gdkwindow.c (gdk_window_xid_at): Use signed integers so that testing will not fail for windows that are off-screen. (gdk_window_xid_at_coords): Only considers visible windows. Tue Mar 17 03:56:13 1998 Tim Janik * gtk/gtkspinbutton.h: exported gtk_spin_button_spin since it is used in testgtk, and besides that. * gtk/testgtk.c: created a new "test" cursors, which showes different types of GdkCursors and is a very simple example at using the drawing area. Mon Mar 16 18:19:31 GMT 1998 Tony Gale * docs/gtkfaq.sgml: - new question on modal windows - new question on updating progressbars - update all the links to gtk.org Mon Mar 16 09:15:03 GMT 1998 Tony Gale * docs/gtk_tut.sgml: - New subsection on colourselection from Tom Bech - Moved fileselection text to Miscallaneous Widgets section - Started new section on the Text widget - Removed Viewport, Paned, HPaned and VPaned from list of NO_WINDOW widgets. Mon Mar 16 01:33:36 1998 Owen Taylor * gtk-config.in: Added trailing newline, hopefully will fix the problem with esac disappearing. * gtk/Makefile.am (test-debug): Improved test targets will work with --enable-shared [From: Raja R Harinath ] * gtk.m4: Not all shells understand $(...). Use `...` instead. [From: Raja R Harinath ] - use AM_PATH_PROG instead of AM_CHECK_PROG, so the user can specify programs not in their path. * Makefile.am: added gtk.m4 to EXTRA_DIST Sun Mar 15 23:44:10 1998 Tim Janik * gtk/gtkwidget.h: * gtk/gtkmenushell.c: * gtk/gtkmenu.c: * gtk/gtkmain.c: removed EXCLUSIVE_GRAB again, just disable modal event delivery for insensitive children. Sun Mar 15 22:44:33 1998 Tim Janik * gtk/gtkmenushell.c (gtk_menu_shell_button_release): for now reverted the last change, since it broke click-select-click menus for gimp. Sun Mar 15 20:13:42 1998 Tim Janik * gtk/gtkmain.c (gtk_quit_destructor): removed the ugly check whether we need gtk_widget_destroy or gtk_object_destroy. these functions are by no means allowed to act differently! * gtk/gtkmisc.c (gtk_misc_set_alignment): check for _DRAWABLE instead of _VISIBLE to operate on widget->window. (gtk_misc_set_padding): likewise. * gtk/gtkwidget.c: slightly reordered object arguments. * gtk/gtkobject.c (gtk_object_setv): * gtk/gtkobject.c (gtk_object_getv): operator `!' has precedence over `&'. Sun Mar 15 14:38:34 1998 Tim Janik * gtk/gtknotebook.c (gtk_notebook_pages_allocate): applied a fix from lars against a segfault that i discovered. Sun Mar 15 13:25:28 1998 Tim Janik * gtk/gtkwidget.h: added new flag GTK_EXCLUSIVE_GRAB. * gtk/gtkmain.c: allow exclusive grabs. * gtk/gtkmenu.c: grab exclusively. * gtk/gtkmenushell.c: grab exclusively. * gtk/gtkmenushell.c: don't activate insensitive menu items when in click-selects mode. * gtk/gtkmenushell.c (gtk_menu_shell_enter_notify): activate submenus on popup. * gtk/gtkmenushell.c (gtk_menu_shell_button_release): don't take *additional* button presses into account. * gtk/gtkmenushell.c (gtk_menu_shell_button_press): don't take foreign button releases into account. Sun Mar 15 08:27:06 1998 Tim Janik * gtk/gtktipsquery.c (gtk_tips_query_set_labels): changed run type of GtkTipsQuery::widget_entered to GTK_RUN_LAST, so it can be overidden by the user. * gtk/gtkwindow.c (gtk_window_configure_event): small fix by Assar Westerlund . * gtk/gtkmenu.c (gtk_menu_key_press): don't cast a NULL pointer. Sat Mar 14 19:36:16 PST 1998 Shawn T. Amundson * Released 0.99.7 Sat Mar 14 20:07:45 1998 Owen Taylor * gtk.m4: Fixed reversed conditional, so checks against supplied version. Sat Mar 14 10:10:46 1998 Tim Janik * gtk/gtkmain.c (gtk_main): fixed a bug with invoking the quit handlers that could cause them to be removed wihout being invoked. Sat Mar 14 14:36:40 PST 1998 Shawn T. Amundson * Released 0.99.6 * gdk/gtk_tut.sgml: * gdk/gtk_tut_it.sgml: fixed Ian Main's e-mail address Sat Mar 14 17:48:42 1998 Owen Taylor * gtk/Makefile.am: Don't refer to current directory as $(top_builddir)/gtk to avoid confusing non-gmakes. Made Emacs-dependent maintainer-oonly Sat Mar 14 17:47:12 1998 Owen Taylor * gdk/gdkwindow.c: (gdk_window_set_group): Fixed use of unitialized variable. Sat Mar 14 13:26:09 1998 Owen Taylor * gtk/gtkentry.c gtk/gtktext.c: Some cleanups of signedness warnings * gtk/gtkhandlebox.h: Changed gint ... : 1 to guint ... : 1 1998-03-14 Federico Mena Quintero * gtk/gtktoolbar.c (gtk_toolbar_insert_element): Moved the gtk_signal_connect of the specified callback into the big switch() for buttons. We don't want to connect to the "clicked" signal of a custom widget or a space element, because it may not have one. (gtk_toolbar_insert_element): Extra sanity check; if the type is GTK_TOOLBAR_CHILD_WIDGET, then the specified widget must not be NULL. Sat Mar 14 02:54:28 PST 1998 Manish Singh * gtk.m4: fixed a bashism in gtk tests Sat Mar 14 08:29:56 1998 Tim Janik * gtk/gtkhandlebox.c (gtk_handle_box_size_allocate): refuse to allocate with a greater height than requested. (gtk_handle_box_remove): clean up if the child is detached. * gtk/gtktoolbar.c (gtk_toolbar_size_allocate): don't take invisible children into account. Sat Mar 14 02:12:44 1998 Owen Taylor * gtk/gtkmain.c gdk/gdk.c: Don't leave NULL's in argv. Sat Mar 14 01:36:51 1998 Owen Taylor * gtk-config.in: Added -I $exec_prefix/glib/include to cflags Sat Mar 14 00:03:34 1998 Owen Taylor * gtk/gtkwindow.c: Don't resize windows when request is rejected by WM. Only use the resize count to guess whether a Configure event was a rejection by the WM, or a move. * gdk/gdk.c gdk/gdktypes.h: - Don't XDestroyWindow foreign windows (If they're a child of one of our windows, reparent them to root and send them a WM delete event, otherwise, just delete the GTK structure.) Handle notification of their deletion properly. (Made foreign windows a seperate window type to do this) * gtk/gtkobject.c (gtk_object_set_data_full): Call the DestroyNotify when replacing the object data. Sat Mar 14 02:03:13 1998 Tim Janik * gtk/gtksignal.c: make use of *_by_id() functions for handler key. * gtk/gtkwidget.c: make use of *_by_id() functions for a bunch of keys. (gtk_widget_shutdown): new function to perform pre-destruction shutdown of the widget. (gtk_widget_unparent): call gtk_widget_set_parent_window(widget,NULL) * gtk/gtkobject.h: * gtk/gtkobject.c: GtkObject destruction is now split into an internally used shutdown class method and the usual GtkObject::destroy signal emission. this allowes for class based shutdown functionality prior to actuall object destruction. added *_by_id() counterparts for gtk_object_data_* functions, meant for internal use only. * gtk/gtkmain.c (gtk_quit_add_destroy): new function which will destroy a GtkObject once gtk_main() of a certain level finishes. it is save to destroy the object prior to that, gtk_quit_add_destroy will only destroy objects that are still existing. 1998-03-13 Federico Mena Quintero * gtk/gtkclist.c (gtk_clist_row_is_visible): Now we return a GtkVisibility value, instead of a simple boolean. Also, changed all the functions that expected a boolean value to use "!= GTK_VISIBILITY_NONE". * gtk/gtkclist.h: Changed prototype for gtk_clist_row_is_visible(). * gtk/gtkenums.h (enum): Added GtkVisibility enum. Fri Mar 13 11:23:55 PST 1998 Shawn T. Amundson * docs/gtk_tut.sgml: * docs/gtk_tut_it.sgml: * docs/gtk_tut_packbox1.gif: * docs/gtk_tut_packbox2.gif: * docs/gtk_tut_table.gif: added graphics, update tutorials appropriately Fri Mar 13 18:25:07 1998 Tim Janik * gtk/gtkcombo.c: fix popup calculations (removal of FIXMEs), changes from Lars Hamann. Fri Mar 13 10:25:16 1998 Tim Janik * gtk/gtkwidget.h: * gtk/gtkwidget.c: renamed gtk_widget_delete_hides to gtk_widget_hide_on_delete at owens request, and because the new name is much more descriptive. Fri Mar 13 17:33:56 GMT 1998 Tony Gale docs/gtkfaq.sgml: fix the spelling of Helge Hess's name Fri Mar 13 09:40:17 GMT 199 Tony Gale * docs/gtkfaq.sgml: update links to documentation and remove question on what needs to be done before 1.0 Fri Mar 13 01:17:44 1998 George Lebl * gtk/gtkfilesel.c: Set the column width of the clists to the longest string length so that the bottom scrollbar appears when you get some long files in the list 1998-03-12 Federico Mena Quintero * docs/gtk_tut.sgml: fix one missing quote. Thu Mar 12 18:01:03 1998 Owen Taylor * gtk.m4 gtk-config.in Makefile.am configure.in: Added a new mechanism for GTK-dependent programs to find out about the installed GTK. (Does not remove any current functionality) * gtk+-xconfig.in: Was no longer used for anything. Thu Mar 12 20:17:47 1998 Tim Janik * gtk/gtkhandlebox.c (gtk_handle_box_delete_float): return TRUE for GtkWidget::delete_event to avoid destruction of our float window. * gtk/gtkmain.c (gtk_main_iteration_do): GDK_DELETE will destroy a widget if the last handler returned FALSE or there was none connected. * gtk/testgtk.c: adapted all delete_event/destroy case that were affected. * gtk/gtkwidget.c (gtk_widget_delete_hides): new function that will hide a widget and return TRUE to avoid window deletion if connected to GtkWIdget::delete_event. Thu Mar 12 11:51:33 PST 1998 Shawn T. Amundson * docs/gtk.texi: Changed name of GTK to the GIMP Toolkit Wed Mar 11 22:52:57 1998 Russell Nelson * gtk/gtktest.c: new_pixmap wasn't using its filename argument. * docs/gtk.texi: Add descriptions Wed Mar 11 14:36:48 PST 1998 Shawn T. Amundson * gtk/docs/: added tutorial, changed some files around to make more sense. Thu Mar 12 10:49:38 1998 Tim Janik * gtk/gtkmain.h: * gtk/gtkmain.c: changed handler tags to be of type guint, reflecting the internal tag handling. * gtk/gtkcurve.h: macro fixups. Thu Mar 12 08:55:34 1998 Tim Janik * gtkitem.c: * gtktree.c: * gtklist.c: fetch the inintial value of attributes.event_mask from gtk_widget_get_events (widget) (pointed out by Damon Chaplin ). Thu Mar 12 07:43:33 1998 Tim Janik * gdk/gdk.h: * gdk/gdkvisual.c: applied gtk-shige-980311-0.patch.gz, which removes the erronerous gdk_query_visuals() function in favour of gdk_list_visuals() which does a correct job. * gtk/gtkcontainer.h: applied gtk-draco-980311-0.patch.gz which fixes a class cast check. * gtk/gtkspinbutton.c: applied gtk-hamann_jeske-980312-0.patch.gz about '+' sign acceptance. * gtk/gtknotebook.c: applied gtk-hamann_jeske-980311-1.patch.gz which cares about delayed tab label creation. Thu Mar 12 06:58:17 1998 Tim Janik * gtk/gtktree.c (gtk_tree_map): avoid warnings about NULL casts. * gtk/gtkstatusbar.c (gtk_statusbar_destroy): don't leak the context id key's slist. * gtk/gtkobject.c (gtk_object_set_data_full): duplicate keys that get inserted into the hashtable, otherwise this function *forces* the caller to leak memory, for dynamically allocated keys (problem pinpointed by Mattias Gronlund). Tue Mar 10 23:02:42 1998 Owen Taylor * gdk/gdkdnd.c gtk/gtkclist.c gtk/gtksignal.c gtk/testgtk.c: Various minor cleanups related to -W 1998-03-11 Elliot Lee * gtk/gtkentry.h: Keep it consistent - don't list gtk_entry_set_max_length unless it's implemented. (Someone make up their mind please ;-) Wed Mar 11 07:10:11 1998 Tim Janik * gtk/gtkspinbutton.h: * gtk/gtkspinbutton.c: applied gtk-hamann_jeske-980311-0.patch.gz, to limit entered characters to numbers, '-' and '.'. Wed Mar 11 04:35:06 1998 Tim Janik * gtk/gtklist.c: * gtk/gtktree.h: * gtk/gtktree.c: * gtk/gtktreeitem.h: * gtk/gtktreeitem.c: applied gtk-bolliet-980310-0.patch.gz which adds more checks and implements gtk_tree_clear_items. made a bunch of style and indentation fixes. Wed Mar 11 03:35:17 1998 Tim Janik * gtk/gtktooltips.h: * gtk/gtktooltips.c: code and structure clean ups. fixed the tooltips flickering bug. Tue Mar 10 14:24:09 1998 Owen Taylor * gtk/gtkselection.c (gtk_selection_clear): Make the return result reflect whether the clear event was out of data. * gtk/gtkeditable.c: Ignore out of date selection clear events. * gtk/gtkentry.c gtk/gtktext.c: Don't synthesize releases on [2/3]BUTTON presses, since we get the normal click as well. Claim the selection when selecting words/lines. Tue Mar 10 13:34:29 1998 Owen Taylor * gtk/gtkrange.c (gtk_range_default_[vh]trough_click): Take forward/back step arrows into account when computing position for middle button clicks. * gtk/gtktext.c gtk/gtkentry.c: - Fixes for deleting characters (don't subtract guints and get negative numbers!) - Reset cursor_virtual_x when moving by words and lines - Extra sanity checks - Fix to gtk_text_get_chars (from Tony Gale ) 1998-03-10 Federico Mena Quintero * gdk/gdkgc.c (gdk_gc_set_function): Replace GXor by GXxor. Seems to have been a typo. Tue Mar 10 00:49:18 EST 1998 The Rasterman * gdk/gdkwindow.c: (gdk_window_xid_at) fixed minor memory leak and minor buglet in tree search. Mon Mar 9 21:21:19 PST 1998 Shawn T. Amundson * Released 0.99.5 Mon Mar 9 23:24:42 1998 Miguel de Icaza * gtk/gtkclist.c (gtk_clist_get_selection_info): Export functionality. Tue Mar 10 05:42:34 1998 Tim Janik * configure.in: Bumped version number to 0.99.5. Tue Mar 10 05:30:05 1998 Tim Janik * gtk/gtkrange.h: * gtk/gtkrange.c: changed gtk_range_trough_click() to take an additional jump_perc arg, class method and callers changed. * gdk/gdk.c (gdk_ic_destroy): applied gtk-gronlund-980309-1.patch.gz which fixes a memory leak. Mon Mar 9 20:38:15 1998 Owen Taylor * gtk/gtkentry.c gtk/gtkeditable.c gtk/gtkspinbutton.c: Moved "activate" to editable class. Made the vfuncs in gtkeditable just vfuncs not signals. * gtkentry.[ch] gtktext.[ch]: Made behavior when pressing multiple buttons at once more rational. * gtkentry.c gtktext.c: Unified and rationalized key bindings. (Now are basically emacs+CUA) * gtktext.c: - Last position now always shares the property of the preceding character - Freeze the widget when inserting large amounts of text. - Selecting lines now selects the _whole_ line. - Fixed bug with displaying the cursor - Ctrl-Home/End now move the cursor to the _absolute home/end * gtkmenuitem.c: Remove necessary code out of a g_return_if_fail 1998-03-09 Federico Mena Quintero * gtk/gtkclist.c (gtk_clist_set_foreground): We now accept the color parameter to be NULL. If it is NULL, it will mark the row with "color not set", so it will be repainted with the default color. (gtk_clist_set_background): Likewise. Mon Mar 9 15:48:10 1998 Tim Janik * Signal signedness and naming corrections, plus GtkType fixes: * gtk/gtkadjustment.c: * gtk/gtkbutton.c: * gtk/gtkcheckmenuitem.c: * gtk/gtkclist.c: * gtk/gtkcolorsel.c: * gtk/gtkcontainer.c: * gtk/gtkcurve.c: * gtk/gtkdata.c: * gtk/gtkeditable.c: * gtk/gtkentry.c: * gtk/gtkhandlebox.c: * gtk/gtkinputdialog.c: * gtk/gtkitem.c: * gtk/gtklist.c: * gtk/gtkmenuitem.c: * gtk/gtkmenushell.c: * gtk/gtknotebook.c: * gtk/gtkstatusbar.c: * gtk/gtktoolbar.c: * gtk/gtktree.c: * gtk/gtktreeitem.c: * gtk/gtkwidget.c: * gtk/gtktogglebutton.c: * gtk/gtkwindow.c: made the _signals[] arrays of type guint rather than gint. * gtk/gtkwidget.c (gtk_widget_get_ancestor): made widget_type a GtkType. * gtk/gtkcombo.h: handler ids need to be of type guint (entry_change_id, list_change_id). * gtk/gtkaccelerator.c: changed signal_num to signal_id and typed it guint. * gtk/gtkmain.c: made gtk_ndebug_keys a guint. * gtk/gtkmenu.h: * gtk/gtkmenu.c: (gtk_menu_popup): made button a guint. (gtk_menu_set_active): made index a guint. * gtk/gtkmenuitem.h: * gtk/gtkmenuitem.c: made accelerator_signal a guint. * gtk/gtkoptionmenu.h: * gtk/gtkoptionmenu.c: (gtk_option_menu_set_history): made index a guint. * gtk/gtksignal.h: * gtk/gtksignal.c: * gtk/gtkobject.h: * gtk/gtkobject.c: changed a bunch of prototypes to take guints rather than gints. also made some conversions from guint to GtkType, left over from when the fundamental-types system was introduced. * gtk/gtkobject.h: * gtk/gtkobject.c: made object_data_id_index and obj_count guints. made *signals and nsignals guints in GtkObjectClass. Mon Mar 9 13:36:53 GMT 1998 Tony Gale * docs/gtkfaq.sgml: - Use 'diff -ru' for patches - Explained patch application/rejection - Added information on CVS - New question on right justified menus with menufactory From Nathan: - Information on Objective-C bindings - Add missing variable in colour example. Mon Mar 9 11:44:33 1998 Tim Janik * gtk/gtkfilesel.c (gtk_file_selection_update_history_menu): reverted the changes ian introduced in r1.16 on Mar 06, since they broke the history menu. Mon Mar 9 08:07:01 1998 Tim Janik * gtk/gtkspinbutton.h: * gtk/gtkspinbutton.c: applied gtk-hamann_jeske-980308-0.patch.gz to have a gtk_spin_button_construct() function Mon Mar 9 01:01:41 1998 Owen Taylor * gtk/gtkrc.c: No, you can't add a GtkStyle * to a list of GtkRcNode *. (Fixes huge performance problem) Plus, don't bother creating a new style unless style actually has bg pixmaps. Sun Mar 8 15:53:33 1998 Owen Taylor * gtk/gtktext.c: - Show selection correctly when starting selection with arrows - Display pixmap background only when not editable - Redraw focus area more carefully to prevent flashing (and make style of drawing consistent with Entry) * gtk/gtktreeitem.c: ref colormaps for pixmap by colormap storage. * gtk/gtkrc.c: Store a separate style for each RcStyle for each colormap, so we can handle background pixmaps correctly, which need to be per-colormap. (Leaks colormaps...) Parse text color style entries correctly. * gtk/testgtk.c: insert text without fg color gtk/testgtkrc: move "*" after rest, so the other class styles take effect * gdk/gdkwindow.c gdk/gdk.c gdk/gdkprivate.h: Send DND events safely, in case drop window disappears. (Performance hit because XSync()'s are necessary) * gdk/gdk.h gdk/gdkpixmap.c: Added gdk_pixmap_colormap_create_from_xpm[_d] to allow creating pixmaps from xpm's before you have a GdkWindow. Sun Mar 8 12:33:38 PST 1998 Jay Painter * gtk/gtkclist.c: the GList clist->selection now contains row indexes in the data portion of the linked list structure instead of pointers, fixed several bugs with the different selection modes * gtk/testgtk.c: displays information for unselect events, and prints the list of selected rows Sun Mar 8 13:03:22 1998 Tim Janik * gtk/gtkrange.h: removed gtk_range_calc_value(). Sun Mar 8 04:22:36 1998 Tim Janik * gtk/gtkfilesel.c: applied gtk-gronlund-980307.patch.gz which fixes a memory leak by making use of gtk_clist_set_row_data_full. * gtk/gtkclist.c: applied gtk-gronlund-980307.patch.gz which ads a gtk_clist_set_row_data_full () function. slightly modified to always invoke the destroy function regardless of the value of the row_data. * docs/gtk.texi: applied gtk-draco-980305-1.patch.gz, spelling fixes. * gdk/gdk.c (gdk_init): cleared up a tiny memory leak from not destroying a temporary copy of argv (gtk-gronlund-980307-02.patch.gz). Sun Mar 8 03:00:17 1998 Tim Janik * configure.in: define the version variables in config.h. * gtk/gtkmain.h: * gtk/gtkmain.c: added static version variables. * gdk/gdkpixmap.c: fixed memory leaks (gtk-gronlund-980307-1.patch.gz) Sat Mar 7 18:46:57 1998 Owen Taylor * gtk/gtkpreview.[ch]: Added a new function, gtk_preview_reset(), that can be used (under highly controlled circumstances), to change the properties of the preview colormap after a preview has already been created and destroyed. Sun Mar 8 00:18:04 1998 Tim Janik * gtk/gtkobject.c: register living objects in a hashtable. Sat Mar 7 20:20:53 1998 Tim Janik * gtk/gtkobject.c: (gtk_object_check_cast): (gtk_object_check_class_cast): made the object/class cast checks much more descriptive, based on gtk-draco-980305-2.patch.gz and gtk-draco-980306-1.patch.gz but optimized for common code path. * gtk/gtkpreview.c: added a few extra checks for the visual (gtk-draco-980305-0.patch.gz). * gdk/gdk.c (gdk_signal): abort() on a signal if G_ENABLE_DEBUG is defined, so we dump core (gtk-draco-980305-0.patch.gz). Sat Mar 7 13:00:00 1998 The Rasterman * gdk/gdkwindow.c (gdk_window_xid_at_coords),(gdk_window_xid_at): added these two calls, gdk_window_xid_at_coords beign the one to actually call to look up the current X Window ID at a particular x,y co-ordinate onscreen accounting for a list of windows to be excluded from this search. Useful for DND support. * gdk/gdkprivate.h added in above function calls. Sat Mar 7 01:07:24 1998 Owen Taylor * gtk/gtkrange.c (gtk_range_expose): Fixed the vscrollbar flickering problem, by checking the area on expose events. (There was a hscrollbar flickering problem as well, it just wasn't very noticeable) Fri Mar 6 21:30:05 1998 Owen Taylor * gtk/gtkeditable.c: Disallow pasting into non-editable widgets. * gtk/gtktext.[ch]: -Added scrolling when dragging the selection paste the top/bottom. -Fix some of the problems with displaying the selection state before mouse release. -Disallow pasting into non-editable widgets -Fixed segfault when changing window size -Update the cursor correctly when switching between editable and non-editable * testgtk.c: Added a toggle button for editability for the text widget. Fri Mar 6 14:47:33 PST 1998 Shawn T. Amundson * Applied gtk-matsu-980205-0 (oops, should be 980305) gdk/gdkinputcommon.h: return NULL if device is not ready gtk/gtkwindow.c: check for GDK_ISO_Left_Tab Fri Mar 6 13:17:58 1998 Marc Ewing * gtk/gtkclist.c (real_select_row, real_unselect_row): fix selection bugs Thu Mar 5 20:41:27 1998 Ian Main * gtk/gtkfilesel.c: Added gtk_file_selection_show_fileop_buttons(GtkFileSelection *fs), and gtk_file_selection_hide_fileop_buttons(GtkFileSelection *fs). Changed pulldown to only contain current directory name instead of the full path. Removed Help button (it can now be packed into the button_area if desired). * gtk/gtkfilesel.h: Added GtkWidget *button_area (the fileop buttons at the top are packed into this hbox), and GtkWidget action_area (hbox below clists) to GtkFileSelection structure. * gtk/testgtk.c: Changed the filesel example to show off the hiding/ showing of fileop buttons, and the packing area. 1998-03-05 Federico Mena Quintero * gdk/gdkprivate.h: Changed the name of default_filters to gdk_default_filters to avoid namespace pollution. Yes, it just happened to me. * gdk/gdk.c (gdk_event_translate): * gdk/gdkglobals.c: * gdk/gdkwindow.c (gdk_window_add_filter gdk_window_remove_filter): Likewise. Thu Mar 5 12:32:06 1998 Marc Ewing * gtk/gtkclist.c (select_row): emit UNselect on rows that are not selected. Thu Mar 5 01:22:06 1998 Owen Taylor * gtk/gtkwidget.c (gtk_widget_unparent): Unset allocation on unparent, to force reallocation if we get adding back to a new parent which is already size-allocated. * gtk/gtktreeitem.[ch]: Keep track of separate +/- pixmaps for each colormap, removed the idle hack. * gdk/gdk.c: Don't warn when unable to open XIM method, since X11R5 apparently has no default method. * gtk/gtkwidget.c (gtk_widget_set_style_internal): Don't call size_request on initial emission - since the widget size isn't set yet, it can't change. * gtk/Makefile.am: New rules 'test' and 'test-debug' to run testgtk with the correct working directory. * gtk/gtkentry.c (gtk_move_forward_word): Check for position at end of line. * gtk/gtkinputdialog.h (struct _GtkInputDialogClass): removed 'gpointer data' arguments from default handler structures. Wed Mar 4 20:06:47 1998 Miguel de Icaza * gdk/gdk.c (gdk_event_translate): Drags can only be started with the left button. Wed Mar 4 16:02:44 GMT 1998 Tony Gale * docs/gtkfaq.sgml: widget hierarchy update from Tim Janik Mon Mar 2 19:57:27 1998 Miguel de Icaza * gdk/gdkproperty.c (gdk_atom_name): Initialize gdk_error_code to zero before calling the X routine. Tue Mar 3 01:22:25 1998 Tim Janik * gtk/gtkspinbutton.c: applied patch from lars and steffan to proper check for realized widgets. Mon Mar 2 18:27:09 CST 1998 Shawn T. Amundson * gtk/gtkstatusbar.h: fixed ifndef..define typo Mon Mar 2 17:48:38 1998 Owen Taylor Miscellaneous minor fixes to remove ANSI C incompatibilities * gdk/gdkregion.c gtk/gtkclist.c: fix // comments * gdk/gdkdnd.c gdk/gdkinputcommon.h: change types of some arguments to ANSI functions * gtk/gtkcombo.c gtk/gtktree.c: fix casts of function pointers to void * * gtk/gtkmain.c: An actual bug! (in deprecated gtk_input_add_interp) * gtk/gtknotebook.h: Bitfields must be gint or guint. (and should be guint) * gtk/gtkstatusbar.c: trailing ';' * gtk/testgtk.c: GList where there should have been GSList Mon Mar 2 12:26:59 1998 Owen Taylor * gtk/gtkentry.c: Changed 'entry != NULL' to 'editable != NULL' in three spots. Sun Mar 1 18:29:58 PST 1998 Shawn T. amundson * Released GTK+ 0.99.4. Sun Mar 1 16:47:29 PST 1998 Shawn T. Amundson * gtk/testgtk.c: small fix to notebook portion Sun Mar 1 15:18:38 PST 1998 Shawn T. Amundson * Required changes for version change to 0.99.4 * gtk/gtktree.[ch]: patch from J. Bolliet to correct some bugs * gtk/testgtk.c: added test here from J. Bolliet, removed testtree * gtk/clist: gtk-abilleira-981602-0, allows gtk_clist_set_pixmap and gtk_clist_set_pixtext to not require a mask * gdk/gdkdraw.c,gdk.h: gtk-trow-980217-0 adds gdk_draw_lines and fixes some things about gdk_draw_polygon Sun Mar 1 17:40:58 1998 Owen Taylor * gdk/gdkpixmap.c: Make sure either the window or the depth is given when creating a pixmap. Sun Mar 1 22:59:09 1998 Tim Janik * gtk/gtkstatusbar.h: * gtk/gtkstatusbar.c: complete api change to honour message contexts. unfortunaltely this also involved argument changes on the signal emissions which will not be caught by the compiler. your callbacks should look like: void message_text_popped (GtkStatusbar *statusbar, guint context_id, const gchar *text, gpointer func_data); * gtk/gtkwidget.c (gtk_widget_set_rc_style): eliminated bug about initial signal emission. (gtk_widget_set_parent): don't ensure style, just call gtk_widget_set_style_recurse. (gtk_widget_set_style_recurse): only change a widget's rc styles if if there has already been a lookup. * gtk/testgtk.c: adaptions for statusbar widget. substituted notebook pixmaps with pixmaps from fvwm, since we don't know where the originals came from. * gtk/gtkobject.c (gtk_object_data_destroy): call the destroy notifier with the objects data, not its internal structure. * gtk/gtkspinbutton.c (gtk_spin_button_button_press): small fix from lars. Sun Mar 1 15:08:13 CST 1998 Shawn T. Amundson * docs/*.texi changes from Greg Mclean. Sun Mar 1 18:41:07 1998 Tim Janik * gtk/gtkwidget.c (gtk_widget_restore_default_style): hm if we save the default style, we should also provide a function to restore it ;). * gtk/main.[hc]: small fixups to idle handlers, added support for quit handlers. Sun Mar 1 05:18:11 1998 Owen Taylor * gtk/gtkentry.c gtk/gtktext.c gtkeditable.[ch] Changed interface to cut/copy/paste so it makes sense when triggered by say, menu items. Sun Mar 1 03:20:39 1998 Owen Taylor * gtk/gtkentry.[ch] gtk/gtktext.[ch] gtkeditable.[ch] Turned off debugging in gtktext.c Bug fixes for cutting, pasting, deleting, etc. Some of the bugs that were there before have definitely been fixed. * gtk/testgtk.c gtk/testgtkrc: Removed my ugly orange backgrounds, to make things look nicer. Sat Feb 28 23:58:54 1998 Owen Taylor * gtk/gtkentry.[ch] gtktext.[ch] gtkeditable.[ch] Created a new base widget type Editable for the entry and text widgets, which encapsulates most of the selection and clipboard handling stuff, plus some common signals. Changed the Entry widget extensively to support this, but the interface and appearance should be the same. Changed the Text widget moderately to support this. It now supports: - Selection style cut and paste - Clipboard style cut and paste - Emacs style key bindings (~same as Entry) - Word motion - "changed" signal There are definitely still some bugs in the new stuff. Use style->base for the background and style->text for the foreground. * gtkfilesel.c gtkspinbutton.c testgtk.c: small changes to fit the new interface more exactly. Sat Feb 28 19:29:09 1998 Tim Janik * gtk/gtkclist.c (gtk_clist_new_with_titles): retrive the clist widget from gtk_type_new (gtk_clist_get_type ()), not gtk_clist_new(), otherwise gtk_clist_construct() gets called twice. * gtk/gtkhandlebox.h: * gtk/gtkhandlebox.c: emit signals when the child is attached/detached. Sat Feb 28 15:18:36 1998 Tim Janik * gtk/gtkpreview.c: fix behavior of gtk_preview_put() with srcx/srcy != 0, gtk-shige-980127-0.patch.gz by AOSASA Shigeru . * gdk: applied gtk-roebling-980121-0.patch.gz, patch for region support in Gdk, by Robert Roebling . Fri Feb 27 15:31:55 1998 Tim Janik * gtk/gtktipsquery.c: we make an active server grab now, this way we can change the cursor globally and don't need to tweak event masks of other windows. * gtk/gtkframe.c (gtk_frame_style_set): recompute label size. * gtk/gtkwidget.h: * gtk/gtkwidget.c: New signal GtkWidget::style_set to be emitted when a widget's style changed. New flag GTK_RC_STYLE to indicate whether an rc lookup has been perfomed for the widget. (gtk_widget_ensure_style): New function. (gtk_widget_set_rc_style): New function. * docs/styles.txt: new file. Fri Feb 27 01:11:55 1998 Owen Taylor * gtk/gtktext.c - gtk_text_delete and gtk_text_insert now update caches and refresh screen correctly if the text widget isn't frozen. - Fixed bug where text->first_line_start_index wasn't being updated correctly on insertion and deletion. - Added new public macro GTK_TEXT_INDEX (text, ind), and function gtk_text_get_chars(text, index, nchars); Thu Feb 26 22:36:46 1998 Owen Taylor * gdk/gdkwindow.c gdktypes.c gdk.h: new functions for setting WM hints gdk_window_set_icon() gdk_window_set_icon_name() gdk_window_set_group() gdk_window_set_decorations() gdk_window_set_functions() * gdk/MwmUtil.h: new uninstalled header file from lesstif distribution, used for setting MWM hints. * gdk/gdkdnd.c Makefile.am: renamed from gdk/gdk_dnd.c * gtk/gtkhandlebox.c (gtk_handle_box_realize): Use MWM hints to undecorate window. * gtk/testgtk.c gtk/circles.xbm: new test for WM hints. Wed Feb 25 22:56:42 1998 Tim Janik * gtk/gtkspinbutton.h: * gtk/gtkspinbutton.c: new widget from Lars Hamann and Stefan Jeske . * gtk/gtknotebook.c: fixups from lars and stefan. Wed Feb 25 13:18:53 1998 Owen Taylor * gtk/gtkbbox.[ch] gtk/gtkhbox.[ch] gtk/gtkvbox.[ch] : Move layout constants into an enumeration, split GTK_BUTTONBOX_DEFAULT into GTK_BUTTONBOX_DEFAULT and GTK_BUTTONBOX_DEFAULT_STYLE (enumeration member). * gtk/gtkclist.c: Renamed gtk_clist_row_isvisable to .._is_visible From: Maciej Stachowiak Wed Feb 25 13:50:05 GMT 1998 Tony Gale * docs/gtkfaq.sgml: added questions on: - Why don't the contents of a button move when the button is pressed? - How do I catch a double click event in a list widget? - When compiling GTK+ I get an error like: make: file `Makefile' line 456: Syntax error Removed questions on menus which are covered in the tutorial. Added link to HTML versions of FAQ and Tutorial on my web site. Tue Feb 24 22:47:01 1998 Owen Taylor * gtk/gtktext.c: Added some support for i18n. The support for input methods, including preedit, is there, but input is ignored unless it comes one byte at a time, so the CJK locales won't really work. Fixing that would require variable-width character support in the Text widget, which is probably the wrong approach. Eventually we'll probably want to go to UCS-4 internally. Also, revised key press handling, which should improve the forwarding of non-handled keypresses to the toplevel, and make adding selection handling easier. * gtk/gtkentry.c: Minor changes so that C-d, etc delete the selection if there is one. * gdk/gdk.c (gdk_ic_get_events): Check the result of XGetICValues - it is failing for some reason, and causing some warnings to be printed. Mon Feb 23 15:41:13 1998 Owen Taylor * gtk/gtkwidget.c gtk/gtkmenu.c: Don't process configure events that just move the window, and don't resize it. Because we need to make sure that a widget gets redrawn after a size_allocate - and that only happens when the configure event changes the size of the window. Plus, it's inefficient. Mon Feb 23 15:45:37 1998 Marc Ewing * gtk/gtktoolbar.h: * gtk/gtktoolbar.c: Added gtk_toolbar_*_element() functions. Rewrote others to simply call gtk_toolbar_insert_element() to do the work. Added two new GtkToolbarChildType options: TOGGLEBUTTON and RADIOBUTTON, available through the gtk_toolbar_*_element() functions. Mon Feb 23 13:44:10 1998 Tim Janik * gtk/gtkstatusbar.h: * gtk/gtkstatusbar.c: (re-)implemented the statusbar widget. my first intend was to fix the code, but then there was nothing to fix. Sun Feb 22 20:42:04 1998 Marc Ewing * gtk/gtkclist.c (gtk_clist_insert): Allow inserts on empty clists. Sun Feb 22 14:28:43 1998 Owen Taylor * gtk/gtkmain.c (gtk_events_pending): Count idle handlers at internal priority as pending events. Sun Feb 22 00:20:12 MET 1998 Eckehard Berns * gdk/gdkcc.c (gdk_color_context_query_colors): fixed a bug for mode GDK_CC_MODE_TRUE, when on a 24-bit visual on a 32-bit mashine. Sat Feb 21 15:33:20 1998 Tim Janik * gtk/gtkwidget.h: * gtk/gtkwidget.c: renamed signal GtkWidget::set_parent to GtkWidget::parent_set. since it's purpose is pure notification, it should have been named this way in the first place. Sat Feb 21 12:06:11 1998 Scott Goehring * gtk/gtkentry.c (gtk_entry_set_text): Added a test for passing a NULL text pointer. Sat Feb 21 14:49:17 1998 Tim Janik * gtk/gtkobject.h: * gtk/gtkobject.c: gtk_object_query_args takes an additional pointer now which if supplied will point to an array holding the sequential argument ids. * gtk/gtktree.c: fix emission of selection_changed signal, supplied by Bolliet Jerome. * gtk/gtktreeitem.c: inline the plus and minus pixmaps, supplied by Bolliet Jerome. * gtk/gtknotebook.c: do a resize when a page is removed and don't refer to the removed page on the switch signal, supplied by Lars Hamann and Stefan Jeske. * gtk/gtktoolbar.h: * gtk/gtktoolbar.c: gtk_toolbar_append_item, gtk_toolbar_prepend_item, gtk_toolbar_insert_item, gtk_toolbar_append_widget, gtk_toolbar_prepend_widget, gtk_toolbar_insert_widget: take an additional gchar *tooltip_private_text as argument to fully support the underlying call to gtk_tooltip_set_tip. Fri Feb 20 06:40:00 1998 Tim Janik * gtk/gtktipsquery.h: * gtk/gtktipsquery.c: New widget GtkTipsQuery for letting the user query tooltips of widgets. * gtk/testgtk.c: add example for GtkTipsQuery. * gtk/gtk.h: include gtk/gtktipsquery.h. * gtk/gtklabel.c: enable default constructing. Thu Feb 19 18:53:51 1998 Larry Ewing * removed g_warnings from the common XShm failure cases in gdkimage.c 1998-02-19 Federico Mena Quintero * gtk/gtkcombo.c (gtk_combo_entry_key_press): Added M-p and M-n key equivalents for up and down keys. Just for us Emacs weenies :-) Thu Feb 19 12:18:24 1998 Owen Taylor * gtk/testgtk.c : Use POINTER_MOTION_HINT when dragging shapes around. (gtk-wille-980203-0 Stefan Wille <1wille@vsys1.informatik.uni-hamburg.de>) * gtk/gtktext.c : Fixes to inserting and deleting characters on line breaks. (gtk-magnus-980210-0 Magnus Hulthen ) * glib/configure.in glib/glibconfig.h.in: the value of ---enable_debug is written into glibconfig.h so everything is recompiled when it changes. (HACK) * gtk/gtkmain.c gdk/gdk.c docs/debugging.txt: Added --gdk-no-debug and --gtk-no-debug switches. Effect of switches is no cumulative. Thu Feb 19 06:56:52 1998 Tim Janik * gtkbox.c: * gtkbutton.c: * gtkcontainer.c: * gtkframe.c: * gtklabel.c: * gtkobject.c: * gtkwidget.c: * gtkwindow.c: present the argument access masks on their announcement. * gtk/gtkobject.h: * gtk/gtkobject.c: (gtk_object_add_arg_type): take an additional argument describing the access mask of the new arg. this can be of GTK_ARG_READABLE, GTK_ARG_WRITABLE or GTK_ARG_READWRITE (the latter is an alias for the two previous ones). (gtk_object_query_args): provide an access_mask array if desired. * gtk/gtkwidget.c (gtk_widget_real_realize): realized the assumtion that widget is a NO_WINDOW widget in actuall code. * gtkwindow.c: slight changes to gtk_window_configure_event that will make the resizing behaviour a little less odd. sigh, for some (buggy) reason, there are still container resizes triggered by manual resizing to very small window sizes. the cointainer resizes will cause gtk_real_window_move_resize to be invoked, which makes the app look like it wants to fight the users resizing action. ;( Thu Feb 19 01:11:48 1998 Owen Taylor * configure.in gdk/gdk.[ch] gdk/gdkcc.c gdk/gdkglobals.c gdk/gdkinputcommon.h gdk/gdkprivate.h gdk/gdkvisual.c glib/configure.in glib/glib.h glib/gutils.c gtk/Makefile.am gtk/gtkmain.c gtk/gtkobject.[ch] gtk/gtkdebug.h docs/debugging.txt New system for controlling debugging: * --enable-debug=[no/yes/minimum] * G_DISABLE_ASSERT and G_DISABLE_CHECKS for glib * G_NO_CHECK_CASTS to control cast checking * G_ENABLE_DEBUG enables run time checking which controls: Object tracing Showing events Miscellaneous g_print's in GDK And is controlled by --gdk-debug/GDK_DEBUG, --gtk-debug/GTK_DEBUG * debug_level and show_events are gone from GTK See docs/debugging.txt for details. And some fixups to the configure.in's so '-g' can be overriden on the command line for --enable-debug Thu Feb 19 05:40:51 1998 Tim Janik * gtk/gtknotebook.h: * gtk/gtknotebook.c: applied gtk-hamann_jeske-980218-0.patch.gz, a patch from Lars Hamann and Stefan Jeske which introduces major usability improvements. fixed bugs are: - container border_width>0 does now work correctly for show_tabs==TRUE and for tab_pos=GTK_POS_BOTTOM/GTK_POS_RIGHT. - toggleing visibility of the tab labels works now. - emission of GtkNotebook:switch_page and all page changes also the signature for the GtkNotebook:switch_page signal changed, callbacks should now look like: gint notebook_switch_page (GtkWidget *widget, GtkNotebookPage *page, gint page_num, gpointer data); Wed Feb 18 01:09:56 PST 1998 Jay Painter * gdk/gdk.c: fixed ambigous else compiler warning * gtk/gtkgamma.c: fixed ambigous else compiler warning * gtk/gtkclist.h: * gtk/gtkclist.c: new signals which break everything! (yeah!) * gtk/gtkfilesel.c: fixed to use new clist signals Wed Feb 18 04:38:24 1998 Tim Janik * gtk/gtkwidget.h: * gtk/gtkwidget.c: new signal GtkWidget::set_parent. this signal will be emitted once a widget gets a new/no parent assigned (i.e. from gtk_widget_unparent and gtk_widget_set_parent). Wed Feb 18 02:58:50 1998 Tim Janik * gtk/gtktooltips.h: new functions gtk_tooltips_data_get and gtk_tooltips_set_tip, gtk_tooltips_set_tips is discouraged now. (_GtkTooltips): removed some fields that were never used. changed boolean fields to one bit size, to pack together with the delay field. (_GtkTooltipsData): added tip_private, renamed tips_text to tip_text. * gtk/gtktooltips.c: (gtk_tooltips_data_get): new function to retrive the _GtkTooltipsData structure of a widget. (gtk_tooltips_set_tip): new function for more extensible tooltips settings than gtk_tooltips_set_tips which is discuraged now. removed a bug that caused a stale object_data key to a _GtkTooltipsData structure. removed a bug that caused tips falsly to come up for a grab widget on widgets where events were grabbed from. 1998-02-17 Federico Mena Quintero * gdk/gdkcc.c: Added some missing newlines on debug messages. Tue Feb 17 05:41:31 1998 Tim Janik * gtk/gtkentry.c (gtk_entry_init): invoke gtk_entry_grow_text already in this place, so the application will never see entry->text==NULL. (see also ChangeLog entry from Tue Feb 11 1997 on this). * gtk/gtkcheckbutton.c: * gtk/gtkradiobutton.c: * gtk/gtktogglebutton.c: applied patch to fix draw_indicator behaviour from Lars Hamann and Stefan Jeske. * gtk/gtkmain.h: * gtk/gtkmain.c (gtk_grab_get_current): new function that returns the current grab widget or NULL. * gdk/gdkwindow.c (gdk_window_shape_combine_mask): remove shape mask if mask==NULL (provided by Stefan Wille). Tue Feb 17 00:06:26 1998 Owen Taylor * gtk/gtkpaned.c, gtk/gtk[hv]paned.c: (gtk-fortier-980215-0) From Patrice Fortier Add a widget->window for paned windows, so they can be reparented properly. Mon Feb 16 23:47:09 1998 Owen Taylor * gtk/gtkviewport.c: (gtk-fortier-980130-0) From Patrice Fortier Eliminate some extra expose events for viewports. (To be conservative, I set the user's event mask for both widget->window, and viewport->bin_window -owt) Mon Feb 16 23:12:14 1998 Owen Taylor * gtk/gtkmain.c: Make timeout and idle insertion code use g_list_insert_sorted(). Mon Feb 16 17:35:17 1998 Owen Taylor * gtk/gtktreeitem.c: Use gtk_signal_default_marshaller, for expand/collapse signals. Fri Feb 13 19:08:51 1998 Tim Janik * gtk/gtkclist.c (check_exposures): check for clist !REALIZED. (draw_rows): bail out if the widget isn't drawable. (hadjustment_value_changed): (vadjustment_value_changed): bail out if clist isn't drawable. * gdk/gdk.c (graphics_expose_predicate): check for private != NULL. (gdk_event_get_graphics_expose): check for window != NULL. Fri Feb 13 00:33:26 1998 Owen Taylor * gtk/testgtk.c (shape_create_icon): Realize window before creating xpm so it gets the right colormap/visual, instead of the default one. Thu Feb 12 23:59:49 1998 Owen Taylor * gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch] gtk/gtkselection.[ch] gdk/gdk.[ch] gtktypeutils.h Replaced all _interp functions with _full functions. (_interp functions left in for compatibility until 0.99.5). Difference: _full functions take _both_ a C-language callback and a marshaller, and simply ignore the C-language callback if the marshaller is present. This allows the destroy notification to be used without marshalling. gtk_selection_add_handler[_full]() regularized to agree with other callbacks. Also, added gtk_input_add_full() to the header file. (gtk_input_add_interp() was never there) * gtk/gtkmain.[ch] gtk/gtkwidget.c: Idle functions are now prioritized. Added new function gtk_idle_add_priority to create an idle with a specified priority (default is zero) constants #defined - GTK_PRIORITY_[HIGH/INTERNAL/DEFAULT/LOW] (redraws, resizes run at GTK_PRIORITY_INTERNAL) * gtk/gtkentry.c gtk/testselection.c: changes to keep up with change to gtkselection.c. * gtk/gtkentry.c gtk/gtkinputdialog.c gtk/gtklist.c gtk/gtklistitem.c gtktree.c gtk/gtktreeitem.c testgtkrc: Change style->white to style->base[] where appropriate. Change the default style to make this apparent. (Yes, its ugly... it can be removed later) Tue Feb 10 15:01:44 1998 Owen Taylor * gtk/gtkobject.c gtk/gtkobject.h: Add a DestroyNotify field, and gtk_object_set_data_full() to match. * gtk/gtkobject.c (gtk_object_finalize): ObjectData structures were being added to a free list, then forgotten about. Just rely on GMemChunk instead. 2018-02-11 Federico Mena Quintero * gtk/gtkclist.c: * gtk/gtkentry.c: * gtk/gtkfixed.c: * gtk/gtkhandlebox.c: * gtk/gtknotebook.c: * gtk/gtkpaned.c: * gtk/gtkpreview.c: * gtk/gtkrange.c: * gtk/gtkruler.c: * gtk/gtktext.c: * gtk/gtkviewport.c: Fixed unrealize handler to comply with the documentation (which mentions the right thing to do). Wed Feb 11 00:18:31 1998 Tim Janik * docs/refcounting.txt: backed out the section "Gnits to care about". * docs/developers.txt: new file, kinda developers FAQ. * gtk/gtksignal.c: new function gtk_signal_handler_pending() returning the id of the next handler pending for that signal or 0. put struct GtkHandler back into gtksignal.c along with gtk_signal_get_handlers. Tue Feb 10 07:12:07 1998 Tim Janik * gtk/gtksignal.h: * gtk/gtksignal.c: ok, there have been several severe bugs in the signal handler referencing and ->next connection stuff. these bugs caused invokations of handlers that are disconnected and - worse - destroyed already. invokation of *destroyd* handlers mean: anything can be executed , because the handler structure can just as well be realocated. at the cost of an extra ->prev field per handler we should have a reasonable stable system now, because of the various places that can cause a handler to be disconnected (*any* handler invokation can cause *any* or *all* handlers to be disconnected, there is no way around a doubly linked list, actually handler disconnection has never worked correctly because of this. handlers are connected together via a *doubly* linked list now, and it is *not* valid to remove a handler out of this list untill all its references have been droped, i.e. handler->ref_count==0. to prevent emissions of disconnected but still referenced handlers, disconnected handlers are simply marked as blocked and get an id of 0 which is an invalid signal handler id. the handler->id has been changed to have 28 significant bits (using alignment gaps), since 65536 (old range: guint16) signal connections (as a total) can easily be reached by complex applications. this whole handler thingy is at least as tedious as writing doubly linked list implementations ;) Mon Feb 9 23:08:16 1998 Owen Taylor * gtk/gtkwidget.c (gtk_widget_unparent): Check for the RESIZE_NEEDED flag and remove the widget from the list. Remove the check from gtk_widget_destroy (no longer needed). * Unrealize widget _before_ calling "destroy" signal, and unset VISIBLE flag. * Unrealize child widgets _after_ unrealizing parent to improve visual appearance. Mon Feb 9 16:42:21 1998 Miguel de Icaza * gtk/gtksignal.c (gtk_signal_get_handlers): no longer a private routine; gtksignal.h: export gtk_signal_get_handlers and GtkHandlers type. Sun Feb 8 07:06:54 1998 Tim Janik * gtk/gtkmenu.c (gtk_menu_get_attach_widget): new function to return the widget that the menu is attached to. Sat Feb 7 11:33:08 1998 Owen Taylor * gdk/gdkgc.c (gdk_gc_copy): use a mask of 0xffffffff instead of 0xffff, since there are 22 flags currently defined. (From: Jon Trowbridge ) Changed to something better. ~((~1) << GCLastBit) (From: from Daniel Stephens ) Sat Feb 7 02:29:01 1998 Tim Janik * gdk/gdk.c (gdk_event_translate): don't wipe out window_private's x and y coordinates if the configure notify is only about resizing, query the correct origin instead. Wed Feb 4 23:05:28 1998 Scott Goehring * gtk/gtkmenufactory.c: menufactories now ref&sink the menus they create Thu Feb 5 02:13:08 1998 Tim Janik * gtk/gtklist.h: * gtk/gtklist.c (gtk_list_remove_items_no_unref): new function to perform the same actions as gtk_list_remove_items, but supply the removed widgets with an additional reference count. * gtk/gtkmain.c (gtk_main_iteration_do): ignore events with event_widget == NULL, since they are bogus events from destroyed GdkWindows, exept for the case where event->type==GDK_PROPERTY_NOTIFY. Always handle expired timeout functions when returning from this function. * gtk/gtkwidget.c (gtk_widget_event): ignore GDK_EXPOSE events if event->window == NULL. Also, if this function couldn't handle the event for any reason (including failing assumptions), make the return value to look as if the event had been handled to avoid further processing (and warnings). * gtk/gtkwidget.h: * gtk/gtkwidget.c: remove gtk_widget_sink, because there is no point in providing such a function. * gdk/gdk.c (gdk_init): changed options `-name' and `-class' to `--name' and `--class', because the old names would confuse getopt(). these arguments have been introduced in the changes from gtk+970916 to gtk+970925 without a ChangeLog entry, changing argument names is painful, it would be nice if people would care about compatibility and consistency in the first place! Tue Feb 3 15:09:55 1998 Tim Janik * docs/widget_system.txt: new file containing notes about the inner workings of the widget system of GTK+, a widget flag description and certain invariants about widget states. * docs/refcounting.txt: moved file (previously REFCOUNTING) introducing The Reference Counting Scheme of GDK an GTK+. lots of additions/corrections. * gtk/gtksignal.c (gtk_signal_real_emit): for the emission of AFTER signals, fetch the objects signals via gtk_signal_get_handlers again. some handlers might have been removed or added. not doing this would mess up the memchunk allocation of signal handlers (this had been triggered by multiple *_while_alive connections), bad, bad, bad! (gtk_handlers_run): do the referencing on signal handlers unconditionally, the invokation of AFTER handlers will now take care of modified lists. * gtk/gtksignal.h: added gtk_signal_connect_while_alive. Tue Feb 3 15:34:27 1998 Owen Taylor * gdk/gdkcolor.c (gdk_colormap_get_system): Only query the colormap for GRAYSCALE and PSEUDOCOLOR visuals, and don't ask for more than 256 colors in any case. * gdk/gdkwindow.c (gdk_window_internal_destroy): Remove the input window information when we destroy the window, not when we are notified of it. * gdk/gdkinputcommon.h (gdk_input_device_new): Work around bug in XFree86 3.3.1's handling of Wacom macro buttons. by assumming no device will report exactly 25 buttons. * gdk/gdkinputcommon.h (gdk_input_common_other_event): Fill in string translation for generated key press events, do sanity checking on received key codes. * gdk/gdkcc.c (gdk_color_context_new): Allocate enough room for a GdkColorContextPrivate, not just for a GdkColorContext. Tue Feb 3 15:09:55 1998 Tim Janik * gtk/testgtk.c: don't add the same menu to different menuitems/ optionmenus. * gtk/gtkmenuitem.h: * gtk/gtkmenuitem.c: new function gtk_menu_item_remove_submenu ro be consistent with optionmenu. use gtk_menu_attach_to_widget/ gtk_menu_detach for setting/removing the submenu. invoke gtk_widget_destroy(submenu) in destructor to be consistent with other destructors. * gtk/gtkoptionmenu.h: * gtk/gtkoptionmenu.c: attach/detach to menu widget via gtk_menu_attach_to_widget/gtk_menu_detach. invoke gtk_widget_destroy(menu) in destructor to be consistent with other destructors. * gtk/gtkmenu.h: * gtk/gtkmenu.c: new functions gtk_menu_attach_to_widget and gtk_menu_detach that correspond to the action of gtk_widget_set_parent and gtk_widget_unparent. * gtk/widget.c: few fixups. Tue Feb 3 00:12:00 1998 Owen Taylor * gtk/gtktable.c Fixed problem with division by zero in row/column-spanned tables. Also removed a bunch of conditionals by making the observation that x/1 == x. Mon Feb 2 04:15:08 1998 Tim Janik * gtk/gtkwindow.c: * gtk/gtkwidget.c: * gtk/gtkmain.c: * gtk/gtkwidget.c: * gtk/gtkcontainer.c: * gtk/gtkprivate.h (GTK_PRIVATE_UNSET_FLAG) (GTK_PRIVATE_UNSET_FLAGS): changed name to reflect that these macros in fact can't operate on multiple flags. * gtk/gtktoolbar.c: fixed destroy handler, so it doesn't segfault with the new refcounting scheme anymore. * gtk/gtkhandlebox.c: * gtk/gtkclist.c: * gtk/gtkentry.c: * gtk/gtkrange.c: * gtk/gtktext.c: * gtk/gtkviewport.c: enforced gdk_window_set_user_data (window, NULL); gdk_window_destroy (window); window = NULL; throughout the code. * gtk/gtkmain.c (gtk_propagate_event): fixed a bad, bad referencing bug that could caused unreferencing of finalized objects. * gtk/testgtk.c: destroy fileselection on "OK" (this triggered the above mentioned bug). * gtk/gtkwidget.h: * gtk/gtkwidget.c: * gtk/gtkobject.h: * gtk/gtkobject.c: implemented and object reference tracer (gtk_trace_referencing) which is activated if GTK_TRACE_OBJECTS is defined (currently per default). in gdb: set the static variable `gtk_trace_object' to point to the object that you want to have reference traced. * gtk/gtkfileselection.c: few cleanups. * gtk/gtkcolorsel.c: * gtk/gtkcombo.c: * gtk/gtkobject.c: * gtk/gtkselection.c: * gtk/gtkwidget.c: * gtk/gtkwindow.c: cleanups with key name spaces. * gtk/gtkcombo.c: fixed destruction bug with popwin. * gtk/gtkcontainer.h: * gtk/gtkcontainer.c: GTK_RESIZE_NEEDED is a private flag now. (gtk_container_register_toplevel): new function. (gtk_container_unregister_toplevel): new function. * gtk/gtkmain.c: GTK_LEAVE_PENDING is a private flag now. * gtk/gtkmenu.c: call gtk_container_register_toplevel in gtk_menu_class_init instead of this dirty gtk_widget_set_parent(,NULL) hack. new default handler gtk_menu_destroy for calling gtk_container_unregister_toplevel. removed GTK_ANCHORED, GTK_UNMAPPED. * gtk/gtkobject.h: macro cleanups, added GTK_DESTROYED flag. * gtk/gtkobject.c: only emit DESTROY signal if !GTK_OBJECT_DESTROYED (object). * gtk/gtkprivate.h: new file that will not be automatically included. it holds the private flags for GtkWidget along with it's SET/UNSET and examination macros. * gtk/gtkwidget.c: private flags: GTK_RESIZE_NEEDED, GTK_REDRAW_PENDING, GTK_RESIZE_PENDING, GTK_IN_REPARENT, GTK_USER_STYLE. GTK_ANCHORED is replaced by GTK_TOPLEVEL. added missing UNSET for GTK_IN_REPARENT. removed the gtk_widget_set_parent(, NULL) hack for toplevels. upon destroy free memory for widgets with GTK_WIDGET_HAS_SHAPE_MASK. * gtk/gtkwidget.h: split up the widget flags into a public and a private portion. added an extra field private_flags to GtkWidget without making it bigger by using an alignment gap of 16 bit. macro cleanups. * gtk/gtkwindow.c: removed GTK_ANCHORED. new function gtk_window_destroy for calling gtk_container_unregister_toplevel. removed the gtk_widget_set_parent(,NULL), call gtk_container_register_toplevel instead. remove GTK_UNMAPPED. GTK_RESIZE_NEEDED is private now. * gtk/gtksignal.c (gtk_signal_disconnect): removed a bug on removal that cut off the handler list -> living_objects == 0 with testgtk. made some warnings more descriptive. new function gtk_signal_connect_object_while_alive, which will automatically destroy the connection once one of the objects is destroyed. didn't include this before removal of the above mentioned bug. Sat Jan 31 21:26:27 1998 Owen Taylor * gtk/gtkwidget.c: Added a new GTK_IN_REPARENT flag and revised gtk_widget_reparent so that the child would not be unrealized unnecessarily. Changed gtk_widget_unrealize () to recursively unrealize the children (since the child windows will be destroyed too.) Sat Jan 31 00:05:34 PST 1998 Manish Singh * gtk/gtkcombo.c: changed to use g_strcasecmp * gtk/gtkobject.c: #include for atexit Sat Jan 31 00:13:33 1998 Owen Taylor * gtk/gtkstyle.c: Backed out change to close polygons since it caused problems for the Notebook. Fri Jan 30 22:28:09 1998 Owen Taylor * gtk/gtkclist.{c,h}: - Conformity to new reference counting schemes - Font and color information is no-longer taken from the (possibly unitialized) style before the widget is realized, but is obtained when needed. (Fixes problems with non-default styles) - white_gc => base_gc where appropriate - Handle graphics expose events correctly (or as correctly as anywhere else) so that scrolling when overlapped works. Fri Jan 30 21:32:11 1998 Owen Taylor * gtk/gtkwidget.c (gtk_widget_init): Don't replace the object flags, augment them. (Otherwise we'll clear the FLOATING flag) Fri Jan 30 23:55:03 1998 Tim Janik * Incorporation of Marius Vollmer's reference counting revolution, plus various fixups and additions from myself. * gdk/gdk.h: * gdk/gdkgc.c: new functions gdk_gc_ref/gdk_gc_unref. * gdk/gdkprivate.h: cleanups on ref_count field sizes. * gtk/gtkadjustment.c (gtk_adjustment_set_value): new function for emission of GtkAdjustment::value_changed signal. * gtk/gtkbin.c: * gtk/gtkcolorsel.c: * gtk/gtkcurve.c: * gtk/gtkentry.c: * gtk/gtkframe.c: * gtk/gtkinputdialog.c: * gtk/gtklabel.c: * gtk/gtkpixmap.c: * gtk/gtkpreview.c: * gtk/gtkrange.c: * gtk/gtktable.c: * gtk/gtkwindow.c: replaced functionality of gtk_*_destroy by gtk_*_finalize. * gtk/gtkbox.c: * gtk/gtkbutton.c: * gtk/gtkfixed.c: * gtk/gtkmenushell.c: * gtk/gtknotebook.c: * gtk/gtkpaned.c: * gtk/gtkscale.c: removed default destroy handler. * in general: reference parent->window for NO_WINDOW widgets. set user data of a GdkWindow to NULL before destruction. * gtk/gtkbutton.c: use gtk_widget_unparent instead of gtk_widget_destroy in *_set_arg. * gtk/gtkcontainer.c: provide other containers with a default destroy handler that will destroy all children. new function gtk_container_foreach_interp. new field resize_widgets. * gtk/gtklist.c: handle destruction of children in gtk_list_destroy. replaced occourances of gtk_widget_destroy with gtk_widget_unparent. reference children that are in the selection list. * gtk/gtkmain.c: reference grab widgets. (gtk_get_event_widget): check for event.window != NULL. Note: this function may return NULL now!. (gtk_propagate_event): much simplified by using proper reference counting. * gtk/gtkmenu.c: introduce GTK_TOPLEVEL, and gtk_widget_set_parent(, NULL) hack. * gtk/gtkmenuitem.c: gtk_widget_(un)ref the submenu. * gtk/gtkmenushell.c: check for return value of gtk_get_event_widget. * gtk/gtknotebook.c: proper gtk_widget_unparent()ing. * gtk/gtkobject.c: new functions gtk_object_finalize, gtk_object_notify_weaks, gtk_object_debug, gtk_object_sink, gtk_object_weakref, gtk_object_weakunref. implementation of the new reference counting scheme for gtkobjects (consult gtk+/REFCOUNTING). * gtk/gtkoptionmenu.c: proper reference counting for option_menu->menu. * gtk/gtkscrolledwindow.c: new finalize handler for proper referencing of the subwidgets. * gtk/gtksignal.c: internal representation of signal_type is now 16 bit instead of 13 bits. this is needed because of user signals. new functions gtk_signal_handler_ref and gtk_signal_handler_unref (replacement for gtk_signal_handler_destroy). gtk_signal_emit, gtk_signal_emit_by_name, gtk_signal_real_emit used to return the existence of a GtkObject. this will always be TRUE now, therefore the return value is now void. * gtk/gtktooltips.h: * gtk/gtktooltips.c: GtkTooltips is now a descendant of GtkData and therefore a real GtkObject. * gtk/gtktree.c: reference changes similar to thos in gtklist.c. * gtk/gtktreeitem.c: reference th e pixmaps properly. * gtk/gtktypeutils.h: * gtk/gtktypeutils.c: new function gtk_arg_copy() to conform to the requirements of gtk_object_get(). * gtk/gtkviewport.c: finalize handler for proper referencing of the adjustments. * gtk/gtkwidget.c: substituted VISIBILITY_NOTIFY_EVENT by NO_EXPOSE_EVENT. added finalize handler. added gtk_widget_ref/gtk_widget_unref. new functions gtk_widget_idle_draw and gtk_widget_idle_sizer, that will handle all widgets that are currently in either queue. referencing all over the place. changes because gtk_signal_emit returns void now. moved queue removal into the destroy handler. gtk_widget_real_unrealize propagates now down the tree. new flag GTK_TOPLEVEL. new function gtk_widget_destroyed for connection to the destroy signal of a widget. this function nullifies the widgets structure pointer, look at gtkmain.c for an example on this. * gtk/gtkwindow.c: new functions gtk_window_activate_focus, gtk_window_activate_default. for activation of the appropriate children. changes to the resizing code because there is a new field resize_widgets in GtkContainer now. * gtk/testgtk.c: some changes because of all the above ;) Fri Jan 30 17:41:06 1998 George Lebl * gtk/gtktable.c: fixed round-off error in calculation of tabels with a lot of cells Fri Jan 30 08:51:16 1998 Federico Mena * gdk/gdkcc.c (gdk_color_context_get_pixel): red/green/blue parameters are now expected to be in [0, 65535], to be consistent with the rest of Gdk. (gdk_color_context_get_pixels): Made it use 16-bit color values as well. Fixed mdist=1000000 buglet (it should start with at least 0x1000000). (gdk_color_context_get_pixels_incremental): Same as gdk_color_context_get_pixels(). Thu Jan 29 22:57:39 1998 Owen Taylor * gtk/gtkstyle.c (gtk_default_draw_polygon): Close the polygon if it isn't already. (To match gtk_draw_polygon) Simplified logic. (Appearance could probably be improved for objects with gradual curves by adding in some intermediate edge coloration) Thu Jan 29 21:36:14 1998 Tim Janik * gtk/gtksignal.c (gtk_signal_query): new function to gather information about a certain signal. * gtk/gtksignal.c (gtk_signal_newv): new function similar to gtk_signal_new(). * gtk/gtksignal.c (gtk_signal_real_emit): check for function_offset == 0. * gtk/gtksignal.c (gtk_signal_connect_by_type): perform a signal id lookup on the parent as well. * gtk/gtkobject.c (gtk_object_class_add_user_signal): new function for implementation of user defined signals. * gtk/gtkobject.c (gtk_object_class_add_signals): free old signal id array. * gtk/gtkobject.h: this holds the typedefs for GtkSignalFunc and GtkSignalMarshaller now, because they are used for gtk_object_class_add_user_signal. * gtk/gtktypeutils.c (gtk_type_class_init): reset object_class->signals and object_class->nsignals for new object classes. Tue Jan 27 15:52:48 1998 Federico Mena * gtk/gtkhandlebox.c (gtk_handle_box_realize): The auto_shrink policy of the floating window is now set to TRUE. This fixes the problem of the floating window being too big when the handlebox child is small. (gtk_handle_box_motion): Now we use GDK_POINTER_MOTION_HINT_MASK to improve movement. Tue Jan 27 14:15:50 CST 1998 Shawn T. Amundson * docs/gtkfaq.sgml: more additions/changes Tony Gale. Mon Jan 26 17:12:12 CST 1998 Shawn T. Amundson * docs/gtkfaq.sgml: additions/changes from new FAQ maintainers Nathan Froyd and Tony Gale. Mon Jan 26 16:54:02 CST 1998 Shawn T. Amundson * docs/gtk.texi: additions/changes from Gregory A. McLean Mon Jan 26 02:15:29 1998 Tim Janik * gdk/gdkdraw.c: * gdk/gdkgc.c: * gdk/gdkimage.c: * gdk/gdkinput.c: * gdk/gdkpixmap.c: * gdk/gdkproperty.c: * gdk/gdkselection.c: * gdk/gdkwindow.c: added a bunch of checks for window != NULL and private->destroyed. Sun Jan 25 19:15:32 1998 Tim Janik * gtk/gtkwidget.h (enum): added new widget flag GTK_LEAVE_PENDING. * gtk/gtkmain.c (gtk_main_iteration_do): if a widget has GTK_LEAVE_PENDING set, send it its LEAVE_NOTIFY event, regardless of a grab or sensitivity. changed the compression code for enter/leave notify events to free *both* compressed event, and removed an unneccessary call to g_list_remove. * ChangeLog: finally catched up with the recent changes on my part. * gtk/gtkobject.h: new element n_args in GtkObjectClass. * gtk/gtkobject.c (gtk_object_query_args): this function now returns the arguments in the correct order. * gtk/gtkbox.c: * gtk/gtkbutton.c: * gtk/gtkcontainer.c: * gtk/gtkframe.c: * gtk/gtklabel.c: * gtk/gtkobject.c: * gtk/gtkwidget.c: * gtk/gtkwindow.c: various fixes and additions to the gtk_*_set_arg and gtk_*_get_arg() functions. * gdk/gdk.h: * gdk/gdk.c (gdk_pointer_is_grabbed): new function. * gtk/gtkmain.h: * gtk/gtkmain.c: implementations of gtk_invoke_key_snoopers(), gtk_key_snooper_install() and gtk_key_snooper_remove(). this mechanism allowes applications to track global hot keys that need to bypass accelerator tables and else key processing stuff. Thu Jan 22 18:58:44 1998 Federico Mena * gdk/gdkcc.c: Switched the file to GNU indentation, for consistency. * gdk/gdktypes.h (struct _GdkColorContext): Picky, picky... fix two lines with wrong indentation :-) Thu Jan 22 02:32:06 1998 Scott Goehring * gtk/Makefile.am: Fixed the call to runelisp to use $(SHELL). (Cannot rely on the script having execute permissions.) Wed Jan 21 17:29:54 CST 1998 Shawn T. Amundson * Released 0.99.3 Wed Jan 21 01:32:21 1998 Tim Janik * gtk/gtkwidget.h: * gtk/gtkwidget.c: changed the state_changed signal to take an extra argument `old_state'. removed `gtk_widget_restore_state'. changed `gtk_widget_set_state' and `gtk_widget_set_sensitive' to use only one function `gtk_widget_propagate_state' to iterate down the tree. this causes GtkWidget::state_changed to be invoked on state changes and on sensitivity changes. some comment cleanups. Tue Jan 20 16:38:52 1998 Owen Taylor * gtk/gtkcombobox.{c,h}: removed gtk/gtkcombo.{c,h}: added [Paolo Molaro's version] gtk/testgtk.c: changed to use new version gtk/Makefile.am gtk/gtk.h Mon Jan 19 20:10:19 CST 1998 Shawn T. Amundson * gdk/gdk.h Fixed typo where strdup was used instead of g_strdup (found by Frank Neumann) Mon Jan 19 16:21:00 1998 Federico Mena * gtk/gtktoolbar.c (gtk_toolbar_class_init): Set container_class->focus to NULL. Widgets in the toolbar should not get the focus via the normal key bindings (no toolkit does this, and it makes sense). * gtk/testgtk.c (create_toolbar): Removed the GTK_PIXMAP casts to match Eckehard's new prototypes. * gtk/gtktoolbar.h: Switched the order of the tooltip_text and widget parameters to the gtk_toolbar_*_widget() functions, to be friendlier to the C++ bindings. This is per request of Guillaume Laurent. Mon Jan 19 09:16:38 1998 Tim Janik * gtk/gtkmain.c (gtk_grab_add) (gtk_grab_remove): this is a stack of grabbing widgets now, having unique entries. the GTK_HAS_GRAB flag of a widget is set while it is on the stack (wasn't implemented before). Mon Jan 19 00:46:18 1998 MET Eckehard Berns * gtk/gtktoolbar.[ch]: changed gtk_toolbar_{append,prepend,inser]_item to accept any GtkWidget as icon to allow more flexibility Sun Jan 18 16:54:55 CST 1998 Shawn T. Amundson * gtk/gtkstatusbar.[ch] added new widget, the statusbar Sun Jan 18 09:57:00 1998 Owen Taylor * gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkdrawingarea.c gtk/gtkentry.c gtk/gtkeventbox.c gtk/gtkfixed.c gtk/gtkhandlebox.c gtk/gtkhscale.c gtk/gtkhscrollbar.c gtk/gtkitem.c gtk/gtklist.c gtk/gtkmenushell.c gtk/gtkmisc.c gtk/gtknotebook.c gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtkprogressbar.c gtk/gtkruler.c gtk/gtktext.c gtk/gtktree.c gtk/gtkviewport.c gtk/gtkvscale.c gtk/gtkvscrollbar.c gtk/gtkwidget.{c,h} Added gtk_widget_set_parent_window() and gtk_widget_get_parent_window(). All widgets should use: gtk_widget_get_parent_window() instead of widget->parent->window. Any widget that wants to have children not in the parent window, should use gtk_widget_set_parent() in their realize() and add() routines. CList and Viewport widgets changed to do this. (Viewport widget using code from gtk-fortier-980117-0.patch.) Sat Jan 17 23:56:02 1998 Owen Taylor * gtk/gtkobject.c: renamed g_string_equal => g_str_equal renamed g_string_hash => g_str_hash Sun Jan 18 03:57:52 1998 Tim Janik * gtk/gtkframe.c: gtk_*_get_arg() and gtk_*_set_arg() implementations. * gtk/gtkobject.c: new arg `GtkObject::object_signal' similar to `GtkObject::signal'. check for class type in gtk_object_{setv|getv}. * gtk/gtkobject.c: * gtk/gtksignal.c: * gtk/gtktypeutils.h: * gtk/gtktypeutils.c: added GTK_TYPE_DOUBLE. * gtk/gtkwidget.c: new args `has_focus' and `has_default'. * gtk/gtkwindow.c: new arg `window_position'. * gtk/gtkbox.h: * gtk/gtkbox.c: new functions gtk_box_reorder_child, gtk_box_query_child_packing and gtk_box_set_child_packing to allow modification of the child linkage after the widget tree is setup. * gtk/gtkbox.c: * gtk/gtklabel.c: * gtk/gtkwindow.c: * gtk/gtkwidget.c: * gtk/gtkobject.c: gtk_*_get_arg() and gtk_*_set_arg() fixes and implementations. Sat Jan 17 18:06:35 1998 Owen Taylor * gdk/gdk.c (gdk_events_pending): Take putback events into account * gdk/gdk.c (gdk_event_free): Handle dropdataavaible memory allocation correctly. (Incompatible change: client must _not_ fre event->data and event->data_type.) * gdk/gdk.c (gdk_event_translate): Changed DND dragging so that we don't ungrab pointer when we reenter window to prevent extra Enter/Leave effects which had bad effects. Changed drag zone handling to not send uncessary DragEnter events. Fixed EnterNotify/LeaveNotify handling. (Only pay attention to events on window, don't specify these events to XGrabPointer - that isn't valid, and handle reverse the sense of the handling of LeaveNotify.) * gdk/gdkwindow.c (gdk_window_remove_filter): Free removed filter. * gtk/gtk.defs (GdkFont): gdk_font_free => gdk_font_unref * gtk/gtkmain.{c,h} (gtk_events_pending): new function - apps should use this instead of gdk_events_pending. * gtk/gtkvbbox.h: Fixed a duplication in the headers. * gtk/testgtk.c (dnd_drop): Don't free the drop data, it belongs to the event. Sat Jan 17 13:26:15 CST 1998 Shawn T. Amundson * gtk/gtkentry.[ch]: Applied patch from which adds gtk_entry_set_max_length function. This was part of gtk-lupus-970112-0. * gtk/testgtk.c: Applied gtk-wille-980113-0 which fixes a problem with a shaped widget keeping grab forever when double clicked. * docs/gtk.texi: patch from Gregory McLean to add some on aspect_frame, button_box, and color_selection widgets Sat Jan 17 06:24:05 1998 Tim Janik * gtk/gtktypeutils.h (gtk_type_get_arg): new function. * gtk/gtkobject.h (gtk_object_query_args): new function. * gtk/gtkobject.h (gtk_object_getv): new function. * gtk/gtkwidget.h (gtk_widget_get): new function. Fri Jan 16 00:36:31 1998 Federico Mena * gtk/gtkhandlebox.c: Now we use a GtkWindow of type GTK_WINDOW_DIALOG as a destination for reparenting the child of the handle box. This solves the problem of having X calls in Gtk. It also makes the handle box work with KWM, OLVWM, 4Dwm (so I expect mwm to work as well). I hadn't noticed that previously it only worked with fvwm and twm. * gtk/gtkhandlebox.h (struct _GtkHandleBox): Removed the real_parent field, as it is never used. (struct _GtkHandleBox): Added a float_window field. This is a GtkWindow to where the child is now reparented. * gtk/gtkhandlebox.c: Lots of changes all over the place. Now the widget has two windows. The steady_window stays put in the parent container, and the widget->window is the one that gets reparented. Now that window is transient, in compliance with the ICCCM, instead of an OverrideRedirect window. We have two windows so that we can properly receive Expose events for the thin 3D line that marks the place where the handlebox is docked. * gtk/gtkhandlebox.h (struct _GtkHandleBox): Added fields for dragging (mouse position information). Added fleur_cursor so that we look pretty. Added steady_window field; it is the window that actually stays on the parent (widget->window is the one that gets reparented). Thu Jan 15 19:03:19 1998 Miguel de Icaza * gtk/gtkclist.c (gtk_clist_set_column_width): Call gtk_clist_size_allocate_columns every time the column configuration changes. Fri Jan 16 01:55:17 1998 Tim Janik * improved the gtk_widget_set handling. removed GtkArgFunc and added GtkArgSetFunc and GtkArgGetFunc in _GtkTypeInfo. performance consuming strcmp() calls are avoided in gtk_*_set_arg() now, it is passed an arg_id on which it can switch() now. * gtk/gtkobject.h: * gtk/gtkobject.c (gtk_object_add_arg_type): added parameter arg_id. * gtk/gtktypeutils.h: * gtk/gtktypeutils.c (gtk_type_set_arg): added parameter arg_id. * gtk/gtkobject.c: bug fixes and changes in the assertion system for arg handling. changed g_print() warning calls to real g_warning()s. * changed all *_get_type() functions to initialize GtkTypeInfo correctly with GtkArgSetFunc and GtkArgGetFunc fields. Thu Jan 15 00:44:27 PST 1998 Jay Painter * gtk/gtkentry.[ch]: Change window cursor to "I" * gtk/gtkpane.[ch]: Cleared up a tiny memory leak from not destroying the cursor Tue Jan 13 07:30:02 PST 1998 Jay Painter * gtk/gtkclist.c: minor updates * gtk/gtktext.c: you can type in it! It should also seg-fault *MUCH* less now, because editing was never really turned off. * gtk/testgtk.c: changed the gtktext test a little * gtk/testgtkrc: removed pixmap background for now, since I intend to break that for a while 1998-01-13 Federico Mena Quintero * gtk/gtktoolbar.c: (gtk_real_toolbar_style_changed): Fixed child->icon and child->label == NULL bugs. * gtk/gtktoolbar.h: Added some new functions: gtk_toolbar_append_widget() gtk_toolbar_prepend_widget() gtk_toolbar_insert_widget() These let the user insert any kind of widget in the toolbar. Also changed the gtk_toolbar_*_item() functions to return a GtkWidget * so that the user can do things with the toolbar buttons. * gtk/gtktoolbar.c: Now the toolbar supports its own buttons and arbitrary widgets as well. Geometry management has been changed accordingly. Added gtk_toolbar_remove() function, so container functionality should be complete now. * gtk/testgtk.c (create_toolbar): Added an entry widget to test the new toolbar. * Most of these changes are adapted from the gtk-lupus-970112-0-patch (should be 970112... :-) Sat Jan 9 20:52:00 PST 1998 Ian Main * gtk/gtkfilesel.c: Changed a few tests in the path correcting function. Hopefully this helps the filesel stability. Fri Jan 8 00:55:00 PST 1998 Jay Painter * gtk/gtkclist.c: * gtk/gtkclist.h: modifications to GtkCList so it's look and feel is the same as scrolled windows. Thu Jan 8 17:56:09 PST 1998 Manish Singh * glib/gscanner.c * gtk/gtclist.c * config.h.in * configure.in: added test for inline and put the inline keywords back in * gtk/gtklabel.c: made the prototypes match the definitions * gtk/fnmatch.c: minor change to make sure the right config.h gets included 1998-01-07 Elliot Lee * gtk/gtkcombobox.c gtk/gtkcombobox.h: New widget, GtkComboBox * gdk/gdkwindow.c: Make gdk_window_init set the width & height of gdk_root_parent Wed Jan 7 18:06:17 PST 1998 Manish Singh * gtk/gtkentry.c: * gtk/gtkentry.h: applied patch to use a backing pixmap for drawing, which removes the bad flickering. (gtk-wille-980106-0) Wed Jan 7 02:14:30 PST 1998 Manish Singh * glib/glib.h * glib/glist.c * glib/gslist.c * glib/testglib.c: Added g_[s]list_insert_sorted function and appropriate tests in testglib Tue Jan 6 17:09:46 1998 Owen Taylor * gtk/gtknotebook.h gtk/gtknotebook.c Added "switch_page" signal. (gtk-hamann_jeske-971212-0.patch) Tue Jan 6 17:07:29 1998 Owen Taylor * gtk/gtkentry.c gtk/gtkentry.h gtk/testgtk.c : Fixed problem with deleting while text is selected. Changed behavior so that motion keys remove selection. Added new gtk_entry_select_region () call. Sat Jan 3 20:23:25 1998 Owen Taylor * glib/glib.h: Changed guint32 -> guint for bitfields. (Bitfields must be int or unsigned int?) Sat Jan 3 15:39:45 PST 1998 Jay Painter * gtk/testgtk.c: better CList test Sat Jan 3 11:09:51 CST 1998 Shawn T. Amundson * GTK+ 0.99.2 Released Sat Jan 3 11:09:51 CST 1998 Shawn T. Amundson * gtk/gtkscrolledwindow.c: initialize scrollbar_spacing (gtk-fortier-980103-0) Sat Jan 3 10:15:08 1998 Scott Goehring * configure.in: fixed a typo (no_xext_lib, not no_ext_lib). Sat Jan 3 00:41:28 PST 1998 Manish Singh * gtk/gtkentry.c: * gtk/gtkentry.h: applied Gordon Matzigkeit's patch to add fixed-length entry fields (gtk_entry_new_with_max_length) Fri Jay 2 23:52 PST 1998 Jay Painter * reverted glibconfig.h and glib.h files back to the way they were before my ugly hack * gtk/gtkclist.c: * glib/gscanner.c: removed inlines from clist and gscanner Fri Jan 2 23:55:24 CST 1998 Shawn T. Amundson * Several portability fixes from Michael Callahan including adding in missing #includes and adding void in function prototypes. Fri Jan 2 19:28:52 1988 Jay Painter * gtk/gtkclist.h: * gtk/gtkclist.c: * gtk/gtk.h: * gtk/testgtk.c: * gtk/testgtkrc: added GtkCList, column list widget, and a small test to testgtk Fri Jan 2 15:42:51 1998 Federico Mena * gtk/gtkmain.c (gtk_main_iteration): Make the big switch handle GDK_NO_EXPOSE and GDK_VISIBILITY_NOTIFY events. Fri Jan 2 12:07:33 CST 1998 Shawn T. Amundson * gtk/gtkviewport.c: corrects a small resize bug in the viewport widget. The viewport widget provides a _set_shadow function to draw its shadows. But if GTK_SHADOW_NONE is sent to this function, the viewport isn't resized correctly (it's still considered as a shadowed widget). (gtk-fortier-971213-0) * gtk/gtknotebook.c: this patch fixes the redraw problems of notebook tabs, without using gdk_gc_set_clip_rectangle. (gtk-hamann_jeske-971218-0) * add gtk_widget_(show/hide)_all (Stefan Wille) (gtk-wille-301297-0) Patch for testgtk not included because it did not patch clean. Thu Jan 1 21:21:56 PST 1998 Manish Singh * configure.in: fixed up the xinput test * Miscellaneous portability fixes. Mon Dec 29 22:05:45 1997 Miguel de Icaza * gdk/gdkgc.c (gdk_gc_copy): New function, used to copy the values from one gc to another gc. Sat Dec 27 20:39:99 1997 Elliot Lee * gtk/gtkhandlebox.c: It mostly works now, please test it and make fixes as needed. Fri Dec 26 11:20:03 1997 Scott Goehring * gtk/Makefile.am (gtkinclude_HEADERS): added gtkhandlebox.c * gtk/gtkhandlebox.c (gtk_handle_box_reparent): eliminated a compiler warning caused by not casting an argument in a debugging message. :) Fri Dec 26 02:59:39 1997 Federico Mena * gdk/gdktypes.h gdk/gdk.c gdk/gdkwindow.c: Added new GDK_NO_EXPOSE and GDK_VISIBILITY_NOTIFY events. They are needed for Alan Cox's TV widget and for GtkXmHTML. Only missing with respect to their Xlib counterparts are the major_code and minor_code fields from the GdkEventNoExpose structure. Does anyone need them? Tue Dec 23 03:03:17 1997 Tim Janik * gtk/gtkscrolledwindow.c (SCROLLBAR_SPACING): this macro computes the spacing from klass->scrollbar_spacing now. adapted all functions that used this macro (based on a patch from Patrice Fortier). * gtk/gtkscrolledwindow.h (struct _GtkScrolledWindowClass): added scrollbar_spacing to substitute a define (patch from Patrice Fortier). * gtk/gtkrc.h (gtk_rc_parse_string): new function. * gtk/gtkrc.c: many functions adapted to use GScanner for scanning. (gtk_rc_parse): use gtk_rc_parse_any for parsing. (gtk_rc_parse_string): new function to support parsing from strings, just calls gtk_rc_parse_any. (gtk_rc_parse_any): new function using GScanner as lexer. Thu Dec 18 23:46:11 CST 1997 Shawn T. Amundson * GDK support for 1 bpp depth screens. Thu Dec 18 23:46:11 CST 1997 Shawn T. Amundson * Changes from Bolliet Jerome to gtktree. Corrects a bug in gtk_tree_remove_items and gtk_tree_item_destroy. Adds the possibility to connect all items by lines. This is the default now. You can overide this with the function gtk_tree_set_view_line which take a tree and a boolean. Thu Dec 18 23:26:49 CST 1997 Shawn T. Amundson * removed configure, Makefile.in, and aclocal.m4 files Wed Dec 17 23:36:57 1997 Scott Goehring * gdk/gdkcc.c (gdk_color_context_free): Caught a stray gdk_colormap_destroy that Owen missed (and Shawn found). Wed Dec 17 20:59:52 1997 Owen Taylor * gdk/gdkinput.c gdk/gdkinput.h gdk/gdkinputcommon.h gdk/gdkinputxfree.h gdk/gdkinputgxi.h gdk/gdkinputnone.h. gtk/gtkinputdialog.h gtk/testinput.c Added support for device keys mapping to key events. Fixed various bugs. Wed Dec 17 20:53:00 1997 Owen Taylor * gdk/gdk.c gdk/gdk.h: Changed gdk_get_event to remove predicate filtering, and to allocate the events. Added gdk_event_get_graphics_expose for scroll handling. * gtk/gtkmain.c gtk/gtktext.c: Use above changes. Interface change for gtk_get_current_event. * testgtk.c Added another test to test new scrolling mechanism.s * gdk/gdk.c gdk/gdk.h gdk/gdkwindow.c gdk/gdkprivate.h: Added beginnings of event filtering. Removed obsolte OtherEvent mechanism. * gdk/gdk.c: Combined FocusIn/FocusOut events. Now ignore focus events which aren't for window itself. (Only pay attention to NotifyAncestor/Inferior/Nonlinear) * gtk/gtkwindow.c gtk/gtkwindow.h: Virtualize set_focus function so it can be overridden. * gtk/gtkwidget.c: Reparenting should now work for containers. (Guillaume Laurent ) * gdk/gdkgc.c: By default, GraphicsExpose events are now _not_ generated. * gtk/testselection.c: Suppress a warning, fix a bug? Wed Dec 17 20:47:42 1997 Owen Taylor * configure.in, glib/configure.in: Remember if user set CFLAGS, so we can set it for --enable-debug only if they didn't. Added missing quotes. )Raphael.Quinet@eed.ericsson.se) Only use -DX_LOCALE if setlocale doesn't work. * gdk/gdki18n.h: Simplified system for trying to get iswalnum() - include if present, otherwise if present. Wed Dec 17 21:09:12 1997 Owen Taylor 1997-10-13 Marius Vollmer Bug fixes: * gtksignal.c (gtk_params_get): Initialize the GtkArg even when the return type is GTK_TYPE_NONE. Revamped reference counting, see the file REFCOUNTING. * Makefile.am (EXTRA_DIST): Added REFCOUNTING. * REFCOUNTING: New file. * gdk/gdk.c (received_destroy_notify, window_to_destroy): Removed. (gdk_event_get): Code that deals with the above removed. (gdk_event_translate): Abort when the GdkWindow for the XEvent cannot be found. For DestroyNotify: Do not use receive_destroy_notify and window_to_destroy but call gdk_window_destroy_notify. * gdk/gdk.h: (gdk_pixmap_destroy, gdk_colormap_destroy, gdk_fontset_free): Removed. (gdk_pixmap_ref, gdk_pixmap_unref, gdk_bitmap_ref, gdk_bitmap_unref): New prototypes. (gdk_font_free, gdk_font_unref): Renamed gdk_font_free to gdk_font_unref. * gdk/gdkcolor.c (gdk_colormap_real_destroy): Made static. (gdk_colormap_destroy): Removed. * gdk/gdkfont.c (gdk_font_free): Renamed to gdk_font_unref. Handle fontsets as well. (gdk_fontset_free): Removed. * gdk/gdkpixmap.c (gdk_pixmap_destroy): Removed. (gdk_pixmap_ref, gdk_pixmap_unref, gdk_bitmap_ref, gdk_bitmap_ref): New functions. * gdk/gdkwindow.c: (gdk_window_new, gdk_window_foreign_new): Call gdk_window_ref for the pointer in the xid table. (gdk_window_internal_destroy): Renamed from gdk_window_destroy. New parameter XDESTROY that takes the role of `destroyed==2'; removed special casing of `destroyed==2'. Free dnd_data only when really destroying. Do not touch the ref_count. Calling gdk_window_destroy on a Pixmap is now a real error, not just a warning. (gdk_window_destroy): Just call gdk_window_internal_destroy and gdk_window_unref, as advertised in REFCOUNTING. (gdk_window_destroy_notify): New function. (gdk_window_unref): Print a warning when the ref_count is zero and the window has not been destroyed. Should never happen. Do not destroy the window, just free the memory. * gdk/gdkprivate.h (gdk_window_real_destroy): Removed. * gtk/gtkaccelerator.c (gtk_accelerator_table_destroy): Removed. (gtk_accelerator_table_unref): Do the job of gtk_accelerator_table_destroy directly. (gtk_accelerator_table_init): Init ref_count with 1. * gtk/gtkaccelerator.h (gtk_accelerator_table_destroy): Removed. * gtk/gtkcurve.c, gtk/gtkgamma.c: Replaced gdk_pixmap_destroy with gdk_pixmap_unref. * gtk/gtkhscrollbar.c (gtk_hscrollbar_realize): Reflect the fact that the widget->window is used as the range->trough in the ref_count. * gtk/gtkvscrollbar.c (gtk_vscrollbar_realize): Likewise. * gtk/gtkmain.c (gtk_main_iteration): Protect event_widget with ref/unref while handling the GDK_DELETE and GDK_DESTROY events. * gtk/gtkmenu.c (gtk_menu_set_accelerator_table): Don't do anything when the new accel_table is the old one. * gtk/gtkmenufactory.c (gtk_menu_factory_destroy): Unref factory->table if there is one. (gtk_menu_factory_create, gtk_menu_factory_create_widget): Don't ref newly created accel_table, it is now created with a ref_count of 1. * gtk/gtkmenuitem.c (gtk_menu_item_set_submenu): Don't do anything when the new submenu is the old one. * gtk/gtkpixmap.c (gtk_pixmap_destroy): New static function. (parent_class): New global variable. (gtk_pixmap_init): Set object_class->destroy. (gtk_pixmap_set): Don't do anything about the pixmap when the new pixmap is the old one. Likewise for the mask. * gtk/gtkprogressbar.c, gtk/gtkruler.c: Replaced gdk_pixmap_destroy with gdk_pixmap_unref. * gtk/gtkrange.c (gtk_range_set_adjustment): Don't do anything when the new adjustment is the old one. * gtk/gtkrc.c: Replaced gdk_fontset_free/gdk_font_free with gdk_font_unref. * gtk/gtkstyle.c (gtk_style_new): Initialize ref_count with 1. (gtk_styles_init): Replace gtk_style_destroy with gtk_style_unref for the cache. (gtk_style_new_from_key): Ref style before returning it when it has not been newly created. (gtk_style_destroy): Don't look at the ref_count, destroy always. Free style-font with gdk_font_unref, regardless of font->type. * gtk/gtktooltips.c (gtk_tooltips_real_destroy): Renamed from gtk_tooltips_destroy and made static. Don't look at ref_count, destroy always. (gtk_tooltips_new): Initialize ref_count with 1. (gtk_tooltips_unref): Don't look at pending_destroy, destroy always when ref_count is 0. (gtk_tooltios_widget_remove): Use gtk_tooltips_destroy_data instead of hand-coded destruction. * gtk/gtktooltips.h (GtkTooltips::pending_destroy): Removed. (gtk_tooltips_destroy): Removed. * gtk/gtkviewport.c (gtk_viewport_set_hadjustment, gtk_viewport_set_vadjustment): Don't do anything when the new adjustment is the old one. * gtk/gtkwidget.c (gtk_widget_reparent): Protect the reparented widget with ref/unref while moving it. (gtk_widget_set_default_colormap): Replace gdk_colormap_destroy with the proper ref/unref spell. (gtk_widget_set_default_style): Don't do anything when the new style is the old one. * gtk/testinput.c (configure_event): Replaced gdk_pixmap_destroy with gdk_pixmap_unref. More Interpreter support: * gdk/gdktypes.h (GdkDestroyNotify): New type. * gdk/gdk.c (struct _GdkInput::destroy): New field. (gdk_input_add_interp): New version of gdk_input_add that follows the interp conventions for callbacks. (gdk_input_add): Implement in terms of gdk_input_add_interp. (gdk_input_remove): Call destroy notify when appropriate. * gdk/gdk.h (gdk_input_add_interp): New prototype. * gtk.defs: Updated from guile-gtk. * gtk/gtktypebuiltins.c, gtk/gtktypebuiltins.h: Regenerated. * gtk/gtkmain.c (GtkInputFunction, struct _GtkInputFunction): New types. (gtk_invoke_input_function, gtk_destroy_input_function, gtk_input_add_interp, gtk_input_remove): New functions. Wed Dec 17 12:00:48 1997 Federico Mena * gdk/gdkcc.c: New GdkColorContext functionality! This should eventually solve all of our color management problems. Gdk still needs to be modified to support visuals with less than 8 bpp. Gtk needs to be modified just a bit. Wed Dec 17 13:56:17 PST 1997 Manish Singh * a small patch by Lauri Alanko that allows Gimp to pass on --display to it's plugins. Sun Dec 14 00:08:00 PST 1997 Raph Levien * a minor patch to make the file selection dialog not always select the first file in a directory Sat Dec 13 Jay Painter * gtk/gtkvscrollbar.c: added focus flag so vertical scrollbars can get keyboard focus Fri Dec 12 Owen Taylor * Removed warning when XGetWindowProperty fails - this can be the desired behavior. Fri Dec 12 Owen Taylor * gdk/makecursor* gdk/makekeysym* gdk/Makefile.am Removed old sed/awk code and replaced it with a spiffier awk-only code from Art_Haas@dril-quip.com Fri Dec 12 Owen Taylor * gdk/gdkgc.c: If gdk_gc_set_clip_rectangle is called with rectangle = NULL, remove clip mask, instead of segfaulting. * gtk/gtknotebook.c: Set clip mask before redrawing, so that we don't overwrite things outside of exposed areas when drawing them shadows. (Based on a patch from Lars Hamann , and Stefan Jeske) Thu Dec 11 10:57:29 CST 1997 Shawn T. Amundson * Change to ltconfig to remove -z text for Solaris x86 * Change to configure stuff so compile works on Solaris x86 * Added gdk/gdkkeysyms.h and gdk/gdkcursors.h back into the tree Thu Dec 11 09:44:03 1997 Tim Janik * gdk.c: added gdk_progclass==NULL patch by Oliver Graf . Wed Dec 10 23:40:03 1997 Tim Janik * fixed some compiler errors, because g_return_if_fail() wasn't used with a trailing semicolon in some places. fixed few other warnings also. Tue Dec 9 Owen Taylor * configure changes: (configure.in, glib/configure.in) Change test ! `...` to test -z `...` (Harald Meland ) Change $gtk_cv_x_locale to $need_x_locale so it isn't cached. With --enable_debug, don't touch CFLAGS if they're already set. Tue Dec 9 Owen Taylor * gdk/gdkpixmap.c: don't use gdk_black/white for pixmap mask. From Patrice Fortier Mon Dec 8 Owen Taylor * gtk/testselection.c (selection_received): foreward -> forward. * gtk/gtktext.c (gtk_text_forward_delete): Renamed; changed all callers. * gtk/gtktext.h: foreward -> forward. From Tom Tromey Mon Dec 8 Owen Taylor * gtk/gtkimage.c: Fixes to expose() handler From Rob Browning Mon Dec 8 21:09:43 PST 1997 Geoffrey T. Dairiki * gtk/gtklabel.h: * gtk/gtklabel.c: Add support for GTK_JUSTIFY_FILL. This support is used by the new gtktooltips.c. * gtk/testgtk.c (create_labels, create_main_window): A new test window for labels (to test the new GTK_JUSTIFY_FILL'ed labels.) Mon Dec 8 21:09:43 PST 1997 Geoffrey T. Dairiki * gtk/gtklabel.h: * gtk/gtklabel.c: Add support for GTK_JUSTIFY_FILL. This support is used by the new gtktooltips.c. * gtk/testgtk.c (create_labels, create_main_window): A new test window for labels (to test the new GTK_JUSTIFY_FILL'ed labels.) Sun Dec 7 Owen Taylor * gdk/gdk.c, gdk/gdk.h, gdk/gdktypes.h: Remove dependencies of interfaces on USE_XIM * gdki18n.h: Attempt to make wchar handling more portable * gdkwindow.c: Include config.h. (For gdkinput.h) Sun Dec 7 Owen Taylor * gtk/gtkentry.c, gtk/gtkentry.h: Fixed word motion Added cut/copy/paste via X clipboard Generalized extending selection using to work with all types of motion, not just arrow keys. Don't change length of GtkEntry structure because of USE_XIM Sun Dec 7 03:19:02 1997 Tim Janik * gtkfilesel.c: applied jamesa-971010-0 for stability. * gtkrc.c: applied jamesa-971010-2 for a small optimization. * gtkcheckmenuitem.h: * gtkcheckmenuitem.c: * gtkradiomenuitem.c: * testgtk.c: applied johannes-971113-0 which adds gtk_check_menu_item_set_show_toggle() to change the way check menu items and radio menu items look. Fri Dec 5 1997 Elliot Lee * gdk/gdk.c: clean up warnings, remove some un-ifdef'd debugging printing, DnD is Bug Free now, etc. * gtk/gtkcolorsel.c: fix DnD support. * gtk/gtkmain.c: DnD events go to the original window even if there is a grab - if I drop on a window the data had better go to it and not some other window :) * gtk/testgtk.c: Replace (GtkSignalFunc) with GTK_SIGNAL_FUNC(), and do a nicer DnD demo. * My very first ChangeLog entry, seeing as people have a fixation on them (what's wrong with "rcs2log" output?) Thu Dec 4 1997 Owen Taylor * gdk/gdkgc.c: Ignore gdk_gc_set_font if font is a fontset. Wed Dec 3 1997 Jay Painter * gtk/gtkstyle.c: fixed a problem introduced recently in gtk_style_detach witch crashed script_fu. Wed Dec 3 1997 Owen Taylor * gdk/Makefile.am: add a dependence for $(DEP_FILES) on $(BUILT_SOURCES) to work around automake problem Wed Dec 3 1997 Owen Taylor * configure.in glib/configure.in glib/glibconfig.h.in gdk/gdk.h gdk/gdk18n.h gdk.c gtk/gtkentry.c: Try to handle variations in headers gracefully. Do not automatically include gdk/gdki18n.h. Wed Dec 3 1997 Jay Painter * gtk/gtkoptionmenu.c: fixed a old bug where if you set a new menu for a optionmenu the widget would not get positioned correctly inside of the optionmenu. Tue Dec 2 1997 Owen Taylor * gdk/gdkpixmap.c: Include unistd.h to get SEEK_END for SunOS (john_johns@credence.com) Tue Dec 2 1997 Owen Taylor * gtk+/fnmatch.c: Define _GNU_SOURCE before including fnmatch.h to make sure all constants are defined. (Yasuhiro SHIRASAKI ) Tue Dec 2 1997 Owen Taylor * configure.in, glib/configure.in: Make the logic to add -Wall, -ansi, -pedantic for GCC operational. Tue Dec 2 1997 Owen Taylor * glib/glib.h, glib/configure.in. Disabled gldouble, since it wasn't used anywhere and caused portability problems Tue Dec 2 1997 Owen Taylor * glib/glib.h, glib/configure.in, glib/glibconfig.h.in: Added a g_memmove function which is simply memmove if it exists, otherwise bcopy.(Should really check if bcopy has the correct semantics, and create our own memmove is necessary) * glib/gstring.c, glib/garray.c, gtk/gtktext.c: memmove => g_memmove Sun Nov 30 1997 Jay Painter * gtk/gtknotebook.c: fixed a old bug where all the notebook pages which were not displayed when the notebook widget was realized were never size allocated when they were realized. Thr Nov 28 1997 Jay Painter * gtk/gtklist.h: removed GtkSelectionMode * gtk/gtkenums.h: added GtkSelectionMode Fri Nov 28 01:26:55 1997 Tim Janik * gtk/gtkwindow.c (gtk_window_show): propagate a size_request before the initial window creations (prevents windows with size of -1x-1). * gtk/gtkmain.c (gtk_main_level): new function to determine the current recursion level of gtkmain(). (gtk_true) (gtk_false): new functions implemented as a convenience for signals that just need a handler with the appropriate return value. Tue Nov 25 1997 Owen Taylor gdk.c: Fix so that "other_events" are actually generated Tue Nov 25 1997 Owen Taylor Patches to support internationalized input by: Takashi Matsuda TANAKA Shinya From the README: Feature: Followings are the main feature of this patch. * support XIM protocol. * GtkEntry widget support Over-The-Spot and Root style input. * input style is configurable by command-line option. Furthermore, this patch includes several changes which are useful without XIM too. * copy and paste with other clients by compound text. * Window title can be specified by multi byte string. configure.in: Added --with-locale and --enable-xim options gdk/Makefile.am: gdk/gdki18n.h [new file] Multibyte string manipulation functions gdk/gdk.c gdk/gdk.h gdk/gdkprivate.h Input method and context handling functions Command line options to control input methods Changes to KeyPress handling to support input methods Fixes to not return events for destroyed windows gdk/gdkselection.c Text property handling functions gdk/gdkwindow.c Set window title by multibyte string gtk/gtkentry.c Support for using an input context for XIM input. Cut and paste using compound text. Improvements to pasting (no longer replace the active selection with itself OWT) gtk/gtkselection.c fix to send selection clear events to the right owner gtk/testgtkrc Added a default fontset that will allow international characters INSTALL Some rudimentary documentation about the new configuration options. Mon Nov 24 1997 Owen Taylor gtk/gtkaspectframe.c: Some minor improvements to rounding in aspectframes. Make sure that child allocation is always >= 0 Always trigger size allocation with gtk_widget_queue_resize to prevent calling size_allocate before allocation done. Mon Nov 24 1997 Owen Taylor gtk/gtkframe.c: Changed tests for drawability to GTK_WIDGET_DRAWABLE Always trigger size allocation with gtk_widget_queue_resize to prevent calling size_allocate before allocation done. Mon Nov 24 1997 Jay Painter gtk-dairiki-971117-2.patch gtk/gtkaspectframe.c (gtk_aspect_frame_size_allocate): When computing new dimensions of the subwidget, round to nearest integer rather than truncating. Mon Nov 24 1997 Jay Painter gtk-dairiki-971117-1.patch * gtk/gtkvruler.c (gtk_vruler_draw_ticks): * gtk/gtkhruler.c (gtk_hruler_draw_ticks): Ensure that subticks always are drawn when they should be (sometimes they were getting drawn with zero length --- invisible). Also clear rectangle behind text labels to ensure they don't touch or overlap ticks. Mon Nov 24 1997 Jay Painter * gtk/gtkaspectframe.c (gtk_aspect_frame_set): gtk-dairiki-971117-0.patch Clear window when aspect ratio or alignment is changed. Mon Nov 24 1997 Jay Painter * gtk/gtkobject.h: fixed GTK_OBJECT_NSIGNALS macro Mon Nov 24 1997 Jay Painter * gtk/gtklabel.h: modified gtklabel to clip its drawing to its given area, now it will always draw in the area it's been given and clip accordingly. Note: this may cause the a label to disappear on widgets which don't give their child labels proper area! Mon, 17 Nov 1997 Michael K. Johnson * gtkwidget.c: gtk_set_style_recurse was not allowing updated widget names to cause new styles to be applied. * gtkentry.c gtkentry.h: The entry widget now has invisible attribute. The cursor does not move to show you typing; this is an intentional design decision but I'm not so attached to it that I'll reverse any patches that change it... :-) This patch is a modified version of a patch to which I have lost the attribution. I modified it by packing the "visible" flag into the structure more tightly (without damaging backwards compatibility on sane systems) and by allowing entry timers to run. Mon Nov 17 1997 Jay Painter * gtkviewport.c: Raph's Mon, 10 Nov 1997 patch to gtk-list to fix some viewport bugs Mon Nov 17 1997 Jay Painter * gtk/gtkwidget.c: gtk-ajaborsk-971016-2 A little patch again to prevent user to use gtk_widget_set_events() when a widget is already realized. In this case, the gtk_widget_set_events() doesn't work. Mon Nov 17 1997 Jay Painter * gtk/gtkwindow.c: gtk-ajaborsk-971016-1 This small patch correct position for GTK_WIN_POS_CENTER and GTK_WIN_POS_MOUSE GtkWindow positions. Sat Nov 15 1997 Jay Painter * gdk/gdkgc.c: added function gdk_gc_set_clip_rectangle * gdk/gdk.h: header for above Sat Nov 15 1997 Jay Painter * gdk/gdkgc.c: added function gdk_gc_set_clip_rectangle * gdk/gdk.h: header for above Wed Nov 12 1997 Jay Painter * gdk/gdkpixmap.c: Patrice Fortier's patch for transparent pixmaps. * gdk/gdk.h: gdk/gdkdraw.c: Patrice Fortier's patch to add pixel draw function. Sun Nov 9 1997 Jay Painter * Fixed problems with makefiles relating to the bug which required glib to be installed. * Fixed makefiles to incluce the xpm's in gtk+/gtk needed for testgtk. * Updated gtk+ and gtk+/glib to libtool-1.0f Fri Nov 7 1997 Jay Painter * gtk/gtktext.c: return char_widths[ch & 0xff]; in line 2152 Thr Nov 5 1997 Jay Painter * gtk/testgtk.c: added drag and drop test, removed the test hack from the button test Tue Nov 4 08:28:57 1997 Federico Mena * gtk/gtkmain.c (gtk_handle_idle): Patch from David Mosberger to avoid crashes when handling idle function (this manifested itself in the Umax and Microtek backends in SANE. Sun Nov 2 07:34:56 1997 Tim Janik * gtk/gtkfilesel.c: Small fixes about a segmentation viaolation cause by a double click in the directoy list (introduced by my previous changes). * gtk/gtklist.c: Small fixes to gtk_list_add() and gtk_list_remove(). * gtk/testgtk.c (list_add): Applied Stefan Wille's patch to make this function do something ;). Fri Oct 31 Jay Painter *gdk/gdk.c: reformatted DND code for GTK coding standards *gdk/gdkwindow.c: changed memory allocation for DND to q_mem stuff Thu Oct 30 Jay Painter * gdk/gdkwindow.c: * gdk/gdk/gdk.h: * gtk/gtkwidget.h: * gtk/gtkwidget.c: Applied Stephan Willie's shaped window patch * gdk/gdkwindow: * gdk/gdk.h: * gtk/gtkwidget.h: * gtk/gtkwidget.c: reformatted the DND code to conform to GTK coding standards * gtk/testgtk: massive fixes, SW's shaped window example Thu Oct 30 07:33:27 1997 Tim Janik * gtk/gtklistitem.c (gtk_real_list_item_toggle): applied Johannes Keukelaar's patch for keyboard support in GtkList widgets. * gtk/gtkfilesel.c: adapted dir and file list selection behaviour to deal with keyboard selections. this is a little bit tricky: in the dir list it just changes the entrys value on a one button press. but on a keyboard selection via gtk_widget_activate() it does a new population (likewise on a double click) as this seems more obvious. 1997-10-25 Marius Vollmer * gdk/gdkcolor.c (gdk_colormap_get_system): Initialize private->ref_count. Wed Oct 22 09:47:43 1997 Tim Janik * gtk/gtkwindow.c (gtk_window_key_release_event): Fixed a stupid bug that caused the key_release_event to be propagated twice. Sun Oct 12 11:01:43 1997 Tim Janik * acconfig.h: * configure.in: * gdk/gdkimage.c: Added configure check for IPC_RMID_DEFERRED_RELEASE, because shmat() fails after a shmctl(..., IPC_RMID,...) for OSF1 V3.2, SunOS 4.1.1, 5.5, 5.5.1, 5.6, IRIX 5.2 and 6.2. Mon Oct 6 11:59:07 1997 Federico Mena * gdk/gdk.c (gdk_event_translate): In line 1693, fixed typo that would cause motion notify events not to be delivered. Sun Oct 5 18:15:06 1997 Federico Mena * gtk/gtkrc.c (gtk_rc_parse_bg_pixmap): Changed strdup() for g_strdup(). Wed Sep 24 17:16:34 1997 Peter Mattis * configure.in: Fixed a stupid error in the test for libXext that would cause it to fail if X_EXTRA_LIBS was not empty. * gtk/gtkmain.h (gtk-timj-970919.patch): * gtk/gtkmain.c (gtk-timj-970919.patch): new function `gtk_idle_remove_by_data' to remove all idle callbacks that take a specific piece of data as argument. (gtk_get_current_event): remove idles through gtk_idle_remove_by_data. * gtk/gtkwidget.c (gtk-timj-970919.patch): (gtk_widget_destroy): remove pending idles for widgets that have GTK_REDRAW_PENDING or GTK_RESIZE_PENDING and GTK_ANCHORED set (only anchored widgets can have a resize queue handler pending). widgets that have GTK_RESIZE_NEEDED will be removed from their anchored toplevels `resize_widgets' list. (gtk_widget_queue_draw): let the widget remember the queue handler tag (through `redraw_handler_key') for later call to `gtk_idle_remove'. (gtk_widget_queue_resize): let the widget remember the queue handler tag (through `resize_handler_key') for later call to `gtk_idle_remove'. corrected referencing the toplevel widget for which the handler is pending. if a widget is added to the `resize_widgets' list of a toplevel widget, GTK_RESIZE_NEEDED is set and it's referenced. (gtk_real_widget_queue_resize): on the deletion of the `resize_widgets' list, unset GTK_RESIZE_NEEDED and unreference the removed widgets. * gtk/gtkwindow.c (gtk-timj-970919.patch): (gtk_real_window_move_resize): move `resize_containers = NULL' initialization out of if-statement. while stepping through the `resize_widgets' list, unreference the widgets and clear GTK_RESIZE_NEEDED. if a widget realy needs are resize, they are flagged through GTK_RESIZE_NEEDED now (instead of GTK_RESIZE_PENDING, as this is indicative for a pending handler). added checks to provide segfaulting if a widgets parent pointer is NULL (e.g. on toplevel widgets that have GTK_RESIZE_NEEDED set). Tue Sep 23 13:23:27 1997 Federico Mena * gdk/gdkimage.c: Applied Tim Janik's patch to mark shm segments as IPC_RMID so that they are automatically removed always. * gdk/gdkfont.c: Removed casts from lvalues. * gtk/gtkmain.c: Removed GTK_RETLOC_*() (which do a cast) from lvalues. * gtk/gtkaccelerator.c (gtk_accelerator_table_remove): Added "const" to the accelerator_key param to be consistent with the declaration in gtkaccelerator.h. The const is not useful in this case, anyway. Tue Sep 16 13:11:06 1997 Peter Mattis * gtkpreview.c: Andrew Logan Kieschnick's change to eliminate round-off error when gamma is set to 1.0. * gtkrange.c: * gtkviewport.c: Jay Painter's changes to modify the way in which viewports resize. * gdkinput.c: * gdkinputgxi.h: * gdkinputxfree.h: * gtk/Makefile.am: * gtk.h: * gtkeventbox.c: * gtkeventbox.h: Owen Taylor's event box widget and fixes for X input support (that I had broken). * gdk.h: * gdkwindow.c: * gtksignal.h: * gtksignal.c: Elliot Lee's changes to support Objective C. (id is apparently a reserved word in Objective C). Sun Sep 14 22:33:15 1997 Peter Mattis * gtkwidget.c (gtk_widget_queue_resize): If the toplevel container is invisible we simply call "gtk_container_need_resize" on it. This fixes a bug with option menus not redrawing correctly. * gtkmenuitem.c (gtk_menu_item_enter): (gtk_menu_item_leave): These functions now simply pass the event on to their parent. This is necessary for menus to work properly due to the change in how grabs are dealts with. * gtkwindow.c (gtk_real_window_move_resize): Fixed a bug that caused the GTK_RESIZE_PENDING flag to not be unset in some cases. Fri Sep 5 20:49:37 1997 Marius Vollmer Bug fixes: * Makefile.am: Added PATCHES to EXTRA_DIST. * gtk/gtkpixmap.c (gtk_pixmap_new): Move the "pixmap != NULL" test after the allocation of the pixmap. To shut up the compiler: * gtk/gtkfilesel.c (get_pwdb): Initialize home_dir. * gtk/gtkmain.c (gtk_init): Replace comments around calls to g_set_*_handler with "if (0)". * gtk/gtkrc.c (gtk_rc_get_token): Initialize hex_number and float_number. * gtk/gtkwindow.c (gtk_window_key_press_event): Initialize direction. Changes to the type system in gtk/: * Makefile.am: Added gtktypebuiltins.h to gtkinclude_HEADERS. Added gtk.defs, runelisp, gentypeinfo.el and gtktypebuiltins.c to EXTRA_DIST. Added rules to generate gtktypebuiltins.* from gtk.defs. * runelisp, gentypeinfo.el, gtk.defs: New files. * gtkaccelerator.c, gtkaccelerator.h (gtk_accelerator_table_ref): Return the table so that this function can be used as the `copy' function for GTK_TYPE_BOXED values. * gtkstyle.c, gtkstyle.h (gtk_style_ref): Likewise. * gtkenums.h: Removed GtkArgType enum. * gtkmain.c (gtk_init): Call gtk_type_init to initialize the type system. * gtkobject.c (gtk_object_init_type): New function to take over for gtk_object_get_type. (gtk_object_get_type): Just return the constant GTK_TYPE_OBJECT. (gtk_object_collect_args): Do the right thing for the new GTK_TYPE_* types. * gtksignal.c (gtk_params_get): Likewise. * gtktypeutils.c: (gtk_type_init_builtin_types): New function. (gtk_type_init): Call it. Also made non-static. (gtk_type_unique): The allocation scheme for numerical ids has changed: The low 8 bits hold the appropriate GtkFundamentalType of a type, the rest is a globally unique sequence number. (gtk_type_hash): Use the sequence number of a key to hash it. (gtk_type_register_builtin): New function. * gtktypeutils.h: (GtkFundamentalType): New enumeration of the fundamental types. (GTK_TYPE_MAKE, GTK_FUNDAMENTAL_TYPE, GTK_TYPE_SEQNO): New macros to work with the new id scheme. (GtkArg): Added fields for new types and renamed old ones. GtkArg should now be a mostly opaque structure, except name and type. (GTK_VALUE_*): New macros to access the values of a GtkArg. (GTK_RETLOC_*): New macros to access the location of a return value that is contained in a GtkArg. * gtktypebuiltins.h: New file to access the typeids of the builtin types. * gtkwidget.h (GTK_TYPE_WIDGET): New macro to access the type id of the widget class. Thru out: Changed GTK_ARG_* to the appropriate GTK_TYPE_*. Changed access to GtkArg structure to the appropriate GTK_VALUE_* or GTK_RETLOC_* macro. Changed GtkArgType to GtkType. Changed some guints to GtkType. General changes in gtk/ to support interpreters: * gtkradiobutton.c (gtk_radio_button_new_from_widget, gtk_radio_button_new_with_label_from_widget): New functions. * gtksignal.c (gtk_signal_connect_no_marshal): New function. (struct _GtkHandler): Added no_marshal and destroy_func fields. (gtk_signal_handler_new): Initialize them. (gtk_signal_connect_by_type): Added no_marshal and destroy_func arguments. Changed all callers. (gtk_signal_destroy): Invoke destroy_func if there is one and the global destroy func does not apply. (gtk_handlers_run): If the handler has no_marshal set, call its function directly without going thru the signal's marshaller. Wed Sep 3 09:56:22 1997 RHS Linux User * gtkrange.c: Changed the way the range control focus was drawn so that the range control is drawn correctly when it does not have the focus. Tue Sep 2 17:41:17 1997 RHS Linux User * gtkwidget.c: 'gtk_real_widget_queue_resize' should only remove the "resize_widgets" if another resize is not pending. Mon Sep 1 18:28:08 1997 Peter Mattis * gtkmain.c: Changed the way GDK_DELETE events are handled. Only, if 'gtk_widget_event' returns TRUE is the widget destroyed. By default, 'gtk_widget_event' will return FALSE causing the window to not be destroyed. This prevents segfaults in the GIMP and other programs that do not correctly handle GDK_DELETE events. * gtkmain.c: Added modal dialog support by allowing events destined for a child of the grab widget to go to the child instead of the grab widget. (Added 'gtk_widget_is_ancestor' to determine the relationship between the grab widget and the event widget). * *.[ch]: Incorprated a whole mess of patches. (Started keeping the ChangeLog up to date again). Thu Jun 5 17:22:21 1997 Peter Mattis * gtkmenufactory.c: * gtkmenufactory.h: Added 'gtk_menu_factory_remove_*' calls. Removing entries/paths causes the associated widgets to be destroyed. * gtkwidget.c: * gtkwidget.h: Calling 'gtk_widget_set_style' is used as an indication that the programmer specifically wants that style to be used. RC-style substitution is disabled for the widget after such a call. * gtkpixmap.c: * gtkpixmap.h: * gtkimage.c: * gtkimage.h: Changed to use clip mask and a single pixmap (or image) to deal with transparent areas. * gdkpixmap.c: Modified xpm loading routines to optionally return a clip mask. * gdkgc.c: * gdkdraw.c: * gdktypes.h: Modifications to allow clip masks to be used with gc's. Clip masks are bitmaps that specify drawable regions. Thu May 1 03:11:51 1997 Peter Mattis * gtkscrolledwindow.c: Scrolled windows need to have the GTK_NO_WINDOW flag set. Not having it set caused an obscure redrawing bug. Wed Apr 30 12:38:03 1997 Peter Mattis * gtkhruler.c: * gtkvruler.c: Fixed a small bug that caused the indicator to be positioned slightly off. Sun Apr 27 14:28:21 1997 Peter Mattis * gtkmenushell.c: * gtkmenushell.h: * gtkmenu.c: * gtkmenu.h: Changes so that if a menu is popped up there is a timeout period during which a menu item will not be activated and if the mouse button is released in that period the menu will stay popped up. * gtkcurve.c: * gtkcurve.h: Included curve widget courtesy of David Mosberger-Tang (davidm@azstarnet.com). * gtkentry.c: * gtkentry.h: Changed "insert" and "delete" signals to "insert_text" and "delete_text" respectively. (The symbol "delete" cannot be used since it is a C++ reserved word). Sat Apr 19 01:43:49 1997 Peter Mattis * gtkmenufactory.c: A path which ends in "" will cause an invisible (hidden) menu entry to be created. This is useful for setting an accelerator key for which a corresponding menu entry is not desired. * gtktooltips.c: Fixed some problems with destruction of the active tip widget not properly updating the tooltips data structures. Fri Apr 18 15:09:45 1997 Peter Mattis * gtkcontainer.c: * gtklist.c: * gtkwidget.c: * gtkwidget.h: Patch from Owen Taylor (owt1@cornell.edu) which fixes problems with destruction of objects and with destruction of objects which hold the focus. Thu Apr 17 11:29:15 1997 Peter Mattis * gtkmenushell.c: Incorrect logic in 'gtk_menu_shell_button_release' for deciding when a menu should stay popped up when the mouse button is released. * *.c: Miscellaneous fixes from folks on the net. Tue Apr 15 02:43:17 1997 Peter Mattis * *.c: * gtkwidget.h: Added GTK_BASIC widget flag which when set specifies a widget as "basic". A "basic" widget is one which doesn't take input events. For example, labels, pixmaps, boxes, tables, alignments, etc. Sat Apr 12 15:23:08 1997 Peter Mattis * gtkcolorsel.c: Add "#include " to define M_PI. * gtksignal.c: Fixed a bug in 'gtk_signal_emit' which showed up because of the new cast checking macros. The 'object' was being accessed after it had been destroyed. * gtkoptionmenu.c: Fixed bug with using 'GTK_BIN' instead of 'GTK_BUTTON' which showed up because of the new cast checking macros. * *.h: 'GTK_CHECK_CAST', 'GTK_CHECK_CLASS_CAST' and 'GTK_CHECK_TYPE' used by standard widget macros everywhere. Wed Apr 9 00:54:17 1997 Peter Mattis * docs/gtk.texi: Started further work on documentation. Major changes and additions are being made. * gtkarrow.c: * gtkarrow.h: Removed function 'gtk_arrow_get'. * gtkcontainer.c: 'gtk_container_check_resize' no performs additional checking to account for the case where the containers allocation is no longer sufficient because its parent (or its parents parent, etc.) needs to resize its children. Tue Apr 8 21:15:50 1997 Peter Mattis * gtkstyle.c: Fixed a bug in 'gtk_style_init' in which the font was not ref'd (via 'gdk_font_ref'), but was free'd (via in 'gdk_font_free') in 'gtk_style_destroy'. (David Mosberger-Tang). Also cleaned up 'gtk_style_destroy' while I was at it. * gtkmain.c: Fixed a bug in 'gtk_propogate_event' which caused entry widgets (and probably other widgets) not to be destroyed in some instances. Mon Apr 7 01:20:38 1997 Peter Mattis * gtkentry.c: * gtkentry.h: Changed the "insert_text", "delete_text" and "changed_text" signals to "insert", "delete", and "changed" respectively. They really should have been named this way originally except the previous signal mechanism prevented duplicate signal names. ("changed" is also used by adjustments). * gtkradiomenuitem.c: * gtkradiomenuitem.h: New widget. * gtkcheckmenuitem.c: * gtkcheckmenuitem.h: New widget. * gtksignal.c: Modified 'gtk_signal_lookup' to require an object type to be passed as a parameter. In addition, signals are now only needed to be uniquely defined in their branch of the class hierarchy. This allows the same signal name to be used in two different branches of the class hierarchy. For instance, the "changed" signal is used both by adjustments and entries...in different ways! * gtktypeutils.c: Added 'gtk_type_parent' which returns the parent type for a given type. Sun Apr 6 22:08:35 1997 Peter Mattis * gtkwidget.c: If a widget is set insensitive it loses the focus if it had it. * gtkcontainer.c: Insensitive widgets no longer participate in tab traversal. * gtkscrolledwindow.c: The "viewport" child is now destroyed and a container class "foreach" function was written (which fixes the sensitivity bug). Sat Apr 5 14:25:38 1997 Peter Mattis * gtkhscrollbar.c: * gtkvscrollbar.c: Fixed trough size allocation bug. * gtkhscale.c: * gtkvscale.c: Fixed trough size allocation and position bug that showed up when scales were placed in notebooks. Thu Mar 27 17:45:54 1997 David Mosberger-Tang * gtk/gtkmain.c (gtk_handle_idle): Fix appending pending_idles to idle_functions so it works even when idle_functions is empty. Sat Mar 15 14:15:59 1997 Peter Mattis * *.[ch]: Moved '*_class_init' and '*_init' function declarations for widgets into the source file as those functions no longer had to be public. * gtkcheckbutton.c: Fixed redrawing of check button. * gtkframe.c: Fixed redrawing of frame when the shadow type is changed. Sat Mar 8 15:19:23 1997 Peter Mattis * gdkimage.c: Fixed a stupid bug with 'gdk_image_new' which potentially added a NULL image to "image_list" and caused problems when 'gdk_image_exit' was called. Wed Mar 5 00:40:08 1997 Peter Mattis * gtkpreview.c: Massively changed the colormap handling used by the preview widget. Gray previews are now dithered. A single visual and colormap is shared by the color and gray previews. A GTK_PREVIEW_INFO property is installed on the root window in certain cases to allow multiple GTK programs to share the system colormap. Sun Mar 2 05:43:06 1997 Peter Mattis * gtkcheckbutton.c: 'gtk_checkbutton_size_allocate' was allocating too much space to its children and not leaving the check button room for the focus border. * gtknotebook.c: 'gtk_notebook_size_request' wasn't requesting enough space when the notebook tabs are visible. Sat Mar 1 01:59:35 1997 Peter Mattis * gtkpreview.c: Fixed a problem with 'gtk_preview_put' when the image byte order is GDK_MSB_FIRST. * gtksignal.c: * gtksignal.h: Added 'gtk_signal_connect_after' and 'gtk_signal_connect_object_after' functions. These connect signal handlers which will run after the class function associated with the signal. * gtkstyle.c: Fixed a stupid bug in 'gtk_style_new_from_key' that was causing twice as many styles to be created as necesary. * gtkwidget.c: 'gtk_real_widget_size_allocate' erases the widgets old allocation if it has the GTK_NO_WINDOW flag set. * gtkwidget.c: 'gtk_real_widget_unmap' now erases the widget if it has the GTK_NO_WINDOW flag set. * gtklabel.c: Removed 'gtk_label_unmap' as similar functionality was added to gtk_real_widget_unmap. * gtkbin.c: Modified 'gtk_bin_map' and 'gtk_bin_unmap' so that it erases and draws the widget if it has the GTK_NO_WINDOW flag set. * gtkframe.c: Modified 'gtk_frame_size_allocate' so that it erases the old allocation. Fri Feb 28 03:27:05 1997 Peter Mattis * gtkwindow.c: 'gtk_window_set_title' now changes the window title if the window is already realized. * gtkentry.c: 'gtk_entry_set_text' was emitting both a "delete_text" and a "changed_text" signal. Modified so that it only emits a "changed_text" signal. * gtkpreview.c: Modified to work correctly on systems with MSB byte order. The colormap for TRUE and DIRECT color displays is now created if the default visual is not equal to the visual we are using. * gtkstyle.c: 'gtk_style_attach' and 'gtk_style_find' weren't working properly in the presence of multiple colormaps are different depth visuals. * gtkcontainer.c: Massively improved focus traversal using tab and arrow keys. It now uses the layout of the widgets to determine where to move the focus to. Mon Feb 24 03:24:02 1997 Peter Mattis * gtkmenufactory.c: Set the accelerator table field for menus when they are created. * gtkmenu.c: * gtkmenu.h: Added a default accelerator table field to menus so that runtime modification of accelerator keys in menus can work better. * gtkrange.c: 'gtk_range_default_{h,v}motion' had faulty logic for deciding what to do when the slider was at the edge of the trough. They previously didn't update the adjustment value event if the value wasn't what it should be when the slider was at the edge of the trough. * gtkviewport.c: 'gtk_viewport_size_allocate' and 'gtk_viewport_adjustment_value_changed' both had the potential for performing a divide by 0. Checks are now in place to prevent this. * gtkmenu.c: 'gtk_menu_map' now makes sure the menu lies on screen if the position function is NULL. * gtkentry.c: Modified selection handling. 'gtk_delete_selection' actually removes the X selection now. 'gtk_entry_destroy' removes the selection as well and relies on the change in "gdk.c" to make sure the selection event will not be sent to a non-existant window. * gdk.c: Selection events are only passed on if the selection owner is not NULL. * gtkstyle.c: 'gtk_style_detach' and 'gtk_style_destroy' were not destroying the black and white gc's. Sun Feb 23 19:17:56 1997 Peter Mattis * gtkwindow.c: 'gtk_window_size_request' was setting the window hints. This was also being done in 'gtk_window_map', so the instance being done in 'gtk_window_size_request' was removed. Fri Feb 21 01:04:01 1997 Peter Mattis * gtkwidget.c: 'gtk_widget_draw' has to use the widgets allocated position for the drawing rectangle when the widget has the GTK_NO_WINDOW flag set. * gtkwidget.c: In 'gtk_widget_init' the visual and colormap were being directly compared against 'default_visual' and 'default_colormap' instead of calling 'gtk_widget_get_default_{visual,colormap}'. * gdkrectangle.c: Amazing! There was a bug in the 'gtk_rectangle_intersect' logic. Its been there for near eternity and I never noticed. * gtkpreview.c: * gtkpreview.h: Created preview widget which allows drawing to an rgb or grayscale buffer which is automatically displayed on the screen. Performs dithering as necessary. Thu Feb 20 20:33:21 1997 Peter Mattis * gdkwindow.c: Modified the logic in 'gdk_window_new' which determined when to add a window to the WM_COLORMAP_WINDOWS property. Wed Feb 19 19:55:29 1997 Peter Mattis * gtkruler.c: 'gtk_ruler_make_pixmap' was always destroying the old backing store and creating a new one even when it would create a new one of exactly the same size as the old one. Tue Feb 18 18:32:10 1997 Peter Mattis * gmem.c: 'g_mem_chunk_alloc' was incorrectly modifying the mem areas free mem field when reallocating a previously freed atom. This caused a fairly severe memory leak. * gtkmenushell.c: 'gtk_menu_shell_button_release' had a bug in the logic for deciding whether to initiate an X pointer grab or not when the mouse button was released. It now only initiates a grab if the mouse is released within an active menu item. Fri Feb 14 00:57:40 1997 Peter Mattis * gtknotebook.c: Changed the look of notebook tabs slightly. * gtkentry.c: * gtkentry.h: Deleting an entry widget which is holding the X selection presents some difficulties. The X selection must be released, but the widget can't be destroyed until the SELECTION_CLEAR event is received that the X server will send in response to clearing the X selection. There are probably still bugs in the current method of entry widget deletion when the X selection is held. * gtkmain.c: 'gtk_propagate_event' was not properly destroying the toplevel window when receiving a key press event. * gtkwidget.c: Setting a widget insensitive did not cause it to redraw. It now does. Thu Feb 13 16:59:07 1997 Peter Mattis * gtkviewport.c: 'gtk_viewport_size_allocate' was allocating its child widget an adjusted allocation. Since the actual scrolling has handled by a subwindow this caused the child to be double scrolled. Modified to always set the child allocations origin to (0, 0). Wed Feb 12 01:06:48 1997 Peter Mattis * gtkentry.c: Text is now centered vertically. Previously it was pushed up against the top. This problem was only evident when the widget was allocated more vertical space than it requested. * gtkfilesel.c: 'gtk_file_selection_key_press' was previously only a stub for tab completion. The actual tab completion call had been left out. (Oops!) Tue Feb 11 01:43:08 1997 Peter Mattis * gtksignal.c: 'gtk_signal_disconnect_by_data' was going into a loop and crashing. Bad logic. Fixed. * gtkmain.c: An idle function which returns FALSE will be removed from the list of idle functions. This makes the functioning of idle functions and timeouts more similar. * gtkentry.c: 'gtk_entry_get_text' now returns an empty string when the actual text is NULL. This allows "stupid" programs to use the value returned by 'gtk_entry_get_text' blindly (without checking to see if its NULL). * gtkradiobutton.c: Modified 'gtk_radio_button_clicked' so that 'gtk_toggle_button_toggled' is called _after_ the widget state is changed. * gtksignal.c: * gtksignal.h: Added 'gtk_signal_name' which returns the character string name for a given signal number. * gtkwidget.c: 'gtk_widget_set_parent' checks to see if the widget is now "anchored" through the parent chain to a widget which is GTK_ANCHORED. If it is, then it changes the widgets style using 'gtk_rc_get_style' and recursively performs the same operation on the widgets children. This is necessary is 'gtk_rc_get_style' only works properly on "anchored" widgets. * gtkwindow.c: Modified GTK_WIN_POS logic so that it is only used immediately after the window has been shown. * gtkmenu.c: 'gtk_menu_key_press'. Can now change menu item accelerator keys on the fly. Why? Why not. Cool/useless feature of the day. * gtkmenuitem.c: Accelerator key drawing. Somehow that never got finished. (Oops!) * gtkdrawingarea.c: 'gtk_drawing_area_size_allocate' was not actually installed during 'gtk_drawing_area_class_init'. (Oops!) * gtkframe.c: 'gtk_frame_size_request' fixed size requisition problem caused by unsigned arithmetic. * gtkwindow.c: Modified window widget so that it only uses the widget uposition auxiliary information immediately after it has been shown. This prevents the annoying bug which can cause a uposition'ed window to jump back to its original position after the user moves it. * gtkwidget.c: Need to ref and unref style in 'gtk_widget_{push,pop}_style' to make sure that a style on the style stack is not destroyed. * gtktogglebutton.c: 'gtk_toggle_button_set_state' now calls gtk_button_clicked to actually change the state of the button. In this way, radio buttons can now perform the appropriate actions when the toggle button state is set. Mon Feb 10 00:27:39 1997 Peter Mattis * gtklist.c: 'gtk_list_select_item' and 'gtk_list_unselect_item' were casting a GList* variable to a a GtkWidget* variable. Bad bad bad. (Tim Janik). * gtksignal.c: Modified 'gtk_signal_connect' and 'gtk_signal_connect_object' to warn when a signal type cannot be found. Sun Feb 9 00:15:30 1997 Peter Mattis * gtkoptionmenu.c: * gtkoptionmenu.h: Changed option menus back to being derived from buttons. This fixes up some screwiness with their user interaction. * gtkwindow.c: Modified key press handler to support focus traversal. * gtkcontainer.c: * gtkcontainer.h: Added default focus traversal back in. Sat Feb 8 10:44:38 1997 Peter Mattis * gtkviewport.h: * gtkviewport.c: Massively sped up viewport scrolling. Used to be reallocating child's size (offset) each time a scrollbar moved. Now a subwindow is moved. All the children are moved automatically by moving the subwindow. Much much much faster. Tue Feb 4 00:20:44 1997 Peter Mattis * gtree.c: Changed 'g_tree_node_search' to use a loop instead of recursion. Mon Feb 3 11:30:03 1997 Peter Mattis * gtkbutton.c: Removed 'parent_destroy' global and replaced it with 'parent_class' global to reflect style used in other widgets. * gtknotebook.c: Tab labels were being allocated less than their requested size. * gtkrange.c: * gtkrange.h: Moved the "digits" field of scales into the range type. The adjustment value for scales is truncated to the number of visible digits instead of being left untouched. * gtree.c: Fixed a bug in the AVL tree implementation. Single rotations were always being performed during insertion. It is sometimes necessary to perform a double rotation. * gtklabel.c: Modified 'gtk_label_expose' to only draw the label when the allocated space is greater than or equal to the requested space. * gtklabel.c: Added call to 'gtk_widget_unmap' to 'gtk_label_destroy' in order for the label to redraw correctly (erase itself) when destroyed. * gtklabel.c: Added 'gtk_label_unmap' call which erases the labels allocation when it gets unmapped. * *.h: Removed a few remaining instances of using "class" as a parameter name. (Causes problems for C++). Fri Jan 31 12:26:50 1997 Peter Mattis * gtkcontainer.c: 'gtk_container_enable_resize' needs to call 'gtk_container_check_resize' instead of 'gtk_container_need_resize'. * gtkwidget.c: 'gtk_real_widget_show' now maps the widget if its parent is mapped. * gtkscrolledwindow.c: Fixed size allocation when the scrollbar policy's are GTK_POLICY_AUTOMATIC. Doing it correctly is harder than I originally thought. * gtklist.c: Added 'gtk_list_child_position' to determine the integer position in a list of a child. Filled in the 'gtk_list_item_select' and 'gtk_list_item_unselect' stubs. Thu Jan 30 16:08:06 1997 Peter Mattis * gmem.c: Changed the implementation of G_ALLOC_AND_FREE mem chunks. They used to allocate SIZEOF_VOID_P extra bytes per atom in order to keep track of which mem area they were allocated from. Now the mem area is determined by searching through an AVL tree of the mem areas for a mem chunk and comparing memory locations. A little slower, but makes G_ALLOC_AND_FREE mem chunks much more attractive. * gtree.c: Added an AVL tree implementation to glib. * gtksignal.c: * gstring.c: va_arg (arg_list, {char, short}) is invalid. Arguments passed in a variable argument list are promoted. ({char, short}->int). Seemed to work ok before under Linux. Crashed under FreeBSD. Tue Jan 28 02:27:51 1997 Peter Mattis * gdkwindow.c: Fixed a major slowdown apparent in the file selection dialog which was caused by calling 'gtk_window_add_colormap_windows' way way way too often. * *.c: Many widgets called 'gtk_container_need_resize' when something internal changed which would cause the widget to grow or shrink. The assumption was made that the widget would change size and an expose event would be generated. This happens "most" of the time. But its possible for certain widgets to change size without generating expose events, or for its internal geometry to change without a change of size which would mean no expose event was generated. So a wrapper function called 'gtk_container_check_resize' was created and 'gtk_container_need_resize' was modified so that it returns FALSE if a resize was actually generated and TRUE if nothing changed. This allows 'gtk_container_check_resize' to initiate a 'gtk_widget_size_allocate' and 'gtk_widget_draw' to emulate the expose event. Sat Jan 25 14:17:44 1997 Peter Mattis * gtkmain.c: Fixed a bug with propogating key press events. The events were sent 2 times to the toplevel windows which caused the focus widget to be activated twice when the space bar was pressed. * */configure.in: * */Makefile.am: Added support for libtool and removed the old shared library configuration craziness. Fri Jan 24 12:59:22 1997 Peter Mattis * gtktext.c: * gtktext.h: Josh's fixes and additions to the text widget. * gtkfill.c: * gtkfill.h: Filler widget useful for filling space in a table. Can specify a minimum size. Used by the canvas widget. * gtknotebook.c: * gtknotebook.h: Made outline of notebook widget. * gtkcanvas.c: * gtkcanvas.h: Started canvas widget. A composite of 2 rulers (w/ an origin), 2 scrolllbars. Guides, grids, snap to. Sun Jan 19 18:26:45 1997 Peter Mattis * gtkdialog.c: * gtkdialog.h: Created dialog widget which creates a standard looking dialog with buttons along the button and a separator. * gtkxid.c: Generalized the window table code for looking up a gdk window based on an XID to work for any XID and a piece of data. Can now look up gdk fonts based on their XID. * gtkruler.c: * gtkruler.h: * gtkhruler.c: * gtkhruler.h: * gtkvruler.c: * gtkvruler.h: Started conversion of the ruler widget. * gtktext.c: * gtktext.h: Started conversion of the text widget. Scrolling doesn't work. * gtkmain.c: Fixed a fairly major bug. The event widget needs to be in a call for the entire duration of handling an event. Not just for when the event widget itself is handling the event. * gtkfilesel.c: Fixed up some bugs with resizing. Fri Jan 10 14:18:03 1997 Peter Mattis * gtkwidget.c: * gtkwidget.h: * gtkentry.c: * gtkentry.h: Support for selections. * gdkselection.c: * gdk.c: * gdktypes.h: * gdk.h: Gdk support for X selections. Currently only text selections are supported. * gtksignal.c: Fixed a major bug which occurred when destroying an object. Memory was being written to after it was freed. * gtkfilesel.c: * gtkfilesel.h: Hooked up more functionality to the file selection dialog. Wed Jan 8 18:13:53 1997 Peter Mattis * gtkfilesel.c: * gtkfilesel.h: Mostly converted old file selection dialog widget. The widget is derived from the GtkWindow class and is quite a bit simpler in the widget code. * gtkwidget.c: Fixed 'gtk_widget_grab_focus' and 'gtk_widget_grab_default' to check that the toplevel widget is a type of window (which includes classes derived from windows). Tue Jan 7 01:12:32 1997 Peter Mattis * gtkwindow.c: Was calling 'gtk_window_resize' twice in a row...why? * gtksignal.c: * gtksignal.h: * *.c: Changed 'gtk_signal_new' so that the class function that is called when the signal is emitted can be called either before, after or both before and after the calling of any signal handlers. * gtkobject.c: * gtkobject.h: Added 'object_data' mechanism for storing data associated with a character string key in objects. Removed 'user_data' field of objects and changed 'gtk_object_{get,set}_user_data' to use the object data mechanism. Removed 'handlers' field of objects. * gtkwidget.c: * gtkwidget.h: * gtkwindow.c: Modified aux info mechanism to use object data mechanism. * gtksignal.c: Modified signal mechanism to use object data mechanism instead of 'handlers' field. Mon Jan 6 15:10:16 1997 Peter Mattis * gtkmenushell.c: Fixed up button press handling so as to conform more closely to that used by Motif. Wed Jan 1 21:27:17 1997 Peter Mattis * gtkmenu.c: * gtkmenu.h: * gtkmenubar.c: * gtkmenubar.h: * gtkmenushell.c: * gtkmenushell.h: Reorganization of menu-ing code so that code duplication is reduced. The menu shell now contains most of the code for menu-ing interaction while menus and menubars simply layout their child menu items in the appropriate place. Sun Dec 29 17:48:18 1996 Peter Mattis * gtkmenu.c: * gtkmenubar.c: * gtkmenuitem.h: * gtkmenuitem.c: Modifications so that menu item accelerators and the submenu indicator are drawn correctly and the correct amount of space is allocated. Sat Dec 28 00:32:13 1996 Peter Mattis * gtkmenufactory.h: * gtkmenufactory.c: Started menu factories as an easy method to create and manipulate menus. Fri Dec 27 13:17:34 1996 Peter Mattis * gtkmenu.c: * gtkmenu.h: * gtkmenubar.c: * gtkmenubar.h: * gtkmenuitem.c: * gtkmenuitem.h: * gtkmenushell.c: * gtkmenushell.h: Implemented basic menu functionality. Menubars and popup menus work. Submenus work. (Much left to be done). Wed Dec 18 15:27:05 1996 Peter Mattis * gtktypeutils.h: * gtktypeutils.c: Added 'gtk_type_from_name' which returns a type identifier given a type name. Implemented using a second hash table keyed by type names. * gtkbutton.c: * gtktogglebutton.c: Fixed very small messed-up drawing bug when a button loses its focus. * gtkwidget.h: * gtkwidget.c: * gtkbutton.c: * gtkwindow.c: Added default button handling. Default buttons now draw correctly and pressing return or enter causes the default button (if one exists) to be activated. Tue Dec 17 19:32:21 1996 Peter Mattis * gtkhscale.c: * gtkvscale.c: Overrode 'draw_slider' method of ranges in order to draw the slider of scales with a line in them so as to be closer to the Motif look-and-feel. * gtkwindow.c: Modified 'gtk_window_focus_in_event' so that focus in events are only handled when the window is visible. Fixes a bug where spurious focus in events get sent when a window is being hidden. * gtkwidget.h: Added 'activate_signal' field to the GtkWidgetClass structure. Added 'gtk_widget_activate' call to emit the activate signal for a widget if it is non-zero. Tue Dec 10 15:59:45 1996 Peter Mattis * gtkwidget.c: 'gtk_widget_set_name' oops in strdup'ing the old "widget->name" instead of the new one we are setting. * gtkrc.c: 'gtk_rc_widget_path' changed to use 'gtk_widget_get_name' instead of accessing the "widget->name" field directly. * gtkwidget.c: Added 'gtk_widget_get_name' function which returns the widgets name if it exists and the widgets type name if it does not. * gtkcheckbutton.c: Added 'gtk_check_button_draw' function. Modified 'gtk_check_button_expose' to pass an expose event to child instead of callings its draw function. * gtkentry.c: 'gtk_entry_draw_text' why was "+1" being added to the font->ascent to calculate the font position? This was wrong and caused some characters in fonts to be clipped. (Notably "g"). * gtkentry.c: 'gtk_entry_realize' specify GTK_BUTTON1_MOTION_MASK and GTK_POINTER_MOTION_HINT_MASK for _both_ windows. * gtkmain.c: 'gtk_propagate_event' needs to set the GTK_IN_CALL flag for the object before calling 'gtk_widget_event' and needs to destroy the object if necessary after 'gtk_widget_event' returns. * gtkradiobutton.c: 'gtk_radio_button_clicked' needs to call 'gtk_toggle_button_toggled' when the currently active button is toggled. * gtkwidget.c: 'gtk_real_widget_hide' needs to call 'gtk_widget_unmap' if the widget is currently mapped. * gtkwindow.c: Prevent automatic resizing after the user has specified a new window size. Add 'handling_resize' flag to windows. * gtkscrolledwindow.c: Implement the GTK_POLICY_AUTOMATIC scrollbar policy. Need to connect to the adjustments 'changed' signal and notice when the scrollbars aren't in use. * gtkcontainer.c: 'gtk_container_init' must set 'auto_resize' and 'need_resize' fields to TRUE and FALSE respectively. * gtkwidget.c: 'gtk_widget_set_parent' must all set a widgets state to its parents state. Sun Dec 1 01:31:01 1996 Peter Mattis * Started ChangeLog 070701000153bd000081a40000000a0000000a000000013d12d398000007d20000008800000003000000000000000000000016ff35088dreloc/doc/gtk/HACKINGIf you want to hack on the Gtk+ project, it will make you life easier to have the following packages installed: - GNU autoconf 2.13 - GNU automake 1.4 (Beta releases are at ftp://ftp.cygnus.com/pub/tromey) - GNU libtool 1.2d - indent (GNU indent 1.9.1 is known good) - GNU gettext 10.35 Available in ftp://alpha.gnu.org/gnu These should be available by ftp from ftp.gnu.org or any of the fine GNU mirrors. Beta software can be found at alpha.gnu.org. In order to get CVS gtk+ installed on your system, you need to have the most recent CVS version of glib installed as well. The installation process of glib is similar to that of gtk+, but needs to be fulfilled prior to installation of gtk+. To compile a CVS version of gtk+ on your system, you will need to take several steps to setup the tree for compilation. You can do all these steps at once by running: cvsroot/gtk+# ./autogen.sh Basically this does the following for you: cvsroot/gtk+# aclocal; automake; autoconf The above commands create the "configure" script. Now you can run the configure script in cvsroot/gtk+ to create all the Makefiles. Before running autogen.sh or configure, make sure you have libtool in your path. Note that autogen.sh runs configure for you. If you wish to pass options like --prefix=/usr to configure you can give those options to autogen.sh and they will be passed on to configure. If at all possible, please use CVS to get the latest development version of gtk+ and glib. You can do the following to get glib and gtk+ from cvs: $ export CVSROOT=':pserver:anonymous@cvs.gnome.org:/cvs/gnome' $ cvs login (there is no password, just hit return) $ cvs -z3 checkout glib $ cvs -z3 checkout gtk+ For information about submitting patches and commiting changes to CVS, see the README and README.cvs-commits files. In particular, don't, under any circumstances, commit anything to CVS before reading and understanding README.cvs-commmits. 070701000153be000081a40000000a0000000a000000013d12d39800001ca40000008800000003000000000000000000000016ff35088dreloc/doc/gtk/INSTALLPrerequisites ============= GTK+ requires the GLIB library, available at the same location as you got this package. Simple install procedure ======================== % gzip -cd gtk+-1.2.10.tar.gz | tar xvf - # unpack the sources % cd gtk+-1.2.10 # change to the toplevel directory % ./configure # run the `configure' script % make # build GTK [ Become root if necessary ] % rm -rf /install-prefix/include/gtk /install-prefix/include/gdk % make install # install GTK Special note for GTK+-1.2.9 =========================== Between GTK+-1.2.8 and GTK+-1.2.9, the include files for GTK+ have been moved to $(includedir)/gtk-1-2/ to allow parallel installations of GTK+-1.2 and GTK+-2.0 to work correctly. If you are installing on top of an old installation of GTK+, you should remove the directories: $(includedir)/gtk/ $(includedir)/gdk/ Before running 'make install' The Nitty-Gritty ================ The 'configure' script can be given a number of options to enable and disable various features. For a complete list, type: ./configure --help A few of the more important ones: * --prefix=PREFIX install architecture-independent files in PREFIX [ Defaults to /usr/local ] * --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [ Defaults to the value given to --prefix ] * --with-xinput=[no/gxi/xfree] support XInput [default=no] The --with-xinput flag specifies whether to compile with support for the XInput extension (mainly used for graphics tablets), and which form of support to use: no : no support xfree : Use special features in the Wacom drivers in XFree86 3.3.1 and later. gxi : Use generic XInput support (not recommended) The XInput support is not known to work with any other XServer than XFree86. For more information about XInput, see: http://www.gtk.org/~otaylor/xinput/howto/index.html http://www.lepied.com/xfree86/ * --disable-nls do not use Native Language Support If this flag is not specified, GTK+ will try to find and use the gettext() set of functions to provide translations of the strings in the standard dialogs into the user's native language. * --enable-xim support XIM [default=yes] Specifying --disable-xim will disable support for entering internationalized text using X Input Methods. This will give some slight savings in speed and memory use and might be necessary with older versions of X. * --with-locale=LOCALE locale name you want to use The --with-locale options is used to determine if your operating system has support for the locale you will be using. If not, X's built in locale support will be used. Because of bugs in autoconf, it is necessary to specify this option even if your LANG environment variable is correctly set. This option does not determine which locale GTK will use at runtime. That will be determined from the usual environment variables. If you will be using multiple locales with GTK, specify the one for which your operating system has the worst support for the --with-locale option. * --with-native-locale=[yes/no] Use native locale support If set, GTK+ will use your C library's native locale support, instead of making conversions between wide characters and multibyte-strings by going through Xlib's property-conversion functions. Specifying this flag can speed up some operations involving text by between 5 and 20 times. This defaults to no, because it has not extensively been tested for portability, but should be safe on most modern systems. Options can be given to the compiler and linker by setting environment variables before running configure. A few of the more important ones: CC : The C compiler to use CPPFLAGS : Flags for the C preprocesser such as -I and -D CFLAGS : C compiler flags The most important use of this is to set the optimization/debugging flags. For instance, to compile with no debugging information at all, run configure as: CFLAGS=-O2 ./configure # Bourne compatible shells (sh/bash/zsh) or, setenv CFLAGS -O2 ; ./configure # csh and variants Native-Language Support and gettext() ===================================== To provide native-language support (NLS) GTK+ uses the gettext() set of functions. These functions are found in the C library on many systems, such as the Solaris C library and the GNU C Library, version 2. If your C library does not provide the necessary functionality, you may wish to install the GNU gettext package. You'll need version 0.10.35 or better. Version 0.10.35 is available from ftp://alpha.gnu.org/pub/gnu Generally, GTK+ will properly detect what is installed on your system and enable or disable NLS as appropriate. However, in rare cases, it may be necessary to disable NLS manually to get GTK+ to compile. You can do this by specifying the --disable-nls flag when configuring GTK+. Using an uninstalled copy of GLIB [ Unsupported ] ================================================= You can compile GTK+ against a copy of GLIB that you have not yet installed. To do this, give the --with-glib=DIR options to ./configure. For instance: ./configure --with-glib=../glib-1.2.10 This, however, will not work if you built GLIB with different source and build directories. It is recommended that you install GLIB before compiling GTK+. The --with-glib option is not regularly tested and may not function correctly. In addition, inter-library dependencies won't be generated when using --with-glib=. Installation directories ======================== The location of the installed files is determined by the --prefix and --exec-prefix options given to configure. There are also more detailed flags to control individual directories. However, the use of these flags is not tested. One particular detail to note, is that the architecture-dependent include file glibconfig.h is installed in: $exec_pref/lib/glib/include/ if you have a version in $prefix/include, this is out of date and should be deleted. A shell script gtk-config is created during the configure process, and installed in the bin/ directory ($exec_prefix/bin). This is used to determine the location of GTK when building applications. If you move GTK after installation, it will be necessary to edit this file. For complete details, see the file docs/gtk-config.txt Notes for using XIM support for Japanese input ============================================== * There is a bug in older versions of kinput2 that will cause GTK+ to hang when destroying a text entry. The latest versions of kinput is available from: ftp://ftp.sra.co.jp/pub/x11/kinput2 * The locale information file for the ja_JP EUC locale distributed with some recent versions of X11 specifies to use the C library multibyte functions. Unless your C library has support for Japanese locales, this is incorrect, and will cause problems for GTK's internationalization. (In particular, this occurs with GNU libc 2.0 in which the multibyte functions always translate to and from UTF-8; but the problem may occur for other C libraries, and other operating systems as well.) To fix this, change the line: use_stdc_env True to use_stdc_env False in the file /usr/X11R6/lib/X11/locale/ja_JP/XLC_LOCALE. 070701000153bf000081a40000000a0000000a000000013d12d3980000526c0000008800000003000000000000000000000017ff35088dreloc/doc/gtk/Makefile# Generated automatically from Makefile.in by configure. # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = /usr/bin/ksh srcdir = . top_srcdir = . prefix = /usr/local exec_prefix = ${prefix} bindir = ${exec_prefix}/bin sbindir = ${exec_prefix}/sbin libexecdir = ${exec_prefix}/libexec datadir = ${prefix}/share sysconfdir = ${prefix}/etc sharedstatedir = ${prefix}/com localstatedir = ${prefix}/var libdir = ${exec_prefix}/lib infodir = ${prefix}/info mandir = ${prefix}/man includedir = ${prefix}/include oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/gtk+ pkglibdir = $(libdir)/gtk+ pkgincludedir = $(includedir)/gtk+ top_builddir = . ACLOCAL = aclocal AUTOCONF = autoconf AUTOMAKE = automake AUTOHEADER = autoheader INSTALL = /usr/local/bin/install -c INSTALL_PROGRAM = ${INSTALL} $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = ${INSTALL} -m 644 INSTALL_SCRIPT = ${INSTALL_PROGRAM} transform = s,x,x, NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = sparc-sun-solaris2.9 host_triplet = sparc-sun-solaris2.9 AS = @AS@ AWK = gawk CATALOGS = az.mo ca.mo cs.mo da.mo de.mo el.mo es.mo et.mo eu.mo fi.mo fr.mo ga.mo gl.mo hr.mo hu.mo it.mo ja.mo ko.mo lt.mo nl.mo no.mo nn.mo pl.mo pt.mo pt_BR.mo ro.mo ru.mo sk.mo sl.mo sp.mo sr.mo sv.mo tr.mo uk.mo vi.mo wa.mo zh_CN.GB2312.mo zh_TW.Big5.mo CATOBJEXT = .mo CC = gcc DATADIRNAME = lib DLLTOOL = @DLLTOOL@ GDK_WLIBS = GENCAT = GLIB_CFLAGS = -I/usr/local/include/glib-1.2 -I/usr/local/lib/glib/include -D_REENTRANT GLIB_CONFIG = /usr/local/bin/glib-config GLIB_DEPLIBS = -L/usr/local/lib -lgmodule -lglib -ldl GLIB_LIBS = -L/usr/local/lib -lgmodule -lglib -ldl GMOFILES = az.gmo ca.gmo cs.gmo da.gmo de.gmo el.gmo es.gmo et.gmo eu.gmo fi.gmo fr.gmo ga.gmo gl.gmo hr.gmo hu.gmo it.gmo ja.gmo ko.gmo lt.gmo nl.gmo no.gmo nn.gmo pl.gmo pt.gmo pt_BR.gmo ro.gmo ru.gmo sk.gmo sl.gmo sp.gmo sr.gmo sv.gmo tr.gmo uk.gmo vi.gmo wa.gmo zh_CN.GB2312.gmo zh_TW.Big5.gmo GMSGFMT = /usr/local/bin/msgfmt GTK_BINARY_AGE = 10 GTK_DEBUG_FLAGS = -DGTK_NO_CHECK_CASTS GTK_INTERFACE_AGE = 1 GTK_LOCALE_FLAGS = GTK_MAJOR_VERSION = 1 GTK_MICRO_VERSION = 10 GTK_MINOR_VERSION = 2 GTK_VERSION = 1.2.10 GTK_XIM_FLAGS = -DUSE_XIM GT_NO = GT_YES = #YES# INCLUDE_LOCALE_H = #include INDENT = INSTOBJEXT = .mo INTLDEPS = INTLLIBS = INTLOBJS = LIBTOOL = $(SHELL) $(top_builddir)/libtool LN_S = ln -s LT_AGE = 9 LT_CURRENT = 9 LT_RELEASE = 1.2 LT_REVISION = 1 MAINT = # MAKEINFO = makeinfo MKINSTALLDIRS = ./mkinstalldirs OBJDUMP = @OBJDUMP@ PACKAGE = gtk+ PERL = perl POFILES = az.po ca.po cs.po da.po de.po el.po es.po et.po eu.po fi.po fr.po ga.po gl.po hr.po hu.po it.po ja.po ko.po lt.po nl.po no.po nn.po pl.po pt.po pt_BR.po ro.po ru.po sk.po sl.po sp.po sr.po sv.po tr.po uk.po vi.po wa.po zh_CN.GB2312.po zh_TW.Big5.po POSUB = po RANLIB = ranlib REBUILD = STRIP_BEGIN = $(strip $(STRIP_DUMMY) STRIP_DUMMY = STRIP_END = ) USE_INCLUDED_LIBINTL = no USE_NLS = yes VERSION = 1.2.10 glib_cflags = -I/usr/local/include/glib-1.2 -I/usr/local/lib/glib/include glib_libs = -L/usr/local/lib -lgmodule -lglib -ldl glib_thread_cflags = -I/usr/local/include/glib-1.2 -I/usr/local/lib/glib/include -D_REENTRANT glib_thread_libs = -L/usr/local/lib -lgmodule -lgthread -lglib -lthread -ldl gtklocaledir = ${prefix}/${DATADIRNAME}/locale l = x_cflags = -I/usr/openwin/include x_includes = /usr/openwin/include x_ldflags = -L/usr/openwin/lib -R/usr/openwin/lib x_libs = -lXext -lX11 -lsocket -lnsl xinput_progs = SRC_SUBDIRS = gdk gtk SUBDIRS = po $(SRC_SUBDIRS) docs bin_SCRIPTS = gtk-config # require automake 1.4 AUTOMAKE_OPTIONS = 1.4 EXTRA_DIST = HACKING gtk+.spec.in gtk.m4 makecopyright TODO NEWS.pre-1-0 ChangeLog.pre-1-0 README.cvs-commits intl/libgettext.h intl/po2tbl.sed.in examples/aspectframe/Makefile examples/aspectframe/aspectframe.c examples/Makefile examples/README.1ST examples/extract.awk examples/extract.sh examples/base/Makefile examples/base/base.c examples/buttons/Makefile examples/buttons/buttons.c examples/buttons/info.xpm examples/calendar/Makefile examples/calendar/calendar.c examples/clist/Makefile examples/clist/clist.c examples/entry/Makefile examples/entry/entry.c examples/eventbox/Makefile examples/eventbox/eventbox.c examples/filesel/Makefile examples/filesel/filesel.c examples/gtkdial/Makefile examples/gtkdial/dial_test.c examples/gtkdial/gtkdial.c examples/gtkdial/gtkdial.h examples/helloworld/Makefile examples/helloworld/helloworld.c examples/helloworld2/Makefile examples/helloworld2/helloworld2.c examples/list/Makefile examples/list/list.c examples/menu/Makefile examples/menu/menu.c examples/menu/itemfactory.c examples/notebook/Makefile examples/notebook/notebook.c examples/packbox/Makefile examples/packbox/packbox.c examples/packer/Makefile examples/packer/pack.c examples/paned/Makefile examples/paned/paned.c examples/pixmap/Makefile examples/pixmap/pixmap.c examples/progressbar/Makefile examples/progressbar/progressbar.c examples/radiobuttons/Makefile examples/radiobuttons/radiobuttons.c examples/rangewidgets/Makefile examples/rangewidgets/rangewidgets.c examples/rulers/Makefile examples/rulers/rulers.c examples/scribble-simple/Makefile examples/scribble-simple/scribble-simple.c examples/scrolledwin/Makefile examples/scrolledwin/scrolledwin.c examples/selection/Makefile examples/selection/gettargets.c examples/selection/setselection.c examples/statusbar/Makefile examples/statusbar/statusbar.c examples/table/Makefile examples/table/table.c examples/text/Makefile examples/text/text.c examples/tictactoe/Makefile examples/tictactoe/tictactoe.c examples/tictactoe/tictactoe.h examples/tictactoe/ttt_test.c examples/tree/Makefile examples/tree/tree.c examples/wheelbarrow/Makefile examples/wheelbarrow/wheelbarrow.c examples/fixed/fixed.c examples/fixed/Makefile examples/frame/frame.c examples/frame/Makefile examples/spinbutton/spinbutton.c examples/spinbutton/Makefile examples/find-examples.sh gdk.pc.in gtk+.pc.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gdk.pc gtk+.pc m4datadir = $(datadir)/aclocal m4data_DATA = gtk.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = gtk+.spec gtk-config gdk.pc gtk+.pc SCRIPTS = $(bin_SCRIPTS) DATA = $(m4data_DATA) $(pkgconfig_DATA) DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \ INSTALL Makefile.am Makefile.in NEWS TODO acconfig.h acinclude.m4 \ aclocal.m4 config.guess config.h.in config.sub configure configure.in \ gdk.pc.in gtk+.pc.in gtk+.spec.in gtk-config.in install-sh ltconfig \ ltmain.sh missing mkinstalldirs DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: # Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status $(ACLOCAL_M4): # configure.in acinclude.m4 cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: #$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) config.h: stamp-h @if test ! -f $@; then \ rm -f stamp-h; \ $(MAKE) stamp-h; \ else :; fi stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=config.h \ $(SHELL) ./config.status @echo timestamp > stamp-h 2> /dev/null $(srcdir)/config.h.in: #$(srcdir)/stamp-h.in @if test ! -f $@; then \ rm -f $(srcdir)/stamp-h.in; \ $(MAKE) $(srcdir)/stamp-h.in; \ else :; fi $(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h cd $(top_srcdir) && $(AUTOHEADER) @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null mostlyclean-hdr: clean-hdr: distclean-hdr: -rm -f config.h maintainer-clean-hdr: gtk+.spec: $(top_builddir)/config.status gtk+.spec.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status gtk-config: $(top_builddir)/config.status gtk-config.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status gdk.pc: $(top_builddir)/config.status gdk.pc.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status gtk+.pc: $(top_builddir)/config.status gtk+.pc.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ else if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ else :; fi; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) list='$(bin_SCRIPTS)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ done install-m4dataDATA: $(m4data_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(m4datadir) @list='$(m4data_DATA)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(m4datadir)/$$p"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(m4datadir)/$$p; \ else if test -f $$p; then \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(m4datadir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(m4datadir)/$$p; \ fi; fi; \ done uninstall-m4dataDATA: @$(NORMAL_UNINSTALL) list='$(m4data_DATA)'; for p in $$list; do \ rm -f $(DESTDIR)$(m4datadir)/$$p; \ done install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgconfigdir) @list='$(pkgconfig_DATA)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgconfigdir)/$$p"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgconfigdir)/$$p; \ else if test -f $$p; then \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgconfigdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(pkgconfigdir)/$$p; \ fi; fi; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) list='$(pkgconfig_DATA)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkgconfigdir)/$$p; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ test "$$subdir" = "." && dot_seen=yes; \ done; \ test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist -rm -rf $(distdir) GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst dc_install_base=`cd $(distdir)/=inst && pwd`; \ cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) dist -rm -rf $(distdir) @banner="$(distdir).tar.gz is ready for distribution"; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes" dist: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) distdir: $(DISTFILES) -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) $(mkinstalldirs) $(distdir)/examples $(distdir)/examples/aspectframe \ $(distdir)/examples/base $(distdir)/examples/buttons \ $(distdir)/examples/calendar $(distdir)/examples/clist \ $(distdir)/examples/entry $(distdir)/examples/eventbox \ $(distdir)/examples/filesel $(distdir)/examples/fixed \ $(distdir)/examples/frame $(distdir)/examples/gtkdial \ $(distdir)/examples/helloworld \ $(distdir)/examples/helloworld2 $(distdir)/examples/list \ $(distdir)/examples/menu $(distdir)/examples/notebook \ $(distdir)/examples/packbox $(distdir)/examples/packer \ $(distdir)/examples/paned $(distdir)/examples/pixmap \ $(distdir)/examples/progressbar \ $(distdir)/examples/radiobuttons \ $(distdir)/examples/rangewidgets $(distdir)/examples/rulers \ $(distdir)/examples/scribble-simple \ $(distdir)/examples/scrolledwin \ $(distdir)/examples/selection $(distdir)/examples/spinbutton \ $(distdir)/examples/statusbar $(distdir)/examples/table \ $(distdir)/examples/text $(distdir)/examples/tictactoe \ $(distdir)/examples/tree $(distdir)/examples/wheelbarrow \ $(distdir)/intl @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done for subdir in $(SUBDIRS); do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ chmod 777 $(distdir)/$$subdir; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook info-am: info: info-recursive dvi-am: dvi: dvi-recursive check-am: all-am check: check-recursive installcheck-am: installcheck: installcheck-recursive all-recursive-am: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive install-exec-am: install-binSCRIPTS install-exec: install-exec-recursive install-data-am: install-m4dataDATA install-pkgconfigDATA install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive uninstall-am: uninstall-binSCRIPTS uninstall-m4dataDATA \ uninstall-pkgconfigDATA uninstall: uninstall-recursive all-am: Makefile $(SCRIPTS) $(DATA) config.h all-redirect: all-recursive-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(m4datadir) \ $(DESTDIR)$(pkgconfigdir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-recursive clean-am: clean-hdr clean-tags clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-hdr distclean-tags distclean-generic clean-am -rm -f libtool distclean: distclean-recursive -rm -f config.status maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-recursive -rm -f config.status .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ uninstall-binSCRIPTS install-binSCRIPTS uninstall-m4dataDATA \ install-m4dataDATA uninstall-pkgconfigDATA install-pkgconfigDATA \ install-data-recursive uninstall-data-recursive install-exec-recursive \ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ all-recursive check-recursive installcheck-recursive info-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \ install-exec-am install-exec install-data-am install-data install-am \ install uninstall-am uninstall all-redirect all-am all installdirs-am \ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean dist-hook: gtk+.spec if test -e $(srcdir)/INSTALL.in && test -e $(srcdir)/README.in ; then \ CONFIG_FILES="INSTALL:$(srcdir)/INSTALL.in README:$(srcdir)/README.in" \ CONFIG_HEADERS= \ $(SHELL) config.status \ && cp INSTALL README $(distdir) ; \ fi \ && cp gtk+.spec $(distdir) .PHONY: files release sanity snapshot files: @files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \ echo $$p; \ done @for subdir in $(SUBDIRS); do \ files=`cd $$subdir; $(MAKE) files | grep -v "make\[[1-9]\]"`; \ for file in $$files; do \ echo $$subdir/$$file; \ done; \ done release: rm -rf .deps */.deps $(MAKE) distcheck sanity: ./sanity_check $(VERSION) snapshot: $(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"` # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: 070701000153c0000081a40000000a0000000a000000013d12d39800000ea8000000880000000300000000000000000000001aff35088dreloc/doc/gtk/Makefile.am## Makefile.am for GTK+ SRC_SUBDIRS = gdk gtk SUBDIRS = po $(SRC_SUBDIRS) docs bin_SCRIPTS = gtk-config # require automake 1.4 AUTOMAKE_OPTIONS = 1.4 EXTRA_DIST = \ HACKING \ gtk+.spec.in \ gtk.m4 \ makecopyright \ TODO \ NEWS.pre-1-0 \ ChangeLog.pre-1-0 \ README.cvs-commits \ intl/libgettext.h \ intl/po2tbl.sed.in \ examples/aspectframe/Makefile \ examples/aspectframe/aspectframe.c \ examples/Makefile \ examples/README.1ST \ examples/extract.awk \ examples/extract.sh \ examples/base/Makefile \ examples/base/base.c \ examples/buttons/Makefile \ examples/buttons/buttons.c \ examples/buttons/info.xpm \ examples/calendar/Makefile \ examples/calendar/calendar.c \ examples/clist/Makefile \ examples/clist/clist.c \ examples/entry/Makefile \ examples/entry/entry.c \ examples/eventbox/Makefile \ examples/eventbox/eventbox.c \ examples/filesel/Makefile \ examples/filesel/filesel.c \ examples/gtkdial/Makefile \ examples/gtkdial/dial_test.c \ examples/gtkdial/gtkdial.c \ examples/gtkdial/gtkdial.h \ examples/helloworld/Makefile \ examples/helloworld/helloworld.c \ examples/helloworld2/Makefile \ examples/helloworld2/helloworld2.c \ examples/list/Makefile \ examples/list/list.c \ examples/menu/Makefile \ examples/menu/menu.c \ examples/menu/itemfactory.c \ examples/notebook/Makefile \ examples/notebook/notebook.c \ examples/packbox/Makefile \ examples/packbox/packbox.c \ examples/packer/Makefile \ examples/packer/pack.c \ examples/paned/Makefile \ examples/paned/paned.c \ examples/pixmap/Makefile \ examples/pixmap/pixmap.c \ examples/progressbar/Makefile \ examples/progressbar/progressbar.c \ examples/radiobuttons/Makefile \ examples/radiobuttons/radiobuttons.c \ examples/rangewidgets/Makefile \ examples/rangewidgets/rangewidgets.c \ examples/rulers/Makefile \ examples/rulers/rulers.c \ examples/scribble-simple/Makefile \ examples/scribble-simple/scribble-simple.c \ examples/scrolledwin/Makefile \ examples/scrolledwin/scrolledwin.c \ examples/selection/Makefile \ examples/selection/gettargets.c \ examples/selection/setselection.c \ examples/statusbar/Makefile \ examples/statusbar/statusbar.c \ examples/table/Makefile \ examples/table/table.c \ examples/text/Makefile \ examples/text/text.c \ examples/tictactoe/Makefile \ examples/tictactoe/tictactoe.c \ examples/tictactoe/tictactoe.h \ examples/tictactoe/ttt_test.c \ examples/tree/Makefile \ examples/tree/tree.c \ examples/wheelbarrow/Makefile \ examples/wheelbarrow/wheelbarrow.c \ examples/fixed/fixed.c \ examples/fixed/Makefile \ examples/frame/frame.c \ examples/frame/Makefile \ examples/spinbutton/spinbutton.c \ examples/spinbutton/Makefile \ examples/find-examples.sh \ gdk.pc.in gtk+.pc.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA= gdk.pc gtk+.pc dist-hook: gtk+.spec if test -e $(srcdir)/INSTALL.in && test -e $(srcdir)/README.in ; then \ CONFIG_FILES="INSTALL:$(srcdir)/INSTALL.in README:$(srcdir)/README.in" \ CONFIG_HEADERS= \ $(SHELL) config.status \ && cp INSTALL README $(distdir) ; \ fi \ && cp gtk+.spec $(distdir) m4datadir = $(datadir)/aclocal m4data_DATA = gtk.m4 .PHONY: files release sanity snapshot files: @files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \ echo $$p; \ done @for subdir in $(SUBDIRS); do \ files=`cd $$subdir; $(MAKE) files | grep -v "make\[[1-9]\]"`; \ for file in $$files; do \ echo $$subdir/$$file; \ done; \ done release: rm -rf .deps */.deps $(MAKE) distcheck sanity: ./sanity_check $(VERSION) snapshot: $(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"` 070701000153c1000081a40000000a0000000a000000013d12d39800004f43000000880000000300000000000000000000001aff35088dreloc/doc/gtk/Makefile.in# Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ AS = @AS@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ DATADIRNAME = @DATADIRNAME@ DLLTOOL = @DLLTOOL@ GDK_WLIBS = @GDK_WLIBS@ GENCAT = @GENCAT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_DEPLIBS = @GLIB_DEPLIBS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GTK_BINARY_AGE = @GTK_BINARY_AGE@ GTK_DEBUG_FLAGS = @GTK_DEBUG_FLAGS@ GTK_INTERFACE_AGE = @GTK_INTERFACE_AGE@ GTK_LOCALE_FLAGS = @GTK_LOCALE_FLAGS@ GTK_MAJOR_VERSION = @GTK_MAJOR_VERSION@ GTK_MICRO_VERSION = @GTK_MICRO_VERSION@ GTK_MINOR_VERSION = @GTK_MINOR_VERSION@ GTK_VERSION = @GTK_VERSION@ GTK_XIM_FLAGS = @GTK_XIM_FLAGS@ GT_NO = @GT_NO@ GT_YES = @GT_YES@ INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ INDENT = @INDENT@ INSTOBJEXT = @INSTOBJEXT@ INTLDEPS = @INTLDEPS@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PERL = @PERL@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ REBUILD = @REBUILD@ STRIP_BEGIN = @STRIP_BEGIN@ STRIP_DUMMY = @STRIP_DUMMY@ STRIP_END = @STRIP_END@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ glib_cflags = @glib_cflags@ glib_libs = @glib_libs@ glib_thread_cflags = @glib_thread_cflags@ glib_thread_libs = @glib_thread_libs@ gtklocaledir = @gtklocaledir@ l = @l@ x_cflags = @x_cflags@ x_includes = @x_includes@ x_ldflags = @x_ldflags@ x_libs = @x_libs@ xinput_progs = @xinput_progs@ SRC_SUBDIRS = gdk gtk SUBDIRS = po $(SRC_SUBDIRS) docs bin_SCRIPTS = gtk-config # require automake 1.4 AUTOMAKE_OPTIONS = 1.4 EXTRA_DIST = HACKING gtk+.spec.in gtk.m4 makecopyright TODO NEWS.pre-1-0 ChangeLog.pre-1-0 README.cvs-commits intl/libgettext.h intl/po2tbl.sed.in examples/aspectframe/Makefile examples/aspectframe/aspectframe.c examples/Makefile examples/README.1ST examples/extract.awk examples/extract.sh examples/base/Makefile examples/base/base.c examples/buttons/Makefile examples/buttons/buttons.c examples/buttons/info.xpm examples/calendar/Makefile examples/calendar/calendar.c examples/clist/Makefile examples/clist/clist.c examples/entry/Makefile examples/entry/entry.c examples/eventbox/Makefile examples/eventbox/eventbox.c examples/filesel/Makefile examples/filesel/filesel.c examples/gtkdial/Makefile examples/gtkdial/dial_test.c examples/gtkdial/gtkdial.c examples/gtkdial/gtkdial.h examples/helloworld/Makefile examples/helloworld/helloworld.c examples/helloworld2/Makefile examples/helloworld2/helloworld2.c examples/list/Makefile examples/list/list.c examples/menu/Makefile examples/menu/menu.c examples/menu/itemfactory.c examples/notebook/Makefile examples/notebook/notebook.c examples/packbox/Makefile examples/packbox/packbox.c examples/packer/Makefile examples/packer/pack.c examples/paned/Makefile examples/paned/paned.c examples/pixmap/Makefile examples/pixmap/pixmap.c examples/progressbar/Makefile examples/progressbar/progressbar.c examples/radiobuttons/Makefile examples/radiobuttons/radiobuttons.c examples/rangewidgets/Makefile examples/rangewidgets/rangewidgets.c examples/rulers/Makefile examples/rulers/rulers.c examples/scribble-simple/Makefile examples/scribble-simple/scribble-simple.c examples/scrolledwin/Makefile examples/scrolledwin/scrolledwin.c examples/selection/Makefile examples/selection/gettargets.c examples/selection/setselection.c examples/statusbar/Makefile examples/statusbar/statusbar.c examples/table/Makefile examples/table/table.c examples/text/Makefile examples/text/text.c examples/tictactoe/Makefile examples/tictactoe/tictactoe.c examples/tictactoe/tictactoe.h examples/tictactoe/ttt_test.c examples/tree/Makefile examples/tree/tree.c examples/wheelbarrow/Makefile examples/wheelbarrow/wheelbarrow.c examples/fixed/fixed.c examples/fixed/Makefile examples/frame/frame.c examples/frame/Makefile examples/spinbutton/spinbutton.c examples/spinbutton/Makefile examples/find-examples.sh gdk.pc.in gtk+.pc.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gdk.pc gtk+.pc m4datadir = $(datadir)/aclocal m4data_DATA = gtk.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = gtk+.spec gtk-config gdk.pc gtk+.pc SCRIPTS = $(bin_SCRIPTS) DATA = $(m4data_DATA) $(pkgconfig_DATA) DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \ INSTALL Makefile.am Makefile.in NEWS TODO acconfig.h acinclude.m4 \ aclocal.m4 config.guess config.h.in config.sub configure configure.in \ gdk.pc.in gtk+.pc.in gtk+.spec.in gtk-config.in install-sh ltconfig \ ltmain.sh missing mkinstalldirs DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) config.h: stamp-h @if test ! -f $@; then \ rm -f stamp-h; \ $(MAKE) stamp-h; \ else :; fi stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=config.h \ $(SHELL) ./config.status @echo timestamp > stamp-h 2> /dev/null $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in @if test ! -f $@; then \ rm -f $(srcdir)/stamp-h.in; \ $(MAKE) $(srcdir)/stamp-h.in; \ else :; fi $(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h cd $(top_srcdir) && $(AUTOHEADER) @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null mostlyclean-hdr: clean-hdr: distclean-hdr: -rm -f config.h maintainer-clean-hdr: gtk+.spec: $(top_builddir)/config.status gtk+.spec.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status gtk-config: $(top_builddir)/config.status gtk-config.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status gdk.pc: $(top_builddir)/config.status gdk.pc.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status gtk+.pc: $(top_builddir)/config.status gtk+.pc.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ else if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ else :; fi; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) list='$(bin_SCRIPTS)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ done install-m4dataDATA: $(m4data_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(m4datadir) @list='$(m4data_DATA)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(m4datadir)/$$p"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(m4datadir)/$$p; \ else if test -f $$p; then \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(m4datadir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(m4datadir)/$$p; \ fi; fi; \ done uninstall-m4dataDATA: @$(NORMAL_UNINSTALL) list='$(m4data_DATA)'; for p in $$list; do \ rm -f $(DESTDIR)$(m4datadir)/$$p; \ done install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgconfigdir) @list='$(pkgconfig_DATA)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgconfigdir)/$$p"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgconfigdir)/$$p; \ else if test -f $$p; then \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgconfigdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(pkgconfigdir)/$$p; \ fi; fi; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) list='$(pkgconfig_DATA)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkgconfigdir)/$$p; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. @SET_MAKE@ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ test "$$subdir" = "." && dot_seen=yes; \ done; \ test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist -rm -rf $(distdir) GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst dc_install_base=`cd $(distdir)/=inst && pwd`; \ cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) dist -rm -rf $(distdir) @banner="$(distdir).tar.gz is ready for distribution"; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes" dist: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) distdir: $(DISTFILES) -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) $(mkinstalldirs) $(distdir)/examples $(distdir)/examples/aspectframe \ $(distdir)/examples/base $(distdir)/examples/buttons \ $(distdir)/examples/calendar $(distdir)/examples/clist \ $(distdir)/examples/entry $(distdir)/examples/eventbox \ $(distdir)/examples/filesel $(distdir)/examples/fixed \ $(distdir)/examples/frame $(distdir)/examples/gtkdial \ $(distdir)/examples/helloworld \ $(distdir)/examples/helloworld2 $(distdir)/examples/list \ $(distdir)/examples/menu $(distdir)/examples/notebook \ $(distdir)/examples/packbox $(distdir)/examples/packer \ $(distdir)/examples/paned $(distdir)/examples/pixmap \ $(distdir)/examples/progressbar \ $(distdir)/examples/radiobuttons \ $(distdir)/examples/rangewidgets $(distdir)/examples/rulers \ $(distdir)/examples/scribble-simple \ $(distdir)/examples/scrolledwin \ $(distdir)/examples/selection $(distdir)/examples/spinbutton \ $(distdir)/examples/statusbar $(distdir)/examples/table \ $(distdir)/examples/text $(distdir)/examples/tictactoe \ $(distdir)/examples/tree $(distdir)/examples/wheelbarrow \ $(distdir)/intl @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done for subdir in $(SUBDIRS); do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ chmod 777 $(distdir)/$$subdir; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook info-am: info: info-recursive dvi-am: dvi: dvi-recursive check-am: all-am check: check-recursive installcheck-am: installcheck: installcheck-recursive all-recursive-am: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive install-exec-am: install-binSCRIPTS install-exec: install-exec-recursive install-data-am: install-m4dataDATA install-pkgconfigDATA install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive uninstall-am: uninstall-binSCRIPTS uninstall-m4dataDATA \ uninstall-pkgconfigDATA uninstall: uninstall-recursive all-am: Makefile $(SCRIPTS) $(DATA) config.h all-redirect: all-recursive-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(m4datadir) \ $(DESTDIR)$(pkgconfigdir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-recursive clean-am: clean-hdr clean-tags clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-hdr distclean-tags distclean-generic clean-am -rm -f libtool distclean: distclean-recursive -rm -f config.status maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-recursive -rm -f config.status .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ uninstall-binSCRIPTS install-binSCRIPTS uninstall-m4dataDATA \ install-m4dataDATA uninstall-pkgconfigDATA install-pkgconfigDATA \ install-data-recursive uninstall-data-recursive install-exec-recursive \ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ all-recursive check-recursive installcheck-recursive info-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \ install-exec-am install-exec install-data-am install-data install-am \ install uninstall-am uninstall all-redirect all-am all installdirs-am \ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean dist-hook: gtk+.spec if test -e $(srcdir)/INSTALL.in && test -e $(srcdir)/README.in ; then \ CONFIG_FILES="INSTALL:$(srcdir)/INSTALL.in README:$(srcdir)/README.in" \ CONFIG_HEADERS= \ $(SHELL) config.status \ && cp INSTALL README $(distdir) ; \ fi \ && cp gtk+.spec $(distdir) .PHONY: files release sanity snapshot files: @files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \ echo $$p; \ done @for subdir in $(SUBDIRS); do \ files=`cd $$subdir; $(MAKE) files | grep -v "make\[[1-9]\]"`; \ for file in $$files; do \ echo $$subdir/$$file; \ done; \ done release: rm -rf .deps */.deps $(MAKE) distcheck sanity: ./sanity_check $(VERSION) snapshot: $(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"` # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: 070701000153c2000081a40000000a0000000a000000013d12d39800004de90000008800000003000000000000000000000013ff35088dreloc/doc/gtk/NEWSOverview of Changes in GTK+ 1.2.10: * Fix focus drawing with no window manager * Fix cut-and-paste with no current event * Fix compilation using --with-xinput=gxi * Fix problem with cut-and-paste and KOI8-R * Fix rare problem with enter events and menus * Fix problem with --with-native-locale and GNU libc-2.1 * Further fixes for using fonts, not fontsets, with non iso-8859-1. * Fix problem with dropping onto internal children, such as CList buttons * Translation updates Overview of Changes in GTK+ 1.2.9: * Move include files into a gtk-1-2/ subdir to support parallel installation with GTK+-2.0. If you are installing from source on top of a previous version, you should to remove $(includedir)/gdk/ and $(includedir)/gtk/ manually before installing the new version. * Improved submenu navigation. * Other small useability improvements for menus, scrollbars, etc. * Patch enabling themes with better appearance by making some geometry parameters settable. * Changes so that using fonts (as well as fontsets) for non-iso-8859-1 locales will work. * New --with-native-locale configure option for faster string handling on systems with non-broken locale support. * Refuse to initialize GTK+ when setuid (http://www.gtk.org/setuid.html) * Change to make GdkRGB use less SHM segments. * Addition of .pc files * Many bug fixes (#50834, #50892, #13447, #50857, #1923, #50934, #3123, #51163, #50492, #51026, #1704, #51039, #2682, #50964, #50926, #50686, #50678, #50511, #8170, #567, #424, #1290, #4524, #8041, #8002, #7302, #11008, #34218, #12074, #12072, #9656, #10316, #14082, #13941, #13432, #7841, #6739, #8079, #28842, #50290, #50337, #6510, #15282, #11887, #18648, #26545, and others) Overview of Changes in GTK+ 1.2.8: * GNU Make 3.79 bug workaround * FAQ and tutorial updates and improvements * Miscellaneous bug fixes: CList, Calendar, rc-files, FontSelection Overview of Changes in GTK+ 1.2.7: * More header cleanups. * Fixed activation bug for insensitive widgets. * Locale fixes to RC file parsing code. * Miscellaneous bugfixes for Item Factory, CList, CTree, X Selections, HScale, VScale, Pixmap, Viewport, OptionMenu, Entry and Notebook. * Upgrade to libtool 1.3.4. Overview of Changes in GTK+ 1.2.6: * container queue_resize fixes * gtk[vh]scale: minor fixups * rename idle to idle_id in testgtk to avoid conflicts with broken libs * More consistant naming of gtkrc files * Added language support: ro, uk Overview of Changes in GTK+ 1.2.5: * more GtkCTree and GtkWindow bug fixes. * more redraw/resize queue fixes, better expose event discarding code. * more miscellaneous bugs fixed * new configure.in option --disable-rebuilds to completely disable rebuilds of autogenerated sources. * check for 5.002 now, to avoid failing autogeneration build rules due to old perl versions. * fonts (and fontsets) are cached now. * more autogeneration make rules and dependancy fixups, we should be save with autogeneration up to make -j12 now ;) * new window position GTK_WIN_POS_CENTER_ALWAYS, which will recenter the GtkWindow on every size change. * major rework of window manager hints handling code, fixed a bunch of races with the new resizing code. * the new wm hints and resizing code is absolutely perfect and bug free now, it only lacks testing ;) * fixed up various rc style memory prolems. * gtk_widget_modify_style() now properly changes the style of realized widgets and references the style passed into it. if people worked around this bug, this will introduce a slight memory leak in their code. The code should typically look like: GtkRcStyle *rc_style = gtk_rc_style_new (); [...] gtk_widget_modify_style (widget, rc_style); gtk_rc_style_unref (rc_style); * fix problems with positioning menus offscreen. * GtkText fixes for some crashes and drawing errors. * Better handling for unexpected window destroys in GDK and GTK+. This should make it possible to use a GtkPlug and catch the case where its parent socket is randomly killed. * FAQ updates. * FileSelection i18n patches, RadioButton fixups. * many translation improvements. * miscellaneous other bugs fixed. Overview of Changes in GTK+ 1.2.4: * DnD improvements (drags can be canceled with Esc now). * suppressed configure event reordering in Gdk. * rewrite of Gtk's configure event handling. * major improvements for the object argument system (Elena Devdariani). * major bugfixes for threading, GtkNotebook, GtkItemFactory, GtkCList and GtkCTree. * tutorial/FAQ updates, new file generation.txt on autogenerated sources. * configure's --with-glib= is "officially" unsupported. * upgrade to libtool 1.3.3. * various buglets fixed. Overview of Changes in GTK+ 1.2.3: * Upgrade to libtool 1.3 * Check for dgettext (for systems with old versions of GNU Gettext) * Many bug fixes (see ChangeLog for details) Overview of Changes in GTK+ 1.2.2: * Improved Dnd behaviour with Motif applications. * Bug fixes for the Gtk selection code. * Minor bug fixes to the Gdk Atom cache and Dnd code (with --display option). * Bug fixes and leak plugs for the Gdk IM code. * Added gtk_object_get() facility to retrive object arguments easily. The var args list expects ("arg-name", &value) pairs. * Fixed mapping for GdkInputCondition<->GIOCondition, this should fix problems where closed pipes were no longer signalling GDK_INPUT_READ on systems with a native poll(). * Some cleanups to GtkLabel's memory allocation code (shouldn't leak memory anymore). * We don't attempt to lookup xpm color "None" anymore, this should prevent eXodus (commercial X windows server) from popping up a color dialog every time a transparent pixmap is created. * Fixed bug where Gtk timout/idle handlers would execute without the global Gdk lock being held. * Other minor bug fixes. Overview of Changes in GTK+ 1.2.1: * Many Bug fixes have been applied to the menu and accelerator code. * GtkItemFactory can "adopt" foreign menu items now and manage their accelerator installation. This is often required to get GtkItemFactory like accelerator propagation between different windows with the same menu heirarchy and for centralized parsing and saving of accelerators. * GtkCList/GtkCTree buttons should always display correctly now. * Miscellaneous other bug fixes. What's New in GTK+ 1.2.0 (since 1.0.x): * New widgets: GtkFontSelector, GtkPacker, GtkItemFactory, GtkCTree, GtkInvisible, GtkCalendar, GtkLayout, GtkPlug, GtkSocket * Many new features and robustness for existing widgets * Theme support * New DND implementation * Internationalization of standard dialogs * New key binding system * Tearoff menus and menu accelerators * Wide character support for entry and text * Resizing code has been overhauled * Queued redraws of partial areas * Far better support for object arguments * Speed optimizations * Runtime loading of dynamic modules * Support for GLib log domains * Tutorial improvements * A bug fix or two Overview of Changes in GTK+ 1.1.16: * Major fixes and improvements for handlebox * A change to the way widget->requisition works. Now, widget->requisition is always what the widget requested, unmodified by the usize. See Changes-1.2.txt for details. This correct various bugs with gtk_widget_set_usize(). * Fixes for XIM on X11R5 systems * Don't allow cut-and-paste of text in password-style entries * --enable-debug is now on by default for the development releaes. (When compiling for "production", use --enable-debug=minimum) * Handle systems where Helvetica is not present more gracefully * Fixes for memory leaks * CList and CTree fixes * Bug fixes for drawing problems. * Miscellaneous bug fixes to GtkLabel, GtkCList, GtkCTree, GtkColorsel, Focusing, DND * Tutorial improvements Overview of Changes in GTK+ 1.1.15: * Tutorial Updates * Added --libs gthread to gtk-config * Bug fixes What is new in GTK+ 1.1.14: * Additions to docs/Changes-1.2.txt * Just warn when loading theme engine fails * CLAMP GtkScale digits to a meaningful range * GTK_LOCALDIR is now defined in a better fashion * New functions (feature freeze, we know...): gtk_menu_set_title() gtk_toggle_button_get_active() * Some locale fixups in gtkrc code * Fixes to make gtk_radio_button_set_group() keep only one radio button in the group active * Foreign windows are now always treated as viewable; this fixes a problem where updating didn't occure properly in GtkPlug * DND fixes for 64 bit architectures, and for specifying operations with modifier keys. * Major revisions to GtkLayout: avoid having to create window for NO_WINDOW children, adjust allocations of children as scrolled so queued draws work, and a resize is queued instead of allocating directly in a put() or move() What is new in GTK+ 1.1.13: * Dnd and selection bug fixes and memory purification. * Widget sensitivity fixups. * Tooltips windows are now named "gtk-tooltips" so rc file rules can match tooltips windows. Fixed interaction of tooltips and NO_WINDOW widgets. * Spin buttons now update their values upon value retrival. * Overhaul of the resizing vs. redrawing logic to reduce redrawing needs a lot. Gtk makes full use of the draw_area coalescing code now, which got minorly improved as well. * Containers map their Gdk windows after their children now to reduce expose event generation. * Gdk event queue fixups, this solves the double-click problems people were recently having. * Account for the fact that GSource's are only properly reentrant from within dispatch(), thus we don't do Gdk event processing from within check() or prepare() anymore. * Rc files feature a bg_pixmap value of "" now. * Improved session management support in Gdk. * Automatic disabling of NLS if no gettext is found should work now. * Removed deprecated functions, docs/Changes-1.2.txt gives an overview. * Gtk+ development now requires GNU autoconf 2.13, GNU automake 1.4 and GNU libtool 1.2d. * More bug fixes all over the place. What is new in GTK+ 1.1.12: * Korean translation added * Fixed memory leaks * A few other bug fixes What is new in GTK+ 1.1.11: * Dutch, Japanese, Swedish, Polish, and Norwegian translations * Removed deprecated _interp variants: gtk_container_foreach_interp, gtk_idle_add_interp, gtk_timeout_add_interp, gtk_signal_connect_interp * Lots of cast corrections * Many fixes What is new in GTK+ 1.1.9: * Check for broken glibc 2.0 mb functions and avoid them * Label and Entry display fixes * Move main thread back to GDK, for locking when translating events * Bug fixes What is new in GTK+ 1.1.8: * Added support for gettext and the localization of the standard dialogs. * Added line-wrapping for the label, and JUSTIFY_FILL * Support reordering via drag and drop in CList and CTree. * Replaced GtkDrawWindow widget with a GTK_USER_DRAW flag * Extended gtkpaned API to support minimum sizes and proportional resizing. * Changed the handling of shared memory segments so as to remove the need for GTK+ to set up signal handlers. * Re-implemented event loop in terms of the event loop that has been added to GLib 1.1.8 * Added 'grab_focus' signal to allow keyboard accelerators for entries. * Load locale specific RC files if present. * Bug fixes. What is new in GTK+ 1.1.7: * Fixed memory mis-allocation in default files code * Various event handling fixes * Wide character support for entry and text * Destroy widgets _after_ propagating unrealize signals through widget heirarchy * Only build XIM-support if available * Tutorial and examples updates * Added gtk_drag_source_unset() What is new in GTK+ 1.1.6: * The signal system now features emission hooks whith special semantics, refer to the ChangeLog for this. * Minor? speedups and memory reductions to the emission handling of the signal system. * _interp() function variants are deprecated now. the corresponding *_full() variants are provided for a long time now. * Dnd abort timeout increased to 10 minutes. * GtkScrolledWindow inherits from GtkBin now. * GTK_POLICY_NEVER is implemented for scrolled windows now. * Lots of API clean ups. * Incremental freezing abilities. * Integrated widgets from the GNOME tree: GtkLayout, GtkPlug and GtkSocket. * New window functions for transient relationship, default size, and geometry hints * Default rc files are now read in ( g_str_hash() g_string_equal() -> g_str_equal() gtk_tooltips_set_tips() -> gtk_tooltips_set_tip() * Support for quit handlers in gtk_main(). * Motif window mangaer hints support. * Widget arguments are now flagged for readability/writability. * Additions to documentation. * Various FAQ updates. (FAQ now included) * Clean ups and many many bug fixes by a lot of people all over the place. * New, long and descriptive ChangeLog entries for bored readers ;) Overview of Changes in GTK+ 0.99.3: * Filesel enhancement / stability changes * New widget, gtkcombo * Widgets in the toolbar do not get the focus * New widget, gtkstatusbar (still in-progress) * g_string_equal renamed g_str_equal * g_string_hash renamed g_str_hash * new gtkbox functions to allow modification of the child linkage after the widget tree is setup * gtk_*_get_arg() and gtk_*_set_arg() fixes and implementations * DND changes/fixes * Entry widget now has set_max_length function * Handlebox widget changes/fixes * Some work on text widget (still in-progress) * Now the toolbar supports arbitrary widgets as well * CList has resizable columns again * CList now looks consistant with scrolled windows * Remove flickering from entry widget * Added switch_page signal to notebook widget * Documentation additions * Other bug fixes... 070701000153c4000081a40000000a0000000a000000013d12d398000008990000008800000003000000000000000000000015ff35088dreloc/doc/gtk/READMEGeneral Information =================== This is GTK+ version 1.2.10. GTK+, which stands for the Gimp ToolKit, is a library for creating graphical user interfaces for the X Window System. It is designed to be small, efficient, and flexible. GTK+ is written in C with a very object-oriented approach. The official ftp site is: ftp://ftp.gtk.org/pub/gtk The official web site is: http://www.gtk.org/ Information about mailing lists can be found at http://www.gtk.org/mailinglists.html Installation ============ See the file 'INSTALL' How to report bugs ================== Bugs should be reported to the GNOME bug tracking system. (http://bugzilla.gnome.org, product gtk+.) You will need to create an account for yourself. In the bug report please include: * Information about your system. For instance: - What operating system and version - What version of X - For Linux, what version of the C library And anything else you think is relevant. * How to reproduce the bug. If you can reproduce it with the testgtk program that is built in the gtk/ subdirectory, that will be most convenient. Otherwise, please include a short test program that exhibits the behavior. As a last resort, you can also provide a pointer to a larger piece of software that can be downloaded. * If the bug was a crash, the exact text that was printed out when the crash occured. * Further information such as stack traces may be useful, but is not necessary. If you do send a stack trace, and the error is an X error, it will be more useful if the stacktrace is produced running the test program with the --sync command line option. Patches ======= Patches should also be submitted to bugzilla.gnome.org. If the patch fixes an existing bug, add the patch as an attachment to that bug report. Otherwise, enter a new bug report that describes the patch, and attach the patch to that bug report. Bug reports containing patches should include the PATCH keyword in their keyword fields. If the patch adds to or changes the GTK programming interface, the API keyword should also be included. Patches should be in unified diff form. (The -u option to GNU diff.) 070701000153c5000081a40000000a0000000a000000013d12d398000009a60000008800000003000000000000000000000021ff35088dreloc/doc/gtk/README.cvs-commitsGTK+ is part of the GNOME CVS repository. At the current time, any person with write access to the GNOME repository, can make changes to GTK+. This is a good thing, in that it encourages many people to work on GTK+, and progress can be made quickly. However, GTK+ is a fairly large and complicated package that many other things depend on, so to avoid unnecessary breakage, and to take advantage of the knowledge about GTK+ that has been built up over the last 18 months, we'd like to ask people commiting to GTK+ to follow a few rules: 0) Ask first. If your changes are major, or could possibly break existing code, you should always ask. If your change is minor and you've been working on GTK+ for a while it probably isn't necessary to ask. But when in doubt, ask. Even if your change is correct, somebody may know a better way to do things. If you are making changes to GTK+, you should be subscribed to gtk-devel-list@redhat.com. (Subscription address: gtk-devel-list-request@redhat.com.) This is a good place to ask about intended changes. If you just want to make a trivial change, and don't want to subscribe, you can also mail gtk-bugs@gtk.org. Or, alternatively, you can look in the ChangeLog for somebody who has been making changes to the file you want to change and email them. #gimp on byxnet (irc.gimp.org, irc2.gimp.org, irc3.gimp.org, irc.germany.gimp.org...)s also a good place to find GTK+ developers to discuss changes with, however, email to gtk-devel-list is the most certain and preferred method. 1) Ask _first_. 2) There must be a ChangeLog for every commit. (If you discover that you only committed half the files you meant to and need to fix that up, or something, you don't need a new ChangeLog entry. But in general, ChangeLog entries are mandatory.) Changes with out ChangeLog entries will be reverted. 3) There _must_ be a ChangeLog for every commit. Notes: * If you are going to be changing many files in an experimental fashion, it probably is a good idea to create a separate branch for your changes. * The ChangeLog entries should preferrably match in date format with the existing entries. You can set how emacs does this by using customize mode: - M-x customize - set Programming/Tools/ChangeLog/Add Log Time Format to 'Old Format' Or, set the add-log-time-format to 'current-time-string in your .emacs file. Owen Taylor 13 Aug 1998 070701000153c6000081a40000000a0000000a000000013d12d398000019730000008800000003000000000000000000000013ff35088dreloc/doc/gtk/TODO Outstanding items: * focus handling for GtkOptionMenu (needs the previous) * implement gtk_default_draw_oval and other missing things in gtkstyle.c. * enforce invariants on *_RESIZE* and *_REDRAW* flags. * GtkToolTips: allocate GtkTooltipsData from memchunks * Make all widget attributes configurable after the widget is created (timj). * Radio buttons need to display CAN/HAS_DEFAULT correctly, if draw_inidicator is TRUE. (Radio buttons do not need to CAN_DEFAULT! OWT) * More dialogs: Print, maybe others... * make the gtk_main callbacks consistent in their add/remove behaviour. * Check return values on all calls to XIC[Get/Set]Values * The "--geometry" option should be supported - Having gdk_init() parse the geometry option. (putting it into GDK means you can use XParseGeometry() without wrapping it) - Add a call gdk_get_geometry() that retrieves the results in a form like that returned by XParseGeometry() - The application then can modify the results (as would gemvt) then call a routine gtk_window_set_geometry() on whatever it considers to be its main window. - Then in some manner GtkWindow takes that into account when setting its hints. (Probably it uses the size and position as the current uposition and usize, and modulates that be the equivalents of the X flags XValue, YValue, WidthValue, HeightValue, XNegative, or YNegative ( You'd have to extend gdk_window_set_hints to accept the window gravity option to get it right. ) * Allow moving the separator for paned widgets by dragging it directly instead of using the handle. * Check into XAddConnectionWatch - is this needed for XIM? * Places where a _full variant is needed: gtk_init_add gtk_menu_popup gtk_toolbar_prepend_element gtk_toolbar_insert_element * Try to rationally deal with someone else deleting one of our windows??? This would mean keeping track of our window heirarchy ourselves, for one thing, and will never be safe, because of race conditions. * Should all the default handlers really return FALSE? This can cause confusing presses to be sent to containers that actually want to get events on themselves. * The menu code should skip separators during keyboard navigation, whether they are sensitive or insensitive. * OwnerButtonPressGrab needs to go! Text/Edit widget: Bugs: - Really big font (150 pt), plus lots of editing caused segfault Improvements: - Unify the key binding support in some fashion between the Entry and Text widget widgets, use GtkBindings for this. - Figure out a way not to recompute the geometry on insertions/deletions which are large, but not a significant fraction of the entire text. (e.g., compute the changes as when the widget is not frozen, but without the actual scrolling) - Prune the line start cache. But since it is only 68 bytes per line, and it is a lot faster when lines are in the cache, it may be better not to, at least for now. - Show the non-editable state by changing colors. (Use the style entries for insensitive?) - Multibyte support for the Text widget. - Unicode support to do the multi-byte right. - Support an .inputrc. (The readline one doesn't really work, unless it is extended because it can't represent X keysyms, just terminal type input) - A vi mode - Word wrap, instead of line folding. (Should the continuation characters be shown?) - Horizontal scrolling - Disable pasting compound text - When showing background pixmap (not editable) actually set the background pixmap as the windows bg pixmap, to improve appearance on exposes. But this would require using another window to get the origins. - In word wrap mode, break: aaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb as: | Maximum column aaaaaaaaaaa bbbbbbbbbbb| bbbbbbbbbbbbbbbbbbbbbbb| bbbbbbbbb | Instead of: | aaaaaaaaaaa | bbbbbbbbbbbbbbbbbbbbbbb| bbbbbbbbbbbbbbbbbbbb | - Blinking cursor - API's : gtk_text_clear, gtk_text_delete_lines (gint start, gint end), gtk_text_append/prepend, gtk_text_insert_at (gint row, gint column), some function to get the row/column from the x/y-coordinates of a mouse click, some function to get the word/line under the mouse pointer [ From: Stefan Jeske ] - "changed" emitted when doing deletes on empty Text widget. - Delete IC in editable->unrealize, not editable->finalize? Themes ====== - When a scale gets shown/hidden only queue a redraw on the non-window portion, not the whole area. - In various places, to avoid shaping windows excessively, we set parent relative backgrounds. This is an ugly hack and needs a better solution. Plus, I don't think these parent-relative backgrounds always persist to when they are actually needed. Such calls exist in: GtkButton, GtkHandeBox, GtkItem, GtkListItem, GtkMenu, GtkMenuItem, GtkMisc, GtkNoteBook, GtkOptionMenu, GtkPaned, GtkPreview, GtkSpinButton and GtkTreeItem. - For menus and for GtkWindow's, the realize() function calls paint(), so that background pixmaps can be set ahead of time, and prevent flashing when the window is shown. This is an ugly hack and needs a better solution. ======= Calendar Widget: - The widget should be nicely resizeable vertical too. - CALENDAR_MARGIN should be removed, uses INNER_BORDER and style->class->[xy]thickness insted. - Flag to choose between using standard three letter abbreviated weekday name or just the first character from it. It looks like that is what most other calendar-widgets do. - Arrows should resize with the header-font. - The keyboard support has to be finished. DND === - Use a cursor instead of an ICON when over Motif windows, to get rid of the current junk that Motif leaves because of its XCopyArea stupidity for doing highlighting. - Add a GTK_DRAG_VERIFY target flag and a "drag_data_verify" signal so that apps can easily check if a, say, text/uri-list URL looks OK during the drop. - Check more for memory leaks. - Drag and drop for Entry and Text widgets. - Send synthetic motion events on structure changes so drag_enter/leave get sent properly. (See the popup in testdnd) 0707010001baec000041ed0000000a0000000a000000043d12d48e000000000000008800000003000000000000000000000013ff35088dreloc/doc/gtk/docs0707010001baed000081a40000000a0000000a000000013d12d39c000029470000008800000003000000000000000000000023ff350892reloc/doc/gtk/docs/Changes-1.2.txtIncompatible Changes from GTK+-1.0 to GTK+-1.2: * GtkAcceleratorTable has been replaced with GtkAccelGroup * GtkMenuFactory has been replaced with GtkItemFactory, although a version of GtkMenuFactory is currently still provided to ease the migration phase. * The GtkTypeInfo structures used in the gtk_*_type_init() functions have changed a bit, the old format: GtkTypeInfo bin_info = { "GtkBin", sizeof (GtkBin), sizeof (GtkBinClass), (GtkClassInitFunc) gtk_bin_class_init, (GtkObjectInitFunc) gtk_bin_init, (GtkArgSetFunc) NULL, (GtkArgGetFunc) NULL, }; needs to be converted to: static const GtkTypeInfo bin_info = { "GtkBin", sizeof (GtkBin), sizeof (GtkBinClass), (GtkClassInitFunc) gtk_bin_class_init, (GtkObjectInitFunc) gtk_bin_init, /* reserved_1 */ NULL, /* reserved_2 */ NULL, (GtkClassInitFunc) NULL, }; the GtkArgSetFunc and GtkArgGetFunc functions are not supported from the type system anymore, and you should make sure that your code only fills in these fields with NULL and doesn't use the deprecated function typedefs (GtkArgSetFunc) and (GtkArgGetFunc) anymore. * A number of Gtk functions were renamed. For compatibility, gtkcompat.h #define's the old 1.0.x function names in terms of the new names. To assure your Gtk program doesn't rely on outdated function variants, compile your program with -DGTK_DISABLE_COMPAT_H to disable the compatibility aliases. Here is the list of the old names and replacements: Old: Replacement: gtk_accel_label_accelerator_width gtk_accel_label_get_accel_width gtk_check_menu_item_set_state gtk_check_menu_item_set_active gtk_container_border_width gtk_container_set_border_width gtk_label_set gtk_label_set_text gtk_notebook_current_page gtk_notebook_get_current_page gtk_packer_configure gtk_packer_set_child_packing gtk_paned_gutter_size gtk_paned_set_gutter_size gtk_paned_handle_size gtk_paned_set_handle_size gtk_scale_value_width gtk_scale_get_value_width gtk_style_apply_default_pixmap gtk_style_apply_default_background (1) gtk_toggle_button_set_state gtk_toggle_button_set_active gtk_window_position gtk_window_set_position (1) gtk_style_apply_default_background() has an additional argument, gboolean set_bg. This parameter should be FALSE if the background is being set for a NO_WINDOW widget, otherwise true. * During the development phase of the 1.1.x line of Gtk certain functions were deprecated and later removed. Functions affected are: Removed: Replacement: gtk_clist_set_border gtk_clist_set_shadow_type gtk_container_block_resize gtk_container_set_resize_mode gtk_container_unblock_resize gtk_container_set_resize_mode gtk_container_need_resize gtk_container_check_resize gtk_ctree_show_stub gtk_ctree_set_show_stub gtk_ctree_set_reorderable gtk_clist_set_reorderable gtk_ctree_set_use_drag_icons gtk_clist_set_use_drag_icons gtk_entry_adjust_scroll (1) gtk_object_class_add_user_signal gtk_object_class_user_signal_new gtk_preview_put_row gtk_preview_put gtk_progress_bar_construct gtk_progress_set_adjustment gtk_scrolled_window_construct gtk_scrolled_window_set_{h|v}adjustment gtk_spin_button_construct gtk_spin_button_configure gtk_widget_thaw_accelerators gtk_widget_unlock_accelerators gtk_widget_freeze_accelerators gtk_widget_lock_accelerators (1) This function is no longer needed as GtkEntry should automatically keep the scroll adjusted properly. * Additionally, all gtk_*_interp functions were removed. gtk_*_full versions were provided as of GTK+-1.0 and should be used instead. * GtkButton has been changed to derive from GtkBin. To access a button's child, use GTK_BIN (button)->child, instead of the old GTK_BUTTON (button)->child. * The selection API has been slightly modified: gtk_selection_add_handler() and gtk_selection_add_handler_full() have been removed. To supply the selection, one now register the targets one is interested in with: void gtk_selection_add_target (GtkWidget *widget, GdkAtom selection, GdkAtom target, guint info); or: void gtk_selection_add_targets (GtkWidget *widget, GdkAtom selection, GtkTargetEntry *targets, guint ntargets); When a request for a selection is received, the new "selection_get" signal will be called: void "selection_get" (GtkWidget *widget, GtkSelectionData *selection_data, guint info, guint time); A "time" parameter has also been added to the "selection_received" signal. void "selection_received" (GtkWidget *widget, GtkSelectionData *selection_data, guint time); * The old drag and drop API has been completely removed and replaced. See the reference documentation for details on the new API. * Support for Themes has been added. In general, this does not affect application code, however, a few new rules should be observed: - To set a shape for a window, you must use gtk_widget_shape_combine_mask() instead of gdk_window_shape_combine_mask(), or the shape will be reset when switching themes. - It is no longer permissable to draw directly on an arbitrary widget, or to set an arbitrary widget's background pixmap. If you need to do that, use a GtkDrawingArea or (for a toplevel) the new GtkDrawWindow widget. * The ScrolledWindow widget no longer creates a Viewport automatically. Instead, it has been generalized to accept any "self-scrolling" widget. The self-scrolling widgets in the Gtk+ core are GtkViewport, GtkCList, GtkCTree, GtkText, and GtkLayout. All of these widgets can be added to a scrolled window as normal children with gtk_container_add() and scrollbars will be set up automatically. To add scrollbars to a non self-scrolling widget, (such as a GtkList), first add it to a viewport, then add the viewport to a scrolled window. The scrolled window code provides a convenience function to do this: void gtk_scrolled_window_add_with_viewport (GtkScrolledWindow *scrollwin, GtkWidget *child); This does exactly what it says - it creates a Viewport, adds the child widget to it, then adds the Viewport to the scrolled window. The scrollbars have been removed from the GtkCList and GtkCTree, because they are now scrolled by simply adding them to a Scrolled Window. The scrollbar policy is set on the scrolled window with gtk_scrolled_window_set_policy() and not on the child widgets (e.g. GtkCList's gtk_clist_set_policy() was removed). * The "main loop" of GTK+ has been moved to GLib. This should not affect existing programs, since compatibility functions have been provided. However, you may want to consider migrating your code to use the GLib main loop directly. * the GTK_BASIC flag was removed, and with it the corresponding macro and function GTK_WIDGET_BASIC() and gtk_widget_basic(). * All freeze/thaw methods are now recursive - that is, if you freeze a widget n times, you must also thaw it n times. Therefore, if you have code like: gboolean frozen; frozen = GTK_CLIST_FROZEN (clist); gtk_clist_freeze (clist); [...] if (!frozen) gtk_clist_thaw (clist); it will not work anymore. It must be, simply: gtk_clist_freeze (clist); [...] gtk_clist_thaw (clist); * The thread safety in GTK+ 1.2 is slightly different than that which appeared in early versions in the 1.1 development track. The main difference is that it relies on the thread primitives in GLib, and on the thread-safe GLib main loop. This means: - You must call g_thread_init() before executing any other GTK+ or GDK functions in a threaded GTK+ program. - Idles, timeouts, and input functions are executed outside of the main GTK+ lock. So, if you need to call GTK+ inside of such a callback, you must surround the callback with a gdk_threads_enter()/gdk_threads_leave() pair. [ However, signals are still executed within the main GTK+ lock ] In particular, this means, if you are writing widgets that might be used in threaded programs, you _must_ surround timeouts and idle functions in this matter. As always, you must also surround any calls to GTK+ not made within a signal handler with a gdk_threads_enter()/gdk_threads_leave() pair. - There is no longer a special --with-threads configure option for GTK+. To use threads in a GTK+ program, you must: a) If you want to use the native thread implementation, make sure GLib found this in configuration, otherwise, call you must provide a thread implementation to g_thread_init(). b) Link with the libraries returned by: gtk-config --libs gthread and use the cflags from: gtk-config --cflags gthread You can get these CFLAGS and LIBS by passing gthread as the fourth parameter to the AM_PATH_GTK automake macro. * Prior to GTK+-1.2, there were two conflicting interpretations of widget->requistion. It was either taken to be the size that the widget requested, or that size modified by calls to gtk_widget_set_usize(). In GTK+-1.2, it is always interpreted the first way. Container widgets are affected in two ways by this: 1) Container widgets should not pass widget->requisition as the second parameter to gtk_widget_size_request(). Instead they should call it like: GtkRequisition child_requisition; gtk_widget_size_request (widget, &child_requisition); 2) Container widgets should not access child->requisition directly. Either they should use the values returned by gtk_widget_size_request(), or they should call the new function: void gtk_widget_get_child_requisition (GtkWidget *widget, GtkRequisition *requisition); which returns the requisition of the given widget, modified by calls to gtk_widget_set_usize(). 0707010001baee000081a40000000a0000000a000000013d12d39e0000416b000000880000000300000000000000000000001cff350892reloc/doc/gtk/docs/Makefile# Generated automatically from Makefile.in by configure. # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = /usr/bin/ksh srcdir = . top_srcdir = .. prefix = /usr/local exec_prefix = ${prefix} bindir = ${exec_prefix}/bin sbindir = ${exec_prefix}/sbin libexecdir = ${exec_prefix}/libexec datadir = ${prefix}/share sysconfdir = ${prefix}/etc sharedstatedir = ${prefix}/com localstatedir = ${prefix}/var libdir = ${exec_prefix}/lib infodir = ${prefix}/info mandir = ${prefix}/man includedir = ${prefix}/include oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/gtk+ pkglibdir = $(libdir)/gtk+ pkgincludedir = $(includedir)/gtk+ top_builddir = .. ACLOCAL = aclocal AUTOCONF = autoconf AUTOMAKE = automake AUTOHEADER = autoheader INSTALL = /usr/local/bin/install -c INSTALL_PROGRAM = ${INSTALL} $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = ${INSTALL} -m 644 INSTALL_SCRIPT = ${INSTALL_PROGRAM} transform = s,x,x, NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = sparc-sun-solaris2.9 host_triplet = sparc-sun-solaris2.9 AS = @AS@ AWK = gawk CATALOGS = az.mo ca.mo cs.mo da.mo de.mo el.mo es.mo et.mo eu.mo fi.mo fr.mo ga.mo gl.mo hr.mo hu.mo it.mo ja.mo ko.mo lt.mo nl.mo no.mo nn.mo pl.mo pt.mo pt_BR.mo ro.mo ru.mo sk.mo sl.mo sp.mo sr.mo sv.mo tr.mo uk.mo vi.mo wa.mo zh_CN.GB2312.mo zh_TW.Big5.mo CATOBJEXT = .mo CC = gcc DATADIRNAME = lib DLLTOOL = @DLLTOOL@ GDK_WLIBS = GENCAT = GLIB_CFLAGS = -I/usr/local/include/glib-1.2 -I/usr/local/lib/glib/include -D_REENTRANT GLIB_CONFIG = /usr/local/bin/glib-config GLIB_DEPLIBS = -L/usr/local/lib -lgmodule -lglib -ldl GLIB_LIBS = -L/usr/local/lib -lgmodule -lglib -ldl GMOFILES = az.gmo ca.gmo cs.gmo da.gmo de.gmo el.gmo es.gmo et.gmo eu.gmo fi.gmo fr.gmo ga.gmo gl.gmo hr.gmo hu.gmo it.gmo ja.gmo ko.gmo lt.gmo nl.gmo no.gmo nn.gmo pl.gmo pt.gmo pt_BR.gmo ro.gmo ru.gmo sk.gmo sl.gmo sp.gmo sr.gmo sv.gmo tr.gmo uk.gmo vi.gmo wa.gmo zh_CN.GB2312.gmo zh_TW.Big5.gmo GMSGFMT = /usr/local/bin/msgfmt GTK_BINARY_AGE = 10 GTK_DEBUG_FLAGS = -DGTK_NO_CHECK_CASTS GTK_INTERFACE_AGE = 1 GTK_LOCALE_FLAGS = GTK_MAJOR_VERSION = 1 GTK_MICRO_VERSION = 10 GTK_MINOR_VERSION = 2 GTK_VERSION = 1.2.10 GTK_XIM_FLAGS = -DUSE_XIM GT_NO = GT_YES = #YES# INCLUDE_LOCALE_H = #include INDENT = INSTOBJEXT = .mo INTLDEPS = INTLLIBS = INTLOBJS = LIBTOOL = $(SHELL) $(top_builddir)/libtool LN_S = ln -s LT_AGE = 9 LT_CURRENT = 9 LT_RELEASE = 1.2 LT_REVISION = 1 MAINT = # MAKEINFO = makeinfo MKINSTALLDIRS = ./mkinstalldirs OBJDUMP = @OBJDUMP@ PACKAGE = gtk+ PERL = perl POFILES = az.po ca.po cs.po da.po de.po el.po es.po et.po eu.po fi.po fr.po ga.po gl.po hr.po hu.po it.po ja.po ko.po lt.po nl.po no.po nn.po pl.po pt.po pt_BR.po ro.po ru.po sk.po sl.po sp.po sr.po sv.po tr.po uk.po vi.po wa.po zh_CN.GB2312.po zh_TW.Big5.po POSUB = po RANLIB = ranlib REBUILD = STRIP_BEGIN = $(strip $(STRIP_DUMMY) STRIP_DUMMY = STRIP_END = ) USE_INCLUDED_LIBINTL = no USE_NLS = yes VERSION = 1.2.10 glib_cflags = -I/usr/local/include/glib-1.2 -I/usr/local/lib/glib/include glib_libs = -L/usr/local/lib -lgmodule -lglib -ldl glib_thread_cflags = -I/usr/local/include/glib-1.2 -I/usr/local/lib/glib/include -D_REENTRANT glib_thread_libs = -L/usr/local/lib -lgmodule -lgthread -lglib -lthread -ldl gtklocaledir = ${prefix}/${DATADIRNAME}/locale l = x_cflags = -I/usr/openwin/include x_includes = /usr/openwin/include x_ldflags = -L/usr/openwin/lib -R/usr/openwin/lib x_libs = -lXext -lX11 -lsocket -lnsl xinput_progs = info_TEXINFOS = gdk.texi gtk.texi man_MANS = gtk-config.1 TUTORIAL_FR_FILES = html/gtk_tut_fr-1.html html/gtk_tut_fr-2.html html/gtk_tut_fr-3.html html/gtk_tut_fr-4.html html/gtk_tut_fr-5.html html/gtk_tut_fr-6.html html/gtk_tut_fr-7.html html/gtk_tut_fr-8.html html/gtk_tut_fr-9.html html/gtk_tut_fr-10.html html/gtk_tut_fr-11.html html/gtk_tut_fr-12.html html/gtk_tut_fr-13.html html/gtk_tut_fr-14.html html/gtk_tut_fr-15.html html/gtk_tut_fr-16.html html/gtk_tut_fr-17.html html/gtk_tut_fr-18.html html/gtk_tut_fr-19.html html/gtk_tut_fr-20.html html/gtk_tut_fr-21.html html/gtk_tut_fr-22.html html/gtk_tut_fr-23.html html/gtk_tut_fr-24.html html/gtk_tut_fr.html text/gtk_tut_fr.txt TUTORIAL_FILES = text/gtk_tut.txt html/gtk_tut.html html/gtk_tut.html html/gtk_tut-1.html html/gtk_tut-2.html html/gtk_tut-3.html html/gtk_tut-4.html html/gtk_tut-5.html html/gtk_tut-6.html html/gtk_tut-7.html html/gtk_tut-8.html html/gtk_tut-9.html html/gtk_tut-10.html html/gtk_tut-11.html html/gtk_tut-12.html html/gtk_tut-13.html html/gtk_tut-14.html html/gtk_tut-15.html html/gtk_tut-16.html html/gtk_tut-17.html html/gtk_tut-18.html html/gtk_tut-19.html html/gtk_tut-20.html html/gtk_tut-21.html html/gtk_tut-22.html html/gtk_tut-23.html html/gtk_tut-24.html html/gtk_tut-25.html html/gtk_tut-26.html html/gtk_tut-27.html html/gtk_tut-28.html html/gtk_tut-29.html html/gtk_tut-30.html html/gtk_tut-31.html TUTORIAL_IT_FILES = html/gtk_tut_it.html html/gtk_tut_it-1.html html/gtk_tut_it-2.html html/gtk_tut_it-3.html html/gtk_tut_it-4.html html/gtk_tut_it-5.html html/gtk_tut_it-6.html html/gtk_tut_it-7.html html/gtk_tut_it-8.html html/gtk_tut_it-9.html html/gtk_tut_it-10.html html/gtk_tut_it-11.html html/gtk_tut_it-12.html html/gtk_tut_it-13.html html/gtk_tut_it-14.html html/gtk_tut_it-15.html html/gtk_tut_it-16.html html/gtk_tut_it-17.html html/gtk_tut_it-18.html html/gtk_tut_it-19.html html/gtk_tut_it-20.html html/gtk_tut_it-21.html html/gtk_tut_it-22.html html/gtk_tut_it-23.html html/gtk_tut_it-24.html text/gtk_tut_it.txt FAQ_FILES = html/gtkfaq.html html/gtkfaq-1.html html/gtkfaq-2.html html/gtkfaq-3.html html/gtkfaq-4.html html/gtkfaq-5.html html/gtkfaq-6.html html/gtkfaq-7.html text/gtkfaq.txt EXTRA_DIST = Changes-1.2.txt debugging.txt developers.txt refcounting.txt styles.txt text_widget.txt widget_system.txt generation.txt gtk-config.txt gtk-config.1.in texinfo.tex macros.texi gtkdocs_fix gtkfaq.sgml gtk_tut.sgml gtk_tut_it.sgml gtk_tut_fr.sgml gtk_tut_packbox1.gif gtk_tut_packbox2.gif html/gtk_tut_table.gif html/gtk_tut_packbox1.gif html/gtk_tut_packbox2.gif gtk_tut_table.gif $(TUTORIAL_FILES) $(TUTORIAL_FR_FILES) $(TUTORIAL_IT_FILES) $(FAQ_FILES) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = gtk-config.1 TEXI2DVI = texi2dvi INFO_DEPS = gdk.info gtk.info DVIS = gdk.dvi gtk.dvi TEXINFOS = gdk.texi gtk.texi man1dir = $(mandir)/man1 MANS = $(man_MANS) NROFF = nroff DIST_COMMON = Makefile.am Makefile.in gtk-config.1.in texinfo.tex DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: .SUFFIXES: .dvi .info .ps .texi .texinfo .txi $(srcdir)/Makefile.in: # Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps docs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status gtk-config.1: $(top_builddir)/config.status gtk-config.1.in cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status gdk.info: gdk.texi gdk.dvi: gdk.texi gtk.info: gtk.texi gtk.dvi: gtk.texi DVIPS = dvips .texi.info: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .texi.dvi: TEXINPUTS=.:$$TEXINPUTS \ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< .texi: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .texinfo.info: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .texinfo: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .texinfo.dvi: TEXINPUTS=.:$$TEXINPUTS \ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< .txi.info: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .txi.dvi: TEXINPUTS=.:$$TEXINPUTS \ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< .txi: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .dvi.ps: $(DVIPS) $< -o $@ install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(infodir) @list='$(INFO_DEPS)'; \ for file in $$list; do \ d=$(srcdir); \ for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ if test -f $$d/$$ifile; then \ echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ else : ; fi; \ done; \ done @$(POST_INSTALL) @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ done; \ else : ; fi uninstall-info: $(PRE_UNINSTALL) @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ ii=yes; \ else ii=; fi; \ list='$(INFO_DEPS)'; \ for file in $$list; do \ test -z "$ii" \ || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ done @$(NORMAL_UNINSTALL) list='$(INFO_DEPS)'; \ for file in $$list; do \ (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ done dist-info: $(INFO_DEPS) list='$(INFO_DEPS)'; \ for base in $$list; do \ d=$(srcdir); \ for file in `cd $$d && eval echo $$base*`; do \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file; \ done; \ done mostlyclean-aminfo: -rm -f gdk.aux gdk.cp gdk.cps gdk.dvi gdk.fn gdk.fns gdk.ky gdk.kys \ gdk.ps gdk.log gdk.pg gdk.toc gdk.tp gdk.tps gdk.vr gdk.vrs \ gdk.op gdk.tr gdk.cv gdk.cn gtk.aux gtk.cp gtk.cps gtk.dvi \ gtk.fn gtk.fns gtk.ky gtk.kys gtk.ps gtk.log gtk.pg gtk.toc \ gtk.tp gtk.tps gtk.vr gtk.vrs gtk.op gtk.tr gtk.cv gtk.cn clean-aminfo: distclean-aminfo: maintainer-clean-aminfo: cd $(srcdir) && for i in $(INFO_DEPS); do \ rm -f $$i; \ if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \ rm -f $$i-[0-9]*; \ fi; \ done install-man1: $(mkinstalldirs) $(DESTDIR)$(man1dir) @list='$(man1_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ done uninstall-man1: @list='$(man1_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ rm -f $(DESTDIR)$(man1dir)/$$inst; \ done install-man: $(MANS) @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-man1 uninstall-man: @$(NORMAL_UNINSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 tags: TAGS TAGS: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = docs distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/html $(distdir)/text @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info info-am: $(INFO_DEPS) info: info-am dvi-am: $(DVIS) dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-info-am install-man install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-info uninstall-man uninstall: uninstall-am all-am: Makefile $(INFO_DEPS) $(MANS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(mandir)/man1 mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-aminfo clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-aminfo distclean-generic clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-aminfo maintainer-clean-generic \ distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: install-info-am uninstall-info mostlyclean-aminfo \ distclean-aminfo clean-aminfo maintainer-clean-aminfo install-man1 \ uninstall-man1 install-man uninstall-man tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs \ mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean .PHONY: html htmldir faq tutorial tutorial_it tutorial_fr files htmldir: (cd $(srcdir); mkdir -p html; cp gtk_tut*gif html) textdir: mkdir -p $(srcdir)/text # # The content is useless and the texi makes texi2html unhappy # #gdk.html gdk_toc.html: gdk.texi # (cd $(srcdir); texi2html gdk.texi) # #gtk.html gtk_toc.html: gtk.texi # (cd $(srcdir); texi2html gtk.texi) # #html/gdk.html html/gdk_toc.html: htmldir gdk.html gdk_toc.html # (cd $(srcdir); cp gdk.html gdk_toc.html html/) # #html/gtk.html html/gtk_toc.html: htmldir gtk.html gtk_toc.html # (cd $(srcdir); cp gtk.html gtk_toc.html html/) $(FAQ_FILES): faq faq: htmldir textdir (cd $(srcdir); sgml2html gtkfaq.sgml; \ perl gtkdocs_fix gtkfaq*html; \ mv gtkfaq*html html/; \ sgml2txt gtkfaq.sgml; \ mv gtkfaq.txt text/) $(TUTORIAL_FILES): tutorial $(TUTORIAL_FR_FILES): tutorial_fr $(TUTORIAL_IT_FILES): tutorial_it tutorial: htmldir textdir (cd $(srcdir); sgml2html gtk_tut.sgml; \ perl gtkdocs_fix gtk_tut*html; \ mv gtk_tut*html html/; \ sgml2txt gtk_tut.sgml; \ mv gtk_tut.txt text/) tutorial_it: htmldir textdir (cd $(srcdir); sgml2html --language=it gtk_tut_it.sgml; \ perl gtkdocs_fix gtk_tut_it*html; \ mv gtk_tut_it*html html/; \ sgml2txt --language=it gtk_tut_it.sgml; \ mv gtk_tut_it.txt text/) tutorial_fr: htmldir textdir (cd $(srcdir); sgml2html --language=fr gtk_tut_fr.sgml; \ perl gtkdocs_fix gtk_tut_fr*html; \ mv gtk_tut_fr*html html/; \ sgml2txt --language=fr gtk_tut_fr.sgml; \ mv gtk_tut_fr.txt text/) files: @files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \ echo $$p; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: 0707010001baef000081a40000000a0000000a000000013d12d39c0000139c000000880000000300000000000000000000001fff350892reloc/doc/gtk/docs/Makefile.am## Process this file with automake to produce Makefile.in info_TEXINFOS = gdk.texi gtk.texi man_MANS = gtk-config.1 TUTORIAL_FR_FILES=html/gtk_tut_fr-1.html \ html/gtk_tut_fr-2.html \ html/gtk_tut_fr-3.html \ html/gtk_tut_fr-4.html \ html/gtk_tut_fr-5.html \ html/gtk_tut_fr-6.html \ html/gtk_tut_fr-7.html \ html/gtk_tut_fr-8.html \ html/gtk_tut_fr-9.html \ html/gtk_tut_fr-10.html \ html/gtk_tut_fr-11.html \ html/gtk_tut_fr-12.html \ html/gtk_tut_fr-13.html \ html/gtk_tut_fr-14.html \ html/gtk_tut_fr-15.html \ html/gtk_tut_fr-16.html \ html/gtk_tut_fr-17.html \ html/gtk_tut_fr-18.html \ html/gtk_tut_fr-19.html \ html/gtk_tut_fr-20.html \ html/gtk_tut_fr-21.html \ html/gtk_tut_fr-22.html \ html/gtk_tut_fr-23.html \ html/gtk_tut_fr-24.html \ html/gtk_tut_fr.html text/gtk_tut_fr.txt TUTORIAL_FILES=text/gtk_tut.txt html/gtk_tut.html \ html/gtk_tut.html \ html/gtk_tut-1.html \ html/gtk_tut-2.html \ html/gtk_tut-3.html \ html/gtk_tut-4.html \ html/gtk_tut-5.html \ html/gtk_tut-6.html \ html/gtk_tut-7.html \ html/gtk_tut-8.html \ html/gtk_tut-9.html \ html/gtk_tut-10.html \ html/gtk_tut-11.html \ html/gtk_tut-12.html \ html/gtk_tut-13.html \ html/gtk_tut-14.html \ html/gtk_tut-15.html \ html/gtk_tut-16.html \ html/gtk_tut-17.html \ html/gtk_tut-18.html \ html/gtk_tut-19.html \ html/gtk_tut-20.html \ html/gtk_tut-21.html \ html/gtk_tut-22.html \ html/gtk_tut-23.html \ html/gtk_tut-24.html \ html/gtk_tut-25.html \ html/gtk_tut-26.html \ html/gtk_tut-27.html \ html/gtk_tut-28.html \ html/gtk_tut-29.html \ html/gtk_tut-30.html \ html/gtk_tut-31.html TUTORIAL_IT_FILES= html/gtk_tut_it.html \ html/gtk_tut_it-1.html \ html/gtk_tut_it-2.html \ html/gtk_tut_it-3.html \ html/gtk_tut_it-4.html \ html/gtk_tut_it-5.html \ html/gtk_tut_it-6.html \ html/gtk_tut_it-7.html \ html/gtk_tut_it-8.html \ html/gtk_tut_it-9.html \ html/gtk_tut_it-10.html \ html/gtk_tut_it-11.html \ html/gtk_tut_it-12.html \ html/gtk_tut_it-13.html \ html/gtk_tut_it-14.html \ html/gtk_tut_it-15.html \ html/gtk_tut_it-16.html \ html/gtk_tut_it-17.html \ html/gtk_tut_it-18.html \ html/gtk_tut_it-19.html \ html/gtk_tut_it-20.html \ html/gtk_tut_it-21.html \ html/gtk_tut_it-22.html \ html/gtk_tut_it-23.html \ html/gtk_tut_it-24.html \ text/gtk_tut_it.txt FAQ_FILES=html/gtkfaq.html \ html/gtkfaq-1.html \ html/gtkfaq-2.html \ html/gtkfaq-3.html \ html/gtkfaq-4.html \ html/gtkfaq-5.html \ html/gtkfaq-6.html \ html/gtkfaq-7.html \ text/gtkfaq.txt .PHONY: html htmldir faq tutorial tutorial_it tutorial_fr files htmldir: (cd $(srcdir); mkdir -p html; cp gtk_tut*gif html) textdir: mkdir -p $(srcdir)/text # # The content is useless and the texi makes texi2html unhappy # #gdk.html gdk_toc.html: gdk.texi # (cd $(srcdir); texi2html gdk.texi) # #gtk.html gtk_toc.html: gtk.texi # (cd $(srcdir); texi2html gtk.texi) # #html/gdk.html html/gdk_toc.html: htmldir gdk.html gdk_toc.html # (cd $(srcdir); cp gdk.html gdk_toc.html html/) # #html/gtk.html html/gtk_toc.html: htmldir gtk.html gtk_toc.html # (cd $(srcdir); cp gtk.html gtk_toc.html html/) $(FAQ_FILES): faq faq: htmldir textdir (cd $(srcdir); sgml2html gtkfaq.sgml; \ perl gtkdocs_fix gtkfaq*html; \ mv gtkfaq*html html/; \ sgml2txt gtkfaq.sgml; \ mv gtkfaq.txt text/) $(TUTORIAL_FILES): tutorial $(TUTORIAL_FR_FILES): tutorial_fr $(TUTORIAL_IT_FILES): tutorial_it tutorial: htmldir textdir (cd $(srcdir); sgml2html gtk_tut.sgml; \ perl gtkdocs_fix gtk_tut*html; \ mv gtk_tut*html html/; \ sgml2txt gtk_tut.sgml; \ mv gtk_tut.txt text/) tutorial_it: htmldir textdir (cd $(srcdir); sgml2html --language=it gtk_tut_it.sgml; \ perl gtkdocs_fix gtk_tut_it*html; \ mv gtk_tut_it*html html/; \ sgml2txt --language=it gtk_tut_it.sgml; \ mv gtk_tut_it.txt text/) tutorial_fr: htmldir textdir (cd $(srcdir); sgml2html --language=fr gtk_tut_fr.sgml; \ perl gtkdocs_fix gtk_tut_fr*html; \ mv gtk_tut_fr*html html/; \ sgml2txt --language=fr gtk_tut_fr.sgml; \ mv gtk_tut_fr.txt text/) files: @files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \ echo $$p; \ done EXTRA_DIST += \ Changes-1.2.txt \ debugging.txt \ developers.txt \ refcounting.txt \ styles.txt \ text_widget.txt \ widget_system.txt \ generation.txt \ gtk-config.txt \ gtk-config.1.in \ texinfo.tex \ macros.texi \ gtkdocs_fix \ gtkfaq.sgml \ gtk_tut.sgml \ gtk_tut_it.sgml \ gtk_tut_fr.sgml \ gtk_tut_packbox1.gif \ gtk_tut_packbox2.gif \ html/gtk_tut_table.gif \ html/gtk_tut_packbox1.gif \ html/gtk_tut_packbox2.gif \ gtk_tut_table.gif \ $(TUTORIAL_FILES) \ $(TUTORIAL_FR_FILES) \ $(TUTORIAL_IT_FILES) \ $(FAQ_FILES) 0707010001baf0000081a40000000a0000000a000000013d12d39800003df8000000880000000300000000000000000000001fff350892reloc/doc/gtk/docs/Makefile.in# Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ AS = @AS@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ DATADIRNAME = @DATADIRNAME@ DLLTOOL = @DLLTOOL@ GDK_WLIBS = @GDK_WLIBS@ GENCAT = @GENCAT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_DEPLIBS = @GLIB_DEPLIBS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GTK_BINARY_AGE = @GTK_BINARY_AGE@ GTK_DEBUG_FLAGS = @GTK_DEBUG_FLAGS@ GTK_INTERFACE_AGE = @GTK_INTERFACE_AGE@ GTK_LOCALE_FLAGS = @GTK_LOCALE_FLAGS@ GTK_MAJOR_VERSION = @GTK_MAJOR_VERSION@ GTK_MICRO_VERSION = @GTK_MICRO_VERSION@ GTK_MINOR_VERSION = @GTK_MINOR_VERSION@ GTK_VERSION = @GTK_VERSION@ GTK_XIM_FLAGS = @GTK_XIM_FLAGS@ GT_NO = @GT_NO@ GT_YES = @GT_YES@ INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ INDENT = @INDENT@ INSTOBJEXT = @INSTOBJEXT@ INTLDEPS = @INTLDEPS@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PERL = @PERL@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ REBUILD = @REBUILD@ STRIP_BEGIN = @STRIP_BEGIN@ STRIP_DUMMY = @STRIP_DUMMY@ STRIP_END = @STRIP_END@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ glib_cflags = @glib_cflags@ glib_libs = @glib_libs@ glib_thread_cflags = @glib_thread_cflags@ glib_thread_libs = @glib_thread_libs@ gtklocaledir = @gtklocaledir@ l = @l@ x_cflags = @x_cflags@ x_includes = @x_includes@ x_ldflags = @x_ldflags@ x_libs = @x_libs@ xinput_progs = @xinput_progs@ info_TEXINFOS = gdk.texi gtk.texi man_MANS = gtk-config.1 TUTORIAL_FR_FILES = html/gtk_tut_fr-1.html html/gtk_tut_fr-2.html html/gtk_tut_fr-3.html html/gtk_tut_fr-4.html html/gtk_tut_fr-5.html html/gtk_tut_fr-6.html html/gtk_tut_fr-7.html html/gtk_tut_fr-8.html html/gtk_tut_fr-9.html html/gtk_tut_fr-10.html html/gtk_tut_fr-11.html html/gtk_tut_fr-12.html html/gtk_tut_fr-13.html html/gtk_tut_fr-14.html html/gtk_tut_fr-15.html html/gtk_tut_fr-16.html html/gtk_tut_fr-17.html html/gtk_tut_fr-18.html html/gtk_tut_fr-19.html html/gtk_tut_fr-20.html html/gtk_tut_fr-21.html html/gtk_tut_fr-22.html html/gtk_tut_fr-23.html html/gtk_tut_fr-24.html html/gtk_tut_fr.html text/gtk_tut_fr.txt TUTORIAL_FILES = text/gtk_tut.txt html/gtk_tut.html html/gtk_tut.html html/gtk_tut-1.html html/gtk_tut-2.html html/gtk_tut-3.html html/gtk_tut-4.html html/gtk_tut-5.html html/gtk_tut-6.html html/gtk_tut-7.html html/gtk_tut-8.html html/gtk_tut-9.html html/gtk_tut-10.html html/gtk_tut-11.html html/gtk_tut-12.html html/gtk_tut-13.html html/gtk_tut-14.html html/gtk_tut-15.html html/gtk_tut-16.html html/gtk_tut-17.html html/gtk_tut-18.html html/gtk_tut-19.html html/gtk_tut-20.html html/gtk_tut-21.html html/gtk_tut-22.html html/gtk_tut-23.html html/gtk_tut-24.html html/gtk_tut-25.html html/gtk_tut-26.html html/gtk_tut-27.html html/gtk_tut-28.html html/gtk_tut-29.html html/gtk_tut-30.html html/gtk_tut-31.html TUTORIAL_IT_FILES = html/gtk_tut_it.html html/gtk_tut_it-1.html html/gtk_tut_it-2.html html/gtk_tut_it-3.html html/gtk_tut_it-4.html html/gtk_tut_it-5.html html/gtk_tut_it-6.html html/gtk_tut_it-7.html html/gtk_tut_it-8.html html/gtk_tut_it-9.html html/gtk_tut_it-10.html html/gtk_tut_it-11.html html/gtk_tut_it-12.html html/gtk_tut_it-13.html html/gtk_tut_it-14.html html/gtk_tut_it-15.html html/gtk_tut_it-16.html html/gtk_tut_it-17.html html/gtk_tut_it-18.html html/gtk_tut_it-19.html html/gtk_tut_it-20.html html/gtk_tut_it-21.html html/gtk_tut_it-22.html html/gtk_tut_it-23.html html/gtk_tut_it-24.html text/gtk_tut_it.txt FAQ_FILES = html/gtkfaq.html html/gtkfaq-1.html html/gtkfaq-2.html html/gtkfaq-3.html html/gtkfaq-4.html html/gtkfaq-5.html html/gtkfaq-6.html html/gtkfaq-7.html text/gtkfaq.txt EXTRA_DIST = Changes-1.2.txt debugging.txt developers.txt refcounting.txt styles.txt text_widget.txt widget_system.txt generation.txt gtk-config.txt gtk-config.1.in texinfo.tex macros.texi gtkdocs_fix gtkfaq.sgml gtk_tut.sgml gtk_tut_it.sgml gtk_tut_fr.sgml gtk_tut_packbox1.gif gtk_tut_packbox2.gif html/gtk_tut_table.gif html/gtk_tut_packbox1.gif html/gtk_tut_packbox2.gif gtk_tut_table.gif $(TUTORIAL_FILES) $(TUTORIAL_FR_FILES) $(TUTORIAL_IT_FILES) $(FAQ_FILES) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = gtk-config.1 TEXI2DVI = texi2dvi INFO_DEPS = gdk.info gtk.info DVIS = gdk.dvi gtk.dvi TEXINFOS = gdk.texi gtk.texi man1dir = $(mandir)/man1 MANS = $(man_MANS) NROFF = nroff DIST_COMMON = Makefile.am Makefile.in gtk-config.1.in texinfo.tex DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: .SUFFIXES: .dvi .info .ps .texi .texinfo .txi $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps docs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status gtk-config.1: $(top_builddir)/config.status gtk-config.1.in cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status gdk.info: gdk.texi gdk.dvi: gdk.texi gtk.info: gtk.texi gtk.dvi: gtk.texi DVIPS = dvips .texi.info: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .texi.dvi: TEXINPUTS=.:$$TEXINPUTS \ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< .texi: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .texinfo.info: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .texinfo: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .texinfo.dvi: TEXINPUTS=.:$$TEXINPUTS \ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< .txi.info: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .txi.dvi: TEXINPUTS=.:$$TEXINPUTS \ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< .txi: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .dvi.ps: $(DVIPS) $< -o $@ install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(infodir) @list='$(INFO_DEPS)'; \ for file in $$list; do \ d=$(srcdir); \ for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ if test -f $$d/$$ifile; then \ echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ else : ; fi; \ done; \ done @$(POST_INSTALL) @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ done; \ else : ; fi uninstall-info: $(PRE_UNINSTALL) @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ ii=yes; \ else ii=; fi; \ list='$(INFO_DEPS)'; \ for file in $$list; do \ test -z "$ii" \ || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ done @$(NORMAL_UNINSTALL) list='$(INFO_DEPS)'; \ for file in $$list; do \ (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ done dist-info: $(INFO_DEPS) list='$(INFO_DEPS)'; \ for base in $$list; do \ d=$(srcdir); \ for file in `cd $$d && eval echo $$base*`; do \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file; \ done; \ done mostlyclean-aminfo: -rm -f gdk.aux gdk.cp gdk.cps gdk.dvi gdk.fn gdk.fns gdk.ky gdk.kys \ gdk.ps gdk.log gdk.pg gdk.toc gdk.tp gdk.tps gdk.vr gdk.vrs \ gdk.op gdk.tr gdk.cv gdk.cn gtk.aux gtk.cp gtk.cps gtk.dvi \ gtk.fn gtk.fns gtk.ky gtk.kys gtk.ps gtk.log gtk.pg gtk.toc \ gtk.tp gtk.tps gtk.vr gtk.vrs gtk.op gtk.tr gtk.cv gtk.cn clean-aminfo: distclean-aminfo: maintainer-clean-aminfo: cd $(srcdir) && for i in $(INFO_DEPS); do \ rm -f $$i; \ if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \ rm -f $$i-[0-9]*; \ fi; \ done install-man1: $(mkinstalldirs) $(DESTDIR)$(man1dir) @list='$(man1_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ done uninstall-man1: @list='$(man1_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ rm -f $(DESTDIR)$(man1dir)/$$inst; \ done install-man: $(MANS) @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-man1 uninstall-man: @$(NORMAL_UNINSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 tags: TAGS TAGS: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = docs distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/html $(distdir)/text @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info info-am: $(INFO_DEPS) info: info-am dvi-am: $(DVIS) dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-info-am install-man install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-info uninstall-man uninstall: uninstall-am all-am: Makefile $(INFO_DEPS) $(MANS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(mandir)/man1 mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-aminfo clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-aminfo distclean-generic clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-aminfo maintainer-clean-generic \ distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: install-info-am uninstall-info mostlyclean-aminfo \ distclean-aminfo clean-aminfo maintainer-clean-aminfo install-man1 \ uninstall-man1 install-man uninstall-man tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs \ mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean .PHONY: html htmldir faq tutorial tutorial_it tutorial_fr files htmldir: (cd $(srcdir); mkdir -p html; cp gtk_tut*gif html) textdir: mkdir -p $(srcdir)/text # # The content is useless and the texi makes texi2html unhappy # #gdk.html gdk_toc.html: gdk.texi # (cd $(srcdir); texi2html gdk.texi) # #gtk.html gtk_toc.html: gtk.texi # (cd $(srcdir); texi2html gtk.texi) # #html/gdk.html html/gdk_toc.html: htmldir gdk.html gdk_toc.html # (cd $(srcdir); cp gdk.html gdk_toc.html html/) # #html/gtk.html html/gtk_toc.html: htmldir gtk.html gtk_toc.html # (cd $(srcdir); cp gtk.html gtk_toc.html html/) $(FAQ_FILES): faq faq: htmldir textdir (cd $(srcdir); sgml2html gtkfaq.sgml; \ perl gtkdocs_fix gtkfaq*html; \ mv gtkfaq*html html/; \ sgml2txt gtkfaq.sgml; \ mv gtkfaq.txt text/) $(TUTORIAL_FILES): tutorial $(TUTORIAL_FR_FILES): tutorial_fr $(TUTORIAL_IT_FILES): tutorial_it tutorial: htmldir textdir (cd $(srcdir); sgml2html gtk_tut.sgml; \ perl gtkdocs_fix gtk_tut*html; \ mv gtk_tut*html html/; \ sgml2txt gtk_tut.sgml; \ mv gtk_tut.txt text/) tutorial_it: htmldir textdir (cd $(srcdir); sgml2html --language=it gtk_tut_it.sgml; \ perl gtkdocs_fix gtk_tut_it*html; \ mv gtk_tut_it*html html/; \ sgml2txt --language=it gtk_tut_it.sgml; \ mv gtk_tut_it.txt text/) tutorial_fr: htmldir textdir (cd $(srcdir); sgml2html --language=fr gtk_tut_fr.sgml; \ perl gtkdocs_fix gtk_tut_fr*html; \ mv gtk_tut_fr*html html/; \ sgml2txt --language=fr gtk_tut_fr.sgml; \ mv gtk_tut_fr.txt text/) files: @files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \ echo $$p; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: 0707010001baf1000081a40000000a0000000a000000013d12d39c00000af00000008800000003000000000000000000000021ff350892reloc/doc/gtk/docs/debugging.txtThe GLIB, GDK, and GTK libraries have extensive support for debugging the library and your programs. The amount of debugging being done can be determined both at run time and compile time. COMPILE TIME OPTIONS -------------------- At compile time, the amount of debugging support included is determined by four macros: G_ENABLE_DEBUG If set, enable support for runtime checking. G_DISABLE_ASSERT If set, disable g_assert macros G_DISABLE_CHECKS If set, disable the g_return_if_fail and g_return_val_if_fail macros GTK_NO_CHECK_CASTS If set, don't check casts between different object types Whether these macros are defined is controlled at configuration time by the --enable-debug option. --enable-debug=minimum [default] Enable only inexpensive sanity checking sets GTK_NO_CHECK_CASTS --enable-debug=yes Enable all debugging support sets G_ENABLE_DEBUG --enable-debug=no (or --disable-debug) Disable all debugging support (fastest) sets G_DISABLE_ASSERT, G_DISABLE_CHECKS, and GTK_NO_CHECK_CASTS RUN TIME OPTIONS ---------------- At run time, if GTK+ was compiled with debugging enabled, different types of debugging information can be printed out. This is controlled by the: GTK_DEBUG and GDK_DEBUG environment variables --gtk-debug and --gdk-debug command line options --gtk-no-debug and --gdk-no-debug command line options First the environment variables are applied, then the command line options are applied in the order given on the command line. Each of these can either be the special value 'all', or a sequence of ':' separated options. (case is ignored). The environment variables and the --gtk-debug and --gdk-debug options add debugging options and the --gtk-no-debug and --gdk-no-debug options remove them. As noted below, some of these are useful in application debugging, but most are only interested to those debugging the libraries For instance: GDK_DEBUG_FLAGS=misc:dnd testgtk --gdk-no-debug dnd --gdk-debug events runs testgtk with the 'misc' and 'events' debugging options. GTK_DEBUG --------- Application relevant options: 'objects' - Trace the creation and destruction of objects, print out a summary at program termination Options only interesting to library maintainers: GDK_DEBUG --------- Application relevant options: 'events' - Show all events received by GTK Options only interesting to library maintainers: 'misc' - Miscellaneous information 'dnd' - Information about drag-and-drop 'color-context' - Information about the internal workings of GdkColorContext 'xim' - Information about X Input Method support - Owen Taylor 98/02/190707010001baf2000081a40000000a0000000a000000013d12d39c00000a2f0000008800000003000000000000000000000022ff350892reloc/doc/gtk/docs/developers.txtThings to care about when using/programing for GTK+ =================================================== This file is meant to collect some frequently triggered failures when programming for/with Gtk, having the spirit of a developers FAQ. It is also the correct place to list up things that programmers should care about in general. In the hope that this text might be usefull to someone, - Tim Janik 1998/02/11 Automatic destruction of widgets on removal from parent ------------------------------------------------------- This is a reference counting issue, you would want to refer to refcounting.txt on it. What are all the widget flags about? ------------------------------------ Refer to the file widget_system.txt which covers widget flags and the resulting invariants in a detailed way. GdkWindow pointers may be NULL in GdkEvents ------------------------------------------- The notification nature of the signal mechanism might cause events to be emitted that have their GdkWindow pointer set to NULL. This is due to the fact that certain events need to be emitted after the real GdkWindow of a widget is not any longer pertinent. It's up to the signal handling function (application) to check for the window field of the event structure to be != NULL, if it is going to perform any operations through Gdk calls on it. Events that a likely to trigger a missing check for the window pointer currently are (and correspond to the trailing signals): GDK_SELECTION_CLEAR GtkWidget::selection_clear_event GDK_FOCUS_CHANGE GtkWidget::focus_in_event GtkWidget::focus_out_event Events that are asured to have a valid GdkEvent.any.window field are GDK_EXPOSE GtkWidget::expose_event gtk_widget_ref() vs. gtk_object_ref() ------------------------------------- The widget referencing functions gtk_widget_ref() and gtk_widget_unref() are currently just wrappers about the corresponding referencing functions for objects. Still you should use the widget referencing functions if you are sure the referenced object is of type GTK_WIDGET_TYPE. Writing Gdk functions --------------------- When writing Gdk functions that operate on GdkWindow structures in any maeningfull sense, that is casting to a GdkWindowPrivate structure for access to fields other then GdkWindow.user_data, the programmer is recommended to check for the GdkWindowPrivate.destroyed field to be == FALSE, especially if the GdkWindowPrivate.xwindow field is used. Silent abortion of the Gdk function is the correct behaviour if this condition isn't met. 0707010001baf3000081a40000000a0000000a000000013d12d39e00002a9d000000880000000300000000000000000000001cff350892reloc/doc/gtk/docs/gdk.infoThis is gdk.info, produced by Makeinfo version 3.12f from gdk.texi. This file documents GDK, the General Drawing Kit Copyright (C) 1996 Peter Mattis Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Peter Mattis. INFO-DIR-SECTION User Interface Toolkit START-INFO-DIR-ENTRY * GDK: (gdk). The General Drawing Kit END-INFO-DIR-ENTRY  File: gdk.info, Node: Top, Next: Copying, Prev: (dir), Up: (dir) The General Drawing Kit *********************** This is edition 1.0 of the GDK documentation, 16 May 1996. * Menu: * Copying:: Your rights. * Overview:: What is GDK? * Initialization:: Initialization and exit. * Events:: Event handling. * Visuals:: Understanding and using visuals. * Windows:: Creating and using windows. * Graphics Contexts:: Creating and modifying GCs. * Pixmaps:: Creating pixmaps. * Images:: Creating images. * Color:: Specifying color. * Fonts:: Creating fonts. * Drawing:: Drawing commands. * XInput Support:: Using extended devices. * Miscellany:: Other stuff. * Examples:: Using GDK. * Function Index:: Index of functions * Concept Index:: Index of concepts  File: gdk.info, Node: Copying, Next: Overview, Prev: Top, Up: Top Copying ******* GDK is "free"; this means that everyone is free to use it and free to redestribute it on a free basis. GDK is not in the public domain; it is copyrighted and there are restrictions on its distribution, but these restrictions are designed to permit everything that a good cooperating citizen would want to do. What is not allowed is to try to prevent others from further sharing any version of GDK that they might get from you. Specifically, we want to make sure that you have the right to give away copies of GDK, that you receive source code or else can get it if you want it, that you can change GDK or use pieces of it in new free programs, and that you know you can do these things. To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of GDK, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. Also, for my own protection, we must make certain that everyone finds out that there is no warranty for GDK. If GDK is modified by someone else and passed on, we want their recipients to know that what they have is not what we distributed, so that any problems introduced by others will no reflect on our reputation. The precise conditions of the licenses for GDK are found in the General Public Licenses that accompanies it.  File: gdk.info, Node: Overview, Next: Initialization, Prev: Copying, Up: Top What is GDK? ************ GDK is designed as a wrapper library that lies on top of Xlib. It performs many common and desired operations for a programmer instead of the programmer having to explicitly ask for such functionality from Xlib directly. For example, GDK provides a common interface to both regular and shared memory XImage types. By doing so, an application can nearly transparently use the fastest image type available. GDK also provides routines for determining the best available color depth and the best available visual which is not always the default visual for a screen.  File: gdk.info, Node: Initialization, Next: Events, Prev: Overview, Up: Top Initialization and exit *********************** Initializing GDK is easy. Simply call `gdk_init' passing in the ARGC and ARGV parameters. Exit is similarly easy. Just call `gdk_exit'. - Function: void gdk_init (int *ARGC, char ***ARGV) Initializes the GDK library. The arguments ARGC and ARGV are scanned and any arguments that GDK recognizes are handled and removed. The ARGC and ARGV parameters are the values passed to `main' upon program invocation. - Function: void gdk_exit (int ERRORCODE) Exit GDK and perform any necessary cleanup. `gdk_exit' will call the systems `exit' function passing ERRORCODE as the parameter. int main (int argc, char *argv[]) { /* Initialize GDK. */ gdk_init (&argc, &argv); /* Exit from GDK...this call will never return. */ gdk_exit (0); /* Keep compiler from issuing a warning */ return 0; }  File: gdk.info, Node: Events, Next: Visuals, Prev: Initialization, Up: Top Event handling ************** Events are the means by which GDK lets the programmer know of user interaction. An event is normally a button or key press or some other indirect user action, such as a the mouse cursor entering or leaving a window. There exist only a few functions for getting events and event information. These are `gdk_events_pending', `gdk_event_get', `gdk_events_record' and `gdk_events_playback'. The latter two functions are useful for automatic testing of a software package and should normally not be needed in a program. - Function: gint gdk_events_pending (void) Returns the number of events pending on the event queue. - Function: gint gdk_event_get (GdkEvent *EVENT) Return the next available event in the EVENT structure. `gdk_event_get' will return `TRUE' on success and `FALSE' on failure. Success and failure is determined by whether an event arrived before the timeout period expired. - Function: void gdk_events_record (char *FILENAME) Turn on recording of events. User events and certain system events will be saved in the file named by the variable FILENAME. This stream of events can later be played back and "should" produce the same results as when the original events were handled. However, the programmer does need to be careful in that the state of the program must be the same when `gdk_events_record' is called and when `gdk_events_playback' is called. For this reason, `gdk_events_record' is normally not called directly, but is instead invoked indirectly by specifying the "-record" command line option. - Function: void gdk_events_playback (char *FILENAME) Start playback of events from a file. (See the above description of `gdk_events_record'). Normally this function is not called directly but is invoked by the "-playback" command line option. - Function: void gdk_events_stop (void) Stop recording and playback of events. void handle_event () { GdkEvent event; if (gdk_event_get (&event)) { switch (event.type) { ... } } }  File: gdk.info, Node: Visuals, Next: Windows, Prev: Events, Up: Top Understanding and using visuals *******************************  File: gdk.info, Node: Windows, Next: Graphics Contexts, Prev: Visuals, Up: Top Creating and using windows **************************  File: gdk.info, Node: Graphics Contexts, Next: Pixmaps, Prev: Windows, Up: Top Creating and modifying GCs **************************  File: gdk.info, Node: Pixmaps, Next: Images, Prev: Graphics Contexts, Up: Top Creating pixmaps ****************  File: gdk.info, Node: Images, Next: Color, Prev: Pixmaps, Up: Top Creating images ***************  File: gdk.info, Node: Color, Next: Fonts, Prev: Images, Up: Top Specifying color ****************  File: gdk.info, Node: Fonts, Next: Drawing, Prev: Color, Up: Top Creating Fonts **************  File: gdk.info, Node: Drawing, Next: XInput Support, Prev: Fonts, Up: Top Drawing Commands ****************  File: gdk.info, Node: XInput Support, Next: Miscellany, Prev: Drawing, Up: Top Using extended devices **********************  File: gdk.info, Node: Miscellany, Next: Examples, Prev: XInput Support, Up: Top Other stuff ***********  File: gdk.info, Node: Examples, Next: Function Index, Prev: Miscellany, Up: Top Using GDK *********  File: gdk.info, Node: Function Index, Next: Concept Index, Prev: Examples, Up: Top Variable Index ************** * Menu: * gdk_event_get: Events. * gdk_events_pending: Events. * gdk_events_playback: Events. * gdk_events_record: Events. * gdk_events_stop: Events. * gdk_exit: Initialization. * gdk_init: Initialization.  File: gdk.info, Node: Concept Index, Prev: Function Index, Up: Top Concept Index ************* * Menu: * Color: Color. * Controlling extended devices: XInput Support. * Debugging: Miscellany. * Drawing: Drawing. * Events: Events. * Examples: Examples. * Exit: Initialization. * Fonts: Fonts. * GC: Graphics Contexts. * Graphics Contexts: Graphics Contexts. * Images: Images. * Initialization: Initialization. * Miscellaneous: Miscellany. * Overview <1>: XInput Support. * Overview: Overview. * Pixmaps: Pixmaps. * Timers: Miscellany. * Using extended device capabilities: XInput Support. * Visuals: Visuals. * Windows: Windows.  Tag Table: Node: Top935 Node: Copying2001 Node: Overview3543 Node: Initialization4220 Node: Events5245 Node: Visuals7518 Node: Windows7658 Node: Graphics Contexts7799 Node: Pixmaps7940 Node: Images8060 Node: Color8166 Node: Fonts8272 Node: Drawing8375 Node: XInput Support8491 Node: Miscellany8624 Node: Examples8736 Node: Function Index8844 Node: Concept Index9334  End Tag Table 0707010001baf4000081a40000000a0000000a000000013d12d39c000029da000000880000000300000000000000000000001cff350892reloc/doc/gtk/docs/gdk.texi\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename gdk.info @settitle GDK @setchapternewpage odd @c %**end of header @set edition 1.0 @set update-date 16 May 1996 @set update-month May 1996 @ifinfo This file documents GDK, the General Drawing Kit Copyright (C) 1996 Peter Mattis Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies @ignore Permission is granted to process this file throught TeX and print the results, provided the printed document carries copying permission notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Peter Mattis. @end ifinfo @titlepage @title The General Drawing Kit @subtitle Version 1.0 @subtitle @value{update-month} @author by Peter Mattis @page @vskip 0pt plus 1filll Copyright @copyright{} 1996 Peter Mattis Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Peter Mattis. @end titlepage @dircategory User Interface Toolkit @direntry * GDK: (gdk). The General Drawing Kit @end direntry @node Top, Copying, (dir), (dir) @top The General Drawing Kit @ifinfo This is edition @value{edition} of the GDK documentation, @w{@value{update-date}}. @end ifinfo @menu * Copying:: Your rights. * Overview:: What is GDK? * Initialization:: Initialization and exit. * Events:: Event handling. * Visuals:: Understanding and using visuals. * Windows:: Creating and using windows. * Graphics Contexts:: Creating and modifying GCs. * Pixmaps:: Creating pixmaps. * Images:: Creating images. * Color:: Specifying color. * Fonts:: Creating fonts. * Drawing:: Drawing commands. * XInput Support:: Using extended devices. * Miscellany:: Other stuff. * Examples:: Using GDK. * Function Index:: Index of functions * Concept Index:: Index of concepts @end menu @node Copying, Overview, Top, Top @comment node-name, next, previous, up @chapter Copying GDK is @dfn{free}; this means that everyone is free to use it and free to redestribute it on a free basis. GDK is not in the public domain; it is copyrighted and there are restrictions on its distribution, but these restrictions are designed to permit everything that a good cooperating citizen would want to do. What is not allowed is to try to prevent others from further sharing any version of GDK that they might get from you. Specifically, we want to make sure that you have the right to give away copies of GDK, that you receive source code or else can get it if you want it, that you can change GDK or use pieces of it in new free programs, and that you know you can do these things. To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of GDK, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. Also, for my own protection, we must make certain that everyone finds out that there is no warranty for GDK. If GDK is modified by someone else and passed on, we want their recipients to know that what they have is not what we distributed, so that any problems introduced by others will no reflect on our reputation. The precise conditions of the licenses for GDK are found in the General Public Licenses that accompanies it. @node Overview, Initialization, Copying, Top @comment node-name, next, previous, up @chapter What is GDK? @cindex Overview GDK is designed as a wrapper library that lies on top of Xlib. It performs many common and desired operations for a programmer instead of the programmer having to explicitly ask for such functionality from Xlib directly. For example, GDK provides a common interface to both regular and shared memory XImage types. By doing so, an application can nearly transparently use the fastest image type available. GDK also provides routines for determining the best available color depth and the best available visual which is not always the default visual for a screen. @node Initialization, Events, Overview, Top @comment node-name, next, previous, up @chapter Initialization and exit @cindex Initialization @cindex Exit Initializing GDK is easy. Simply call @code{gdk_init} passing in the @var{argc} and @var{argv} parameters. Exit is similarly easy. Just call @code{gdk_exit}. @deftypefun void gdk_init (int *@var{argc}, char ***@var{argv}) Initializes the GDK library. The arguments @var{argc} and @var{argv} are scanned and any arguments that GDK recognizes are handled and removed. The @var{argc} and @var{argv} parameters are the values passed to @code{main} upon program invocation. @end deftypefun @deftypefun void gdk_exit (int @var{errorcode}) Exit GDK and perform any necessary cleanup. @code{gdk_exit} will call the systems @code{exit} function passing @var{errorcode} as the parameter. @end deftypefun @example int main (int argc, char *argv[]) @{ /* Initialize GDK. */ gdk_init (&argc, &argv); /* Exit from GDK...this call will never return. */ gdk_exit (0); /* Keep compiler from issuing a warning */ return 0; @} @end example @node Events, Visuals, Initialization, Top @comment node-name, next, previous, up @chapter Event handling @cindex Events Events are the means by which GDK lets the programmer know of user interaction. An event is normally a button or key press or some other indirect user action, such as a the mouse cursor entering or leaving a window. There exist only a few functions for getting events and event information. These are @code{gdk_events_pending}, @code{gdk_event_get}, @code{gdk_events_record} and @code{gdk_events_playback}. The latter two functions are useful for automatic testing of a software package and should normally not be needed in a program. @deftypefun gint gdk_events_pending (void) Returns the number of events pending on the event queue. @end deftypefun @deftypefun gint gdk_event_get (GdkEvent *@var{event}) Return the next available event in the @var{event} structure. @code{gdk_event_get} will return @code{TRUE} on success and @code{FALSE} on failure. Success and failure is determined by whether an event arrived before the timeout period expired. @end deftypefun @deftypefun void gdk_events_record (char *@var{filename}) Turn on recording of events. User events and certain system events will be saved in the file named by the variable @var{filename}. This stream of events can later be played back and ``should'' produce the same results as when the original events were handled. However, the programmer does need to be careful in that the state of the program must be the same when @code{gdk_events_record} is called and when @code{gdk_events_playback} is called. For this reason, @code{gdk_events_record} is normally not called directly, but is instead invoked indirectly by specifying the ``-record'' command line option. @end deftypefun @deftypefun void gdk_events_playback (char *@var{filename}) Start playback of events from a file. (See the above description of @code{gdk_events_record}). Normally this function is not called directly but is invoked by the ``-playback'' command line option. @end deftypefun @deftypefun void gdk_events_stop (void) Stop recording and playback of events. @end deftypefun @example void handle_event () @{ GdkEvent event; if (gdk_event_get (&event)) @{ switch (event.type) @{ @dots{} @} @} @} @end example @node Visuals, Windows, Events, Top @comment node-name, next, previous, up @chapter Understanding and using visuals @cindex Visuals @node Windows, Graphics Contexts, Visuals, Top @comment node-name, next, previous, up @chapter Creating and using windows @cindex Windows @node Graphics Contexts, Pixmaps, Windows, Top @comment node-name, next, previous, up @chapter Creating and modifying GCs @cindex Graphics Contexts @cindex GC @node Pixmaps, Images, Graphics Contexts, Top @comment node-name, next, previous, up @chapter Creating pixmaps @cindex Pixmaps @node Images, Color, Pixmaps, Top @comment node-name, next, previous, up @chapter Creating images @cindex Images @node Color, Fonts, Images, Top @comment node-name, next, previous, up @chapter Specifying color @cindex Color @node Fonts, Drawing, Color, Top @comment node-name, next, previous, up @chapter Creating Fonts @cindex Fonts @node Drawing, XInput Support, Fonts, Top @comment node-name, next, previous, up @chapter Drawing Commands @cindex Drawing @node XInput Support, Miscellany, Drawing, Top @comment node-name, next, previous, up @chapter Using extended devices @cindex Overview @cindex Using extended device capabilities @cindex Controlling extended devices @node Miscellany, Examples, XInput Support, Top @comment node-name, next, previous, up @chapter Other stuff @cindex Timers @cindex Debugging @cindex Miscellaneous @node Examples, Function Index, Miscellany, Top @comment node-name, next, previous, up @chapter Using GDK @cindex Examples @node Function Index, Concept Index, Examples, Top @comment node-name, next, previous, up @unnumbered Variable Index @printindex fn @node Concept Index, , Function Index, Top @comment node-name, next, previous, up @unnumbered Concept Index @printindex cp @summarycontents @contents @bye 0707010001baf5000081a40000000a0000000a000000013d12d39c0000118a0000008800000003000000000000000000000022ff350892reloc/doc/gtk/docs/generation.txtOverview: ======== This file describes the way that autogeneration works within the GTK+ source code. The following files in the gdk/ subdirectory are autogenerated: gdkkeysyms.h gdkcursors.h The following files in the gtk/ subdirectory are autogenerated: gtk.defs Description of GTK+ types (and some functions) in a lisp-style format. gtktypebuiltins.h Header file including declarations for internal types gtktypebuiltins_vars.c Variables for type values for internal types. gtktypebuiltins_ids.c Arrays holding information about each internal type. gtktypebuiltins_evals.c Arrays holding mapping between enumeration values and strings. gtkmarshal.c gtkmarshal.h Autogenerated signal marshallers GDK === gdkkeysyms.h and gdkcursors.h are generated from the corresponding header files X11/cursorfont.h X11/keysymdef.h by some simple sed scripts. These are not actually run automatically because we want all the keysyms even on systems with a limited set. So the Gdk rule to generate both files (X-derived-headers) only needs to be rerun for every new release of the X Window System. GTK+ - type definitions ======================= The type definitions are generated from several sources: gtk-boxed.defs - definitions for boxed types GTK+ header files GDK header files The makeenums.pl script does a heuristic parse of the header files and extracts all enumerations declarations. It also recognizes a number of pseudo-comments in the header files: Two of these apply to individual enumeration values: /*< skip >*/ This enumeration value should be skipped. /*< nick=NICK >*/ The nickname for this value should NICK instead of the normally guessed value. For instance: typedef enum { GTK_TARGET_SAME_APP = 1 << 0, /*< nick=same-app >*/ GTK_TARGET_SAME_WIDGET = 1 << 1 /*< nick=same-widget >*/ } GtkTargetFlags; makes the nicks "same-app" and "same-widget", instead of "app" and "widget" that would normally be used. The other two apply to entire enumeration declarations. /*< prefix=PREFIX >*/ Specifies the prefix to be removed from the enumeration values to generate nicknames. /*< flags >*/ Specifies that this enumeration is used as a bitfield. (makenums.pl normally guesses this from the presence of values with << operators). For instance: typedef enum /*< flags >*/ { GDK_IM_PREEDIT_AREA = 0x0001, GDK_IM_PREEDIT_CALLBACKS = 0x0002, [ ... ] } GdkIMStyle; makeenums.pl can be run into two modes: 1) Generate the gtktypebuiltins_eval.c file (this contains arrays holding the mapping of string <=> enumeration value) 2) Generate the enumeration portion of gtk.defs. The enumearation portion is added to the boxed type declarations in gtk-boxed.defs to create gtk.defs. The makeetypes.awk program takes the gtk.defs file, and from that generates various files depending on the third parameter passed to it: macros: gtktypebuiltins.h variables: gtktypebuiltins_vars.c entries: gtktypebuiltins_ids.c GTK+ - marshallers ================== The files gtkmarshal.c and gtkmarshal.h include declarations and definitions for the marshallers needed inside of GTK+. The marshallers to be generated are listed in the file gtkmashal.list, which is processed by genmarshal.pl. The format of this file is a list of lines: :,, e.g.: BOOL:POINTER,STRING,STRING,POINTER A marshaller is generated for each line in the file. The possible types are: NONE BOOL CHAR INT UINT LONG ULONG FLOAT DOUBLE STRING ENUM FLAGS BOXED POINTER OBJECT FOREIGN (gpointer data, GtkDestroyNotify notify) C_CALLBACK (GtkFunction func, gpointer func_data) SIGNAL (GtkSignalFunc f, gpointer data) ARGS (gint n_args, GtkArg *args) CALLBACK (GtkCallBackMarshal marshall, gpointer data, GtkDestroyNotify Notify) Some of these types map to multiple return values - these are marked above with the return types in parantheses. NOTES ===== When autogenerating GTK+ files, the autogenerated files are often rebuild resulting in the same result. To prevent unecessary rebuilds of the entire directory, some files that multiple other source files depend on are not actually written to directly. Instead, an intermediate file is written, which is then compared to the old file, and only if it is different is it copied into the final location. 0707010001baf6000081a40000000a0000000a000000013d12d39e0000075e0000008800000003000000000000000000000020ff350892reloc/doc/gtk/docs/gtk-config.1.TH GTK+ 1 "25 October 1998" Version 1.2.10 .SH NAME gtk-config - script to get information about the installed version of GTK+ .SH SYNOPSIS .B gtk-config [\-\-prefix\fI[=DIR]\fP] [\-\-exec\-prefix\fI[=DIR]\fP] [\-\-version] [\-\-libs] [\-\-cflags] .SH DESCRIPTION .PP \fIgtk-config\fP is a tool that is used to configure to determine the compiler and linker flags that should be used to compile and link programs that use \fIGTK+\fP. It is also used internally to the .m4 macros for GNU autoconf that are included with \fIGTK+\fP. . .SH OPTIONS .l \fIgtk-config\fP accepts the following options: .TP 8 .B \-\-version Print the currently installed version of \fIGTK+\fP on the standard output. .TP 8 .B \-\-libs Print the linker flags that are necessary to link a \fIGTK+\fP program. .TP 8 .B \-\-cflags Print the compiler flags that are necessary to compile a \fIGTK+\fP program. .TP 8 .B \-\-prefix=PREFIX If specified, use PREFIX instead of the installation prefix that \fIGTK+\fP was built with when computing the output for the \-\-cflags and \-\-libs options. This option is also used for the exec prefix if \-\-exec\-prefix was not specified. This option must be specified before any \-\-libs or \-\-cflags options. .TP 8 .B \-\-exec\-prefix=PREFIX If specified, use PREFIX instead of the installation exec prefix that \fIGTK+\fP was built with when computing the output for the \-\-cflags and \-\-libs options. This option must be specified before any \-\-libs or \-\-cflags options. .SH SEE ALSO .BR gimp (1), .BR gimptool (1) .SH COPYRIGHT Copyright \(co 1998 Owen Taylor Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. 0707010001baf7000081a40000000a0000000a000000013d12d39c000007610000008800000003000000000000000000000023ff350892reloc/doc/gtk/docs/gtk-config.1.in.TH GTK+ 1 "25 October 1998" Version @VERSION@ .SH NAME gtk-config - script to get information about the installed version of GTK+ .SH SYNOPSIS .B gtk-config [\-\-prefix\fI[=DIR]\fP] [\-\-exec\-prefix\fI[=DIR]\fP] [\-\-version] [\-\-libs] [\-\-cflags] .SH DESCRIPTION .PP \fIgtk-config\fP is a tool that is used to configure to determine the compiler and linker flags that should be used to compile and link programs that use \fIGTK+\fP. It is also used internally to the .m4 macros for GNU autoconf that are included with \fIGTK+\fP. . .SH OPTIONS .l \fIgtk-config\fP accepts the following options: .TP 8 .B \-\-version Print the currently installed version of \fIGTK+\fP on the standard output. .TP 8 .B \-\-libs Print the linker flags that are necessary to link a \fIGTK+\fP program. .TP 8 .B \-\-cflags Print the compiler flags that are necessary to compile a \fIGTK+\fP program. .TP 8 .B \-\-prefix=PREFIX If specified, use PREFIX instead of the installation prefix that \fIGTK+\fP was built with when computing the output for the \-\-cflags and \-\-libs options. This option is also used for the exec prefix if \-\-exec\-prefix was not specified. This option must be specified before any \-\-libs or \-\-cflags options. .TP 8 .B \-\-exec\-prefix=PREFIX If specified, use PREFIX instead of the installation exec prefix that \fIGTK+\fP was built with when computing the output for the \-\-cflags and \-\-libs options. This option must be specified before any \-\-libs or \-\-cflags options. .SH SEE ALSO .BR gimp (1), .BR gimptool (1) .SH COPYRIGHT Copyright \(co 1998 Owen Taylor Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. 0707010001baf8000081a40000000a0000000a000000013d12d39c00001b9b0000008800000003000000000000000000000022ff350892reloc/doc/gtk/docs/gtk-config.txtCONFIGURING PACKAGES TO WORK WITH GTK ------------------------------------- Compiling a program succesfully against the GTK, GDK, and GLIB libraries can require a large number of command line options to your compiler and linker that are hard to guess correctly. The additional libraries required may, for example, depend on the manner which GTK was configured Several tools are included in this package to make process easier. First, there is the shell script 'gtk-config' (installed in $exec_prefix/bin): Invoking gtk-config ------------------- gtk-config takes the following flags: --version Prints out the version of GTK installed --cflags Prints '-I' flags pointing to the installed header files. --libs Prints out the linker flags necessary to link a program against GTK --prefix[=PREFIX] If PREFIX is specified, overrides the configured value of $prefix. (And of exec-prefix, unless --exec-prefix is also specified) Otherwise, prints out the configured value of $prefix --exec-prefix[=PREFIX] If PREFIX is specified, overrides the configured value of $exec_prefix. Otherwise, prints out the configured value of $exec_prefix You may also add to the command line a list of additional libraries that gtk-config should supply the CFLAGS and LIBS for. The only currently supported library is 'gthread'. As an example of this latter usage, you can get the appropriate cflags for a threaded program with: gtk-config --cflags gthread Example of using gtk-config --------------------------- Typically, gtk-config will be used within a configure script, as described below. It, however, can also be used directly from the command line to compile a simple program. For example: cc -o simple `gtk-config --cflags` simple.c `gtk-config --libs` This command line might expand to (for example): cc -o simple -I/usr/local/lib/glib/include -I/usr/local/include \ -I/usr/X11R6/include simple.c -L/usr/local/lib -L/usr/X11R6/lib \ -lgtk -lgdk -lglib -lXi -lXext -lX11 -lm Not only is the form using gtk-config easier to type, it will work on any system, no matter how GTK was configured. AM_PATH_GTK ----------- For packages configured using GNU automake, GTK also provides a macro to automate the process of running GTK. AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) This macro: * Determines the location of GTK using gtk-config, which is either found in the user's path, or from the environment variable GTK_CONFIG * Tests the installed libraries to make sure that there version is later than MINIMUM-VERSION. (A default version will be used if not specified) * If the required version was found, sets the GTK_CFLAGS variable to the output of `gtk-config --cflags` and the GTK_LIBS variable to the output of `gtk-config --libs`, and calls AC_SUBST() for these variables so they can be used in generated makefiles, and then executes ACTION-IF-FOUND. * If the required version was not found, sets GTK_CFLAGS and GTK_LIBS to empty strings, and executes ACTION-IF-NOT-FOUND. This macro is in file 'gtk.m4' which is installed in $datadir/aclocal. Note that if automake was installed with a different --prefix than GTK, you will either have to manually move gtk.m4 to automake's $datadir/aclocal, or give aclocal the -I option when running it. Configuring a package that uses AM_PATH_GTK ------------------------------------------- Simply make sure that gtk-config is in your path, and run the configure script. Notes: * The directory where the GTK libraries are installed needs to be found by your system's dynamic linker. This is generally done by editing /etc/ld.so.conf and running ldconfig Or by: setting the environment variable LD_LIBRARY_PATH, or, as a last resort, Giving a -R or -rpath flag (depending on your linker) when running configure, for instance: LDFLAGS=-R/usr/home/owen/lib ./configure * You can also specify a gtk-config not in your path by setting the GTK_CONFIG environment variable to the name of the executable * If you move the GTK package from its installed location, you will need either need to modify gtk-config script manually to point to the new location or rebuild GTK. Advanced note: * configure flags --with-gtk-prefix=PREFIX --with-gtk-exec-prefix=PREFIX are provided to override the prefix and exec-prefix that were stored in the gtk-config shell script by GTK's configure. You are generally better off configuring GTK with the right path to begin with. Example of a package using AM_PATH_GTK -------------------------------------- The following shows how to build a simple package using automake and the AM_PATH_GTK macro. The program used here is the testinput.c You should first read the introductory portions of the automake Manual, if you are not already familiar with it. Two files are needed, 'configure.in', which is used to build the configure script: ==configure.in=== dnl Process this file with autoconf to produce a configure script. AC_INIT(testinput.c) AM_INIT_AUTOMAKE(testinput.c, 1.0.0) AC_PROG_CC AM_PROG_CC_STDC AC_PROG_INSTALL AM_PATH_GTK(0.99.5, [LIBS="$LIBS $GTK_LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS"], AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?)) AC_OUTPUT(Makefile) ================= The only command in this which is not standard for automake is the AM_PATH_GTK() macro. That command does the following: If a GTK version greater than 0.99.5 is found, adds $GTK_LIBS to $LIBS and $GTK_CFLAGS to $CFLAGS. Otherwise, dies with the error message "Cannot find GTK: Is gtk-config in path?" And the 'Makefile.am', which will be used to build the Makefile. == Makefile.am == bin_PROGRAMS = testinput testinput_SOURCES = testinput.c ================= This Makefile.am, says that we are building a single executable, from a single sourcefile 'testinput.c'. Since every program we are building uses GTK we simply added the GTK options to $LIBS and $CFLAGS, but in other circumstances, we might want to specify them on a per-program basis: for instance by adding the lines: testinput_LDADD = $(GTK_LIBS) INCLUDES = $(GTK_CFLAGS) to the Makefile.am. To try this example out, create a new directory, add the two files above two it, and copy the testinput.c file from the gtk/ subdirectory to the new directory. Edit the line: #include "gtk.h" in testgtk.c, to read: #include Now execute the following commands: automake --add-missing aclocal autoconf You now have a package that can be built in the normal fashion ./configure make make install Notes: * If you are converting a package that used a pre-1.0 version of GTK, you should remove the autoconf tests for X. The results of these tests are included in gtk-config and will be added to GTK_LIBS and GTK_CFLAGS by the AM_PATH_GTK macro. Owen Taylor 14 Mar 1997 0707010001baf9000081a40000000a0000000a000000013d12d39e00000f34000000880000000300000000000000000000001cff350892reloc/doc/gtk/docs/gtk.infoThis is gtk.info, produced by makeinfo version 4.0 from gtk.texi. This file documents GTK, the GIMP Toolkit Copyright (C) 1996 Peter Mattis Copyright (C) 1997 Peter Mattis Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Peter Mattis. INFO-DIR-SECTION User Interface Toolkit START-INFO-DIR-ENTRY * GTK: (gtk). The GIMP Toolkit END-INFO-DIR-ENTRY  Indirect: gtk.info-1: 951 gtk.info-2: 49892 gtk.info-3: 99071 gtk.info-4: 148335 gtk.info-5: 198100 gtk.info-6: 205443  Tag Table: (Indirect) Node: Top951 Node: Copying1763 Node: Overview3304 Node: Types4863 Node: Type introduction6005 Node: Basics13817 Node: Simple types22149 Node: Enumerations and flags24087 Node: Strings24232 Node: Boxed types24346 Node: Callbacks24455 Node: Composite types24568 Node: Objects24673 Node: Signals29743 Node: Widgets44534 Node: GtkAlignment49892 Node: GtkArrow53128 Node: GtkAspectFrame55432 Node: GtkBin57059 Node: GtkBox58308 Node: GtkButtonBox64554 Node: GtkButton69362 Node: GtkCheckButton71306 Node: GtkCheckMenuItem73065 Node: GtkCList74980 Node: GtkColorSelection82329 Node: GtkCombo84750 Node: GtkContainer86360 Node: GtkCTree89081 Node: GtkCurve93580 Node: GtkGammaCurve95161 Node: GtkDialog96571 Node: GtkDrawingArea97717 Node: GtkEntry99071 Node: GtkEventBox102253 Node: GtkFileSelection103307 Node: GtkFixed104632 Node: GtkFrame105768 Node: GtkGamma107107 Node: GtkHBox108041 Node: GtkHButtonBox109504 Node: GtkHPaned110839 Node: GtkHRuler111771 Node: GtkHScale112731 Node: GtkHScrollbar113716 Node: GtkHSeparator114761 Node: GtkImage115784 Node: GtkInputDialog116988 Node: GtkItem118232 Node: GtkLabel119256 Node: GtkList120586 Node: GtkListItem122588 Node: GtkMenu123945 Node: GtkMenuBar125539 Node: GtkMenuItem126813 Node: GtkMenuShell128845 Node: GtkMisc130092 Node: GtkNotebook131106 Node: GtkOptionMenu133060 Node: GtkPaned134464 Node: GtkPixmap135498 Node: GtkPreview136621 Node: GtkProgressBar138898 Node: GtkRadioButton140155 Node: GtkRadioMenuItem141715 Node: GtkRange143082 Node: GtkRuler145167 Node: GtkScale146364 Node: GtkScrollbar147531 Node: GtkScrolledWindow148335 Node: GtkSeparator149944 Node: GtkStatusbar150751 Node: GtkTable151915 Node: GtkText153975 Node: GtkToggleButton155713 Node: GtkToolbar157620 Node: GtkTooltips160074 Node: GtkTree161531 Node: GtkTreeItem163489 Node: GtkVBox165150 Node: GtkVButtonBox166656 Node: GtkViewport167989 Node: GtkVPaned169372 Node: GtkVRuler170330 Node: GtkVScale171286 Node: GtkVScrollbar172267 Node: GtkVSeparator173362 Node: GtkWidget174366 Node: GtkWindow181074 Node: Other Objects186613 Node: GtkAcceleratorTable187007 Node: GtkAdjustment188204 Node: GtkGC189187 Node: GtkData189526 Node: GtkStyle190224 Node: Miscellaneous190376 Node: Initialization and exit190957 Node: Customization192513 Node: Menu Factories193639 Node: Tree Factories193796 Node: Tool Tips193949 Node: Resource Files194121 Node: Standard Macros194255 Node: Examples195887 Node: Simple196244 Node: Hello World198100 Node: Hello World II198764 Node: Hello World III199666 Node: Object Implementation200887 Node: Signal Implementation205144 Node: Widget Implementation205297 Node: Function Index205443 Node: Concept Index250665  End Tag Table 0707010001bafa000081a40000000a0000000a000000013d12d39e0000c2e4000000880000000300000000000000000000001eff350892reloc/doc/gtk/docs/gtk.info-1This is gtk.info, produced by makeinfo version 4.0 from gtk.texi. This file documents GTK, the GIMP Toolkit Copyright (C) 1996 Peter Mattis Copyright (C) 1997 Peter Mattis Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Peter Mattis. INFO-DIR-SECTION User Interface Toolkit START-INFO-DIR-ENTRY * GTK: (gtk). The GIMP Toolkit END-INFO-DIR-ENTRY  File: gtk.info, Node: Top, Next: Copying, Prev: (dir), Up: (dir) The GIMP Toolkit **************** This is edition 1.0 of the GTK documentation, 23 August 1998. * Menu: * Copying:: Your rights. * Overview:: What is GTK? * Types:: * Objects:: * Signals:: Signals overview. * Widgets:: Widget overview. * Other Objects:: Utility objects. * Miscellaneous:: Initialization, exit and other features. * Examples:: Using GTK. * Object Implementation:: Object internals. * Signal Implementation:: Signal internals. * Widget Implementation:: Widget internals. * Function Index:: Index of functions. * Concept Index:: Index of concepts.  File: gtk.info, Node: Copying, Next: Overview, Prev: Top, Up: Top Copying ******* GTK is "free"; this means that everyone is free to use it and free to redistribute it on a free basis. GTK is not in the public domain; it is copyrighted and there are restrictions on its distribution, but these restrictions are designed to permit everything that a good cooperating citizen would want to do. What is not allowed is to try to prevent others from further sharing any version of GTK that they might get from you. Specifically, we want to make sure that you have the right to give away copies of GTK, that you receive source code or else can get it if you want it, that you can change GTK or use pieces of it in new free programs, and that you know you can do these things. To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of GTK, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. Also, for our own protection, we must make certain that everyone finds out that there is no warranty for GTK. If GTK is modified by someone else and passed on, we want their recipients to know that what they have is not what we distributed, so that any problems introduced by others will no reflect on our reputation. The precise conditions of the licenses for GTK are found in the General Public Licenses that accompany it.  File: gtk.info, Node: Overview, Next: Types, Prev: Copying, Up: Top What is GTK? ************ GTK is a library for creating graphical user interfaces similar to the Motif "look and feel". It is designed to be small and efficient, but still flexible enough to allow the programmer freedom in the interfaces created. GTK allows the programmer to use a variety of standard user interface widgets (*note Widgets::) such as push, radio and check buttons, menus, lists and frames. It also provides several "container" widgets which can be used to control the layout of the user interface elements. GTK provides some unique features. (At least, I know of no other widget library which provides them). For example, a button does not contain a label, it contains a child widget, which in most instances will be a label. However, the child widget can also be a pixmap, image or any combination possible the programmer desires. This flexibility is adhered to throughout the library. To make life easier for you, GTK presents this flexibility in a uniform framework. Specifically, it implements its own support for object oriented programming that is well adapted to the purposes of a user interface toolkit and it aims at providing a reasonable sane and disciplined programming interface. This uniformity and discipline is intended to make it easy and reliable to access GTK from languages other than C. Especially more dynamic languages like Perl, Python or Scheme will find amble support, and in fact, bindings to these languages already exist.  File: gtk.info, Node: Types, Next: Objects, Prev: Overview, Up: Top Types ***** Other kid's games are all such a bore! They've gotta have rules and they gotta keep score! - Calvin about CalvinBall(tm) GTK implements a semi-simple type system with an associated class mechanism for widgets and several other useful objects. This type system is intended to be general enough to allow both a smooth binding of dynamically typed languages to Gtk, as well as to serve for a rigorous and formalistic definition of the larger part of the Gtk API. The classes for the individual widgets are by far the most important part of this type system, but before we get to them, we describe the basics of the type system itself. This is mostly of interest for widget writers and language binders, so you might want to skip ahead to the next chapter, which talks about the object oriented stuff. * Menu: * Type introduction:: * Basics:: * Simple types:: * Enumerations and flags:: * Strings:: * Boxed types:: * Callbacks:: * Composite types::  File: gtk.info, Node: Type introduction, Next: Basics, Prev: Types, Up: Types Introduction to the Type System =============================== Gtk defines its own system of types, much like a computer language defines what types it supports. Of course, the Gtk type system is build on top of the types that C provides, so it includes members like `int', `long' and `float'. But, compared to C, it allows only few carefully selected types and specifies a lot of restrictions on the way you can use values of these types. For example, there is no general facility for specifying _pointer to X_. Instead, we take a more higher level approach and define such things as `string', which is just like a `char*' but with additional rules about how to manage the memory that it points to. The type system has two purposes: to define a formal system with which to describe the various exported features of Gtk; and to implement this system at run-time so that we get sound and flexible "dynamic" types for the dynamic languages that want to interface with Gtk. Let me restate this with different words, because I think it is important to understand this idea. We will see in a moment that the type system is indeed well defined and all this detail is implemented with functions and data structures in Gtk. For example, every type (and there can be any number of them) can be represented with a unique integer and Gtk has support for the necessary bookkeeping for this. Every type also has a name and there are functions for converting between the name of a type and its unique number. Maybe more useful, there is a big discriminated union that can be used to pass around a value of any representable type, together with its precise type. This is the run-time or dynamic side of the type system. Mostly, you do not need to use it when you don't want to. The compile-time or static side of the type system can is used to statically define the programming interface of Gtk. For example, suppose there is function `gtk_foo' in the Gtk API that has a prototype char *gtk_foo (char *); This looks like it does something with strings. But what does it do with the memory of the string that has been passed in, and what are we supposed or allowed to do with the memory that the returned pointer points to? The more restricted type `string' from the Gtk type system can be used to be more precise. In fact, the definition of `string' below includes the rule that when a `string' is passed to a function, that function is not allowed to retain a pointer into the string beyond the life time of that function call. So we are safe to deallocate it or override it when the function has returned. Likewise, the definition specifies that the memory of a `string' that is returned from a function becomes the sole property of the calling function. The calling function is responsible for deallocating it eventually and it can be sure that nobody else scribbles in it. When `gtk_foo' really obeys these rules, we can say that it takes one argument, which is a `string', and it returns a `string'. Now we can understand why it makes sense to have a more restrictive type system than that of C. With it, it is possible to be more precise and we actually have a framework where we can be sure that as long as we stay inside this framework we are not gratuitously causing trouble for languages that are more disciplined than C. Of course, you are not restricted to making all your interfaces expressible within the framework. There are valid reasons for breaking it, for performance or simply for convenience. But please try to provide all the functionality of your module in such a way that it can be described with this type system and treat the non-conforming functions as additional goodies that are nice to have but not essential. The reward is an instant accessibility of your code from a huge number of scripting and extension languages such as Perl, Python, and Guile. These formal specifications of the Gtk interface are contained in special declarations in the header files of Gtk. They are ignored by the C compiler, but can be used by other language processors. For extra convenience, these declarations are also available in a more condensed form that is easier to parse. Tools for generating bindings of Gtk to other languages can read these declarations and--because all the important details are defined--automatically generate the bulk of the needed glue code. It is also possible to feed these declarations into a running application (an interface builder, say) and thus make it aware of new widgets and functions without recompiling anything. The run-time side of the type system is also somewhat introspective. This means that you can query Gtk about all the members of an enumeration for example. Gtk provides tools that help you provide this introspection for your definitions also. Types are not enough to completely specify an interface, so GTK also has "modes". A mode specifies what happens to a value when it crosses a module boundary; it can be `in', `out', or `inout'. Most fundamental types (and their derived types) support only mode `in'. The modes `out' and `inout' can only be used with the composite types: lists and vectors. When argument of these types are marked as `out' or `inout' it means that the called module is allowed to change the contents of the composite value and that these changes need to be propagated back to the originator of the value. Mode `out' means that the argument has no meaningful value at the beginning and should not be read. Mode `in' specifies that the called module is not allowed to change the value in any way. The type system allows for an unbounded number of types. Every widget is a type for example and you can add new widget types at any time without confusing the run-time implementation of the type system. Nevertheless, all types are derived from a certain "fundamental" type, and there are only a small and finite number of fundamental types. We only specify rules for the fundamental types and all other types inherit these rules from their fundamental type. For example, `int' is a fundamental type, as is `GtkObject'. All widgets derive from `GtkObject' and so the rules for `GtkObject' apply to all widgets as well. This derivation defines a type hierarchy, but this hierarchy is not completely general. You can't derive from `int' for example, and you can only have one level of derivation from `enum'. The fundamental type `GtkObject', however, is the basis for the large and deep hierarchy of widget types. The individual fundamental types are defined and explained in the following sections. Here is a complete list of them: `none' The not-a-value type, similar to `void'. `char' A character. Internationalization issues are still undecided. `bool' True or false. `byte, ubyte, int, uint, long, ulong, float, double' The usual assortment of scalar types. `string' A string. Internationalization issues are still undecided. `enum, flags' Enumerations with a fixed set of literals. Either used to express a single choice from this set or to individually turn on and off several flags. `boxed' A pointer to an opaque structure that can be copied and destroyed. `callback' A pointer to a function with enough extra information so that it can also be used for functions written in languages completely different from C. `GtkObject' A pointer to a GtkObject or derived type. The fun starts here. `args, slist, dlist, cvec, tvec' An assortment of composite types like linked lists and counted or zero-terminated arrays. `pointer, signal, c_callback' Obsolete types.  File: gtk.info, Node: Basics, Next: Simple types, Prev: Type introduction, Up: Types Basic Concepts ============== The basis for the type system are the fundamental types. At run-time, they are represented by members of the `GtkFundamentalType' enumeration. For the static declarations, they are identified with a unique name. - Enumeration: GtkFundamentalType This enumeration contains a member for each defined fundamental type. Most members are listed along with the description of their semantics, but one is listed here: `GTK_TYPE_INVALID' No valid type is derived from this. Use `GTK_TYPE_INVALID' to express exceptional situations. This member does not really correspond to a fundamental type and thus there is no name for it. - Data type: GtkType The type `GtkType' holds the run-time representation of a type. It is an integer of a certain size. The follwing macros are defined to access the basic properties of a `GtkType': - Macro: unsigned int GTK_TYPE_SEQNO (GtkType type) Returns the sequence number of TYPE. The sequence numbers are guaranteed to be dense, i.e., you can use them to index a table and the table need not be much larger than the number of different GtkTypes that you might encounter. - Macro: GtkFundamentalType GTK_FUNDAMENTAL_TYPE (GtkType type) Returns the fundamental type of TYPE. Both macros simply access different bit-fields of a `GtkType', so they are very efficient. New types are registered with the `gtk_type_unique' function. Any kind oftype can be registered with `gtk_type_unique' but there are convenience functions for most fundamental types. Each fundamental type has its own interpretation of the rules below and these convenience functions should be used to automatically get the type registration right. So, don't be put off by the apparent complexity of the interface to `gtk_type_unique'. You will be using it only for new widgets, and there the rules are simple. The `GtkTypeInfo' structure is used to communicate information to `gtk_type_unique' as opposed to passing in large numbers of parameters. typedef struct _GtkTypeInfo GtkTypeInfo; struct _GtkTypeInfo { gchar *type_name; guint object_size; guint class_size; GtkClassInitFunc class_init_func; GtkObjectInitFunc object_init_func; gpointer reserved_1; gpointer reserved_2; GtkClassInitFunc base_class_init_func; } * The `type_name' field refers to the name of the type. This is the same name that is used in the static definitions. It is convention for the type name to be closely related to the name of the underlying C type. For example, the type name of the `GtkObject' structure is "GtkObject", and the name of the `GtkWindowType' enumeration is "GtkWindowType". Note that the C type corresponding to "GtkObject" is really a pointer to a `GtkObject' struct, but the name has no "*" in it. * The `object_size' field refers to the size in bytes of the C structure for types that have such a structure. The easiest (and portable) means of computing this size is by using the C `sizeof' operator. For instance, the sizeof of the `GtkObject' structure is computed by doing `sizeof (GtkObject)'. When the type has no associated structure or when you do not want to support the `gtk_type_new' function for the new type, set `object_size' to 0. Only types derived from GTK_TYPE_OBJECT can be handled by `gtk_type_new', anyway. * The `class_size' field refers to the size in bytes of the C structure for the class. Again, the `sizeof' operator should be used to compute this value. If you don't want to have a class structure for this type, set the field to 0. `gtk_type_class' will then always return `NULL'. * The `class_init_func' and `base_class_init_func' fields are callbacks which are used by the type mechanism to initialize class specific fields. The single argument these functions take is a pointer to a class structure. When you do not need one or both of them, set the corresponding field to `NULL'. The `class_init_func' will be called at most once, right after the class structure of size `class_size' has been allocated. The interaction between `class_init_func' and `base_class_init_func' is only really useful for the full-fledged object system. It is described there *note Objects::. * The `object_init_func' field is a callback which is used by the type mechanism to initialize object specific fields for structures that have been allocated via `gtk_type_new'. The single argument this functions takes is a pointer to an object structure. If you do not want any special object initialization to take place, set this to `NULL'. All object initialization functions for all types that are part of the inheritance chain are called, starting with the most basic type. - Function: guint gtk_type_unique (GtkType PARENT_TYPE, GtkTypeInfo *TYPE_INFO) The PARENT_TYPE is simply the new types parent type. If PARENT_TYPE is GTK_TYPE_INVALID, then the new type is a new fundamental type. You should never register new fundamental types. TYPE_INFO is a pointer to a structure which contains necessary information for construction of the new type. You can only register a specific name once. - Function: gchar* gtk_type_name (GtkType TYPE) The returned string is the name of TYPE as specified to `gtk_type_unique'. - Function: GtkType gtk_type_from_name (guchar *NAME) Return the type associated with NAME. If there is no type associated with NAME, then GTK_TYPE_INVALID will be returned. - Function: GtkType gtk_type_parent (GtkType TYPE) Returns the parent type of TYPE or GTK_TYPE_INVALID if TYPE is a fundamental type. - Function: gpointer gtk_type_class (GtkType TYPE) Returns the initialized class structure for TYPE. The class structure is actually created and initialized the first time it is needed. Refer to *note Objects:: for details on how this initialization works for GTK_TYPE_OBJECT derived types. The returned structure is shared by all objects of TYPE and, as such, should not be modified. - Function: gpointer gtk_type_new (GtkType TYPE) Returns a new instance of an TYPE object. This works only for GTK_TYPE_OBJECT derived types. Please see *note Objects::. - Function: void gtk_type_describe_heritage (GtkType TYPE) Prints the type heritage for TYPE. The heritage for a type includes the type and all its parent types up the type tree. - Function: void gtk_type_describe_tree (GtkType TYPE, gboolean SHOW_SIZE) Prints the type tree which starts at TYPE. SHOW_SIZE is a boolean which determines whether type sizes are printed. - Function: gboolean gtk_type_is_a (GtkType TYPE, GtkType IS_A_TYPE) A predicate function which determines whether the relation TYPE is_a IS_A_TYPE is true. Values of all types can be handled uniformly by storing them into a `GtkArg' structure. The `GtkArg' has the following fields: `gchar *name' This can be used to give the value represented by this `GtkArg' structure a name. It is not used much. `GtkType type' The type of this value. `union d' A big union that has (at least conceptually) one member for each fundamental type. You should not access these members directly. Rather, use the `GTK_VALUE_*' macros. There is one macro for each fundamental type, and its name is derived from the name of the GtkFundamentalType enumeration members simply by replacing "Gtk_TYPE" with "GTK_VALUE". All `GTK_VALUE_*' macros take a `GtkArg' structure as their only parameter (_not_ a pointer) and evaluate to a lvalue. For example, the accessor for the fundamental type GTK_TYPE_INT is called GTK_VALUE_INT and you could use it like this: GtkArg value; value.name = NULL; value.type = GTK_TYPE_INT; GTK_VALUE_INT(value) = 7;  File: gtk.info, Node: Simple types, Next: Enumerations and flags, Prev: Basics, Up: Types Simple Types ============ The Gtk type system has a full set of the usual simple types: integers, floating point numbers, but also boolean and character. You can not derive new types from these. Enum Name Description GTK_TYPE_NONE "void" A type without value. GTK_TYPE_CHAR "char" A 8-bit unsigned number representing a character. Numbers between 0 and 127 are ASCII, the rest is undefined. GTK_TYPE_BOOL "gboolean" The boolean type. It is some small integer where the number 0 represents false and 1 is true. No other values are allowed. GTK_TYPE_INT "gint" A signed integer with at least 32 bits. GTK_TYPE_UINT "guint" A unsigned integer with at least 32 bits. GTK_TYPE_LONG "glong" A signed integer with at least 32 bits. GTK_TYPE_ULONG "gulong" A unsigned integer with at least 32 bits. This is large enough to hold a coerced pointer. GTK_TYPE_FLOAT "gfloat" A single precision floating point number. GTK_TYPE_DOUBLE "gfloat" A souble precision floating point number. GTK_TYPE_POINTER "gpointer" A untyped pointer. Do not use this if you can avoid it. The values of these types are all represented `directly' with the C types that are indicated in the `name' column above. *note Boxed types:: for a discussion of this.  File: gtk.info, Node: Enumerations and flags, Next: Strings, Prev: Simple types, Up: Types Enumerations and Flags ======================  File: gtk.info, Node: Strings, Next: Boxed types, Prev: Enumerations and flags, Up: Types Strings =======  File: gtk.info, Node: Boxed types, Next: Callbacks, Prev: Strings, Up: Types Boxed Types ===========  File: gtk.info, Node: Callbacks, Next: Composite types, Prev: Boxed types, Up: Types Callbacks =========  File: gtk.info, Node: Composite types, Prev: Callbacks, Up: Types Composite Types ===============  File: gtk.info, Node: Objects, Next: Signals, Prev: Types, Up: Top Objects ******* Object functions ================ The GtkObject type is the root of the type hierarchy used by GTK. It provides a minimal set of fields used to implement the actual object, class and signal mechanisms, as well as several utility routines which make dealing with objects easier. For the adventurous, see *Note Object Implementation::. - Function: guint gtk_object_get_type (void) Returns the `GtkObject' type identifier. - Function: void gtk_object_class_add_signals (GtkObjectClass *CLASS, gint *SIGNALS, gint NSIGNALS) Adds SIGNALS to the `signals' field in the GtkObjectClass structure CLASS. *Note Signals::. - Function: GtkObject* gtk_object_new (guint TYPE, ...) - Function: GtkObject* gtk_object_newv (guint TYPE, guint NARGS, GtkArg *ARGS) - Function: void gtk_object_ref (GtkObject *OBJECT); - Function: void gtk_object_unref (GtkObject *OBJECT); - Function: void gtk_object_getv (GtkObject *OBJECT, guint NARGS, GtkArg *ARGS) - Function: void gtk_object_set (GtkObject *OBJECT, ...) - Function: void gtk_object_setv (GtkObject *OBJECT, guint NARGS, GtkArg *ARGS) - Function: GtkArg* gtk_object_query_args (GtkType CLASS_TYPE, guint *NARGS) - Function: void gtk_object_add_arg_type (gchar *ARG_NAME, GtkType ARG_TYPE, guint ARG_ID) - Function: GtkType gtk_object_get_arg_type (gchar *ARG_NAME) - Function: void gtk_object_destroy (GtkObject *OBJECT) Performs checks to make sure it is alright to destroy OBJECT and then emits the `destroy' signal. The check which is performed is to make sure OBJECT is not already processing another signal. If this were the case then destroying the object immediately would undoubtedly cause problems as the other signal would not be able to tell the object was destroyed. The solution is that if OBJECT is processing another signal we mark OBJECT is needing to be destroyed. When we finish processing of the other signal we check whether the object needs to be destroyed. The GtkObject type provides a mechanism for associating arbitrary amounts of data with an object. The data is associated with the object using a character string key. The functions `gtk_object_set_data', `gtk_object_get_data', and `gtk_object_remove_data' are the interface to this mechanism. Two other routines, `gtk_object_set_user_data' and `gtk_object_get_user_data', exist as convenience functions which simply use the same mechanism. - Function: void gtk_object_set_data (GtkObject *OBJECT, const char *KEY, gpointer DATA) Associate DATA with KEY in the data list of OBJECT. - Function: gpointer gtk_object_get_data (GtkObject *OBJECT, const char *KEY) Retrieve the data associated with KEY in the data list of OBJECT. - Function: void gtk_object_remove_data (GtkObject *OBJECT, const char *KEY) Remove the data associated with KEY in the data list of OBJECT. - Function: void gtk_object_set_user_data (GtkObject *OBJECT, gpointer DATA) Sets DATA into the `user_data' field of OBJECT. - Function: gpointer gtk_object_get_user_data (GtkObject *OBJECT) Returns the `user_data' field of OBJECT. The GtkObject type also provides a mechanism for specifying initialization values for fields. This general mechanism is called object value stacks. The reason for using value stacks is that they can simplify the life of the programmer. For instance, by default widgets are non-visible when created. However, the "visible" value for widgets may be specified so that widgets are made visible when created. (FIXME: unfinished). - Function: void gtk_object_value_stack_new (guint OBJECT_TYPE, const gchar *VALUE_ID, GtkParamType VALUE_TYPE) - Function: void gtk_object_push_value (guint OBJECT_TYPE, const gchar *VALUE_ID, ...) Push a value on the value stack specified by OBJECT_TYPE and VALUE_ID. The type of value is implicitly given in the context of OBJECT_TYPE and VALUE_ID. (That is, it is not specified explicitly in the function call). Only a single extra argument is expected which is the data which is to be placed on the stack. - Function: void gtk_object_pop_value (guint OBJECT_TYPE, const gchar *VALUE_ID) Pop a value of the value stack specified by OBJECT_TYPE and VALUE_ID. - Function: gint gtk_object_peek_value (guint OBJECT_TYPE, const gchar *VALUE_ID, gpointer DATA) Peek at the value on the top of the value stack specified by OBJECT_TYPE and VALUE_ID. The DATA argument is interpreted as the location of where to place the "peeked" data. For instance, if the peeked data is of type `GTK_PARAM_POINTER', then DATA will be a pointer to a pointer. If the value stack is empty or does not exist or an error occurs, `gtk_object_peek_value' will return `FALSE'. On success it will return `TRUE'.  File: gtk.info, Node: Signals, Next: Widgets, Prev: Objects, Up: Top Signals Overview **************** Signals are GTK's method for objects to perform callbacks. A signal is an event which occurs upon an object. The programmer can connect to a signal of an object which involves specifying a function to be called when that signal is emitted in the specified object. When a signal is emitted, both the class function associated with the signal (when it was defined) and all signal handlers installed for that signal on the particular object emitting the signal are called. The widget programmer can specify whether the class function is to be called before after or both before and after the signal handlers installed by the widget user. The widget user can, however, specify that their signal handler is to be run after the class function (using the "_after" signal connection routines). Any signal handling function can emit the same signal on the same object while it is running causing that signal emission to either restart or to run recursively. Additionally, signal emission can be terminated prematurely. While both such abilities are rarely used, they do allow for greater flexibility in regards to signals. For instance, a programmer can attach to the key press event signal and intercept all tab key presses from a widget. This particular example is used in the file selection dialog to implement tab completion of filenames and prevent the entry widget from inserting the tab into its buffer. Signals are selected using either an integer identifier or a character string name. It is convention to name the signal the same as the class function which is associated with it. There are two versions of most of the signal functions, one which takes an integer identifier and one which takes a character string name for the signal. - Function: gint gtk_signal_new (gchar *NAME, GtkSignalRunType RUN_TYPE, gint OBJECT_TYPE, gint FUNCTION_OFFSET, GtkSignalMarshaller MARSHALLER, GtkParamType RETURN_VAL, gint NPARAMS, ...) Create a new signal and give it the character string identifier NAME. NAME needs to be unique in the context of OBJECT_TYPE's branch of the class hierarchy. That is, OBJECT_TYPE cannot create a signal type with the same name as a signal type created by one of its parent types. RUN_TYPE specifies whether the class function should be run before (`GTK_RUN_FIRST'), after (`GTK_RUN_LAST') or both before and after normal signal handlers (`GTK_RUN_BOTH'). Additionally, the `GTK_RUN_NO_RECURSE' value can be or'ed with any of those values to specify that the signal should not be recursive. By default, emitting the same signal on the same widget will cause the signal to be emitted twice. However, if the `GTK_RUN_NO_RECURSE' flag is specified, emitting the same signal on the same widget will cause the current signal emission to be restarted. This allows the widget programmer to specify the semantics of signal emission on a per signal basis. (The `GTK_RUN_NO_RECURSE' flag is used by the GtkAdjustment widget). The FUNCTION_OFFSET is the byte offset from the start of the class structure to the class function field within the class structure. The easiest means to compute this offset is by using the `GTK_SIGNAL_OFFSET' macro which takes the class structure type as the first argument and the field as the second argument. For example, `GTK_SIGNAL_OFFSET (GtkObjectClass, destroy)' will give the offset of the `destroy' class function within the `GtkObjectClass'. Note: An offset is specified instead of an absolute location since there will be multiple instances of a class structure being referenced. (The `GtkWidgetClass' structure "is a" `GtkObjectClass' structure, etc.) The MARSHALLER function is used to invoke a signal handler. Since signal handlers may take different parameters and return values and a general mechanism for invoking them is not apparent, the approach of making the signal creator responsible for invoking the signal handler was taken. (FIXME: unfinished). The RETURN_VAL and NPARAMS and the remaining arguments specify the return value and the arguments to the signal handler respectively. Note: There is an implicit first argument to every signal handler which is the widget the signal has been emitted from. The variable argument list (...) specifies the types of the arguments. These can be one of `GTK_PARAM_CHAR', `GTK_PARAM_SHORT', `GTK_PARAM_INT', `GTK_PARAM_LONG', `GTK_PARAM_POINTER' or `GTK_PARAM_FUNCTION'. It is undefined to specify `GTK_PARAM_NONE' as an argument type, however it is OK to use `GTK_PARAM_NONE' for RETURN_VAL. (This corresponds to returning a `void'). `gtk_signal_new' returns the integer identifier of the newly created signal. Signal identifiers start numbering at 1 and increase upwards. A value of -1 will be returned if an error occurs. *Note:* `gtk_signal_new' is only needed by widget writers. A normal user of GTK will never needed to invoke this function. - Function: gint gtk_signal_lookup (gchar *NAME, gint OBJECT_TYPE) Returns the integer identifier for the signal referenced by NAME and OBJECT_TYPE. If OBJECT_TYPE does not define the signal NAME, then the signal is looked for in OBJECT_TYPE's parent type recursively. - Function: gchar* gtk_signal_name (gint SIGNAL_NUM) - Function: gint gtk_signal_emit (GtkObject *OBJECT, gint SIGNAL_TYPE, ...) Emit the signal specified by the integer identifier SIGNAL_TYPE from OBJECT. If an error occurs, `gtk_signal_emit' will return `FALSE' and will return `TRUE' on success. The signal definition determines the parameters passed in the variable argument list (`...'). For example, if the signal is defined as: gint (* event) (GtkWidget *widget, GdkEvent *event); Then a call to emit the "event" signal would look like: GdkEvent event; gint return_val; ... gtk_signal_emit (some_object, gtk_signal_lookup ("event", GTK_OBJECT_TYPE (some_object)), &event, &return_val); Notice that the `widget' argument is implicit in that the first argument to every signal is a type derived from `GtkObject'. The RETURN_VAL argument is actually a pointer to the return value type since the signal mechanism needs to be able to place the return value in an actual location. And lastly, the `gtk_signal_lookup' call is normally avoided by using the `gtk_signal_emit_by_name' function instead. `gtk_signal_emit' is normally used internally by widgets which know the signal identifier (since they defined the signal) and can therefore side-step the cost of calling `gtk_signal_lookup'. - Function: gint gtk_signal_emit_by_name (GtkObject *OBJECT, gchar *NAME, ...) Similar to `gtk_signal_emit' except that the signal is referenced by NAME instead of by its integer identifier. - Function: void gtk_signal_emit_stop (GtkObject *OBJECT, gint SIGNAL_TYPE) Stop the emission of the signal SIGNAL_TYPE on OBJECT. SIGNAL_TYPE is the integer identifier for the signal and can be determined using the function `gtk_signal_lookup'. Alternatively, the function `gtk_signal_emit_stop_by_name' can be used to refer to the signal by name. Attempting to stop the emission of a signal that isn't being emitted does nothing. - Function: void gtk_signal_emit_stop_by_name (GtkObject *OBJECT, gchar *NAME) Similar to `gtk_signal_emit_stop' except that the signal is referenced by NAME instead of by its integer identifier. - Function: gint gtk_signal_connect (GtkObject *OBJECT, gchar *NAME, GtkSignalFunc FUNC, gpointer FUNC_DATA) Connects a signal handling function to a signal emitting object. FUNC is connected to the signal NAME emitted by OBJECT. The arguments and returns type of FUNC should match the arguments and return type of the signal NAME. However, FUNC may take the extra argument of FUNC_DATA. Due to the C calling convention it is OK to ignore the extra argument. (It is OK to ignore all the arguments in fact). `gtk_signal_connect' returns an integer identifier for the connection which can be used to refer to it in the future. Specifically it is useful for removing the connection and/or blocking it from being used. - Function: gint gtk_signal_connect_after (GtkObject *OBJECT, gchar *NAME, GtkSignalFunc FUNC, gpointer FUNC_DATA) Similar to `gtk_signal_connect' except the signal handler is connected in the "after" slot. This allows a signal handler to be guaranteed to run after other signal handlers connected to the same signal on the same object and after the class function associated with the signal. Like `gtk_signal_connect', `gtk_signal_connect_after' returns an integer identifier which can be used to refer to the connection. - Function: gint gtk_signal_connect_object (GtkObject *OBJECT, gchar *NAME, GtkSignalFunc FUNC, GtkObject *SLOT_OBJECT) Connects FUNC to the signal NAME emitted by OBJECT. Similar to `gtk_signal_connect' with the difference that SLOT_OBJECT is passed as the first parameter to FUNC instead of the signal emitting object. This can be useful for connecting a signal emitted by one object to a signal in another object. A common usage is to connect the "destroy" signal of dialog to the "clicked" signal emitted by a "close" button in the dialog. That is, the "clicked" signal emitted by the button will caused the "destroy" signal to be emitted for the dialog. This is also the "right" way to handle closing of a dialog since the "destroy" signal will be sent if the dialog is deleted using a window manager function and this enables the two methods of closing the window to be handled by the same mechanism. Returns an integer identifier which can be used to refer to the connection. - Function: gint gtk_signal_connect_object_after (GtkObject *OBJECT, gchar *NAME, GtkSignalFunc FUNC, GtkObject *SLOT_OBJECT) Similar to `gtk_signal_connect_object' except the signal handler is connected in the "after" slot. This allows a signal handler to be guaranteed to run after other signal handlers connected to the same signal on the same object and after the class function associated with the signal. Returns an integer identifier which can be used to refer to the connection. - Function: gint gtk_signal_connect_interp (GtkObject *OBJECT, gchar *NAME, GtkCallbackMarshal FUNC, gpointer DATA, GtkDestroyNotify DESTROY_FUNC, gint AFTER) - Function: void gtk_signal_disconnect (GtkObject *OBJECT, gint ID) Disconnects a signal handler from an object. The signal handler is identified by the integer ID which is returned by the `gtk_signal_connect*' family of functions. - Function: void gtk_signal_disconnect_by_data (GtkObject *OBJECT, gpointer DATA) Disconnects a signal handler from an object. The signal handler is identified by the DATA argument specified as the FUNC_DATA argument to the `gtk_signal_connect*' family of functions. For the `gtk_signal_connect_object*' functions, DATA refers to the SLOT_OBJECT. *Note:* This will remove all signal handlers connected to OBJECT which were connected using DATA as their FUNC_DATA argument. Multiple signal handlers may be disconnected with this call. - Function: void gtk_signal_handler_block (GtkObject *OBJECT, gint ID) Blocks calling of a signal handler during signal emission. The signal handler is identified by the integer ID which is returned by the `gtk_signal_connect*' family of functions. If the signal is already blocked no change is made. - Function: void gtk_signal_handler_block_by_data (GtkObject *OBJECT, gint DATA) Blocks calling of a signal handler during signal emission. The signal handler is identified by the DATA argument specified as the FUNC_DATA argument to the `gtk_signal_connect*' family of functions. For the `gtk_signal_connect_object*' functions, DATA refers to the SLOT_OBJECT. If the signal is already blocked no change is made. *Note:* This will block all signal handlers connected to OBJECT which were connected using DATA as their FUNC_DATA argument. Multiple signal handlers may be blocked with this call. - Function: void gtk_signal_handler_unblock (GtkObject *OBJECT, gint ID) Unblocks calling of a signal handler during signal emission. The signal handler is identified by the integer ID which is returned by the `gtk_signal_connect*' family of functions. If the signal is already unblocked no change is made. - Function: void gtk_signal_handler_unblock_by_data (GtkObject *OBJECT, gint DATA) Unblocks calling of a signal handler during signal emission. The signal handler is identified by the DATA argument specified as the FUNC_DATA argument to the `gtk_signal_connect*' family of functions. For the `gtk_signal_connect_object*' functions, DATA refers to the SLOT_OBJECT. If the signal is already unblocked no change is made. *Note:* This will unblock all signal handlers connected to OBJECT which were connected using DATA as their FUNC_DATA argument. Multiple signal handlers may be unblocked with this call. - Function: void gtk_signal_handlers_destroy (GtkObject *OBJECT) Destroy all of the signal handlers connected to OBJECT. There should normally never be reason to call this function as it is called automatically when OBJECT is destroyed. - Function: void gtk_signal_default_marshaller (GtkObject *OBJECT, GtkSignalFunc FUNC, gpointer FUNC_DATA, GtkSignalParam *PARAMS) `gtk_signal_new' requires a callback in order to actually call a signal handler for a particular signal. The vast majority of signals are of the particular form: (* std_signal) (gpointer std_arg); `gtk_signal_default_marshaller' is a signal marshaller which marshals arguments for a signal of that form. - Function: void gtk_signal_set_funcs (GtkSignalMarshal MARSHAL_FUNC, GtkSignalDestroy DESTROY_FUN)  File: gtk.info, Node: Widgets, Next: Other Objects, Prev: Signals, Up: Top Widget Overview *************** Widgets are the general term used to describe user interface objects. A widget defines a class interface that all user interface objects conform to. This interface allows a uniform method for dealing with operations common to all objects such as hiding and showing, size requisition and allocation and events. The common interface that widgets must adhere to is described by the GtkWidget and GtkWidgetClass structure. For the purposes of using GTK these structures can be considered read-only and, for the most part, opaque. All widget creation routines in GTK return pointers to GtkWidget structures. In reality, all widget creation routines create structures that can be viewed as equivalent to the GtkWidget structure, but often have contain additional information. *Note Object Implementation::. The widgets available for use are implemented in a hierarchy. Several widgets exist solely as common bases for more specific widgets. For example, it is not possible to create a ruler widget itself, but the ruler widget provides a base and functionality common to the horizontal and vertical rulers. The available widgets (in alphabetical order): * Menu: * GtkAlignment:: The alignment widget. * GtkArrow:: The arrow widget. * GtkAspectFrame:: The aspect frame widget. * GtkBin:: The bin widget. * GtkBox:: The box widget. * GtkButtonBox:: The button box widget. * GtkButton:: The button widget. * GtkCheckButton:: The check button widget. * GtkCheckMenuItem:: The check menu item widget. * GtkCList:: The compound list widget. * GtkColorSelection:: The color selector widget. * GtkCombo:: The combo box widget. * GtkContainer:: The container widget. * GtkCTree:: The multi-column tree widget. * GtkCurve:: The curve widget. * GtkGammaCurve:: The gamma curve widget. * GtkDialog:: The dialog widget. * GtkDrawingArea:: The drawing area widget. * GtkEntry:: The entry widget. * GtkEventBox:: The event box widget. * GtkFileSelection:: The file selection dialog widget. * GtkFixed:: The fixed widget. * GtkFrame:: The frame widget. * GtkGamma:: The gamma widget. * GtkHBox:: The horizontal box widget. * GtkHButtonBox:: The horizontal button box widget. * GtkHPaned:: The horizontal paned widget. * GtkHRuler:: The horizontal ruler widget. * GtkHScale:: The horizontal scale widget. * GtkHScrollbar:: The horizontal scrollbar widget. * GtkHSeparator:: The horizontal separator widget. * GtkImage:: The image widget. * GtkInputDialog:: The input dialog widget. * GtkItem:: The item widget. * GtkLabel:: The label widget. * GtkList:: The list widget. * GtkListItem:: The list item widget. * GtkMenu:: The menu widget. * GtkMenuBar:: The menu bar widget. * GtkMenuItem:: The menu item widget. * GtkMenuShell:: The menu shell widget. * GtkMisc:: The misc widget. * GtkNotebook:: The notebook widget. * GtkOptionMenu:: The option menu widget. * GtkPaned:: The paned widget. * GtkPixmap:: The pixmap widget. * GtkPreview:: The preview widget. * GtkProgressBar:: The progress bar widget. * GtkRadioButton:: The radio button widget. * GtkRadioMenuItem:: The radio menu item widget. * GtkRange:: The range widget. * GtkRuler:: The ruler widget. * GtkScale:: The scale widget. * GtkScrollbar:: The scrollbar widget. * GtkScrolledWindow:: The scrolled window widget. * GtkSeparator:: The separator widget. * GtkStatusbar:: The statusbar widget. * GtkTable:: The table widget. * GtkText:: The text widget. * GtkToggleButton:: The toggle button widget. * GtkToolbar:: The tool bar widget. * GtkTooltips:: The tool tips widget. * GtkTree:: The tree widget. * GtkTreeItem:: The tree item widget. * GtkVBox:: The vertical box widget. * GtkVButtonBox:: The vertical button box widget. * GtkViewport:: The viewport widget. * GtkVPaned:: The vertical paned widget. * GtkVRuler:: The vertical ruler widget. * GtkVScale:: The vertical scale widget. * GtkVScrollbar:: The vertical scrollbar widget. * GtkVSeparator:: The vertical separator widget. * GtkWidget:: The base widget type. * GtkWindow:: The window widget. 0707010001bafb000081a40000000a0000000a000000013d12d39e0000c3d2000000880000000300000000000000000000001eff350892reloc/doc/gtk/docs/gtk.info-2This is gtk.info, produced by makeinfo version 4.0 from gtk.texi. This file documents GTK, the GIMP Toolkit Copyright (C) 1996 Peter Mattis Copyright (C) 1997 Peter Mattis Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Peter Mattis. INFO-DIR-SECTION User Interface Toolkit START-INFO-DIR-ENTRY * GTK: (gtk). The GIMP Toolkit END-INFO-DIR-ENTRY  File: gtk.info, Node: GtkAlignment, Next: GtkArrow, Prev: Widgets, Up: Widgets The alignment widget ==================== Description ----------- The alignment widget is a container (*note GtkContainer::) derived from the bin widget (*note GtkBin::). Its entire purpose is to give the programmer flexibility in how the child it manages is positioned when a window is resized. Normally, a widget is allocated at least as much size as it requests. (*note GtkContainer:: for a discussion of geometry management). When a widget is allocated more size than it requests there is a question of how the widget should expand. By convention, most GTK widgets expand to fill their allocated space. Sometimes this behavior is not desired. The alignment widget allows the programmer to specify how a widget should expand and position itself to fill the area it is allocated. Options ------- - User Option: xscale - User Option: yscale The XSCALE and YSCALE options specify how to scale the child widget. If the scale value is 0.0, the child widget is allocated exactly the size it requested in that dimension. If the scale value is 1.0, the child widget is allocated all of the space in a dimension. A scale value of 1.0 for both x and y is equivalent to not using an alignment widget. - User Option: xalign - User Option: yalign The XALIGN and YALIGN options specify how to position the child widget when it is not allocated all the space available to it (because the XSCALE and/or YSCALE options are less than 1.0). If an alignment value is 0.0 the widget is positioned to the left (or top) of its allocated space. An alignment value of 1.0 positions the widget to the right (or bottom) of its allocated space. A common usage is to specify XALIGN and YALIGN to be 0.5 which causes the widget to be centered within its allocated area. Signals ------- Functions --------- - Function: guint gtk_alignment_get_type (void) Returns the `GtkAlignment' type identifier. - Function: GtkWidget* gtk_alignment_new (gfloat XALIGN, gfloat YALIGN, gfloat XSCALE, gfloat YSCALE) Create a new `GtkAlignment' object and initialize it with the values XALIGN, YALIGN, XSCALE and YSCALE. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_alignment_set (GtkAlignment *ALIGNMENT, gfloat XALIGN, gfloat YALIGN, gfloat XSCALE, gfloat YSCALE) Set the XALIGN, YALIGN, XSCALE and YSCALE options of an alignment widget. It is important to not set the fields of the `GtkAlignment' structure directly (or, for that matter, any type derived from `GtkObject'). - Function: GtkAlignment* GTK_ALIGNMENT (gpointer OBJ) Cast a generic pointer to `GtkAlignment*'. *Note Standard Macros::, for more info. - Function: GtkAlignmentClass* GTK_ALIGNMENT_CLASS (gpointer CLASS) Cast a generic pointer to `GtkAlignmentClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_ALIGNMENT (gpointer OBJ) Determine if a generic pointer refers to a `GtkAlignment' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkArrow, Next: GtkAspectFrame, Prev: GtkAlignment, Up: Widgets The arrow widget ================ Description ----------- The arrow widget is derived from the misc widget (*note GtkMisc::) and is intended for use where a directional arrow (in one of the four cardinal directions) is desired. As such, it has very limited functionality and basically only draws itself in a particular direction and with a particular shadow type. The arrow widget will expand to fill all the space it is allocated. Options ------- - User Option: arrow_type The ARROW_TYPE option specifies which direction the arrow will point. It can be one of `GTK_ARROW_UP', `GTK_ARROW_DOWN', `GTK_ARROW_LEFT' or `GTK_ARROW_RIGHT'. This will set the arrow pointing in the direction specified. - User Option: shadow_type The SHADOW_TYPE option specifies how to draw the shadow for the arrow. Currently, only the `GTK_SHADOW_IN' and `GTK_SHADOW_OUT' shadow types are supported for drawing arrows. Other shadow types will cause nothing to be drawn. Signals ------- Functions --------- - Function: guint gtk_arrow_get_type (void) Returns the `GtkArrow' type identifier. - Function: GtkWidget* gtk_arrow_new (GtkArrowType ARROW_TYPE, GtkShadowType SHADOW_TYPE) Create a new `GtkArrow' object and initialize it with the values ARROW_TYPE and SHADOW_TYPE. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_arrow_set (GtkArrow *ARROW, GtkArrowType ARROW_TYPE, GtkShadowType SHADOW_TYPE) Set the ARROW_TYPE and SHADOW_TYPE options of an arrow widget. It is important to not set the fields of the `GtkArrow' structure directly (or, for that matter, any type derived from `GtkObject'). - Function: GtkArrow* GTK_ARROW (gpointer OBJ) Cast a generic pointer to `GtkArrow*'. *Note Standard Macros::, for more info. - Function: GtkArrowClass* GTK_ARROW_CLASS (gpointer CLASS) Cast a generic pointer to `GtkArrowClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_ARROW (gpointer OBJ) Determine if a generic pointer refers to a `GtkArrow' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkAspectFrame, Next: GtkBin, Prev: GtkArrow, Up: Widgets The aspect frame widget ======================= Description ----------- Ensure that the child window has a specified aspect ratio or, if obey_child, has the same aspect ratio as its requested size. Derived from *note GtkFrame::). Options ------- - User Option: label - User Option: xalign - User Option: yalign - User Option: ratio - User Option: obey_child Signals ------- Functions --------- - Function: guint gtk_aspect_frame_get_type (void) Returns the `GtkAspectFrame' type identifier. - Function: GtkWidget* gtk_aspect_frame_new (gchar *LABEL, gfloat XALIGN, gfloat YALIGN, gfloat RATIO, gint OBEY_CHILD) Create a new `GtkAspectFrame' object and initialize it with the values LABEL, XALIGN, YALIGN, RATIO and OBEY_CHILD. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_aspect_frame_set (GtkAspectFrame *ASPECT_FRAME, gfloat XALIGN, gfloat YALIGN, gfloat RATIO, gint OBEY_CHILD) - Function: GtkAspectFrame* GTK_ASPECT_FRAME (gpointer OBJ) Cast a generic pointer to `GtkAspectFrame*'. *Note Standard Macros::, for more info. - Function: GtkAspectFrameClass* GTK_ASPECT_FRAME_CLASS (gpointer CLASS) Cast a generic pointer to `GtkAspectFrameClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_ASPECT_FRAME (gpointer OBJ) Determine if a generic pointer refers to a `GtkAspectFrame' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkBin, Next: GtkBox, Prev: GtkAspectFrame, Up: Widgets The bin widget ============== Description ----------- The bin widget is a container (*note GtkContainer::) derived from the container widget. It is an abstract base class. That is, it is not possible to create an actual bin widget. It exists only to provide a base of functionality for other widgets. Specifically, the bin widget provides a base for several other widgets that contain only a single child. These widgets include alignments (*note GtkAlignment::), frames (*note GtkFrame::), items (*note GtkItem::), viewports (*note GtkViewport::) and windows (*note GtkWindow::) Options ------- Signals ------- Functions --------- - Function: guint gtk_bin_get_type (void) Returns the `GtkBin' type identifier. - Function: GtkBin* GTK_BIN (gpointer OBJ) Cast a generic pointer to `GtkBin*'. *Note Standard Macros::, for more info. - Function: GtkBinClass* GTK_BIN_CLASS (gpointer CLASS) Cast a generic pointer to `GtkBinClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_BIN (gpointer OBJ) Determine if a generic pointer refers to a `GtkBin' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkBox, Next: GtkButtonBox, Prev: GtkBin, Up: Widgets The box widget ============== Description ----------- The box widget is a container (*note GtkContainer::) derived from the container widget. It is an abstract base class used by the horizontal box (*note GtkHBox::), the vertical box (*note GtkVBox::) and the (*note GtkButtonBox::) widgets to provide a base of common functionality. A box provides an abstraction for organizing the position and size of widgets. Widgets in a box are laid out horizontally or vertically. By using a box widget appropriately, a programmer can control how widgets are positioned and how they will be allocated space when a window gets resized. The key attribute of boxes is that they position their children in a single row (horizontal boxes) or column (vertical boxes). In the case of horizontal boxes, all children are stretched vertically. The vertical size of the box is determined by the largest vertical requisition of all of its children. Similarly, a vertical box stretches all of its children horizontally. The horizontal size (of the vertical box) is determined by the largest horizontal requisition of all of its children. An alignment widget (*note GtkAlignment::) can be used to control child allocation more precisely on a per child basis. The second attribute of boxes is how they expand children. In the case of a horizontal box, the main control is over how children are expanded horizontally to fill the allocated area. (The rest of this discussion will focus on horizontal boxes but it applies to vertical boxes as well). There are two flags which can be set controlling how a widget is expanded horizontally in a horizontal box. These are the `expand' and `fill'. There operation is fairly simple. If `expand' is set, the child's potentially allocated area will expand to fill available space. If `fill' is set, the child's actual allocated area will be its potentially allocated area. There is a difference between the potentially area (which is the area the box widget sets aside for the child) and the actual allocated area (which is the area the box widget actual allocates for the widget via `gtk_widget_size_allocate'). The allocation of space to children occurs as follows (for horizontal boxes): 1. All children are allocated at least their requested size horizontally and the maximum requested child size vertically. 2. Any child with the `expand' flag set is allocated `extra_width / nexpand_children' extra pixels horizontally. If the `homogeneous' flag was set, all children are considered to have the `expand' flag set. That is, all children will be allocated the same area.The horizontal box is a fair widget and, as such, divides up any extra allocated space evenly among the "expand" children. (Those children which have the `expand' flag set). The exception occurs when `extra_width / nexpand_children' does not divide cleanly. The extra space is given to the last widget. 3. `spacing' number of pixels separate each child. Note: The separation is between the potentially allocated area for each child and not the actual allocated area. The `padding' value associated with each child causes that many pixels to be left empty to each side of the child. 4. If a child has the `fill' flag set it is allocated its potentially allocated area. If it does not, it is allocated its requested size horizontally and centered within its potentially allocated area. Its vertical allocation is still the maximum requested size of any child. 5. Children placed at the start of the box are placed in order of addition to the box from left to right in the boxes allocated area.. Children placed at the end of the box are placed in order of addition from right to left in the boxes allocated area. *Note GtkHBox::, and *Note GtkVBox::, for code examples of using horizontal and vertical boxes. Options ------- - User Option: expand - User Option: fill - User Option: padding - User Option: expand Signals ------- Functions --------- - Function: guint gtk_box_get_type (void) Returns the `GtkBox' type identifier. - Function: void gtk_box_pack_start (GtkBox *BOX, GtkWidget *CHILD, gint EXPAND, gint FILL, gint PADDING) Add CHILD to the front of BOX. The flags EXPAND and FILL and the padding value of PADDING are associated with CHILD. - Function: void gtk_box_pack_end (GtkBox *BOX, GtkWidget *CHILD, gint EXPAND, gint FILL, gint PADDING) Add CHILD to the end of BOX. The flags EXPAND and FILL and the padding value of PADDING are associated with CHILD. - Function: void gtk_box_pack_start_defaults (GtkBox *BOX, GtkWidget *WIDGET) A convenience function which is equivalent to the following: gtk_box_pack_start (BOX, WIDGET, TRUE, TRUE, 0); - Function: void gtk_box_pack_end_defaults (GtkBox *BOX, GtkWidget *WIDGET) A convenience function which is equivalent to the following: gtk_box_pack_start (BOX, WIDGET, TRUE, TRUE, 0); - Function: void gtk_box_set_homogeneous (GtkBox *BOX, gint HOMOGENEOUS) Set the homogeneous setting of this box to HOMOGENEOUS. - Function: void gtk_box_set_spacing (GtkBox *BOX, gint SPACING) - Function: void gtk_box_reorder_child (GtkBox *BOX, GtkWidget *CHILD, guint POS) - Function: void gtk_box_query_child_packing (GtkBox *BOX, GtkWidget *CHILD, gint *EXPAND, gint *FILL, gint *PADDING, GtkPackType *PACK_TYPE) - Function: void gtk_box_set_child_packing (GtkBox *BOX, GtkWidget *CHILD, gint EXPAND, gint FILL, gint PADDING, GtkPackType *PACK_TYPE) - Function: GtkBox* GTK_BOX (gpointer OBJ) Cast a generic pointer to `GtkBox*'. *Note Standard Macros::, for more info. - Function: GtkBoxClass* GTK_BOX_CLASS (gpointer CLASS) Cast a generic pointer to `GtkBoxClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_BOX (gpointer OBJ) Determine if a generic pointer refers to a `GtkBox' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkButtonBox, Next: GtkButton, Prev: GtkBox, Up: Widgets The button box widget ===================== Description ----------- The button box widget is a container (*note GtkContainer::) derived from the (*note GtkBox::) widget. It is an abstract base class used by the horizontal button box (*note GtkHButtonBox::) and the vertical button box (*note GtkVButtonBox::) widgets to provide a base of common functionality. The button box, like the box widget, (*note GtkBox::) provides an abstraction for organizing position and size of widgets. In the case of the button box it is targeted at the button widget,(*note GtkButton::). Button widgets are laid out in the box horizontally or vertically. By using a button box widget appropriately, a programmer can control how the button widgets are positioned and how they will be allocated space when a window gets resized. Options ------- - User Option: layout_style * `GTK_BUTTONBOX_SPREAD' * The layout style `GTK_BUTTONBOX_SPREAD' will spread the buttons out evenly within the button box. When the parent window is resized they will re-adjust to the new window dimensions. The `gtk_button_box_set_spacing' function will set the minimum space that the buttons will leave between themselves. * `GTK_BUTTONBOX_EDGE' * * `GTK_BUTTONBOX_START' * The layout style `GTK_BUTTONBOX_START' will place the buttons at the start of the button box, taking into account the spacing as set by the `gtk_button_box_set_spacing' function. The buttons will not move when the parent window is re-sized. * `GTK_BUTTONBOX_END' * The layout style `GTK_BUTTONBOX_END' will place the buttons at the end of the button box, taking into account the spacing as set by the `gtk_button_box_set_spacing' function. Again like the `GTK_BUTTONBOX_START' layout style the buttons will not move when the parent window is re-sized. - User Option: width - User Option: height - User Option: ipad_x - User Option: ipad_y Signals ------- Functions --------- - Function: guint gtk_button_box_get_type (void) Returns the `GtkButtonBox' type identifier. - Function: void gtk_button_box_set_child_size_default (gint WIDTH, gintHEIGHT) - Function: void gtk_button_box_set_child_ipadding_default (gint IPAD_X, gint IPAD_Y) - Function: void gtk_button_box_get_child_size_default (gint *WIDTH, gint *HEIGHT) - Function: void gtk_button_box_get_child_ipadding_default (gint *IPAD_X, gint *IPAD_Y) - Function: void gtk_button_box_set_child_size (GtkButtonBox *WIDGET, gint WIDTH, gint HEIGHT) - Function: void gtk_button_box_set_child_ipadding (GtkButtonBox *WIDGET, gint IPAD_X, gint IPAD_Y) - Function: void gtk_button_box_set_layout (GtkButtonBox *WIDGET, gint LAYOUT_STYLE) This will set the layout style of the buttons within this box. Currently it can be set to one of `GTK_BUTTONBOX_SPREAD', `GTK_BUTTONBOX_EDGE', `GTK_BUTTONBOX_START' or `GTK_BUTTONBOX_END'. The following example: gtk_button_box_set_layout (GTK_BUTTON_BOX (box), GTK_BUTTONBOX_SPREAD); Will set the BOX argument to the "SPREAD" layout style described above. - Function: gint gtk_button_box_get_spacing (GtkButtonBox *WIDGET) Get the per widget value for spacing within the button box. This value is the amount of space that will be between the individual buttons contained by this box. - Function: void gtk_button_box_get_child_size (GtkButtonBox *WIDGET, gint *WIDTH, gint *HEIGHT) - Function: void gtk_button_box_get_child_ipadding (GtkButtonBox *WIDGET, gint *IPAD_X, gint *IPAD_Y) Get the per widget value for the padding inside the buttons. This value controls how large the buttons will be within the box. - Function: gint gtk_button_box_get_layout (GtkButtonBox *WIDGET) Get the LAYOUT_STYLE for the `GtkButtonBox' object passed to this function in the WIDGET variable. layout = gtk_button_box_get_layout(GTK_BUTTON_BOX (box)); - Function: GtkButtonBox* GTK_BUTTON_BOX (gpointer OBJ) Cast a generic pointer to `GtkButtonBox*'. *Note Standard Macros::, for more info. - Function: GtkButtonBoxClass* GTK_BUTTON_BOX_CLASS (gpointer CLASS) Cast a generic pointer to `GtkButtonBoxClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_BUTTON_BOX (gpointer OBJ) Determine if a generic pointer refers to a `GtkButtonBox' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkButton, Next: GtkCheckButton, Prev: GtkButtonBox, Up: Widgets The button widget ================= Description ----------- A pressable button. Contains a widget. Changes its appearance (hilites) when it gets the focus. Changes its appearance (pressed) when activated. Derived from *note GtkContainer::. Signals ------- - Signal: void GtkButton::pressed (GtkButton *BUTTON) - Signal: void GtkButton::released (GtkButton *BUTTON) - Signal: void GtkButton::clicked (GtkButton *BUTTON) - Signal: void GtkButton::enter (GtkButton *BUTTON) - Signal: void GtkButton::leave (GtkButton *BUTTON) Functions --------- - Function: guint gtk_button_get_type (void) Returns the `GtkButton' type identifier. - Function: GtkWidget* gtk_button_new (void) Create a new `GtkButton' object. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkWidget* gtk_button_new_with_label (gchar *LABEL) Create a new `GtkButton' object and set the text that is on the button to LABEL. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_button_pressed (GtkButton *BUTTON) - Function: void gtk_button_released (GtkButton *BUTTON) - Function: void gtk_button_clicked (GtkButton *BUTTON) - Function: void gtk_button_enter (GtkButton *BUTTON) - Function: void gtk_button_leave (GtkButton *BUTTON) - Function: GtkButton* GTK_BUTTON (gpointer OBJ) Cast a generic pointer to `GtkButton*'. *Note Standard Macros::, for more info. - Function: GtkButtonClass* GTK_BUTTON_CLASS (gpointer CLASS) Cast a generic pointer to `GtkButtonClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_BUTTON (gpointer OBJ) Determine if a generic pointer refers to a `GtkButton' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkCheckButton, Next: GtkCheckMenuItem, Prev: GtkButton, Up: Widgets The check button widget ======================= Description ----------- Another form of toggle button (*note GtkToggleButton::) with an indicator. Contains a widget to the right of the indicator. Changes its appearance (hilites) when it gets the focus. Options ------- Signals ------- Functions --------- - Function: guint gtk_check_button_get_type (void) Returns the `GtkCheckButton' type identifier. - Function: GtkWidget* gtk_check_button_new (void) Create a new `GtkCheckButton' object and initialize it with the default values in the library. The new widget is returned as a pointer to a `GtkWidget' object. A `NULL' is returned on failure. - Function: GtkWidget* gtk_check_button_new_with_label (gchar *LABEL) Create a new `GtkCheckButton' object and initialize it with the values LABEL. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on any failure. - Function: GtkCheckButton* GTK_CHECK_BUTTON (gpointer OBJ) - Function: GtkCheckButtonClass* GTK_CHECK_BUTTON_CLASS (gpointer CLASS) - Function: gint GTK_IS_CHECK_BUTTON (gpointer OBJ) - Function: GtkCheckButton* GTK_CHECK_BUTTON (gpointer OBJ) Cast a generic pointer to `GtkCheckButton*'. *Note Standard Macros::, for more info. - Function: GtkCheckButtonClass* GTK_CHECK_BUTTON_CLASS (gpointer CLASS) Cast a generic pointer to `GtkCheckButtonClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_CHECK_BUTTON (gpointer OBJ) Determine if a generic pointer refers to a `GtkCheckButton' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkCheckMenuItem, Next: GtkCList, Prev: GtkCheckButton, Up: Widgets The check menu item widget ========================== Description ----------- Derived from *note GtkMenuItem::. Very similar to a checkbutton (*note GtkCheckButton::), except that it's a menu item. Has a toggled state which is displayed in a small rectangle to the left of the contained widget. Options ------- - User Option: label - User Option: state Signals ------- - Signal: void GtkCheckMenuItem::toggled (GtkCheckMenuItem *CHECK_MENU_ITEM) Functions --------- - Function: guint gtk_check_menu_item_get_type (void) Returns the `GtkCheckMenuItem' type identifier. - Function: GtkWidget* gtk_check_menu_item_new (void) Create a new `GtkCheckMenuItem' object. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkWidget* gtk_check_menu_item_new_with_label (gchar *LABEL) Create a new `GtkCheckMenuItem' object and initialize it with the values LABEL. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_check_menu_item_set_state (GtkCheckMenuItem *CHECK_MENU_ITEM, gint STATE) - Function: void gtk_check_menu_item_toggled (GtkCheckMenuItem *CHECK_MENU_ITEM) - Function: GtkCheckMenuItem* GTK_CHECK_MENU_ITEM (gpointer OBJ) Cast a generic pointer to `GtkCheckMenuItem*'. *Note Standard Macros::, for more info. - Function: GtkCheckMenuItemClass* GTK_CHECK_MENU_ITEM_CLASS (gpointer CLASS) Cast a generic pointer to `GtkCheckMenuItemClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_CHECK_MENU_ITEM (gpointer OBJ) Determine if a generic pointer refers to a `GtkCheckMenuItem' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkCList, Next: GtkColorSelection, Prev: GtkCheckMenuItem, Up: Widgets The compound list widget ======================== Description ----------- A list of rows of columns, with a title row. You can insert rows, and delete rows. The user can scroll around and select a row. Derived from *note GtkContainer::. Cells can be empty, have a text and/or pixmap, or be a widget. Options ------- Signals ------- Functions --------- - Function: guint gtk_clist_get_type (void) Returns the `GtkCList' type identifier. - Function: GtkWidget* gtk_clist_new (int COLUMNS) Create a new `GtkCList' initializing it with the value COLUMNS. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkWidget* gtk_clist_new_with_titles (int COLUMNS, gchar *TITLES[]) - Function: void gtk_clist_set_border (GtkCList *CLIST, GtkShadowType BORDER) Set the border style of the CLIST to the shadow type BORDER. - Function: void gtk_clist_set_selection_mode (GtkCList *CLIST GtkSelectionMode MODE) Set the selection mode on the CLIST to the MODE selection mode. - Function: void gtk_clist_set_policy (GtkCList *CLIST, GtkPolicyType VSCROLLBAR_POLICY, GtkPolicyType HSCROLLBAR_POLICY) Set the policy on the scrollbars on the CLIST to VSCROLLBAR_POLICY and HSCROLLBAR_POLICY. - Function: void gtk_clist_freeze (GtkCList *CLIST) Stop all visual updates of the CLIST. Useful for when making a large number of changes to a `GtkCList'. - Function: void gtk_clist_thaw (GtkCList *CLIST) Allow all visual updates of the CLIST to resume. - Function: void gtk_clist_column_titles_show (GtkCList *CLIST) Show the column title buttons on the CLIST. - Function: void gtk_clist_column_titles_hide (GtkCList *CLIST) Hide the column title buttons on the CLIST. - Function: void gtk_clist_set_column_title (GtkCList *CLIST, gint COLUMN, gchar *TITLE) Set the title in column COLUMN of the CLIST button to TITLE. - Function: void gtk_clist_set_column_widget (GtkCList *CLIST, gint COLUMN, GtkWidget *WIDGET) Set the WIDGET instead of the title button for the column COLUMN in the CLIST. - Function: void gtk_clist_set_column_justification (GtkCList *CLIST, gint COLUMN, GtkJustification JUSTIFICATION) Set the COLUMN's justification, in the CLIST to JUSTIFICATION. - Function: void gtk_clist_set_column_width (GtkCList *CLIST, gint COLUMN, gint WIDTH) Set the pixel width of column COLUMN in the `GtkCList' CLIST to WIDTH. This function is a necessary step in creating a `GtkCList' because otherwise the column width is chosen from the width of the column title, which is almost never correct. - Function: void gtk_clist_set_row_height (GtkCList *CLIST, gint HEIGHT) Change the height of the rows in the CLIST to HEIGHT. The default is the height of the current font. - Function: void gtk_clist_moveto (GtkCList *CLIST, gint ROW, gintCOLUMN, gfloat ROW_ALIGN, gfloat COL_ALIGN) Scroll the viewing area of the `GtkClist' in CLIST to COLUMN and ROW. The ROW_ALIGN and COL_ALIGN are between zero and one, representing the location the row should appear on screen. Setting ROW_ALIGN or the COL_ALIGN to 0.0 will be the top or left of the viewing area. Setting the ROW_ALIGN or COL_ALIGN to 1.0 will be the bottom or right of the viewing area. If the ROW or COLUMN is -1 then there is no change. - Function: void gtk_clist_set_text (GtkCList *CLIST, gint ROW, gint COLUMN, gchar *TEXT) Set a given cell's text, located by the ROW and COLUMN, to TEXT replacing its current contents. - Function: void gtk_clist_set_pixmap (GtkCList *CLIST, gint ROW, gint COLUMN, GdkPixmap *PIXMAP, GdkBitmap *MASK) Set a given cell's text, located by the COLUMN and ROW arguments, to the pixmap described by the PIXMAP argument using the MASK as its mask. The current contents of the cell will be replaced. - Function: void gtk_clist_setpixtext (GtkCList *CLIST, gint ROW, gint COLUMN, gchar *TEXT, guint8 SPACING, GdkPixmap *PIXMAP, GdkBitmap *MASK) Set a given cell's text and pixmap, located by the ROW and COLUMN arguments, to the text and pixmap described by the PIXMAP and TEXT arguments. The MASK will be used for the pixmap mask and the SPACING argument specifies the spacing between the two. - Function: void gtk_clist_set_foreground (GtkCList *CLIST, gint ROW, GdkColor *COLOR) Set the foreground color of row ROW to COLOR in the `GtkCList' CLIST. The COLOR must already be allocated. - Function: void gtk_clist_set_background (GtkCList *CLIST, gint ROW, GdkColor *COLOR) Set the background color of row ROW to COLOR in the `GtkCList' pointed to by CLIST. The color must be previously allocated. - Function: void gtk_clist_set_shift (GtkCList *CLIST, gint ROW, gint COLUMN, gint VERTICAL, gint HORIZONTAL) Set the horizontal and vertical shift for drawing the contents of the cell located at ROW and COLUMN. The VERTICAL and HORIZONTAL arguments can be positive or negative. - Function: gint gtk_clist_append (GtkCList *CLIST, gchar *TEXT[]) Append the given text, in the TEXT[] argument, to the `GtkCList' pointed to by the CLIST. The return value is the index of the row that was just added. - Function: void gtk_clist_insert (GtkCList *CLIST, gint ROW, gchar *TEXT[]) Insert a row into the `GtkCList' pointed to by CLIST at row ROW with the text in TEXT[]. - Function: void gtk_clist_remove (GtkCList *CLIST, gint ROW) Remove row index ROW from the CLIST. - Function: void gtk_clist_set_row_data (GtkCList *CLIST, gint ROW, gpointer DATA) Will set an arbitrary data pointer, DATA, for row ROW in the `GtkCList' pointed to by CLIST. - Function: gpointer gtk_clist_get_row_data (GtkCList *CLIST, gint ROW) Return the data that was set for row ROW from the `GtkCList' pointed to by CLIST. `NULL' is returned if no data was set. - Function: void gtk_clist_select_row (GtkCList *CLIST, gint ROW, gint COLUMN) Force selection of a row, located by ROW and COLUMN, in the `GtkCList' pointed to by CLIST. - Function: void gtk_clist_unselect_row (GtkCList *CLIST, gint ROW, gint COLUMN) Force the unselection of a row, located by ROW and COLUMN, in the `GtkCList' pointed to by CLIST. - Function: void gtk_clist_clear (GtkCList *CLIST) Clear the entire contents of the `GtkCList' pointed to by CLIST. This is much faster then removing each item separately with `gtk_clist_remove'. - Function: GtkCList* GTK_CLIST (gpointer OBJ) Cast a generic pointer to `GtkCList*'. *Note Standard Macros::, for more info. - Function: GtkCListClass* GTK_CLIST_CLASS (gpointer CLASS) Cast a generic pointer to `GtkCListClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_CLIST (gpointer OBJ) Determine if a generic pointer refers to a `GtkCList' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkColorSelection, Next: GtkCombo, Prev: GtkCList, Up: Widgets The color selector widget ========================= Description ----------- A widget that allows a user to pick a color in one of many ways. They can click on a color wheel or saturation bar. They can change hue, saturation, value, red, green, or blue with a slider, or by entering values. Also allows the user to set an alpha (opacity) value. Derived from *note GtkVBox::. Options ------- - User Option: policy * GTK_UPDATE_CONTINUOUS * GTK_UPDATE_DISCONTINUOUS * GTK_UPDATE_DELAYED - User Option: color - User Option: use_opacity - User Option: title Signals ------- Functions --------- - Function: guint gtk_color_selection_get_type (void) Returns the `GtkColorSelection' type identifier. - Function: GtkWidget* gtk_color_selection_new (void) Create a new `GtkColorSelection' object. The new object is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_color_selection_set_update_policy (GtkColorSelection *COLORSEL, GtkUpdateType POLICY) - Function: void gtk_color_selection_set_color (GtkColorSelection *COLORSEL, gdouble *COLOR) - Function: void gtk_color_selection_get_color (GtkColorSelection *COLORSEL, gdouble *COLOR) - Function: void gtk_color_selection_set_opacity (GtkColorSelection *COLORSEL, gint USE_OPACITY) - Function: guint gtk_color_selection_dialog_get_type (void) Returns the `GtkColorSelection' type identifier. - Function: GtkWidget* gtk_color_selection_dialog_new (gchar *TITLE) Create a new `GtkColorSelection' object initializing the title bar of the resulting dialog to TITLE. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkColorSelection* GTK_COLOR_SELECTION (gpointer OBJ) Cast a generic pointer to `GtkColorSelection*'. *Note Standard Macros::, for more info. - Function: GtkColorSelectionClass* GTK_COLOR_SELECTION_CLASS (gpointer CLASS) Cast a generic pointer to `GtkColorSelectionClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_COLOR_SELECTION (gpointer OBJ) Determine if a generic pointer refers to a `GtkColorSelection' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkCombo, Next: GtkContainer, Prev: GtkColorSelection, Up: Widgets The combo widget ================ Description ----------- Text input box which also lets you choose from pre-defined values from a drop-down menu. Derived from *note GtkHBox::. Options ------- Signals ------- Functions --------- - Function: guint gtk_combo_get_type (void) Returns the `GtkCombo' type identifier. - Function: GtkWidget* gtk_combo_new (void) Create a new `GtkCombo' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_combo_set_value_in_list (GtkCombo *COMBO, gint VAL, gint OK_IF_EMPTY) - Function: void gtk_combo_set_use_arrows (GtkCombo *COMBO, gint VAL) - Function: void gtk_combo_set_use_arrows_always (GtkCombo *COMBO, gint VAL) - Function: void gtk_combo_set_case_sensitive (GtkCombo *COMBO, gint VAL) - Function: void gtk_combo_set_item_string (GtkCombo *COMBO, GtkItem *ITEM, gchar *ITEM_VALUE) - Function: void gtk_combo_set_popdown_strings (GtkCombo *COMBO, GList *STRINGS) - Function: GtkCombo* GTK_COMBO (gpointer OBJ) Cast a generic pointer to `GtkCombo*'. *Note Standard Macros::, for more info. - Function: GtkComboClass* GTK_COMBO_CLASS (gpointer CLASS) Cast a generic pointer to `GtkComboClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_COMBO (gpointer OBJ) Determine if a generic pointer refers to a `GtkCombo' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkContainer, Next: GtkCTree, Prev: GtkCombo, Up: Widgets The container widget ==================== Description ----------- A base class for objects that are built out of other widgets. Many widgets are containers. For example, a button contains a widget. That widget might be a text label (usually is), or a pixmap, or even an hbox which has a label and a pixmap. Options ------- - User Option: border_width Signals ------- - Signal: void GtkContainer::add (GtkContainer *CONTAINER, GtkWidget *WIDGET) - Signal: void GtkContainer::remove (GtkContainer *CONTAINER, GtkWidget *WIDGET) - Signal: void GtkContainer::need_resize (GtkContainer *CONTAINER, GtkWidget *WIDGET) - Signal: void GtkContainer::foreach (GtkContainer *CONTAINER, GtkCallback CALLBACK, gpointer CALLBACK_DATA) - Signal: gint GtkContainer::focus (GtkContainer *CONTAINER, GtkDirectionType DIRECTION) Functions --------- - Function: guint gtk_container_get_type (void) Returns the `GtkContainer' type identifier. - Function: void gtk_container_border_width (GtkContainer *CONTAINER, gint BORDER_WIDTH) - Function: void gtk_container_add (GtkContainer *CONTAINER, GtkWidget *WIDGET) Add WIDGET to the CONTAINER. - Function: void gtk_container_remove (GtkContainer *CONTAINER, GtkWidget *WIDGET) Remove WIDGET from CONTAINER. - Function: void gtk_container_disable_resize (GtkContainer *CONTAINER) - Function: void gtk_container_enable_resize (GtkContainer *CONTAINER) - Function: void gtk_container_block_resize (GtkContainer *CONTAINER) - Function: void gtk_container_unblock_resize (GtkContainer *CONTAINER) - Function: gint gtk_container_need_resize (GtkContainer *CONTAINER, GtkWidget *WIDGET) - Function: void gtk_container_check_resize (GtkContainer *CONTAINER, GtkWidget *WIDGET) - Function: void gtk_container_foreach (GtkContainer *CONTAINER, GtkCallback CALLBACK, gpointer CALLBACK_DATA) - Function: void gtk_container_focus (GtkContainer *CONTAINER, GtkDirectionType DIRECTION) - Function: GList* gtk_container_children (GtkContainer CONTAINER) - Function: GtkContainer* GTK_CONTAINER (gpointer OBJ) Cast a generic pointer to `GtkContainer*'. *Note Standard Macros::, for more info. - Function: GtkContainerClass* GTK_CONTAINER_CLASS (gpointer CLASS) Cast a generic pointer to `GtkContainerClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_CONTAINER (gpointer OBJ) Determine if a generic pointer refers to a `GtkContainer' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkCTree, Next: GtkCurve, Prev: GtkContainer, Up: Widgets The multi-column tree widget ============================ Description ----------- The GtkCTree widget is a multi-columned list with a designated column, the `tree column', to display hierarchically-organized data. Each node is either a folder (a branch of the tree) or a leaf. Nodes can be (recursively) expanded, collapsed, (un)selected, removed, moved, sorted etc. GtkCTree is a descendant of *note GtkCList::. Therefore, a cell in a column other than the tree column can only contain a string, a pixmap, both or nothing. A node in the tree column can contain a string and up to two pixmaps and masks, indicating the "folder openend" and "folder closed" status. Compared to GtkCList, there is no concept of row numbers. Therefore, a number of GtkCList methods had to be re-implemented taking `GList *node' arguments instead of `gint row'. Options ------- Signals ------- - Signal: void GtkCTree::tree_expand (GtkCTree *CTREE, GList *NODE) - Signal: void GtkCTree::tree_collapse (GtkCTree *CTREE, GList *NODE) - Signal: void GtkCTree::tree_move (GtkCTree *CTREE, GList *NODE, GList *NEW_PARENT, GList *NEW_SIBLING) - Signal: void GtkCTree::tree_select_row (GtkCTree *CTREE, GList *ROW, gint COLUMN) - Signal: void GtkCTree::tree_unselect_row (GtkCTree *CTREE, GList *ROW, gint COLUMN) Functions --------- - Function: GtkType gtk_ctree_get_type (void) Returns the `GtkCTree' type identifier. - Function: GtkWidget* gtk_ctree_new (gint COLUMNS, gint TREE_COLUMN) Creates a new GtkCTree widget with the given number of columns and the given tree column. On success, a pointer to the newly created widget is returned, and `NULL' otherwise. - Function: GtkWidget* gtk_ctree_new_with_titles (gint COLUMNS, gint TREE_COLUMN, gchar *TITLES[]) Creates a new GtkCTree widget with the given number of columns and the given tree column. The column titles are initialized to the strings of the array TITLES. On success, a pointer to the newly created widget is returned, and `NULL' otherwise. - Function: GList* gtk_ctree_insert (GtkCTree *CTREE, GList *PARENT, GList *SIBLING, gchar *TEXT[], guint8 SPACING, GdkPixmap *PIXMAP_CLOSED, GdkPixmap *MASK_CLOSED, GdkPixmap *PIXMAP_OPENED, GdkPixmap *MASK_OPENED, gboolean IS_LEAF, gboolean EXPANDED) Inserts a new node at the given position. If PARENT == NULL, the node is inserted at root level. If SIBLING == NULL, the node is appended to the existing list of siblings. Otherwise, the node is inserted before SIBLING. If not NULL, the two pixmaps/masks are used to indicate the opened/closed status of the node. SPACING is the number of pixels between pixmap and text. If IS_LEAF == TRUE, the node cannot have any children. The initial expanded/collapsed status is given by EXPANDED. On success, the pointer to the newly inserted node is returned, and NULL otherwise. - Function: void gtk_ctree_remove (GtkCTree *CTREE, GList *NODE) Removes the given node and all its children. - Function: void gtk_ctree_clear (GtkCTree *CTREE) Removes all nodes of CTREE. - Function: void gtk_ctree_post_recursive (GtkCTree *CTREE, GList *NODE, GtkCTreeFunc FUNC, gpointer DATA) Apply FUNC to NODE and all its children, traversing CTREE in post-order. - Function: void gtk_ctree_pre_recursive (GtkCTree *CTREE, GList *NODE, GtkCTreeFunc FUNC, gpointer DATA) Apply FUNC to NODE and all its children, traversing CTREE in pre-order. - Function: gboolean gtk_ctree_is_visible (GtkCTree *CTREE, GList *NODE) Returns the visibility status of the given node. A node is said to be visible if in the chain of parent nodes every node is expanded. Or : the node is currently being displayed (but not necessarily inside the viewing area). - Function: GtkCTree* GTK_CTREE (gpointer OBJ) Cast a generic pointer to `GtkCTree*'. *Note Standard Macros::, for more info. - Function: GtkCTreeClass* GTK_CTREE_CLASS (gpointer CLASS) Cast a generic pointer to `GtkCTreeClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_CTREE (gpointer OBJ) Determine if a generic pointer refers to a `GtkCTree' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkCurve, Next: GtkGammaCurve, Prev: GtkCTree, Up: Widgets The curve widget ================ Description ----------- Derived from *note GtkDrawingArea::. Options ------- - User Option: type * GTK_CURVE_TYPE_LINEAR * GTK_CURVE_TYPE_SPLINE * GTK_CURVE_TYPE_FREE Signals ------- Functions --------- - Function: guint gtk_curve_get_type (void) Returns the `GtkCurve' type identifier. - Function: GtkWidget* gtk_curve_new (void) Create a new `GtkCurve' returning the new widget as a pointer to a `GtkWidget' object. - Function: void gtk_curve_reset (GtkCurve *CURVE) - Function: void gtk_curve_set_gamma (GtkCurve *CURVE, gfloat GAMMA) - Function: void gtk_curve_set_range (GtkCurve *CURVE, gfloat MIN_X, gfloat MAX_X, gfloat MIN_Y, gfloat MAX_Y) - Function: void gtk_curve_get_vector (GtkCurve *CURVE, int VECLEN, gfloat VECTOR[]) - Function: void gtk_curve_set_vector (GtkCurve *CURVE, int VECLEN, gfloat VECTOR[]) - Function: void gtk_curve_set_curve_type (GtkCurve *CURVE, GtkCurveType TYPE) - Function: GtkCurve* GTK_CURVE (gpointer OBJ) Cast a generic pointer to `GtkCurve*'. *Note Standard Macros::, for more info. - Function: GtkCurveClass* GTK_CURVE_CLASS (gpointer CLASS) Cast a generic pointer to `GtkCurveClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_CURVE (gpointer OBJ) Determine if a generic pointer refers to a `GtkCurve' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkGammaCurve, Next: GtkDialog, Prev: GtkCurve, Up: Widgets The gamma curve widget ====================== Description ----------- Lets the user edit a gamma curve (a one-to-one mapping usually used to adjust the intensity of an image to the physical characteristics of the output device). You can set the minimum and maximum values for input and output. You can set the initial vector as well. You are guaranteed that every input value will have a (not necessarily unique) output value specified. Derived from *note GtkVBox::. Makes use of *note GtkCurve:: to draw the curve. Options ------- Signals ------- Functions --------- - Function: guint gtk_gamma_curve_get_type (void) Returns the `GtkGamma' type identifier. - Function: GtkWidget* gtk_gamma_curve_new (void) Create a new `GtkGamma' returning the new widget as a pointer to a `GtkWidget' object. - Function: GtkGammaCurve* GTK_GAMMACURVE (gpointer OBJ) Cast a generic pointer to `GtkGammaCurve*'. *Note Standard Macros::, for more info. - Function: GtkGammaCurveClass* GTK_GAMMACURVE_CLASS (gpointer CLASS) Cast a generic pointer to `GtkGammaCurveClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_GAMMACURVE (gpointer OBJ) Determine if a generic pointer refers to a `GtkGammaCurve' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkDialog, Next: GtkDrawingArea, Prev: GtkGammaCurve, Up: Widgets The dialog widget ================= Description ----------- The dialog widget is a window (*note GtkWindow::) that has a vertical box (*note GtkVBox::), a horizontal box (*note GtkHBox::), separated with a horizontal separator (*note GtkHSeparator::). Options ------- Signals ------- Functions --------- - Function: guint gtk_dialog_get_type (void) Returns the `GtkDialog' type identifier. - Function: GtkWidget* gtk_dialog_new (void) Create a new `GtkDialog' object and return the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkDialog* GTK_DIALOG (gpointer OBJ) Cast a generic pointer to `GtkDialog*'. *Note Standard Macros::, for more info. - Function: GtkDialogClass* GTK_DIALOG_CLASS (gpointer CLASS) Cast a generic pointer to `GtkDialogClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_DIALOG (gpointer OBJ) Determine if a generic pointer refers to a `GtkDialog' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkDrawingArea, Next: GtkEntry, Prev: GtkDialog, Up: Widgets The drawing area widget ======================= Description ----------- A base class for widgets that need a box to draw into. So far, only used by GtkCurve. Options ------- - User Option: width - User Option: height Signals ------- Functions --------- - Function: guint gtk_drawing_area_get_type (void) Returns the `GtkDrawingArea' type identifier. - Function: GtkWidget* gtk_drawing_area_new (void) Create a new `GtkDrawingArea' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_drawing_area_size (GtkDrawingArea *DAREA, gint WIDTH, gint HEIGHT) Set the size of the DAREA widget, created previously, to WIDTH and HEIGHT. - Function: GtkDrawingArea* GTK_DRAWING_AREA (gpointer OBJ) Cast a generic pointer to `GtkDrawingArea*'. *Note Standard Macros::, for more info. - Function: GtkDrawingAreaClass* GTK_DRAWING_AREA_CLASS (gpointer CLASS) Cast a generic pointer to `GtkDrawingAreaClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_DRAWING_AREA (gpointer OBJ) Determine if a generic pointer refers to a `GtkDrawingArea' object. *Note Standard Macros::, for more info. 0707010001bafc000081a40000000a0000000a000000013d12d39e0000c427000000880000000300000000000000000000001eff350892reloc/doc/gtk/docs/gtk.info-3This is gtk.info, produced by makeinfo version 4.0 from gtk.texi. This file documents GTK, the GIMP Toolkit Copyright (C) 1996 Peter Mattis Copyright (C) 1997 Peter Mattis Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Peter Mattis. INFO-DIR-SECTION User Interface Toolkit START-INFO-DIR-ENTRY * GTK: (gtk). The GIMP Toolkit END-INFO-DIR-ENTRY  File: gtk.info, Node: GtkEntry, Next: GtkEventBox, Prev: GtkDrawingArea, Up: Widgets The entry widget ================ Description ----------- Enter text into this widget. Derived from GtkEditable. Can be set so it isn't editable. Options ------- - User Option: max With this option it is possible to set the TEXT_MAX_LENGTH to the value specified in the MAX option. This value is a guint16 value. - User Option: text With this option it is possible to 'preload' the text that will be displayed in the `entry' widget to the string pointed to by TEXT. Signals ------- - Signal: void GtkEntry::insert_text (GtkEntry *ENTRY, gchar *TEXT, gint LENGTH, gint *POSITION) - Signal: void GtkEntry::delete_text (GtkEntry *ENTRY, gint START_POS, gint END_POS) - Signal: void GtkEntry::changed (GtkEntry *ENTRY) - Signal: void GtkEntry::set_text (GtkEntry *ENTRY) - Signal: void GtkEntry::activate (GtkEntry *ENTRY) Functions --------- - Function: guint gtk_entry_get_type (void) Returns the `GtkEntry' type identifier. - Function: GtkWidget* gtk_entry_new (void) Create a new `GtkEntry' object. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkWidget* gtk_entry_new_with_max_length (guint16 MAX) Create a new `GtkEntry' object initializing it with the value MAX. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_entry_set_text (GtkEntry *ENTRY, gchar *TEXT) Will set the text in the previously created `GtkEntry' object to TEXT. It is important to not set the fields of the `GtkEntry' structure directly (or, for that matter, any type derived from `GtkObject'). - Function: void gtk_entry_append_text (GtkEntry *ENTRY, gchar *TEXT) Append the text that is in the TEXT argument to the widgets text. It is important to not set the fields of the `GtkEntry' structure directly. - Function: void gtk_entry_prepend_text (GtkEntry *ENTRY, gchar *TEXT) Add the text in the TEXT argument to the text in the `GtkEntry' widget. It is important to not set the fields of the `GtkEntry' structure directly. - Function: void gtk_entry_set_position (GtkEntry *ENTRY, gint POSITION) - Function: void gtk_entry_set_visibility (GtkEntry *ENTRY, gint VISIBLE) Will make the keystrokes entered into the `GtkEntry' object invisible when VISIBLE is `TRUE'. Defaults to `FALSE'. - Function: gchar* gtk_entry_get_text (GtkEntry *ENTRY) Returns the text that is contained in the `GtkEntry' as a pointer to a `gchar' variable. - Function: GtkEntry* GTK_ENTRY (gpointer OBJ) Cast a generic pointer to `GtkEntry*'. *Note Standard Macros::, for more info. - Function: GtkEntryClass* GTK_ENTRY_CLASS (gpointer CLASS) Cast a generic pointer to `GtkEntryClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_ENTRY (gpointer OBJ) Determine if a generic pointer refers to a `GtkEntry' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkEventBox, Next: GtkFileSelection, Prev: GtkEntry, Up: Widgets The event box widget ==================== Description ----------- Derived from *note GtkBin::. Used by *note GtkTreeItem::. Options ------- Signals ------- Functions --------- - Function: guint gtk_event_box_get_type (void) Returns the `GtkEventBox' type identifier. - Function: GtkWidget* gtk_event_box_new (void) Create a new `GtkEventBox' returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkGtkEventBox* GTK_EVENT_BOX (gpointer OBJ) Cast a generic pointer to `GtkGtkEventBox*'. *Note Standard Macros::, for more info. - Function: GtkGtkEventBoxClass* GTK_EVENT_BOX_CLASS (gpointer CLASS) Cast a generic pointer to `GtkGtkEventBoxClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_EVENT_BOX (gpointer OBJ) Determine if a generic pointer refers to a `GtkGtkEventBox' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkFileSelection, Next: GtkFixed, Prev: GtkEventBox, Up: Widgets The file selection dialog widget ================================ Description ----------- Options ------- - User Option: title - User Option: filename Signals ------- Functions --------- - Function: guint gtk_file_selection_get_type (void) Returns the `GtkFileSelection' type identifier. - Function: GtkWidget* gtk_file_selection_new (gchar *TITLE) Create a new `GtkFileSelection' object and return the new widget as a pointer to a `GtkWidget'. `NULL' is returned on failure. - Function: void gtk_file_selection_set_filename (GtkFileSelection *FILESEL, gchar *FILENAME) - Function: gchar* gtk_file_selection_get_filename (GtkFileSelection *FILESEL) - Function: GtkFileSelection* GTK_FILE_SELECTION (gpointer OBJ) Cast a generic pointer to `GtkFileSelection*'. *Note Standard Macros::, for more info. - Function: GtkFileSelectionClass* GTK_FILE_SELECTION_CLASS (gpointer CLASS) Cast a generic pointer to `GtkFileSelectionClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_FILE_SELECTION (gpointer OBJ) Determine if a generic pointer refers to a `GtkFileSelection' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkFixed, Next: GtkFrame, Prev: GtkFileSelection, Up: Widgets The fixed widget ================ Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_fixed_get_type (void) Returns the `GtkFixed' type identifier. - Function: GtkWidget* gtk_fixed_new (void) Create a new `GtkFixed' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_fixed_put_new (GtkFixed *FIXED, GtkWidget *WIDGET, gint16 X, gint16 Y) - Function: void gtk_fixed_move (GtkFixed *FIXED, GtkWidget *WIDGET, gint16 X, gint16 Y) - Function: GtkFixed* GTK_FIXED (gpointer OBJ) Cast a generic pointer to `GtkFixed*'. *Note Standard Macros::, for more info. - Function: GtkFixedClass* GTK_FIXED_CLASS (gpointer CLASS) Cast a generic pointer to `GtkFixedClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_FIXED (gpointer OBJ) Determine if a generic pointer refers to a `GtkFixed' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkFrame, Next: GtkGamma, Prev: GtkFixed, Up: Widgets The frame widget ================ Options ------- - User Option: label - User Option: xalign - User Option: yalign - User Option: type Description ----------- Signals ------- Functions --------- - Function: guint gtk_frame_get_type (void) Returns the `GtkFrame' type identifier. - Function: GtkWidget* gtk_frame_new (gchar *LABEL) Create a new `GtkFrame' object initializing it with the value in LABEL. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_frame_set_label (GtkFrame *FRAME, gchar *LABEL) - Function: void gtk_frame_set_label_align (GtkFrame *FRAME, gfloat XALIGN, gfloat YALIGN) - Function: void gtk_frame_set_shadow_type (GtkFrame *FRAME, GtkShadowType TYPE) - Function: GtkFrame* GTK_FRAME (gpointer OBJ) Cast a generic pointer to `GtkFrame*'. *Note Standard Macros::, for more info. - Function: GtkFrameClass* GTK_FRAME_CLASS (gpointer CLASS) Cast a generic pointer to `GtkFrameClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_FRAME (gpointer OBJ) Determine if a generic pointer refers to a `GtkFrame' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkGamma, Next: GtkHBox, Prev: GtkFrame, Up: Widgets The gamma widget ================ Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_gamma_curve_get_type (void) Returns the `GtkGamma' type identifier. - Function: GtkWidget* gtk_gamma_curve_new (void) Create a new `GtkGamma' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkGamma* GTK_GAMMA (gpointer OBJ) Cast a generic pointer to `GtkGamma*'. *Note Standard Macros::, for more info. - Function: GtkGammaClass* GTK_GAMMA_CLASS (gpointer CLASS) Cast a generic pointer to `GtkGammaClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_GAMMA (gpointer OBJ) Determine if a generic pointer refers to a `GtkGamma' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkHBox, Next: GtkHButtonBox, Prev: GtkGamma, Up: Widgets The horizontal box widget ========================= Description ----------- Options ------- - User Option: homogeneous This option controls whether each object in the box has the same size. In the case of the `GtkHBox', this effects the width. If this option is set then the EXPAND option to the `gtk_box_pack' (*note GtkBox::) routines is always set to `TRUE'. - User Option: spacing This option controls the amount of space that is added between the objects packed into this `GtkVBox' object. Signals ------- Functions --------- - Function: guint gtk_hbox_get_type (void) Returns the `GtkHBox' type identifier. - Function: GtkWidget* gtk_hbox_new (gint HOMOGENEOUS, gint SPACING) Create a new `GtkHBox' object initializing it with the values in HOMOGENEOUS and SPACING. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkHBox* GTK_HBOX (gpointer OBJ) Cast a generic pointer to `GtkHBox*'. *Note Standard Macros::, for more info. - Function: GtkHBoxClass* GTK_HBOX_CLASS (gpointer CLASS) Cast a generic pointer to `GtkHBoxClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_HBOX (gpointer OBJ) Determine if a generic pointer refers to a `GtkHBox' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkHButtonBox, Next: GtkHPaned, Prev: GtkHBox, Up: Widgets The horizontal button box widget ================================ Description ----------- Options ------- - User Option: spacing - User Option: layout Signals ------- Functions --------- - Function: guint gtk_hbutton_box_get_type (void) Returns the `GtkHButtonBox' type identifier. - Function: GtkWidget* gtk_hbutton_box_new (void) Create a new `GtkHButtonBox' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_hbutton_box_set_spacing_default (gint SPACING) - Function: void gtk_hbutton_box_set_layout_default (gint LAYOUT) - Function: gint gtk_hbutton_box_get_spacing_default (void) - Function: gint gtk_hbutton_box_get_layout_default (void) - Function: GtkHButtonBox* GTK_HBUTTON_BOX (gpointer OBJ) Cast a generic pointer to `GtkHButtonBox*'. *Note Standard Macros::, for more info. - Function: GtkHButtonBoxClass* GTK_HBUTTON_BOX_CLASS (gpointer CLASS) Cast a generic pointer to `GtkHButtonBoxClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_HBUTTON_BOX (gpointer OBJ) Determine if a generic pointer refers to a `GtkHButtonBox' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkHPaned, Next: GtkHRuler, Prev: GtkHButtonBox, Up: Widgets The horizontal paned widget =========================== Description ----------- Options ------- Signals ------- Functions --------- - Function: void gtk_hpaned_get_type (void) Returns the `GtkHPaned' type identifier. - Function: GtkWidget* gtk_hpaned_new (void) Create a new `GtkHPaned' object returning the new widget as a pointer to a `GtkWidget' object. - Function: GtkHPaned* GTK_HPANED (gpointer OBJ) Cast a generic pointer to `GtkHPaned*'. *Note Standard Macros::, for more info. - Function: GtkHPanedClass* GTK_HPANED_CLASS (gpointer CLASS) Cast a generic pointer to `GtkHPanedClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_HPANED (gpointer OBJ) Determine if a generic pointer refers to a `GtkHPaned' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkHRuler, Next: GtkHScale, Prev: GtkHPaned, Up: Widgets The horizontal ruler widget =========================== Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_hruler_get_type (void) Returns the `GtkHRuler' type identifier. - Function: GtkWidget* gtk_hruler_new (void) Create a new `GtkHRuler' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkHRuler* GTK_HRULER (gpointer OBJ) Cast a generic pointer to `GtkHRuler*'. *Note Standard Macros::, for more info. - Function: GtkHRulerClass* GTK_HRULER_CLASS (gpointer CLASS) Cast a generic pointer to `GtkHRulerClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_HRULER (gpointer OBJ) Determine if a generic pointer refers to a `GtkHRuler' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkHScale, Next: GtkHScrollbar, Prev: GtkHRuler, Up: Widgets The horizontal scale widget =========================== Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_hscale_get_type (void) Returns the `GtkHScale' type identifier. - Function: GtkWidget* gtk_hscale_new (GtkAdjustment *ADJUSTMENT) Create a new `GtkHScale' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkHScale* GTK_HSCALE (gpointer OBJ) Cast a generic pointer to `GtkHScale*'. *Note Standard Macros::, for more info. - Function: GtkHScaleClass* GTK_HSCALE_CLASS (gpointer CLASS) Cast a generic pointer to `GtkHScaleClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_HSCALE (gpointer OBJ) Determine if a generic pointer refers to a `GtkHScale' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkHScrollbar, Next: GtkHSeparator, Prev: GtkHScale, Up: Widgets The horizontal scrollbar widget =============================== Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_hscrollbar_get_type (void) Returns the `GtkHScrollbar' type identifier. - Function: GtkWidget* gtk_hscrollbar_new (GtkAdjustment *ADJUSTMENT) Create a new `GtkHScrollbar' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkHScrollbar* GTK_HSCROLLBAR (gpointer OBJ) Cast a generic pointer to `GtkHScrollbar*'. *Note Standard Macros::, for more info. - Function: GtkHScrollbarClass* GTK_HSCROLLBAR_CLASS (gpointer CLASS) Cast a generic pointer to `GtkHScrollbarClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_HSCROLLBAR (gpointer OBJ) Determine if a generic pointer refers to a `GtkHScrollbar' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkHSeparator, Next: GtkImage, Prev: GtkHScrollbar, Up: Widgets The horizontal separator widget =============================== Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_hseparator_get_type (void) Returns the `GtkHSeparator' type identifier. - Function: GtkWidget* gtk_hseparator_new (void) Create a new `GtkHSeparator' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkHSeparator* GTK_HSEPARATOR (gpointer OBJ) Cast a generic pointer to `GtkHSeparator*'. *Note Standard Macros::, for more info. - Function: GtkHSeparatorClass* GTK_HSEPARATOR_CLASS (gpointer CLASS) Cast a generic pointer to `GtkHSeparatorClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_HSEPARATOR (gpointer OBJ) Determine if a generic pointer refers to a `GtkHSeparator' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkImage, Next: GtkInputDialog, Prev: GtkHSeparator, Up: Widgets The image widget ================ Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_image_get_type (void) Returns the `GtkImage' type identifier. - Function: GtkWidget* gtk_image_new (GdkImage *VAL, GdkBitmap *MASK) Create a new `GtkImage' object initializing it with the values in VAL and MASK. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_image_set (GtkImage *IMAGE, GdkImage *VAL, GdkBitmap *MASK) - Function: void gtk_image_get (GtkImage *IMAGE, GdkImage **VAL, GdkBitmap **MASK) - Function: GtkImage* GTK_IMAGE (gpointer OBJ) Cast a generic pointer to `GtkImage*'. *Note Standard Macros::, for more info. - Function: GtkImageClass* GTK_IMAGE_CLASS (gpointer CLASS) Cast a generic pointer to `GtkImageClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_IMAGE (gpointer OBJ) Determine if a generic pointer refers to a `GtkImage' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkInputDialog, Next: GtkItem, Prev: GtkImage, Up: Widgets The input dialog widget ======================= Description ----------- Options ------- Signals ------- - Signal: void GtkInputDialog::enable_device (GtkInputDialog *INPUTD, guint32 DEVID, gpointer *DATA) - Signal: void GtkInputDialog::disable_device (GtkInputDialog *INPUTD, guint32 DEVID, gpointer *DATA) Functions --------- - Function: guint gtk_input_dialog_get_type (void) Returns the `GtkInputDialog' type identifier. - Function: GtkWidget* gtk_input_dialog_new (void) Create a new `GtkInputDialog' object and return the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkInputDialog* GTK_INPUTDIALOG (gpointer OBJ) Cast a generic pointer to `GtkInputDialog*'. *Note Standard Macros::, for more info. - Function: GtkInputDialogClass* GTK_INPUTDIALOG_CLASS (gpointer CLASS) Cast a generic pointer to `GtkInputDialogClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_INPUTDIALOG (gpointer OBJ) Determine if a generic pointer refers to a `GtkInputDialog' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkItem, Next: GtkLabel, Prev: GtkInputDialog, Up: Widgets The item widget =============== Description ----------- Signals ------- - Signal: void GtkItem::select (GtkItem *ITEM) - Signal: void GtkItem::deselect (GtkItem *ITEM) - Signal: void GtkItem::toggle (GtkItem *TOGGLE) Functions --------- - Function: guint gtk_item_get_type (void) Returns the `GtkItem' type identifier. - Function: void gtk_item_select (GtkItem *ITEM) - Function: void gtk_item_deselect (GtkItem *ITEM) - Function: void gtk_item_toggle (GtkItem *ITEM) - Function: GtkItem* GTK_ITEM (gpointer OBJ) Cast a generic pointer to `GtkItem*'. *Note Standard Macros::, for more info. - Function: GtkItemClass* GTK_ITEM_CLASS (gpointer CLASS) Cast a generic pointer to `GtkItemClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_ITEM (gpointer OBJ) Determine if a generic pointer refers to a `GtkItem' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkLabel, Next: GtkList, Prev: GtkItem, Up: Widgets The label widget ================ Description ----------- Options ------- - User Option: str Signals ------- Functions --------- - Function: guint gtk_label_get_type (void) Returns the `GtkLabel' type identifier. - Function: GtkWidget* gtk_label_new (GtkLabel *LABEL, gchar *STR) Create a new `GtkLabel' object and initialize it with the text in STR. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_label_set (GtkLabel *LABEL, gchar *STR) Set the `GtkLabel' label value to the value passed in the STR argument. - Function: void gtk_label_get (GtkLabel *LABEL, gchar **STR) Copies the current value in the `GtkLabel' label field to the variable passed in the STR argument. - Function: GtkLabel* GTK_LABEL (gpointer OBJ) Cast a generic pointer to `GtkLabel*'. *Note Standard Macros::, for more info. - Function: GtkLabelClass* GTK_LABEL_CLASS (gpointer CLASS) Cast a generic pointer to `GtkLabelClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_LABEL (gpointer OBJ) Determine if a generic pointer refers to a `GtkLabel' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkList, Next: GtkListItem, Prev: GtkLabel, Up: Widgets The list widget =============== Description ----------- Signals ------- - Signal: void GtkList::selection_changed (GtkList *LIST) - Signal: void GtkList::select_child (GtkList *LIST, GtkWidget *CHILD) - Signal: void GtkList::unselect_child (GtkList *LIST, GtkWidget *CHILD) Functions --------- - Function: guint gtk_list_get_type (void) Returns the `GtkList' type identifier. - Function: GtkWidget* gtk_list_new (void) Create a new `GtkList' object and return the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_list_insert_items (GtkList *LIST, GList *ITEMS, gint POSITION) - Function: void gtk_list_append_items (GtkList *LIST, GList *ITEMS) - Function: void gtk_list_prepend_items (GtkList *LIST, GList *ITEMS) - Function: void gtk_list_remove_items (GtkList *LIST, GList *ITEMS) - Function: void gtk_list_clear_items (GtkList *LIST, gint START, gint END) - Function: void gtk_list_select_item (GtkList *LIST, gint ITEM) - Function: void gtk_list_unselect_item (GtkList *LIST, gint ITEM) - Function: void gtk_list_select_child (GtkList *LIST, GtkWidget *CHILD) - Function: void gtk_list_unselect_child (GtkList *LIST, GtkWidget *CHILD) - Function: gint gtk_list_child_position (GtkList *LIST, GtkWidget *CHILD) - Function: void gtk_list_set_selection_mode (GtkList *LIST, GtkSelectionMode MODE) - Function: GtkList* GTK_LIST (gpointer OBJ) Cast a generic pointer to `GtkList*'. *Note Standard Macros::, for more info. - Function: GtkListClass* GTK_LIST_CLASS (gpointer CLASS) Cast a generic pointer to `GtkListClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_LIST (gpointer OBJ) Determine if a generic pointer refers to a `GtkList' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkListItem, Next: GtkMenu, Prev: GtkList, Up: Widgets The list item widget ==================== Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_list_item_get_type (void) Returns the `GtkListItem' type identifier. - Function: GtkWidget* gtk_list_item_new (void) Create a new `GtkListItem' object and return the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkWidget* gtk_list_item_new_with_label (gchar *LABEL) Create a new `GtkListItem' object initializing with the value LABEL. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_list_item_select (GtkListItem *LIST_ITEM) - Function: void gtk_list_item_deselect (GtkListItem *LIST_ITEM) - Function: GtkListItem* GTK_LIST_ITEM (gpointer OBJ) Cast a generic pointer to `GtkListItem*'. *Note Standard Macros::, for more info. - Function: GtkListItemClass* GTK_LIST_ITEM_CLASS (gpointer CLASS) Cast a generic pointer to `GtkListItemClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_LIST_ITEM (gpointer OBJ) Determine if a generic pointer refers to a `GtkListItem' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkMenu, Next: GtkMenuBar, Prev: GtkListItem, Up: Widgets The menu widget =============== Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_menu_get_type (void) Returns the `GtkMenu' type identifier. - Function: GtkWidget* gtk_menu_new (void) Create a new `GtkMenu' object returning the new widget as a pointer to a `GtkWidget'. `NULL' is returned on failure. - Function: void gtk_menu_append (GtkMenu *MENU, GtkWidget *CHILD) - Function: void gtk_menu_prepend (GtkMenu *MENU, GtkWidget *CHILD) - Function: void gtk_menu_insert (GtkMenu *MENU, GtkWidget *CHILD, gint POSITION) - Function: void gtk_menu_popup (GtkMenu *MENU, GtkWidget *PARENT_MENU_SHELL, GtkWidget *PARENT_MENU_ITEM, GtkMenuPositionFunc FUNC, gpointer DATA, gint BUTTON) - Function: void gtk_menu_popdown (GtkMenu *MENU) - Function: GtkWidget* gtk_menu_get_active (GtkMenu *MENU) - Function: void gtk_menu_set_active (GtkMenu *MENU) - Function: void gtk_menu_set_accelerator_table (GtkMenu *MENU, GtkAcceleratorTable *TABLE) - Function: GtkMenu* GTK_MENU (gpointer OBJ) Cast a generic pointer to `GtkMenu*'. *Note Standard Macros::, for more info. - Function: GtkMenuClass* GTK_MENU_CLASS (gpointer CLASS) Cast a generic pointer to `GtkMenuClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_MENU (gpointer OBJ) Determine if a generic pointer refers to a `GtkMenu' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkMenuBar, Next: GtkMenuItem, Prev: GtkMenu, Up: Widgets The menu bar widget =================== Description ----------- Options ------- - User Option: position Signals ------- Functions --------- - Function: guint gtk_menu_bar_get_type (void) Returns the `GtkMenuBar' type identifier. - Function: GtkWidget* gtk_menu_bar_new (void) Create a new `GtkMenuBar' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_menu_bar_append (GtkMenuBar *MENU_BAR, GtkWidget *CHILD) - Function: void gtk_menu_bar_prepend (GtkMenuBar *MENU_BAR, GtkWidget *CHILD) - Function: void gtk_menu_bar_insert (GtkMenuBar *MENU_BAR, GtkWidget *CHILD, gint POSITION) - Function: GtkMenuBar* GTK_MENU_BAR (gpointer OBJ) Cast a generic pointer to `GtkMenuBar*'. *Note Standard Macros::, for more info. - Function: GtkMenuBarClass* GTK_MENU_BAR_CLASS (gpointer CLASS) Cast a generic pointer to `GtkMenuBarClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_MENU_BAR (gpointer OBJ) Determine if a generic pointer refers to a `GtkMenuBar' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkMenuItem, Next: GtkMenuShell, Prev: GtkMenuBar, Up: Widgets The menu item widget ==================== Description ----------- Options ------- Signals ------- - Signal: void GtkMenuItem::activate (GtkMenuItem *MENU_ITEM) Functions --------- - Function: guint gtk_menu_item_get_type (void) Returns the `GtkMenuItem' type identifier. - Function: GtkWidget* gtk_menu_item_new (void) Create a new `GtkMenuItem' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkWidget* gtk_menu_item_new_with_label (gchar *LABEL) Create a new `GtkMenuItem' object initializing it with the value in LABEL. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_menu_item_set_submenu (GtkMenuItem *MENU_ITEM, GtkWidget *SUBMENU) - Function: void gtk_menu_item_set_placement (GtkMenuItem *MENU_ITEM, GtkSubmenuPlacement PLACEMENT) - Function: void gtk_menu_item_accelerator_size (GtkMenuItem *MENU_ITEM) - Function: void gtk_menu_item_accelerator_text (GtkMenuItem *MENU_ITEM, gchar *BUFFER) - Function: void gtk_menu_item_configure (GtkMenuItem *MENU_ITEM, gint SHOW_TOGGLE_INDICATOR, gint SHOW_SUBMENU_INDICATOR) - Function: void gtk_menu_item_select (GtkMenuItem *MENU_ITEM) - Function: void gtk_menu_item_deselect (GtkMenuItem *MENU_ITEM) - Function: void gtk_menu_item_activate (GtkMenuItem *MENU_ITEM) - Function: GtkMenuItem* GTK_MENU_ITEM (gpointer OBJ) Cast a generic pointer to `GtkMenuItem*'. *Note Standard Macros::, for more info. - Function: GtkMenuItemClass* GTK_MENU_ITEM_CLASS (gpointer CLASS) Cast a generic pointer to `GtkMenuItemClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_MENU_ITEM (gpointer OBJ) Determine if a generic pointer refers to a `GtkMenuItem' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkMenuShell, Next: GtkMisc, Prev: GtkMenuItem, Up: Widgets The menu shell widget ===================== Description ----------- Options ------- Signals ------- - Signal: void GtkMenuShell::deactivate (GtkMenuShell *MENU_SHELL) Functions --------- - Function: guint gtk_menu_shell_get_type (void) Returns the `GtkMenuShell' type identifier. - Function: void gtk_menu_shell_append (GtkMenuShell *MENU_SHELL, GtkWidget *CHILD) - Function: void gtk_menu_shell_prepend (GtkMenuShell *MENU_SHELL, GtkWidget *CHILD) - Function: void gtk_menu_shell_insert (GtkMenuShell *MENU_SHELL, GtkWidget *CHILD, gint POSITION) - Function: void gtk_menu_shell_deactivate (GtkMenuShell *MENU_SHELL) - Function: GtkMenuShell* GTK_MENU_SHELL (gpointer OBJ) Cast a generic pointer to `GtkMenuShell*'. *Note Standard Macros::, for more info. - Function: GtkMenuShellClass* GTK_MENU_SHELL_CLASS (gpointer CLASS) Cast a generic pointer to `GtkMenuShellClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_MENU_SHELL (gpointer OBJ) Determine if a generic pointer refers to a `GtkMenuShell' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkMisc, Next: GtkNotebook, Prev: GtkMenuShell, Up: Widgets The misc widget =============== Description ----------- Options ------- - User Option: xalign - User Option: yalign - User Option: xpad - User Option: ypad Signals ------- Functions --------- - Function: guint gtk_misc_get_type (void) Returns the `GtkMisc' type identifier. - Function: void gtk_misc_set_alignment (GtkMisc *MISC, gfloat XALIGN, gfloat YALIGN) - Function: void gtk_misc_set_padding (GtkMisc *MISC, gint XPAD, gint YPAD) - Function: GtkMisc* GTK_MISC (gpointer OBJ) Cast a generic pointer to `GtkMisc*'. *Note Standard Macros::, for more info. - Function: GtkMiscClass* GTK_MISC_CLASS (gpointer CLASS) Cast a generic pointer to `GtkMiscClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_MISC (gpointer OBJ) Determine if a generic pointer refers to a `GtkMisc' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkNotebook, Next: GtkOptionMenu, Prev: GtkMisc, Up: Widgets The notebook widget =================== Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_notebook_get_type (void) Returns the `GtkNotebook' type identifier. - Function: GtkWidget* gtk_notebook_new (void) Create a new `GtkNotebook' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on a failure. - Function: void gtk_notebook_append_page (GtkNotebook *NOTEBOOK, GtkWidget *CHILD, GtkWidget *TAB_LABEL) - Function: void gtk_notebook_prepend_page (GtkNotebook *NOTEBOOK, GtkWidget *CHILD, GtkWidget *TAB_LABEL) - Function: void gtk_notebook_insert_page (GtkNotebook *NOTEBOOK, GtkWidget *CHILD, GtkWidget *TAB_LABEL, gint POSITION) - Function: void gtk_notebook_remove_page (GtkNotebook *NOTEBOOK, gint PAGE_NUM) - Function: void gtk_notebook_set_page (GtkNotebook *NOTEBOOK, gint PAGE_NUM) - Function: void gtk_notebook_next_page (GtkNotebook *NOTEBOOK) - Function: void gtk_notebook_prev_page (GtkNotebook *NOTEBOOK) - Function: void gtk_notebook_set_tab_pos (GtkNotebook *NOTEBOOK, GtkPositionType POS) - Function: void gtk_notebook_set_show_tabs (GtkNotebook *NOTEBOOK, gint SHOW_TABS) - Function: void gtk_notebook_set_show_border (GtkNotebook *NOTEBOOK, gint SHOW_BORDER) - Function: GtkNotebook* GTK_NOTEBOOK (gpointer OBJ) Cast a generic pointer to `GtkNotebook*'. *Note Standard Macros::, for more info. - Function: GtkNotebookClass* GTK_NOTEBOOK_CLASS (gpointer CLASS) Cast a generic pointer to `GtkNotebookClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_NOTEBOOK (gpointer OBJ) Determine if a generic pointer refers to a `GtkNotebook' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkOptionMenu, Next: GtkPaned, Prev: GtkNotebook, Up: Widgets The option menu widget ====================== Description ----------- Options ------- - User Option: index Signals ------- Functions --------- - Function: guint gtk_option_menu_get_type (void) Returns the `GtkOptionMenu' type identifier. - Function: GtkWidget* gtk_option_menu_new (void) Create a new `GtkOptionMenu' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkWidget* gtk_option_menu_get_menu (GtkOptionMenu *OPTION_MENU) - Function: void gtk_option_menu_set_menu (GtkOptionMenu *OPTION_MENU, GtkWidget *MENU) - Function: void gtk_option_menu_remove_menu (GtkOptionMenu *OPTION_MENU) - Function: void gtk_option_menu_set_history (GtkOptionMenu *OPTION_MENU, gint INDEX) - Function: GtkOptionMenu* GTK_OPTION_MENU (gpointer OBJ) Cast a generic pointer to `GtkOptionMenu*'. *Note Standard Macros::, for more info. - Function: GtkOptionMenuClass* GTK_OPTION_MENU_CLASS (gpointer CLASS) Cast a generic pointer to `GtkOptionMenuClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_OPTION_MENU (gpointer OBJ) Determine if a generic pointer refers to a `GtkOptionMenu' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkPaned, Next: GtkPixmap, Prev: GtkOptionMenu, Up: Widgets The paned widget ================ Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_paned_get_type (void) Returns the `GtkPaned' type identifier. - Function: void gtk_paned_add1 (GtkPaned *PANED, GtkWidget *CHILD) - Function: void gtk_paned_add2 (GtkPaned *PANED, GtkWidget *CHILD) - Function: void gtk_paned_handle_size (GtkPaned *PANED, guint16 SIZE) - Function: void gtk_paned_gutter_size (GtkPaned *PANED, guint16 SIZE) - Function: GtkPaned* GTK_PANED (gpointer OBJ) Cast a generic pointer to `GtkPaned*'. *Note Standard Macros::, for more info. - Function: GtkPanedClass* GTK_PANED_CLASS (gpointer CLASS) Cast a generic pointer to `GtkPanedClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_PANED (gpointer OBJ) Determine if a generic pointer refers to a `GtkPaned' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkPixmap, Next: GtkPreview, Prev: GtkPaned, Up: Widgets The pixmap widget ================= Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_pixmap_get_type (void) Returns the `GtkPixmap' type identifier. - Function: GtkWidget* gtk_pixmap_new (GdkPixmap *NORMAL, GdkPixmap *ACTIVE, GdkPixmap *PRELIGHT, GdkPixmap *SELECTED, GdkPixmap *INSENSITIVE) - Function: void gtk_pixmap_set (GtkPixmap *PIXMAP, GdkPixmap *VAL, GtkStateType STATE) - Function: void gtk_pixmap_get (GtkPixmap *PIXMAP, GdkPixmap **VAL, GtkStateType STATE) - Function: GtkPixmap* GTK_PIXMAP (gpointer OBJ) Cast a generic pointer to `GtkPixmap*'. *Note Standard Macros::, for more info. - Function: GtkPixmapClass* GTK_PIXMAP_CLASS (gpointer CLASS) Cast a generic pointer to `GtkPixmapClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_PIXMAP (gpointer OBJ) Determine if a generic pointer refers to a `GtkPixmap' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkPreview, Next: GtkProgressBar, Prev: GtkPixmap, Up: Widgets The preview widget ================== Description ----------- Options ------- - User Option: type - User Option: width - User Option: height Signals ------- Functions --------- - Function: guint gtk_preview_get_type (void) Returns the `GtkPreview' type identifier. - Function: void gtk_preview_uninit (void) - Function: GtkWidget* gtk_preview_new (GtkPreviewType TYPE) Create a new `GtkPreview' object initializing it with the values in TYPE. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_preview_size (GtkPreview *PREVIEW, gint WIDTH, gint HEIGHT) Set the size of the PREVIEW object to WIDTH and HEIGHT. - Function: void gtk_preview_put (GtkPreview *PREVIEW, GdkWindow *WINDOW, GdkGC *GC, gint SRCX, gint SRCY, gint DESTX, gint DESTY, gint WIDTH, gint HEIGHT) - Function: void gtk_preview_put_row (GtkPreview *PREVIEW, guchar *SRC, guchar *DEST, gint X, gint Y, gint W) - Function: void gtk_preview_draw_row (GtkPreview *PREVIEW, guchar DATA, gint X, gint Y, gint W) - Function: void gtk_preview_set_expand (GtkPreview *PREVIEW, gint EXPAND) - Function: void gtk_preview_set_gamma (double GAMMA) - Function: void gtk_preview_set_color_cube (guint NRED_SHADES, guint NGREEN_SHADES, guint NBLUE_SHADES, guint NGRAY_SHADES) - Function: void gtk_preview_set_install_cmap (gint INSTALL_CMAP) - Function: void gtk_preview_set_reserved (gint NRESERVED) - Function: GdkVisual* gtk_preview_get_visual (void) - Function: GdkColormap* gtk_preview_get_cmap (void) - Function: GtkPreviewInfo* gtk_preview_get_info (void) - Function: GtkPreview* GTK_PREVIEW (gpointer OBJ) Cast a generic pointer to `GtkPreview*'. *Note Standard Macros::, for more info. - Function: GtkPreviewClass* GTK_PREVIEW_CLASS (gpointer CLASS) Cast a generic pointer to `GtkPreviewClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_PREVIEW (gpointer OBJ) Determine if a generic pointer refers to a `GtkPreview' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkProgressBar, Next: GtkRadioButton, Prev: GtkPreview, Up: Widgets The progress bar widget ======================= Description ----------- Options ------- - User Option: percentage Signals ------- Functions --------- - Function: guint gtk_progress_bar_get_type (void) Returns the `GtkProgressBar' type identifier. - Function: GtkWidget* gtk_progress_bar_new (void) Create a new `GtkProgressBar' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_progress_bar_update (GtkProgressBar *PBAR, gfloat PERCENTAGE) Cause the `GtkProgressBar' to update its visual appearance to reflect the PERCENTAGE. - Function: GtkProgressBar* GTK_PROGRESS_BAR (gpointer OBJ) Cast a generic pointer to `GtkProgressBar*'. *Note Standard Macros::, for more info. - Function: GtkProgressBarClass* GTK_PROGRESS_BAR_CLASS (gpointer CLASS) Cast a generic pointer to `GtkProgressBarClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_PROGRESS_BAR (gpointer OBJ) Determine if a generic pointer refers to a `GtkProgressBar' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkRadioButton, Next: GtkRadioMenuItem, Prev: GtkProgressBar, Up: Widgets The radio button widget ======================= Description ----------- Options ------- - User Option: group - User Option: label Signals ------- Functions --------- - Function: guint gtk_radio_button_get_type (void) Returns the `GtkRadioButton' type identifier. - Function: GtkWidget* gtk_radio_button_new (GSList *GROUP) Create a new `GtkRadioButton' object initializing it with the value in the GROUP argument. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkWidget* gtk_radio_button_new_with_label (GSList *GROUP, gchar *LABEL) Create a new `GtkRadioButton' object initializing it with the values in the GROUP and LABEL arguments. The new widget is returned as a pointer to `GtkWidget' object. `NULL' is returned on failure. - Function: GSList* gtk_radio_button_group (GtkRadioButton *RADIO_BUTTON) - Function: GtkRadioButton* GTK_RADIO_BUTTON (gpointer OBJ) Cast a generic pointer to `GtkRadioButton*'. *Note Standard Macros::, for more info. - Function: GtkRadioButtonClass* GTK_RADIO_BUTTON_CLASS (gpointer CLASS) Cast a generic pointer to `GtkRadioButtonClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_RADIO_BUTTON (gpointer OBJ) Determine if a generic pointer refers to a `GtkRadioButton' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkRadioMenuItem, Next: GtkRange, Prev: GtkRadioButton, Up: Widgets The radio button widget ======================= Description ----------- Options ------- - User Option: group - User Option: label Signals ------- Functions --------- - Function: guint gtk_radio_menu_item_get_type (void) Returns the `GtkRadioMenuItem' type identifier. - Function: GtkWidget* gtk_radio_menu_item_new (GSList *GROUP) Create a new `GtkRadioMenuItem' object and initialize it with the values in GROUP. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkWidget* gtk_radio_menu_item_new_with_label (GSList *GROUP, gchar *LABEL) - Function: GSList* gtk_radio_menu_item_group (GtkRadioMenuItem *RADIO_MENU_ITEM) - Function: GtkRadioMenuItem* GTK_RADIO_MENU_ITEM (gpointer OBJ) Cast a generic pointer to `GtkRadioMenuItem*'. *Note Standard Macros::, for more info. - Function: GtkRadioMenuItemClass* GTK_RADIO_MENU_ITEM_CLASS (gpointer CLASS) Cast a generic pointer to `GtkRadioMenuItemClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_RADIO_MENU_ITEM (gpointer OBJ) Determine if a generic pointer refers to a `GtkRadioMenuItem' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkRange, Next: GtkRuler, Prev: GtkRadioMenuItem, Up: Widgets The range widget ================ Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_range_get_type (void) Returns the `GtkRange' type identifier. - Function: GtkAdjustment* gtk_range_get_adjustment (GtkRange *RANGE) - Function: void gtk_range_set_update_policy (GtkRange *RANGE, GtkUpdatePolicy POLICY) - Function: void gtk_range_set_adjustment (GtkRange *RANGE, GtkAdjustment *ADJUSTMENT) - Function: void gtk_range_draw_background (GtkRange *RANGE) - Function: void gtk_range_draw_trough (GtkRange *RANGE) - Function: void gtk_range_draw_slider (GtkRange *RANGE) - Function: void gtk_range_draw_step_forw (GtkRange *RANGE) - Function: void gtk_range_draw_step_back (GtkRange *RANGE) - Function: void gtk_range_slider_update (GtkRange *RANGE) - Function: gint gtk_range_trough_click (GtkRange *RANGE, gint X, gint Y) - Function: void gtk_range_default_hslider_update (GtkRange *RANGE) - Function: void gtk_range_default_vslider_update (GtkRange *RANGE) - Function: gint gtk_range_default_htrough_click (GtkRange *RANGE, gint X, gint Y) - Function: gint gtk_range_default_vtrough_click (GtkRange *RANGE, gint X, gint Y) - Function: void gtk_range_default_hmotion (GtkRange *RANGE, gint XDELTA, gint YDELTA) - Function: void gtk_range_default_vmotion (GtkRange *RANGE, gint XDELTA, gint YDELTA) - Function: gfloat gtk_range_calc_value (GtkRange *RANGE, gint POSITION) - Function: GtkRange* GTK_RANGE (gpointer OBJ) Cast a generic pointer to `GtkRange*'. *Note Standard Macros::, for more info. - Function: GtkRangeClass* GTK_RANGE_CLASS (gpointer CLASS) Cast a generic pointer to `GtkRangeClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_RANGE (gpointer OBJ) Determine if a generic pointer refers to a `GtkRange' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkRuler, Next: GtkScale, Prev: GtkRange, Up: Widgets The ruler widget ================ Description ----------- Options ------- - User Option: metric - User Option: lower - User Option: upper - User Option: position - User Option: max_size Signals ------- Functions --------- - Function: guint gtk_ruler_get_type (void) Returns the `GtkRuler' type identifier. - Function: void gtk_ruler_set_metric (GtkRuler *RULER, GtkMetricType METRIC) - Function: void gtk_ruler_set_range (GtkRuler *RULER, gfloat LOWER, gfloat UPPER, gfloat POSITION, gfloat MAX_SIZE) - Function: void gtk_ruler_draw_ticks (GtkRuler *RULER) - Function: void gtk_ruler_draw_pos (GtkRuler *RULER) - Function: GtkRuler* GTK_RULER (gpointer OBJ) Cast a generic pointer to `GtkRuler*'. *Note Standard Macros::, for more info. - Function: GtkRulerClass* GTK_RULER_CLASS (gpointer CLASS) Cast a generic pointer to `GtkRulerClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_RULER (gpointer OBJ) Determine if a generic pointer refers to a `GtkRuler' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkScale, Next: GtkScrollbar, Prev: GtkRuler, Up: Widgets The scale widget ================ Description ----------- Options ------- - User Option: digits - User Option: draw_value - User Option: pos Signals ------- Functions --------- - Function: guint gtk_scale_get_type (void) Returns the `GtkScale' type identifier. - Function: void gtk_scale_set_digits (GtkScale *SCALE, gint DIGITS) - Function: void gtk_scale_set_draw_value (GtkScale *SCALE, gint DRAW_VALUE) - Function: void gtk_scale_set_value_pos (GtkScale *SCALE, gint POS) - Function: gint gtk_scale_value_width (GtkScale *SCALE) - Function: void gtk_scale_draw_value (GtkScale *SCALE) - Function: GtkScale* GTK_SCALE (gpointer OBJ) Cast a generic pointer to `GtkScale*'. *Note Standard Macros::, for more info. - Function: GtkScaleClass* GTK_SCALE_CLASS (gpointer CLASS) Cast a generic pointer to `GtkScaleClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_SCALE (gpointer OBJ) Determine if a generic pointer refers to a `GtkScale' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkScrollbar, Next: GtkScrolledWindow, Prev: GtkScale, Up: Widgets The scrollbar widget ==================== Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_scrollbar_get_type (void)a Returns the `GtkScrollbar' type identifier. - Function: GtkScrollbar* GTK_SCROLLBAR (gpointer OBJ) Cast a generic pointer to `GtkScrollbar*'. *Note Standard Macros::, for more info. - Function: GtkScrollbarClass* GTK_SCROLLBAR_CLASS (gpointer CLASS) Cast a generic pointer to `GtkScrollbarClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_SCROLLBAR (gpointer OBJ) Determine if a generic pointer refers to a `GtkScrollbar' object. *Note Standard Macros::, for more info. 0707010001bafd000081a40000000a0000000a000000013d12d39e0000c61c000000880000000300000000000000000000001eff350892reloc/doc/gtk/docs/gtk.info-4This is gtk.info, produced by makeinfo version 4.0 from gtk.texi. This file documents GTK, the GIMP Toolkit Copyright (C) 1996 Peter Mattis Copyright (C) 1997 Peter Mattis Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Peter Mattis. INFO-DIR-SECTION User Interface Toolkit START-INFO-DIR-ENTRY * GTK: (gtk). The GIMP Toolkit END-INFO-DIR-ENTRY  File: gtk.info, Node: GtkScrolledWindow, Next: GtkSeparator, Prev: GtkScrollbar, Up: Widgets The scrolled window widget ========================== Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_scrolled_window_get_type (void) Returns the `GtkScrolledWindow' type identifier. - Function: GtkWidget* gtk_scrolled_window_new (GtkAdjustment *HADJUSTMENT, GtkAdjustment *VADJUSTMENT) Create a new `GtkScrolledWindow' object initializing it with the values in ADJUSTMENT and ADJUSTMENT. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkAdjustment* gtk_scrolled_window_get_hadjustment (GtkScrolledWindow *SCROLLED_WINDOW) - Function: GtkAdjustment* gtk_scrolled_window_get_vadjustment (GtkScrolledWindow *SCROLLED_WINDOW) - Function: void gtk_scrolled_window_set_policy (GtkScrolledWindow *SCROLLED_WINDOW, GtkPolicyType HSCROLLBAR_POLICY, GtkPolicyType VSCROLLBAR_POLICY) - Function: GtkScrolledWindow* GTK_SCROLLED_WINDOW (gpointer OBJ) Cast a generic pointer to `GtkScrolledWindow*'. *Note Standard Macros::, for more info. - Function: GtkScrolledWindowClass* GTK_SCROLLED_WINDOW_CLASS (gpointer CLASS) Cast a generic pointer to `GtkScrolledWindowClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_SCROLLED_WINDOW (gpointer OBJ) Determine if a generic pointer refers to a `GtkScrolledWindow' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkSeparator, Next: GtkStatusbar, Prev: GtkScrolledWindow, Up: Widgets The separator widget ==================== Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_separator_get_type (void) Returns the `GtkSeparator' type identifier. - Function: GtkSeparator* GTK_SEPARATOR (gpointer OBJ) Cast a generic pointer to `GtkSeparator*'. *Note Standard Macros::, for more info. - Function: GtkSeparatorClass* GTK_SEPARATOR_CLASS (gpointer CLASS) Cast a generic pointer to `GtkSeparatorClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_SEPARATOR (gpointer OBJ) Determine if a generic pointer refers to a `GtkSeparator' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkStatusbar, Next: GtkTable, Prev: GtkSeparator, Up: Widgets The statusbar widget ==================== Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_statusbar_get_type (void) Returns the `GtkStatusbar' type identifier. - Function: GtkWidget* gtk_statusbar_new (void) Create a new `GtkStatusbar' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: gint gtk_statusbar_push (GtkStatusbar *STATUSBAR, gchar *TEXT) - Function: void gtk_statusbar_pop (GtkStatusbar *STATUSBAR, gint CONTEXT_ID) - Function: GtkStatusbar* GTK_STATUSBAR (gpointer OBJ) Cast a generic pointer to `GtkStatusbar*'. *Note Standard Macros::, for more info. - Function: GtkStatusbarClass* GTK_STATUSBAR_CLASS (gpointer CLASS) Cast a generic pointer to `GtkStatusbarClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_STATUSBAR (gpointer OBJ) Determine if a generic pointer refers to a `GtkStatusbar' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkTable, Next: GtkText, Prev: GtkStatusbar, Up: Widgets The table widget ================ Description ----------- Options ------- - User Option: rows - User Option: columns - User Option: homogeneous This option controls whether all child widgets in the `GtkTable' will be of the same size. The child widgets will be the size of the largest child. Signals ------- Functions --------- - Function: guint gtk_table_get_type (void) Returns the `GtkTable' type identifier. - Function: GtkWidget* gtk_table_new (gint ROWS, gint COLUMNS, gint HOMOGENEOUS) Create a new `GtkTable' object initializing it with the values in ROWS, COLUMNS and HOMOGENEOUS. The new widget is returned as a pointer to a `GtkWidget'. `NULL' is returned on failure. - Function: void gtk_table_attach (GtkTable *TABLE, GtkWidget *CHILD, gint LEFT_ATTACH, gint RIGHT_ATTACH, gint TOP_ATTACH, gint BOTTOM_ATTACH, gint XOPTIONS, gint YOPTIONS, gint XPADDING, gint YPADDING) - Function: void gtk_table_attach_defaults (GtkTable *TABLE, GtkWidget *WIDGET, gint LEFT_ATTACH, gint RIGHT_ATTACH, gint TOP_ATTACH, gint BOTTOM_ATTACH) - Function: void gtk_table_set_row_spacing (GtkTable *TABLE, gint ROW, gint SPACING) - Function: void gtk_table_set_col_spacing (GtkTable *TABLE, gint COL, gint SPACING) - Function: void gtk_table_set_row_spacings (GtkTable *TABLE, gint SPACING) - Function: void gtk_table_set_col_spacings (GtkTable *TABLE, gint SPACING) - Function: GtkTable* GTK_TABLE (gpointer OBJ) Cast a generic pointer to `GtkTable*'. *Note Standard Macros::, for more info. - Function: GtkTableClass* GTK_TABLE_CLASS (gpointer CLASS) Cast a generic pointer to `GtkTableClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_TABLE (gpointer OBJ) Determine if a generic pointer refers to a `GtkTable' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkText, Next: GtkToggleButton, Prev: GtkTable, Up: Widgets The text widget =============== Description ----------- Signals ------- Functions --------- - Function: guint gtk_text_get_type (void) Returns the `GtkText' type identifier. - Function: GtkWidget* gtk_text_new (GtkAdjustment *HADJ, GtkAdjustment *VADJ); Create a new `GtkText' object initializing it with the values in HADJ and VADJ. The new widget is returned as a pointer to a `GtkWidget'. `NULL' is returned on failure. - Function: void gtk_text_set_editable (GtkText *TEXT, gint EDITABLE) - Function: void gtk_text_set_adjustments (GtkText *TEXT, GtkAdjustment *HADJ, GtkAdjustment *VADJ) - Function: void gtk_text_set_point (GtkText *TEXT, guint INDEX) - Function: guint gtk_text_get_point (GtkText *TEXT) - Function: guint gtk_text_get_length (GtkText *TEXT) - Function: void gtk_text_freeze (GtkText *TEXT) - Function: void gtk_text_thaw (GtkText *TEXT) - Function: void gtk_text_insert (GtkText *TEXT, GdkFont *FONT, GdkColor *FORE, GdkColor *BACK, char *CHARS, gint LENGTH) - Function: gint gtk_text_forward_delete (GtkText *TEXT, guint NCHARS) - Function: gint gtk_text_backward_delete (GtkText *TEXT, guint NCHARS) - Function: GtkText* GTK_TEXT (gpointer OBJ) Cast a generic pointer to `GtkText*'. *Note Standard Macros::, for more info. - Function: GtkTextClass* GTK_TEXT_CLASS (gpointer CLASS) Cast a generic pointer to `GtkTextClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_TEXT (gpointer OBJ) Determine if a generic pointer refers to a `GtkText' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkToggleButton, Next: GtkToolbar, Prev: GtkText, Up: Widgets The toggle button widget ======================== Description ----------- Another form of button (*note GtkButton::) with two states: on and off. The appearance is that of a button which stays pressed on the first click, and is released on the second click. Options ------- - User Option: state Signals ------- - Signal: void GtkToggleButton::toggled (GtkToggleButton *TOGGLE_BUTTON) Functions --------- - Function: guint gtk_toggle_button_get_type (void) Returns the `GtkToggleButton' type identifier. - Function: GtkWidget* gtk_toggle_button_new (void) Create a new `GtkToggleButton' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkWidget* gtk_toggle_button_new_with_label (gchar *LABEL) Create a new `GtkToggleButton' object initializing it with the values in LABEL. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_toggle_button_set_mode (GtkToggleButton *TOGGLE_BUTTON, gint DRAW_INDICATOR) - Function: void gtk_toggle_button_set_state (GtkToggleButton *TOGGLE_BUTTON, gint STATE) - Function: void gtk_toggle_button_toggled (GtkToggleButton *TOGGLE_BUTTON) - Function: GtkToggleButton* GTK_TOGGLE_BUTTON (gpointer OBJ) Cast a generic pointer to `GtkToggleButton*'. *Note Standard Macros::, for more info. - Function: GtkToggleButtonClass* GTK_TOGGLE_BUTTON_CLASS (gpointer CLASS) Cast a generic pointer to `GtkToggleButtonClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_TOGGLE_BUTTON (gpointer OBJ) Determine if a generic pointer refers to a `GtkToggleButton' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkToolbar, Next: GtkTooltips, Prev: GtkToggleButton, Up: Widgets The tool bar widget =================== Description ----------- Options ------- - User Option: orientation * GTK_ORIENTATION_HORIZONTAL * GTK_ORIENTATION_VERTICAL - User Option: style * GTK_TOOLBAR_ICONS * GTK_TOOLBAR_TEXT * GTK_TOOLBAR_BOTH - User Option: space_size Signals ------- Functions --------- - Function: guint gtk_toolbar_get_type (void) Returns the `GtkToolbar' type identifier. - Function: GtkWidget* gtk_toolbar_new (GtkOrientation ORIENTATION, GtkToolbarStyle STYLE) Create a new `GtkToolbar' object initializing it with the values ORIENTATION and STYLE. `NULL' is returned on failure. - Function: void gtk_toolbar_append_item (GtkToolbar *TOOLBAR, char *TEXT, char *TOOLTIP_TEXT, GtkPixmap *ICON, GtkSignalFunc CALLBACK, gpointer USER_DATA) - Function: void gtk_toolbar_prepend_item (GtkToolbar *TOOLBAR, char *TEXT, char *TOOLTIP_TEXT, GtkPixmap *ICON, GtkSignalFunc CALLBACK, gpointer USER_DATA) - Function: void gtk_toolbar_insert_item (GtkToolbar *TOOLBAR, char *TEXT, char *TOOLTIP_TEXT, GtkPixmap *ICON, GtkSignalFunc CALLBACK, gpointer USER_DATA, gint POSITION) - Function: void gtk_toolbar_append_space (GtkToolbar *TOOLBAR) - Function: void gtk_toolbar_prepend_space (GtkToolbar *TOOLBAR) - Function: void gtk_toolbar_insert_space (GtkToolbar *TOOLBAR, gint POSITION) - Function: void gtk_toolbar_set_orientation (GtkToolbar *TOOLBAR, GtkOrientation ORIENTATION) - Function: void gtk_toolbar_set_style (GtkToolbar *TOOLBAR, GtkToolbarStyle STYLE) Set the STYLE of the TOOLBAR to STYLE. - Function: void gtk_toolbar_set_space_size (GtkToolbar *TOOLBAR, gint SPACE_SIZE) - Function: void gtk_toolbar_set_tooltips (GtkToolbar *TOOLBAR, gint ENABLE) - Function: GtkToolbar* GTK_TOOLBAR (gpointer OBJ) Cast a generic pointer to `GtkToolbar*'. *Note Standard Macros::, for more info. - Function: GtkToolbarClass* GTK_TOOLBAR_CLASS (gpointer CLASS) Cast a generic pointer to `GtkToolbarClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_TOOLBAR (gpointer OBJ) Determine if a generic pointer refers to a `GtkToolbar' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkTooltips, Next: GtkTree, Prev: GtkToolbar, Up: Widgets The tool tips widget ==================== Description ----------- Options ------- Signals ------- Functions --------- - Function: GtkTooltips* gtk_tooltips_new (void) Create a new `GtkTooltips' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkTooltips* gtk_tooltips_ref (GtkTooltips *TOOLTIPS) - Function: void gtk_tooltips_unref (GtkTooltips *TOOLTIPS) - Function: void gtk_tooltips_free_string (gpointer DATA, gpointer USER_DATA) - Function: void gtk_tooltips_enable (GtkTooltips *TOOLTIPS) - Function: void gtk_tooltips_disable (GtkTooltips *TOOLTIPS) - Function: void gtk_tooltips_set_delay (GtkTooltips *TOOLTIPS, GtkWidget *WIDGET, gchar *TIPS_TEXT) - Function: void gtk_tooltips_set_colors (GtkTooltips *TOOLTIPS, GdkColor *BACKGROUND, GdkColor *FOREGROUND) - Function: GtkTooltips* GTK_TOOLTIPS (gpointer OBJ) Cast a generic pointer to `GtkTooltips*'. *Note Standard Macros::, for more info. - Function: GtkTooltipsClass* GTK_TOOLTIPS_CLASS (gpointer CLASS) Cast a generic pointer to `GtkTooltipsClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_TOOLTIPS (gpointer OBJ) Determine if a generic pointer refers to a `GtkTooltips' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkTree, Next: GtkTreeItem, Prev: GtkTooltips, Up: Widgets The tree widget =============== Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_tree_get_type (void) Returns the `GtkTree' type identifier. - Function: GtkWidget* gtk_tree_new (void) Create a new `GtkTree' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_tree_append (GtkTree *TREE, GtkWidget *CHILD) - Function: void gtk_tree_prepend (GtkTree *TREE, GtkWidget *CHILD) - Function: void gtk_tree_insert (GtkTree *TREE, GtkWidget *CHILD, gint POSITION) - Function: gint gtk_tree_child_position (GtkTree *TREE, GtkWidget *CHILD) - Function: void gtk_tree_clear_items (GtkTree *TREE, gint START, gint END) - Function: void gtk_tree_remove_items (GtkTree *TREE, GList *ITEMS) - Function: void gtk_tree_select_child (GtkTree *TREE, GtkWidget *CHILD) - Function: void gtk_tree_select_item (GtkTree *TREE, gint ITEM) - Function: void gtk_tree_unselect_child (GtkTree *TREE, GtkWidget *CHILD) - Function: void gtk_tree_unselect_item (GtkTree *TREE, gint ITEM) - Function: void gtk_tree_set_selection_mode (GtkTree *TREE, GtkSelectionMode MODE) - Function: void gtk_tree_set_view_mode (GtkTree *TREE, GtkTreeViewMode MODE) - Function: void gtk_tree_set_view_lines (GtkTree *TREE, guint FLAG) - Function: GtkTree* GTK_TREE (gpointer OBJ) Cast a generic pointer to `GtkTree*'. *Note Standard Macros::, for more info. - Function: GtkTreeClass* GTK_TREE_CLASS (gpointer CLASS) Cast a generic pointer to `GtkTreeClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_TREE (gpointer OBJ) Determine if a generic pointer refers to a `GtkTree' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkTreeItem, Next: GtkVBox, Prev: GtkTree, Up: Widgets The tree item widget ==================== Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_tree_item_get_type (void) Returns the `GtkTreeItem' type identifier. - Function: GtkWidget* gtk_tree_item_new (void) Create a new `GtkTreeItem' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkWidget* gtk_tree_item_new_with_label (gchar *LABEL) Create a new `GtkTreeItem' object initializing it with the values in LABEL. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_tree_item_set_subtree (GtkTreeItem *TREE_ITEM, GtkWidget *SUBTREE) - Function: void gtk_tree_item_select (GtkTreeItem *TREE_ITEM) - Function: void gtk_tree_item_deselect (GtkTreeItem *TREE_ITEM) - Function: void gtk_tree_item_expand (GtkTreeItem *TREE_ITEM) - Function: void gtk_tree_item_collapse (GtkTreeItem *TREE_ITEM) - Function: void gtk_tree_item_remove_subtree (GtkTreeItem *ITEM) - Function: GtkTreeItem* GTK_TREE_ITEM (gpointer OBJ) Cast a generic pointer to `GtkTreeItem*'. *Note Standard Macros::, for more info. - Function: GtkTreeItemClass* GTK_TREE_ITEM_CLASS (gpointer CLASS) Cast a generic pointer to `GtkTreeItemClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_TREE_ITEM (gpointer OBJ) Determine if a generic pointer refers to a `GtkTreeItem' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkVBox, Next: GtkVButtonBox, Prev: GtkTreeItem, Up: Widgets The vertical box widget ======================= Description ----------- Options ------- - User Option: homogeneous This option controls whether each object in the box has the same size. In the case of the `GtkVBox', this refers to the height. If this option is set then the EXPAND option to the `gtk_box_pack' (*note GtkBox::) routines is always turned on. - User Option: spacing This option sets the amount of space that is added between the objects packed into this `GtkVBox' object. Signals ------- This widget does not define any new signals. Functions --------- - Function: guint gtk_vbox_get_type (void) Returns the `GtkVBox' type identifier. - Function: GtkWidget* gtk_vbox_new (gint HOMOGENEOUS, gint SPACING) Create a new `GtkVBox' object initializing it with the values in HOMOGENEOUS and SPACING. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkVBox* GTK_VBOX (gpointer OBJ) Cast a generic pointer to `GtkVBox*'. *Note Standard Macros::, for more info. - Function: GtkVBoxClass* GTK_VBOX_CLASS (gpointer CLASS) Cast a generic pointer to `GtkVBoxClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_VBOX (gpointer OBJ) Determine if a generic pointer refers to a `GtkVBox' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkVButtonBox, Next: GtkViewport, Prev: GtkVBox, Up: Widgets The vertical button box widget ============================== Description ----------- Options ------- - User Option: spacing - User Option: layout Signals ------- Functions --------- - Function: guint gtk_vbutton_box_get_type (void) Returns the `GtkVButtonBox' type identifier. - Function: GtkWidget* gtk_vbutton_box_new (void) Create a new `GtkVButtonBox' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: void gtk_vbutton_box_set_spacing_default (gint SPACING) - Function: void gtk_vbutton_box_set_layout_default (gint LAYOUT) - Function: gint gtk_vbutton_box_get_spacing_default (void) - Function: gint gtk_vbutton_box_get_layout_default (void) - Function: GtkVButtonBox* GTK_VBUTTON_BOX (gpointer OBJ) Cast a generic pointer to `GtkVButtonBox*'. *Note Standard Macros::, for more info. - Function: GtkVButtonBoxClass* GTK_VBUTTON_BOX_CLASS (gpointer CLASS) Cast a generic pointer to `GtkVButtonBoxClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_VBUTTON_BOX (gpointer OBJ) Determine if a generic pointer refers to a `GtkVButtonBox' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkViewport, Next: GtkVPaned, Prev: GtkVButtonBox, Up: Widgets The viewport widget =================== Description ----------- Signals ------- Functions --------- - Function: guint gtk_viewport_get_type (void) Returns the `GtkViewport' type identifier. - Function: GtkWidget* gtk_viewport_new (GtkAdjustment *HADJUSTMENT, GtkAdjustment *VADJUSTMENT) - Function: GtkAdjustment* gtk_viewport_get_hadjustment (GtkViewport *VIEWPORT) - Function: GtkAdjustment* gtk_viewport_get_vadjustment (GtkViewport *VIEWPORT) - Function: void gtk_viewport_set_hadjustment (GtkViewport *VIEWPORT, GtkAdjustment *ADJUSTMENT) - Function: void gtk_viewport_set_vadjustment (GtkViewport *VIEWPORT, GtkAdjustment *ADJUSTMENT) - Function: void gtk_viewport_set_shadow_type (GtkViewport *VIEWPORT, GtkShadowType TYPE) - Function: GtkViewport* GTK_VIEWPORT (gpointer OBJ) Cast a generic pointer to `GtkViewport*'. *Note Standard Macros::, for more info. - Function: GtkViewportClass* GTK_VIEWPORT_CLASS (gpointer CLASS) Cast a generic pointer to `GtkViewportClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_VIEWPORT (gpointer OBJ) Determine if a generic pointer refers to a `GtkViewport' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkVPaned, Next: GtkVRuler, Prev: GtkViewport, Up: Widgets The vertical paned widget ========================= Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_vpaned_get_type (void) Returns the `GtkVPaned' type identifier. - Function: GtkWidget* gtk_vpaned_new (void) Create a new `GtkVPaned' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkVPaned* GTK_VPANED (gpointer OBJ) Cast a generic pointer to `GtkVPaned*'. *Note Standard Macros::, for more info. - Function: GtkVPanedClass* GTK_VPANED_CLASS (gpointer CLASS) Cast a generic pointer to `GtkVPanedClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_VPANED (gpointer OBJ) Determine if a generic pointer refers to a `GtkVPaned' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkVRuler, Next: GtkVScale, Prev: GtkVPaned, Up: Widgets The vertical ruler widget ========================= Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_vruler_get_type (void) Returns the `GtkVRuler' type identifier. - Function: GtkWidget* gtk_vruler_new (void) Create a new `GtkVRuler' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkVRuler* GTK_VRULER (gpointer OBJ) Cast a generic pointer to `GtkVRuler*'. *Note Standard Macros::, for more info. - Function: GtkVRulerClass* GTK_VRULER_CLASS (gpointer CLASS) Cast a generic pointer to `GtkVRulerClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_VRULER (gpointer OBJ) Determine if a generic pointer refers to a `GtkVRuler' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkVScale, Next: GtkVScrollbar, Prev: GtkVRuler, Up: Widgets The vertical ruler widget ========================= Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_vscale_get_type (void) Returns the `GtkVScale' type identifier. - Function: GtkWidget* gtk_vscale_new (GtkAdjustment *ADJUSTMENT) Create a new `GtkVScale' object returning the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkVScale* GTK_VSCALE (gpointer OBJ) Cast a generic pointer to `GtkVScale*'. *Note Standard Macros::, for more info. - Function: GtkVScaleClass* GTK_VSCALE_CLASS (gpointer CLASS) Cast a generic pointer to `GtkVScaleClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_VSCALE (gpointer OBJ) Determine if a generic pointer refers to a `GtkVScale' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkVScrollbar, Next: GtkVSeparator, Prev: GtkVScale, Up: Widgets The vertical scrollbar widget ============================= Description ----------- Options ------- Signals ------- Functions --------- - Function: guint gtk_vscrollbar_get_type (void) Returns the `GtkVScrollbar' type identifier. - Function: GtkWidget* gtk_vscrollbar_new (GtkAdjustment *ADJUSTMENT) Create a new `GtkVScrollbar' object initializing it with the values in ADJUSTMENT. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkVScrollbar* GTK_VSCROLLBAR (gpointer OBJ) Cast a generic pointer to `GtkVScrollbar*'. *Note Standard Macros::, for more info. - Function: GtkVScrollbarClass* GTK_VSCROLLBAR_CLASS (gpointer CLASS) Cast a generic pointer to `GtkVScrollbarClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_VSCROLLBAR (gpointer OBJ) Determine if a generic pointer refers to a `GtkVScrollbar' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkVSeparator, Next: GtkWidget, Prev: GtkVScrollbar, Up: Widgets The vertical separator widget ============================= Description ----------- Signals ------- Functions --------- - Function: guint gtk_vseparator_get_type (void) Returns the `GtkVSeparator' type identifier. - Function: GtkWidget* gtk_vseparator_new (void) Create a new `GtkVSeparator' object and return the new widget as a pointer to a `GtkWidget' object. `NULL' is returned on failure. - Function: GtkVSeparator* GTK_VSEPARATOR (gpointer OBJ) Cast a generic pointer to `GtkVSeparator*'. *Note Standard Macros::, for more info. - Function: GtkVSeparatorClass* GTK_VSEPARATOR_CLASS (gpointer CLASS) Cast a generic pointer to `GtkVSeparatorClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_VSEPARATOR (gpointer OBJ) Determine if a generic pointer refers to a `GtkVSeparator' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkWidget, Next: GtkWindow, Prev: GtkVSeparator, Up: Widgets The base widget =============== Description ----------- Signals ------- - Signal: void GtkWidget::show (GtkWidget *WIDGET) - Signal: void GtkWidget::hide (GtkWidget *WIDGET) - Signal: void GtkWidget::map (GtkWidget *WIDGET) - Signal: void GtkWidget::unmap (GtkWidget *WIDGET) - Signal: void GtkWidget::realize (GtkWidget *WIDGET) - Signal: void GtkWidget::unrealize (GtkWidget *WIDGET) - Signal: void GtkWidget::draw (GtkWidget *WIDGET, GdkRectangle *AREA) - Signal: void GtkWidget::draw_focus (GtkWidget *WIDGET) - Signal: void GtkWidget::draw_default (GtkWidget *WIDGET) - Signal: void GtkWidget::size_request (GtkWidget *WIDGET, GtkRequisition *REQUISITION) - Signal: void GtkWidget::size_allocate (GtkWidget *WIDGET, GtkAllocation *ALLOCATION) - Signal: void GtkWidget::state_changed (GtkWidget *WIDGET) - Signal: gint GtkWidget::install_accelerator (GtkWidget *WIDGET, gchar *SIGNAL_NAME, gchar KEY, guint8 MODIFIERS) - Signal: void GtkWidget::remove_accelerator (GtkWidget *WIDGET, gchar *SIGNAL_NAME) - Signal: gint GtkWidget::event (GtkWidget *WIDGET, GdkEvent *EVENT) - Signal: gint GtkWidget::button_press_event (GtkWidget *WIDGET, GdkEventButton *EVENT) - Signal: gint GtkWidget::button_release_event (GtkWidget *WIDGET, GdkEventButton *EVENT) - Signal: gint GtkWidget::motion_notify_event (GtkWidget *WIDGET, GdkEventMotion *EVENT) - Signal: gint GtkWidget::delete_event (GtkWidget *WIDGET, GdkEventAny *EVENT) - Signal: gint GtkWidget::destroy_event (GtkWidget *WIDGET, GdkEventAny *EVENT) - Signal: gint GtkWidget::expose_event (GtkWidget *WIDGET, GdkEventExpose *EVENT) - Signal: gint GtkWidget::key_press_event (GtkWidget *WIDGET, GdkEventKey *EVENT) - Signal: gint GtkWidget::key_release_event (GtkWidget *WIDGET, GdkEventKey *EVENT) - Signal: gint GtkWidget::enter_notify_event (GtkWidget *WIDGET, GdkEventCrossing *EVENT) - Signal: gint GtkWidget::leave_notify_event (GtkWidget *WIDGET, GdkEventCrossing *EVENT) - Signal: gint GtkWidget::configure_event (GtkWidget *WIDGET, GdkEventConfigure *EVENT) - Signal: gint GtkWidget::focus_in_event (GtkWidget *WIDGET, GdkEventFocus *EVENT) - Signal: gint GtkWidget::focus_out_event (GtkWidget *WIDGET, GdkEventFocus *EVENT) - Signal: gint GtkWidget::map_event (GtkWidget *WIDGET, GdkEventAny *EVENT) - Signal: gint GtkWidget::unmap_event (GtkWidget *WIDGET, GdkEventAny *EVENT) - Signal: gint GtkWidget::property_notify_event (GtkWidget *WIDGET, GdkEventProperty *EVENT) - Signal: gint GtkWidget::selection_clear_event (GtkWidget *WIDGET, GdkEventSelection *EVENT) - Signal: gint GtkWidget::selection_request_event (GtkWidget *WIDGET, GdkEventSelection *EVENT) - Signal: gint GtkWidget::selection_notify_event (GtkWidget *WIDGET, GdkEventSelection *EVENT) - Signal: gint GtkWidget::drop_event (GtkWidget *WIDGET, GdkEventDrop *EVENT) - Signal: gint GtkWidget::drag_begin_event (GtkWidget *WIDGET, GdkEventDragBegin *EVENT) - Signal: gint GtkWidget::other_event (GtkWidget *WIDGET, GdkEventOther *EVENT) Functions --------- - Function: guint gtk_widget_get_type (void) Returns the `GtkWidget' type identifier. - Function: void gtk_widget_class_init (GtkWidgetClass *CLASS) - Function: void gtk_widget_init (GtkWidget *WIDGET) - Function: void gtk_widget_destroy (GtkWidget *WIDGET) - Function: void gtk_widget_show (GtkWidget *WIDGET) - Function: void gtk_widget_hide (GtkWidget *WIDGET) - Function: void gtk_widget_map (GtkWidget *WIDGET) - Function: void gtk_widget_unmap (GtkWidget *WIDGET) - Function: void gtk_widget_realize (GtkWidget *WIDGET) - Function: void gtk_widget_unrealize (GtkWidget *WIDGET) - Function: void gtk_widget_draw (GtkWidget *WIDGET, GdkRectangle *AREA) - Function: void gtk_widget_draw_focus (GtkWidget *WIDGET) - Function: void gtk_widget_draw_children (GtkWidget *WIDGET) - Function: void gtk_widget_size_request (GtkWidget *WIDGET, GtkRequisition *REQUISITION) - Function: void gtk_widget_size_allocate (GtkWidget *WIDGET, GtkAllocation *ALLOCATION) - Function: void gtk_widget_install_accelerator (GtkWidget *WIDGET, GtkAcceleratorTable *TABLE, gchar *SIGNAL_NAME, gchar KEY, guint8 MODIFIERS) - Function: void gtk_widget_remove_accelerator (GtkWidget *WIDGET, GtkAcceleratorTable *TABLE, gchar *SIGNAL_NAME) - Function: gint gtk_widget_event (GtkWidget *WIDGET, GdkEvent *EVENT) - Function: void gtk_widget_reparent (GtkWidget *WIDGET, GtkWidget *NEW_PARENT) - Function: void gtk_widget_popup (GtkWidget *WIDGET, gint X, gint Y) - Function: gint gtk_widget_intersect (GtkWidget *WIDGET, GdkRectangle *AREA, GdkRectangle *INTERSECTION) - Function: void gtk_widget_grab_focus (GtkWidget *WIDGET) - Function: void gtk_widget_grab_default (GtkWidget *WIDGET) - Function: void gtk_widget_restore_state (GtkWidget *WIDGET) - Function: void gtk_widget_set_name (GtkWidget *WIDGET, gchar *NAME) - Function: void gtk_widget_set_state (GtkWidget *WIDGET, GtkStateType STATE) - Function: void gtk_widget_set_sensitive (GtkWidget *WIDGET, gint sensitive) - Function: void gtk_widget_set_parent (GtkWidget *WIDGET, GtkWidget *PARENT) - Function: void gtk_widget_set_style (GtkWidget *WIDGET, GtkStyle *STYLE) - Function: void gtk_widget_set_uposition (GtkWidget *WIDGET, gint X, gint Y) - Function: void gtk_widget_set_usize (GtkWidget *WIDGET, gint WIDTH, gint HEIGHT) - Function: GtkWidget* gtk_widget_get_toplevel (GtkWidget *WIDGET) - Function: GtkWidget* gtk_widget_get_ancestor (GtkWidget *WIDGET, gint TYPE) - Function: GdkColormap* gtk_widget_get_colormap (GtkWidget *WIDGET) - Function: GdkVisual* gtk_widget_get_visual (GtkWidget *VISUAL) - Function: GtkStyle* gtk_widget_get_style (GtkWidget *STYLE) - Function: GtkWidget* GTK_WIDGET (gpointer OBJ) Cast a generic pointer to `GtkWidget*'. *Note Standard Macros::, for more info. - Function: GtkWidgetClass* GTK_WIDGET_CLASS (gpointer CLASS) Cast a generic pointer to `GtkWidgetClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_WIDGET (gpointer OBJ) Determine if a generic pointer refers to a `GtkWidget' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkWindow, Prev: GtkWidget, Up: Widgets The window widget ================= Description ----------- Options ------- - User Option: type The TYPE options specify how this widget will interact with the window manager. Currently the following types and the effect they have on the window to window manager interaction is as follows. * `GTK_WINDOW_TOPLEVEL' * The option `GTK_WINDOW_TOPLEVEL' is usually used for the main application window that will remain for the entire application run. * `GTK_WINDOW_DIALOG' * The option `GTK_WINDOW_DIALOG' is usually used for transient windows. These windows will open up, gather some input or provide some application specific updates, then close. The window manager is free not to provide all the 'normal' window functions to this window. * `GTK_WINDOW_POPUP' * The option `GTK_WINDOW_POPUP' is usually used for transient windows. These windows are typically used for when no user interaction is required, to notify the user of some condition. Other uses for these types of windows are for 'about windows', startup windows and the like. Typically the window manager will *not* provide the usual widgets that surround the window. At the most all that will be provided is a border. Also note that windows that set this TYPE will not be in any window list of the window manager. Though this window will *not* get the kill and close widgets of the window manager they still can receive said events and should be taken into account. - User Option: title The TITLE option will set the title of the window in the window manager. *Note:* On windows that have the TYPE option set to `GTK_WINDOW_POPUP' there is a strong possibility that this will text will not be seen. - User Option: position The POSITION option will determine where the window will be displayed when it is finally drawn to the screen. Currently the following positions and the effect they have on window placement can be specified. * `GTK_WIN_POS_NONE' * This POSITION type will allow the window manager full freedom, depending on the current settings in the window manager. As to where the window will be placed. * `GTK_WIN_POS_CENTER' * This POSITION option will cause the window to center itself on the the screen. This option setting will take into account the VIRTUAL SCREEN size when calculating the center. This is *not* the same as the VIRTUAL DESKTOP setting of many window managers. It will center itself on the current VIRTUAL DESKTOP. * `GTK_WIN_POS_MOUSE' This POSITION option will cause the window to center itself under the mouse pointers' current location. Typical uses for this setting is in warning/error/informational dialogs where user interaction is desired. Signals ------- - Signal: void GtkWindow::move_resize (GtkWindow *WINDOW, gint *X, gint *Y, gint WIDTH, gint HEIGHT) - Signal: void GtkWindow::set_focus (GtkWindow *WINDOW, GtkWidget *FOCUS) Functions --------- - Function: guint gtk_window_get_type (void) Returns the `GtkWindow' type identifier. - Function: GtkWidget* gtk_window_new (GtkWindowType TYPE) Create a new `GtkWindow' object. The new widget is returned as a pointer to a `GtkWidget' object. `NULL' is returned on failure. The TYPE can be one of `GTK_WINDOW_TOPLEVEL', `GTK_WINDOW_DIALOG' or, `GTK_WINDOW_POPUP'. The TYPE value determines how this widget will interact with the window manager. - Function: void gtk_window_set_title (GtkWindow *WINDOW, gchar *TITLE) Set the title of this window to the text in the TITLE argument. It is important to not set the fields of the `GtkWindow' structure directly. - Function: void gtk_window_set_focus (GtkWindow *WINDOW, GtkWidget *FOCUS) - Function: void gtk_window_set_default (GtkWindow *WINDOW, GtkWidget *DEFAULTW) - Function: void gtk_window_set_policy (GtkWindow *WINDOW, gint ALLOW_SHRINK, gint ALLOW_GROW, gint AUTO_SHRINK) - Function: void gtk_window_add_accelerator_table (GtkWindow *WINDOW, GtkAcceleratorTable *TABLE) - Function: void gtk_window_remove_accelerator_table (GtkWindow *WINDOW, GtkAcceleratorTable *TABLE) - Function: void gtk_window_position (GtkWindow *WINDOW, GtkWindowPosition POSITION) Set the position that the window will be at when it is finally drawn to the screen. The POSITION argument effects the the position as described above. - Function: GtkWindow* GTK_WINDOW (gpointer OBJ) Cast a generic pointer to `GtkWindow*'. *Note Standard Macros::, for more info. - Function: GtkWindowClass* GTK_WINDOW_CLASS (gpointer CLASS) Cast a generic pointer to `GtkWindowClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_WINDOW (gpointer OBJ) Determine if a generic pointer refers to a `GtkWindow' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: Other Objects, Next: Miscellaneous, Prev: Widgets, Up: Top Utility objects *************** * Menu: * GtkAcceleratorTable:: The accelerator table object. * GtkAdjustment:: The adjustment object. * GtkGC:: The GC object. * GtkData:: The data object. * GtkStyle:: The style object.  File: gtk.info, Node: GtkAcceleratorTable, Next: GtkAdjustment, Prev: Other Objects, Up: Other Objects The accelerator table object ============================ Description ----------- Functions --------- - Function: GtkAcceleratorTable* gtk_accelerator_table_new (void) - Function: GtkAcceleratorTable* gtk_accelerator_table_find (GtkObject *OBJECT, gchar *SIGNAL_NAME, guchar ACCELERATOR_KEY, guint8 ACCELERATOR_MODS) - Function: GtkAccelerator *gtk_accelerator_table_ref (GtkAcceleratorTable *TABLE) - Function: void gtk_accelerator_table_unref (GtkAcceleratorTable *TABLE) - Function: void gtk_accelerator_table_install (GtkAcceleratorTable *TABLE, GtkObject *OBJECT, gchar *SIGNAL_NAME, guchar ACCELERATOR_KEY, guint8 ACCELERATOR_MODS) - Function: void gtk_accelerator_table_remove (GtkAcceleratorTable *TABLE, GtkObject *OBJECT, gchar *SIGNAL_NAME) - Function: void gtk_accelerator_table_check (GtkAcceleratorTable *TABLE, guchar ACCELERATOR_KEY, guint8 ACCELERATOR_MODS) - Function: void gtk_accelerator_table_set_mod_mask (GtkAcceleratorTable *TABLE, guint8 MODIFIER_MASK)  File: gtk.info, Node: GtkAdjustment, Next: GtkGC, Prev: GtkAcceleratorTable, Up: Other Objects The adjustment object ===================== Description ----------- Functions --------- - Function: guint gtk_adjustment_get_type (void) Returns the `GtkAdjustment' type identifier. - Function: GtkObject* gtk_adjustment_new (gfloat VALUE, gfloat LOWER, gfloat UPPER, gfloat STEP_INCREMENT, gfloat PAGE_INCREMENT, gfloat PAGE_SIZE) - Function: GtkGtkAdjustment* GTK_ADJUSTMENT (gpointer OBJ) Cast a generic pointer to `GtkGtkAdjustment*'. *Note Standard Macros::, for more info. - Function: GtkGtkAdjustmentClass* GTK_ADJUSTMENT_CLASS (gpointer CLASS) Cast a generic pointer to `GtkGtkAdjustmentClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_ADJUSTMENT (gpointer OBJ) Determine if a generic pointer refers to a `GtkGtkAdjustment' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkGC, Next: GtkData, Prev: GtkAdjustment, Up: Other Objects The GC object ============= Description ----------- Functions --------- - Function: GdkGC* gtk_gc_get (gint DEPTH, GdkColormap *COLORMAP, GdkGCValues *VALUES, GdkGCValuesMask VALUES_MASK) - Function: void gtk_gc_release (GdkGC *GC)  File: gtk.info, Node: GtkData, Next: GtkStyle, Prev: GtkGC, Up: Other Objects The data object =============== Description ----------- Functions --------- - Function: guint gtk_data_get_type (void) Returns the `GtkData' type identifier. - Function: GtkData* GTK_DATA (gpointer OBJ) Cast a generic pointer to `GtkData*'. *Note Standard Macros::, for more info. - Function: GtkDataClass* GTK_DATA_CLASS (gpointer CLASS) Cast a generic pointer to `GtkDataClass*'. *Note Standard Macros::, for more info. - Function: gint GTK_IS_DATA (gpointer OBJ) Determine if a generic pointer refers to a `GtkData' object. *Note Standard Macros::, for more info.  File: gtk.info, Node: GtkStyle, Prev: GtkData, Up: Other Objects The style object ================ Description ----------- Functions ---------  File: gtk.info, Node: Miscellaneous, Next: Examples, Prev: Other Objects, Up: Top Initialization, exit and other features *************************************** * Menu: * Initialization and exit:: Initializing and exiting GTK. * Customization:: Customizing the library. * Menu Factories:: Simplified menu creation. * Tree Factories:: Simplified tree creation. * Tool Tips:: Pop up help mechanism. * Resource Files:: Resource files. * Standard Macros:: Macros defined by all objects.  File: gtk.info, Node: Initialization and exit, Next: Customization, Prev: Miscellaneous, Up: Miscellaneous Initializing and exiting GTK ============================ Initializing ------------ Before any GTK functions can be utilized the library must be initialized. This can be accomplished by calling the `gtk_init' function. The arguments you pass to this function should be the same arguments that were passed to your application. This function will parse the arguments that it understands and handle initializing the GDK library for you. Exiting ------- Functions --------- - Function: void gtk_init (int *ARGC, char **ARGV) Function to initialize GTK and GDK for you. This function will remove any command line arguments from ARGC and ARGV that it understands. int main (int argc, char *argv[]) { ...Any local variables or non GTK/GDK initialization /* Initialize GTK. */ gtk_init(&argc, &argc); } - Function: void gtk_exit (int ERROR_CODE) Exit GTK and perform any necessary cleanup. `gtk_exit' will call the systems `exit' function passing ERROR_CODE as the parameter. - Function: gint gtk_events_pending (void) Returns the number of events pending on the event queue. - Function: void gtk_main (void) - Function: guint gtk_main_level (void) - Function: void gtk_main_quit (void) A call to this function will cause the `gtk_main' function to exit, thereby allowing your application to exit.  File: gtk.info, Node: Customization, Next: Menu Factories, Prev: Initialization and exit, Up: Miscellaneous Customization of the library ============================ Description ----------- Like other X-windows applications the GTK library provides a way for the user and application programmer to change the colors of just about any widget. You can also specify what pixmap should be tiled onto the background of some widgets. All this is handled through a similar method as in the standard X-windows environment, through the use of 'rc' files. The format and functions available in these files is discussed below. Functions --------- The following functions are available to handle the rc files. - Function: void gtk_rc_parse (char *FILENAME) This function will parse the FILENAME that is passed to it as its argument. It will use the style settings for the widget types defined there. - Function: void gtk_rc_init (void) This function will initialize the rc file parser, normally this need not be called directly as the `gtk_rc_parse' function will handle this for you.  File: gtk.info, Node: Menu Factories, Next: Tree Factories, Prev: Customization, Up: Miscellaneous Simplified menu creation ========================  File: gtk.info, Node: Tree Factories, Next: Tool Tips, Prev: Menu Factories, Up: Miscellaneous Simplified tree creation ========================  File: gtk.info, Node: Tool Tips, Next: Resource Files, Prev: Tree Factories, Up: Miscellaneous Pop up help mechanism ===================== Description -----------  File: gtk.info, Node: Resource Files, Next: Standard Macros, Prev: Tool Tips, Up: Miscellaneous Resource Files ==============  File: gtk.info, Node: Standard Macros, Prev: Resource Files, Up: Miscellaneous Macros defined by all objects ============================= There are three macros that are defined by all object types. The first two are used for performing casts and the last is for querying whether an object is of a particular type. These macros are both conveniences and debugging tools. If the GTK library was compiled with `NDEBUG' defined as a preprocessor symbol (via the -DNDEBUG to cc), then the macros check the object type and emit a warning if the cast is invalid. Doing such checking is fairly expensive since the cast macros are used everywhere in GTK and would normally be turned off in a public release of a product. Note: The functions below are indeed macros, but they may be considered functions for most purposes. - Function: Gtk* GTK_ (gpointer OBJ) Cast a generic pointer to `Gtk*'. This function is provided in order to be able to provide checking during development stages of code development since it is possible to examine the actual type of object (using `gtk_type_is_a') before performing the cast. - Function: GtkClass* GTK__CLASS (gpointer CLASS) Cast a generic pointer to `GtkClass*'. Like `GTK_', this function is, in reality, a macro. - Function: gint GTK_IS_ (gpointer OBJ) Determine if a generic pointer refers to a `Gtk' object. This function is, in reality, a macro wrapper around the `gtk_type_is_a' function (*note Types::).  File: gtk.info, Node: Examples, Next: Object Implementation, Prev: Miscellaneous, Up: Top Using GTK ********* * Menu: * Simple:: The simplest GTK program. * Hello World:: Hello world in GTK. * Hello World II:: An enhanced hello world. * Hello World III:: Making Hello World II robust.  File: gtk.info, Node: Simple, Next: Hello World, Prev: Examples, Up: Examples The simplest GTK program ======================== The 16 line GTK program shown below is just about the simplest possible program which uses GTK. (Well, technically, you don't have to create the window and it would still be a program which uses GTK). The program, when compiled and run, will create a single window 200x200 pixels in size. The program does not exit until its is explicitly killed using the shell or a window manager function. #include int main (int argc, char *argv[]) { GtkWidget *window; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_show (window); gtk_main (); return 0; } The first point of interest in this program is the standard initialization line. gtk_init (&argc, &argv); Almost every GTK program will contain such a line. GTK will initialize itself and GDK and remove any command line arguments it recognizes from ARGC and ARGV. The next two lines of code create and display a window. window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_show (window); The `GTK_WINDOW_TOPLEVEL' argument specifies that we want the window to undergo window manager decoration and placement. One might be lead to think that the window, since it has no children, would be 0x0 pixels in size. But, this is not the case because a window that has no children defaults to 200x200 pixels in size. Mainly because 0x0 windows are annoying to manipulate or even see in some cases. The last line enters the GTK main processing loop. gtk_main (); Normally, `gtk_main' is called once and the program should exit when it returns. *Note Initialization and exit::. 0707010001bafe000081a40000000a0000000a000000013d12d39e00002066000000880000000300000000000000000000001eff350892reloc/doc/gtk/docs/gtk.info-5This is gtk.info, produced by makeinfo version 4.0 from gtk.texi. This file documents GTK, the GIMP Toolkit Copyright (C) 1996 Peter Mattis Copyright (C) 1997 Peter Mattis Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Peter Mattis. INFO-DIR-SECTION User Interface Toolkit START-INFO-DIR-ENTRY * GTK: (gtk). The GIMP Toolkit END-INFO-DIR-ENTRY  File: gtk.info, Node: Hello World, Next: Hello World II, Prev: Simple, Up: Examples Hello world in GTK ================== #include int main (int argc, char *argv[]) { GtkWidget *window; GtkWidget *label; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_border_width (GTK_CONTAINER (window), 10); label = gtk_label_new ("Hello World"); gtk_container_add (GTK_CONTAINER (window), label); gtk_widget_show (label); gtk_widget_show (window); gtk_main (); return 0; }  File: gtk.info, Node: Hello World II, Next: Hello World III, Prev: Hello World, Up: Examples An enhanced hello world ======================= #include "gtk.h" void hello (void) { g_print ("Hello World\n"); gtk_exit (0); } int main (int argc, char *argv[]) { GtkWidget *window; GtkWidget *button; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_border_width (GTK_CONTAINER (window), 10); button = gtk_button_new_with_label ("Hello World"); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (hello), NULL); gtk_container_add (GTK_CONTAINER (window), button); gtk_widget_show (button); gtk_widget_show (window); gtk_main (); return 0; }  File: gtk.info, Node: Hello World III, Prev: Hello World II, Up: Examples Making Hello World II robust ============================ #include "gtk.h" void hello (void) { g_print ("Hello World\n"); gtk_exit (0); } void destroy (void) { gtk_exit (0); } int main (int argc, char *argv[]) { GtkWidget *window; GtkWidget *button; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (destroy), NULL); gtk_container_border_width (GTK_CONTAINER (window), 10); button = gtk_button_new_with_label ("Hello World"); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (hello), NULL); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); gtk_container_add (GTK_CONTAINER (window), button); gtk_widget_show (button); gtk_widget_show (window); gtk_main (); return 0; }  File: gtk.info, Node: Object Implementation, Next: Signal Implementation, Prev: Examples, Up: Top Object internals **************** Objects (or the `GtkObject' type) and the class hierarchy in general is implemented via a hierarchy of structs and type casting. Be aware that when classes are mentioned it is the conceptual idea of classes that is being referred to. GTK is written entirely in C which provides no direct support for classes. The first part to the class mechanism is the object fields. These are fields that will be used on a per object basis. For example, the widget type contains a field for the widgets parent. Every derived type needs a reference to its parent type. A descendant class of `GtkObject' would define itself like: struct Descendant { GtkObject object; ... }; It is important to note that the `GtkObject' field needs to appear first in the descendant type structure. This allows pointers to objects of type `Descendant' to be cast to pointers to `GtkObject''s and vice-versa. The second part to the class mechanism is the class fields. These fields are defined on a per class basis. In the case of widgets, the class fields are all the "virtual" functions for widgets. The `GtkObject' class defines the `destroy' virtual function and the necessary fields for the signal mechanism as well as a field for determining the runtime type of an object. A virtual function is semantically the same as it is in C++. That is, the actual function that is called is determined based on the type of the object. Or, more specifically, the actual function call depends on the class structure that is pointed to by the `klass' field of the `GtkObject' structure. To see how the class fields work it is necessary to see the object fields for a `GtkObject'. The `GtkObject' type is defined as follows: typedef struct _GtkObject GtkObject; struct _GtkObject { guint32 flags; GtkObjectClass *klass; gpointer object_data; }; The `class' field actually points to a class structure derived from `GtkObjectClass'. By convention, each new type defines its own class structure even if it is unnecessary. As an example, the hypothetical `Descendant' class would define its class structure as: struct DescendantClass { GtkObjectClass parent_class; ... }; It is convention to name the parent class field (`GtkObjectClass' in this case), `parent_class'. For the same reason as stated above for the object structure, the parent class field must be the first field in the class structure. *Note:* GTK assumes that the first field in a structure will be placed by the compiler at the start of the structure. This is certainly true for gcc, however, from my precursory reading of the C standard I was unable to come to a definite conclusion as to whether this was required or simply done for simplicity. I'm not too worried about this assumption, though, as every C compiler I've ever encountered would work with GTK. The `flags' field of the `GtkObject' structure is used to keep track of a relatively few object flags and is also used by the `GtkWidget' type to store additional flags. At this time, the upper 16 bits of the flags field are reserved but unused. The `object_data' field of the `GtkObject' structure is an opaque pointer used by the object data mechanism. In truth, it is a pointer to the beginning of the data list which is composed of the following structures. typedef struct _GtkObjectData GtkObjectData; struct _GtkObjectData { guint id; gpointer data; GtkObjectData *next; }; The data mechanism allows arbitrary data to be associated with a character string key in any object. A hash table is used to transform the character string key into the data id and then a search through the list is made to see if the data exists. The assumption being that the data list will usually be short and therefore a linear search is OK. Future work on the data mechanism might make use of a resizable array instead of a linked list. This would shrink the overhead of the `GtkObjectData' structure by 4 bytes on 32 bit architectures.  File: gtk.info, Node: Signal Implementation, Next: Widget Implementation, Prev: Object Implementation, Up: Top Signal internals ****************  File: gtk.info, Node: Widget Implementation, Next: Function Index, Prev: Signal Implementation, Up: Top Widget internals **************** 0707010001baff000081a40000000a0000000a000000013d12d39e0000b71a000000880000000300000000000000000000001eff350892reloc/doc/gtk/docs/gtk.info-6This is gtk.info, produced by makeinfo version 4.0 from gtk.texi. This file documents GTK, the GIMP Toolkit Copyright (C) 1996 Peter Mattis Copyright (C) 1997 Peter Mattis Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Peter Mattis. INFO-DIR-SECTION User Interface Toolkit START-INFO-DIR-ENTRY * GTK: (gtk). The GIMP Toolkit END-INFO-DIR-ENTRY  File: gtk.info, Node: Function Index, Next: Concept Index, Prev: Widget Implementation, Up: Top Function Index ************** * Menu: * *gtk_accelerator_table_ref: GtkAcceleratorTable. * GTK_: Standard Macros. * GTK__CLASS: Standard Macros. * gtk_accelerator_table_check: GtkAcceleratorTable. * gtk_accelerator_table_find: GtkAcceleratorTable. * gtk_accelerator_table_install: GtkAcceleratorTable. * gtk_accelerator_table_new: GtkAcceleratorTable. * gtk_accelerator_table_remove: GtkAcceleratorTable. * gtk_accelerator_table_set_mod_mask: GtkAcceleratorTable. * gtk_accelerator_table_unref: GtkAcceleratorTable. * GTK_ADJUSTMENT: GtkAdjustment. * GTK_ADJUSTMENT_CLASS: GtkAdjustment. * gtk_adjustment_get_type: GtkAdjustment. * gtk_adjustment_new: GtkAdjustment. * GTK_ALIGNMENT: GtkAlignment. * GTK_ALIGNMENT_CLASS: GtkAlignment. * gtk_alignment_get_type: GtkAlignment. * gtk_alignment_new: GtkAlignment. * gtk_alignment_set: GtkAlignment. * GTK_ARROW: GtkArrow. * GTK_ARROW_CLASS: GtkArrow. * gtk_arrow_get_type: GtkArrow. * gtk_arrow_new: GtkArrow. * gtk_arrow_set: GtkArrow. * GTK_ASPECT_FRAME: GtkAspectFrame. * GTK_ASPECT_FRAME_CLASS: GtkAspectFrame. * gtk_aspect_frame_get_type: GtkAspectFrame. * gtk_aspect_frame_new: GtkAspectFrame. * gtk_aspect_frame_set: GtkAspectFrame. * GTK_BIN: GtkBin. * GTK_BIN_CLASS: GtkBin. * gtk_bin_get_type: GtkBin. * GTK_BOX: GtkBox. * GTK_BOX_CLASS: GtkBox. * gtk_box_get_type: GtkBox. * gtk_box_pack_end: GtkBox. * gtk_box_pack_end_defaults: GtkBox. * gtk_box_pack_start: GtkBox. * gtk_box_pack_start_defaults: GtkBox. * gtk_box_query_child_packing: GtkBox. * gtk_box_reorder_child: GtkBox. * gtk_box_set_child_packing: GtkBox. * gtk_box_set_homogeneous: GtkBox. * gtk_box_set_spacing: GtkBox. * GTK_BUTTON: GtkButton. * GTK_BUTTON_BOX: GtkButtonBox. * GTK_BUTTON_BOX_CLASS: GtkButtonBox. * gtk_button_box_get_child_ipadding: GtkButtonBox. * gtk_button_box_get_child_ipadding_default: GtkButtonBox. * gtk_button_box_get_child_size: GtkButtonBox. * gtk_button_box_get_child_size_default: GtkButtonBox. * gtk_button_box_get_layout: GtkButtonBox. * gtk_button_box_get_spacing: GtkButtonBox. * gtk_button_box_get_type: GtkButtonBox. * gtk_button_box_set_child_ipadding: GtkButtonBox. * gtk_button_box_set_child_ipadding_default: GtkButtonBox. * gtk_button_box_set_child_size: GtkButtonBox. * gtk_button_box_set_child_size_default: GtkButtonBox. * gtk_button_box_set_layout: GtkButtonBox. * GTK_BUTTON_CLASS: GtkButton. * gtk_button_clicked: GtkButton. * gtk_button_enter: GtkButton. * gtk_button_get_type: GtkButton. * gtk_button_leave: GtkButton. * gtk_button_new: GtkButton. * gtk_button_new_with_label: GtkButton. * gtk_button_pressed: GtkButton. * gtk_button_released: GtkButton. * GTK_CHECK_BUTTON: GtkCheckButton. * GTK_CHECK_BUTTON_CLASS: GtkCheckButton. * gtk_check_button_get_type: GtkCheckButton. * gtk_check_button_new: GtkCheckButton. * gtk_check_button_new_with_label: GtkCheckButton. * GTK_CHECK_MENU_ITEM: GtkCheckMenuItem. * GTK_CHECK_MENU_ITEM_CLASS: GtkCheckMenuItem. * gtk_check_menu_item_get_type: GtkCheckMenuItem. * gtk_check_menu_item_new: GtkCheckMenuItem. * gtk_check_menu_item_new_with_label: GtkCheckMenuItem. * gtk_check_menu_item_set_state: GtkCheckMenuItem. * gtk_check_menu_item_toggled: GtkCheckMenuItem. * GTK_CLIST: GtkCList. * gtk_clist_append: GtkCList. * GTK_CLIST_CLASS: GtkCList. * gtk_clist_clear: GtkCList. * gtk_clist_column_titles_hide: GtkCList. * gtk_clist_column_titles_show: GtkCList. * gtk_clist_freeze: GtkCList. * gtk_clist_get_row_data: GtkCList. * gtk_clist_get_type: GtkCList. * gtk_clist_insert: GtkCList. * gtk_clist_moveto: GtkCList. * gtk_clist_new: GtkCList. * gtk_clist_new_with_titles: GtkCList. * gtk_clist_remove: GtkCList. * gtk_clist_select_row: GtkCList. * gtk_clist_set_background: GtkCList. * gtk_clist_set_border: GtkCList. * gtk_clist_set_column_justification: GtkCList. * gtk_clist_set_column_title: GtkCList. * gtk_clist_set_column_widget: GtkCList. * gtk_clist_set_column_width: GtkCList. * gtk_clist_set_foreground: GtkCList. * gtk_clist_set_pixmap: GtkCList. * gtk_clist_set_policy: GtkCList. * gtk_clist_set_row_data: GtkCList. * gtk_clist_set_row_height: GtkCList. * gtk_clist_set_selection_mode: GtkCList. * gtk_clist_set_shift: GtkCList. * gtk_clist_set_text: GtkCList. * gtk_clist_setpixtext: GtkCList. * gtk_clist_thaw: GtkCList. * gtk_clist_unselect_row: GtkCList. * GTK_COLOR_SELECTION: GtkColorSelection. * GTK_COLOR_SELECTION_CLASS: GtkColorSelection. * gtk_color_selection_dialog_get_type: GtkColorSelection. * gtk_color_selection_dialog_new: GtkColorSelection. * gtk_color_selection_get_color: GtkColorSelection. * gtk_color_selection_get_type: GtkColorSelection. * gtk_color_selection_new: GtkColorSelection. * gtk_color_selection_set_color: GtkColorSelection. * gtk_color_selection_set_opacity: GtkColorSelection. * gtk_color_selection_set_update_policy: GtkColorSelection. * GTK_COMBO: GtkCombo. * GTK_COMBO_CLASS: GtkCombo. * gtk_combo_get_type: GtkCombo. * gtk_combo_new: GtkCombo. * gtk_combo_set_case_sensitive: GtkCombo. * gtk_combo_set_item_string: GtkCombo. * gtk_combo_set_popdown_strings: GtkCombo. * gtk_combo_set_use_arrows: GtkCombo. * gtk_combo_set_use_arrows_always: GtkCombo. * gtk_combo_set_value_in_list: GtkCombo. * GTK_CONTAINER: GtkContainer. * gtk_container_add: GtkContainer. * gtk_container_block_resize: GtkContainer. * gtk_container_border_width: GtkContainer. * gtk_container_check_resize: GtkContainer. * gtk_container_children: GtkContainer. * GTK_CONTAINER_CLASS: GtkContainer. * gtk_container_disable_resize: GtkContainer. * gtk_container_enable_resize: GtkContainer. * gtk_container_focus: GtkContainer. * gtk_container_foreach: GtkContainer. * gtk_container_get_type: GtkContainer. * gtk_container_need_resize: GtkContainer. * gtk_container_remove: GtkContainer. * gtk_container_unblock_resize: GtkContainer. * GTK_CTREE: GtkCTree. * GTK_CTREE_CLASS: GtkCTree. * gtk_ctree_clear: GtkCTree. * gtk_ctree_get_type: GtkCTree. * gtk_ctree_insert: GtkCTree. * gtk_ctree_is_visible: GtkCTree. * gtk_ctree_new: GtkCTree. * gtk_ctree_new_with_titles: GtkCTree. * gtk_ctree_post_recursive: GtkCTree. * gtk_ctree_pre_recursive: GtkCTree. * gtk_ctree_remove: GtkCTree. * GTK_CURVE: GtkCurve. * GTK_CURVE_CLASS: GtkCurve. * gtk_curve_get_type: GtkCurve. * gtk_curve_get_vector: GtkCurve. * gtk_curve_new: GtkCurve. * gtk_curve_reset: GtkCurve. * gtk_curve_set_curve_type: GtkCurve. * gtk_curve_set_gamma: GtkCurve. * gtk_curve_set_range: GtkCurve. * gtk_curve_set_vector: GtkCurve. * GTK_DATA: GtkData. * GTK_DATA_CLASS: GtkData. * gtk_data_get_type: GtkData. * GTK_DIALOG: GtkDialog. * GTK_DIALOG_CLASS: GtkDialog. * gtk_dialog_get_type: GtkDialog. * gtk_dialog_new: GtkDialog. * GTK_DRAWING_AREA: GtkDrawingArea. * GTK_DRAWING_AREA_CLASS: GtkDrawingArea. * gtk_drawing_area_get_type: GtkDrawingArea. * gtk_drawing_area_new: GtkDrawingArea. * gtk_drawing_area_size: GtkDrawingArea. * GTK_ENTRY: GtkEntry. * gtk_entry_append_text: GtkEntry. * GTK_ENTRY_CLASS: GtkEntry. * gtk_entry_get_text: GtkEntry. * gtk_entry_get_type: GtkEntry. * gtk_entry_new: GtkEntry. * gtk_entry_new_with_max_length: GtkEntry. * gtk_entry_prepend_text: GtkEntry. * gtk_entry_set_position: GtkEntry. * gtk_entry_set_text: GtkEntry. * gtk_entry_set_visibility: GtkEntry. * GTK_EVENT_BOX: GtkEventBox. * GTK_EVENT_BOX_CLASS: GtkEventBox. * gtk_event_box_get_type: GtkEventBox. * gtk_event_box_new: GtkEventBox. * gtk_events_pending: Initialization and exit. * gtk_exit: Initialization and exit. * GTK_FILE_SELECTION: GtkFileSelection. * GTK_FILE_SELECTION_CLASS: GtkFileSelection. * gtk_file_selection_get_filename: GtkFileSelection. * gtk_file_selection_get_type: GtkFileSelection. * gtk_file_selection_new: GtkFileSelection. * gtk_file_selection_set_filename: GtkFileSelection. * GTK_FIXED: GtkFixed. * GTK_FIXED_CLASS: GtkFixed. * gtk_fixed_get_type: GtkFixed. * gtk_fixed_move: GtkFixed. * gtk_fixed_new: GtkFixed. * gtk_fixed_put_new: GtkFixed. * GTK_FRAME: GtkFrame. * GTK_FRAME_CLASS: GtkFrame. * gtk_frame_get_type: GtkFrame. * gtk_frame_new: GtkFrame. * gtk_frame_set_label: GtkFrame. * gtk_frame_set_label_align: GtkFrame. * gtk_frame_set_shadow_type: GtkFrame. * GTK_FUNDAMENTAL_TYPE: Basics. * GTK_GAMMA: GtkGamma. * GTK_GAMMA_CLASS: GtkGamma. * gtk_gamma_curve_get_type <1>: GtkGamma. * gtk_gamma_curve_get_type: GtkGammaCurve. * gtk_gamma_curve_new <1>: GtkGamma. * gtk_gamma_curve_new: GtkGammaCurve. * GTK_GAMMACURVE: GtkGammaCurve. * GTK_GAMMACURVE_CLASS: GtkGammaCurve. * gtk_gc_get: GtkGC. * gtk_gc_release: GtkGC. * GTK_HBOX: GtkHBox. * GTK_HBOX_CLASS: GtkHBox. * gtk_hbox_get_type: GtkHBox. * gtk_hbox_new: GtkHBox. * GTK_HBUTTON_BOX: GtkHButtonBox. * GTK_HBUTTON_BOX_CLASS: GtkHButtonBox. * gtk_hbutton_box_get_layout_default: GtkHButtonBox. * gtk_hbutton_box_get_spacing_default: GtkHButtonBox. * gtk_hbutton_box_get_type: GtkHButtonBox. * gtk_hbutton_box_new: GtkHButtonBox. * gtk_hbutton_box_set_layout_default: GtkHButtonBox. * gtk_hbutton_box_set_spacing_default: GtkHButtonBox. * GTK_HPANED: GtkHPaned. * GTK_HPANED_CLASS: GtkHPaned. * gtk_hpaned_get_type: GtkHPaned. * gtk_hpaned_new: GtkHPaned. * GTK_HRULER: GtkHRuler. * GTK_HRULER_CLASS: GtkHRuler. * gtk_hruler_get_type: GtkHRuler. * gtk_hruler_new: GtkHRuler. * GTK_HSCALE: GtkHScale. * GTK_HSCALE_CLASS: GtkHScale. * gtk_hscale_get_type: GtkHScale. * gtk_hscale_new: GtkHScale. * GTK_HSCROLLBAR: GtkHScrollbar. * GTK_HSCROLLBAR_CLASS: GtkHScrollbar. * gtk_hscrollbar_get_type: GtkHScrollbar. * gtk_hscrollbar_new: GtkHScrollbar. * GTK_HSEPARATOR: GtkHSeparator. * GTK_HSEPARATOR_CLASS: GtkHSeparator. * gtk_hseparator_get_type: GtkHSeparator. * gtk_hseparator_new: GtkHSeparator. * GTK_IMAGE: GtkImage. * GTK_IMAGE_CLASS: GtkImage. * gtk_image_get: GtkImage. * gtk_image_get_type: GtkImage. * gtk_image_new: GtkImage. * gtk_image_set: GtkImage. * gtk_init: Initialization and exit. * gtk_input_dialog_get_type: GtkInputDialog. * gtk_input_dialog_new: GtkInputDialog. * GTK_INPUTDIALOG: GtkInputDialog. * GTK_INPUTDIALOG_CLASS: GtkInputDialog. * GTK_IS_: Standard Macros. * GTK_IS_ADJUSTMENT: GtkAdjustment. * GTK_IS_ALIGNMENT: GtkAlignment. * GTK_IS_ARROW: GtkArrow. * GTK_IS_ASPECT_FRAME: GtkAspectFrame. * GTK_IS_BIN: GtkBin. * GTK_IS_BOX: GtkBox. * GTK_IS_BUTTON: GtkButton. * GTK_IS_BUTTON_BOX: GtkButtonBox. * GTK_IS_CHECK_BUTTON: GtkCheckButton. * GTK_IS_CHECK_MENU_ITEM: GtkCheckMenuItem. * GTK_IS_CLIST: GtkCList. * GTK_IS_COLOR_SELECTION: GtkColorSelection. * GTK_IS_COMBO: GtkCombo. * GTK_IS_CONTAINER: GtkContainer. * GTK_IS_CTREE: GtkCTree. * GTK_IS_CURVE: GtkCurve. * GTK_IS_DATA: GtkData. * GTK_IS_DIALOG: GtkDialog. * GTK_IS_DRAWING_AREA: GtkDrawingArea. * GTK_IS_ENTRY: GtkEntry. * GTK_IS_EVENT_BOX: GtkEventBox. * GTK_IS_FILE_SELECTION: GtkFileSelection. * GTK_IS_FIXED: GtkFixed. * GTK_IS_FRAME: GtkFrame. * GTK_IS_GAMMA: GtkGamma. * GTK_IS_GAMMACURVE: GtkGammaCurve. * GTK_IS_HBOX: GtkHBox. * GTK_IS_HBUTTON_BOX: GtkHButtonBox. * GTK_IS_HPANED: GtkHPaned. * GTK_IS_HRULER: GtkHRuler. * GTK_IS_HSCALE: GtkHScale. * GTK_IS_HSCROLLBAR: GtkHScrollbar. * GTK_IS_HSEPARATOR: GtkHSeparator. * GTK_IS_IMAGE: GtkImage. * GTK_IS_INPUTDIALOG: GtkInputDialog. * GTK_IS_ITEM: GtkItem. * GTK_IS_LABEL: GtkLabel. * GTK_IS_LIST: GtkList. * GTK_IS_LIST_ITEM: GtkListItem. * GTK_IS_MENU: GtkMenu. * GTK_IS_MENU_BAR: GtkMenuBar. * GTK_IS_MENU_ITEM: GtkMenuItem. * GTK_IS_MENU_SHELL: GtkMenuShell. * GTK_IS_MISC: GtkMisc. * GTK_IS_NOTEBOOK: GtkNotebook. * GTK_IS_OPTION_MENU: GtkOptionMenu. * GTK_IS_PANED: GtkPaned. * GTK_IS_PIXMAP: GtkPixmap. * GTK_IS_PREVIEW: GtkPreview. * GTK_IS_PROGRESS_BAR: GtkProgressBar. * GTK_IS_RADIO_BUTTON: GtkRadioButton. * GTK_IS_RADIO_MENU_ITEM: GtkRadioMenuItem. * GTK_IS_RANGE: GtkRange. * GTK_IS_RULER: GtkRuler. * GTK_IS_SCALE: GtkScale. * GTK_IS_SCROLLBAR: GtkScrollbar. * GTK_IS_SCROLLED_WINDOW: GtkScrolledWindow. * GTK_IS_SEPARATOR: GtkSeparator. * GTK_IS_STATUSBAR: GtkStatusbar. * GTK_IS_TABLE: GtkTable. * GTK_IS_TEXT: GtkText. * GTK_IS_TOGGLE_BUTTON: GtkToggleButton. * GTK_IS_TOOLBAR: GtkToolbar. * GTK_IS_TOOLTIPS: GtkTooltips. * GTK_IS_TREE: GtkTree. * GTK_IS_TREE_ITEM: GtkTreeItem. * GTK_IS_VBOX: GtkVBox. * GTK_IS_VBUTTON_BOX: GtkVButtonBox. * GTK_IS_VIEWPORT: GtkViewport. * GTK_IS_VPANED: GtkVPaned. * GTK_IS_VRULER: GtkVRuler. * GTK_IS_VSCALE: GtkVScale. * GTK_IS_VSCROLLBAR: GtkVScrollbar. * GTK_IS_VSEPARATOR: GtkVSeparator. * GTK_IS_WIDGET: GtkWidget. * GTK_IS_WINDOW: GtkWindow. * GTK_ITEM: GtkItem. * GTK_ITEM_CLASS: GtkItem. * gtk_item_deselect: GtkItem. * gtk_item_get_type: GtkItem. * gtk_item_select: GtkItem. * gtk_item_toggle: GtkItem. * GTK_LABEL: GtkLabel. * GTK_LABEL_CLASS: GtkLabel. * gtk_label_get: GtkLabel. * gtk_label_get_type: GtkLabel. * gtk_label_new: GtkLabel. * gtk_label_set: GtkLabel. * GTK_LIST: GtkList. * gtk_list_append_items: GtkList. * gtk_list_child_position: GtkList. * GTK_LIST_CLASS: GtkList. * gtk_list_clear_items: GtkList. * gtk_list_get_type: GtkList. * gtk_list_insert_items: GtkList. * GTK_LIST_ITEM: GtkListItem. * GTK_LIST_ITEM_CLASS: GtkListItem. * gtk_list_item_deselect: GtkListItem. * gtk_list_item_get_type: GtkListItem. * gtk_list_item_new: GtkListItem. * gtk_list_item_new_with_label: GtkListItem. * gtk_list_item_select: GtkListItem. * gtk_list_new: GtkList. * gtk_list_prepend_items: GtkList. * gtk_list_remove_items: GtkList. * gtk_list_select_child: GtkList. * gtk_list_select_item: GtkList. * gtk_list_set_selection_mode: GtkList. * gtk_list_unselect_child: GtkList. * gtk_list_unselect_item: GtkList. * gtk_main: Initialization and exit. * gtk_main_level: Initialization and exit. * gtk_main_quit: Initialization and exit. * GTK_MENU: GtkMenu. * gtk_menu_append: GtkMenu. * GTK_MENU_BAR: GtkMenuBar. * gtk_menu_bar_append: GtkMenuBar. * GTK_MENU_BAR_CLASS: GtkMenuBar. * gtk_menu_bar_get_type: GtkMenuBar. * gtk_menu_bar_insert: GtkMenuBar. * gtk_menu_bar_new: GtkMenuBar. * gtk_menu_bar_prepend: GtkMenuBar. * GTK_MENU_CLASS: GtkMenu. * gtk_menu_get_active: GtkMenu. * gtk_menu_get_type: GtkMenu. * gtk_menu_insert: GtkMenu. * GTK_MENU_ITEM: GtkMenuItem. * gtk_menu_item_accelerator_size: GtkMenuItem. * gtk_menu_item_accelerator_text: GtkMenuItem. * gtk_menu_item_activate: GtkMenuItem. * GTK_MENU_ITEM_CLASS: GtkMenuItem. * gtk_menu_item_configure: GtkMenuItem. * gtk_menu_item_deselect: GtkMenuItem. * gtk_menu_item_get_type: GtkMenuItem. * gtk_menu_item_new: GtkMenuItem. * gtk_menu_item_new_with_label: GtkMenuItem. * gtk_menu_item_select: GtkMenuItem. * gtk_menu_item_set_placement: GtkMenuItem. * gtk_menu_item_set_submenu: GtkMenuItem. * gtk_menu_new: GtkMenu. * gtk_menu_popdown: GtkMenu. * gtk_menu_popup: GtkMenu. * gtk_menu_prepend: GtkMenu. * gtk_menu_set_accelerator_table: GtkMenu. * gtk_menu_set_active: GtkMenu. * GTK_MENU_SHELL: GtkMenuShell. * gtk_menu_shell_append: GtkMenuShell. * GTK_MENU_SHELL_CLASS: GtkMenuShell. * gtk_menu_shell_deactivate: GtkMenuShell. * gtk_menu_shell_get_type: GtkMenuShell. * gtk_menu_shell_insert: GtkMenuShell. * gtk_menu_shell_prepend: GtkMenuShell. * GTK_MISC: GtkMisc. * GTK_MISC_CLASS: GtkMisc. * gtk_misc_get_type: GtkMisc. * gtk_misc_set_alignment: GtkMisc. * gtk_misc_set_padding: GtkMisc. * GTK_NOTEBOOK: GtkNotebook. * gtk_notebook_append_page: GtkNotebook. * GTK_NOTEBOOK_CLASS: GtkNotebook. * gtk_notebook_get_type: GtkNotebook. * gtk_notebook_insert_page: GtkNotebook. * gtk_notebook_new: GtkNotebook. * gtk_notebook_next_page: GtkNotebook. * gtk_notebook_prepend_page: GtkNotebook. * gtk_notebook_prev_page: GtkNotebook. * gtk_notebook_remove_page: GtkNotebook. * gtk_notebook_set_page: GtkNotebook. * gtk_notebook_set_show_border: GtkNotebook. * gtk_notebook_set_show_tabs: GtkNotebook. * gtk_notebook_set_tab_pos: GtkNotebook. * gtk_object_add_arg_type: Objects. * gtk_object_class_add_signals: Objects. * gtk_object_destroy: Objects. * gtk_object_get_arg_type: Objects. * gtk_object_get_data: Objects. * gtk_object_get_type: Objects. * gtk_object_get_user_data: Objects. * gtk_object_getv: Objects. * gtk_object_new: Objects. * gtk_object_newv: Objects. * gtk_object_peek_value: Objects. * gtk_object_pop_value: Objects. * gtk_object_push_value: Objects. * gtk_object_query_args: Objects. * gtk_object_ref: Objects. * gtk_object_remove_data: Objects. * gtk_object_set: Objects. * gtk_object_set_data: Objects. * gtk_object_set_user_data: Objects. * gtk_object_setv: Objects. * gtk_object_unref: Objects. * gtk_object_value_stack_new: Objects. * GTK_OPTION_MENU: GtkOptionMenu. * GTK_OPTION_MENU_CLASS: GtkOptionMenu. * gtk_option_menu_get_menu: GtkOptionMenu. * gtk_option_menu_get_type: GtkOptionMenu. * gtk_option_menu_new: GtkOptionMenu. * gtk_option_menu_remove_menu: GtkOptionMenu. * gtk_option_menu_set_history: GtkOptionMenu. * gtk_option_menu_set_menu: GtkOptionMenu. * GTK_PANED: GtkPaned. * gtk_paned_add1: GtkPaned. * gtk_paned_add2: GtkPaned. * GTK_PANED_CLASS: GtkPaned. * gtk_paned_get_type: GtkPaned. * gtk_paned_gutter_size: GtkPaned. * gtk_paned_handle_size: GtkPaned. * GTK_PIXMAP: GtkPixmap. * GTK_PIXMAP_CLASS: GtkPixmap. * gtk_pixmap_get: GtkPixmap. * gtk_pixmap_get_type: GtkPixmap. * gtk_pixmap_new: GtkPixmap. * gtk_pixmap_set: GtkPixmap. * GTK_PREVIEW: GtkPreview. * GTK_PREVIEW_CLASS: GtkPreview. * gtk_preview_draw_row: GtkPreview. * gtk_preview_get_cmap: GtkPreview. * gtk_preview_get_info: GtkPreview. * gtk_preview_get_type: GtkPreview. * gtk_preview_get_visual: GtkPreview. * gtk_preview_new: GtkPreview. * gtk_preview_put: GtkPreview. * gtk_preview_put_row: GtkPreview. * gtk_preview_set_color_cube: GtkPreview. * gtk_preview_set_expand: GtkPreview. * gtk_preview_set_gamma: GtkPreview. * gtk_preview_set_install_cmap: GtkPreview. * gtk_preview_set_reserved: GtkPreview. * gtk_preview_size: GtkPreview. * gtk_preview_uninit: GtkPreview. * GTK_PROGRESS_BAR: GtkProgressBar. * GTK_PROGRESS_BAR_CLASS: GtkProgressBar. * gtk_progress_bar_get_type: GtkProgressBar. * gtk_progress_bar_new: GtkProgressBar. * gtk_progress_bar_update: GtkProgressBar. * GTK_RADIO_BUTTON: GtkRadioButton. * GTK_RADIO_BUTTON_CLASS: GtkRadioButton. * gtk_radio_button_get_type: GtkRadioButton. * gtk_radio_button_group: GtkRadioButton. * gtk_radio_button_new: GtkRadioButton. * gtk_radio_button_new_with_label: GtkRadioButton. * GTK_RADIO_MENU_ITEM: GtkRadioMenuItem. * GTK_RADIO_MENU_ITEM_CLASS: GtkRadioMenuItem. * gtk_radio_menu_item_get_type: GtkRadioMenuItem. * gtk_radio_menu_item_group: GtkRadioMenuItem. * gtk_radio_menu_item_new: GtkRadioMenuItem. * gtk_radio_menu_item_new_with_label: GtkRadioMenuItem. * GTK_RANGE: GtkRange. * gtk_range_calc_value: GtkRange. * GTK_RANGE_CLASS: GtkRange. * gtk_range_default_hmotion: GtkRange. * gtk_range_default_hslider_update: GtkRange. * gtk_range_default_htrough_click: GtkRange. * gtk_range_default_vmotion: GtkRange. * gtk_range_default_vslider_update: GtkRange. * gtk_range_default_vtrough_click: GtkRange. * gtk_range_draw_background: GtkRange. * gtk_range_draw_slider: GtkRange. * gtk_range_draw_step_back: GtkRange. * gtk_range_draw_step_forw: GtkRange. * gtk_range_draw_trough: GtkRange. * gtk_range_get_adjustment: GtkRange. * gtk_range_get_type: GtkRange. * gtk_range_set_adjustment: GtkRange. * gtk_range_set_update_policy: GtkRange. * gtk_range_slider_update: GtkRange. * gtk_range_trough_click: GtkRange. * gtk_rc_init: Customization. * gtk_rc_parse: Customization. * GTK_RULER: GtkRuler. * GTK_RULER_CLASS: GtkRuler. * gtk_ruler_draw_pos: GtkRuler. * gtk_ruler_draw_ticks: GtkRuler. * gtk_ruler_get_type: GtkRuler. * gtk_ruler_set_metric: GtkRuler. * gtk_ruler_set_range: GtkRuler. * GTK_SCALE: GtkScale. * GTK_SCALE_CLASS: GtkScale. * gtk_scale_draw_value: GtkScale. * gtk_scale_get_type: GtkScale. * gtk_scale_set_digits: GtkScale. * gtk_scale_set_draw_value: GtkScale. * gtk_scale_set_value_pos: GtkScale. * gtk_scale_value_width: GtkScale. * GTK_SCROLLBAR: GtkScrollbar. * GTK_SCROLLBAR_CLASS: GtkScrollbar. * gtk_scrollbar_get_type: GtkScrollbar. * GTK_SCROLLED_WINDOW: GtkScrolledWindow. * GTK_SCROLLED_WINDOW_CLASS: GtkScrolledWindow. * gtk_scrolled_window_get_hadjustment: GtkScrolledWindow. * gtk_scrolled_window_get_type: GtkScrolledWindow. * gtk_scrolled_window_get_vadjustment: GtkScrolledWindow. * gtk_scrolled_window_new: GtkScrolledWindow. * gtk_scrolled_window_set_policy: GtkScrolledWindow. * GTK_SEPARATOR: GtkSeparator. * GTK_SEPARATOR_CLASS: GtkSeparator. * gtk_separator_get_type: GtkSeparator. * gtk_signal_connect: Signals. * gtk_signal_connect_after: Signals. * gtk_signal_connect_interp: Signals. * gtk_signal_connect_object: Signals. * gtk_signal_connect_object_after: Signals. * gtk_signal_default_marshaller: Signals. * gtk_signal_disconnect: Signals. * gtk_signal_disconnect_by_data: Signals. * gtk_signal_emit: Signals. * gtk_signal_emit_by_name: Signals. * gtk_signal_emit_stop: Signals. * gtk_signal_emit_stop_by_name: Signals. * gtk_signal_handler_block: Signals. * gtk_signal_handler_block_by_data: Signals. * gtk_signal_handler_unblock: Signals. * gtk_signal_handler_unblock_by_data: Signals. * gtk_signal_handlers_destroy: Signals. * gtk_signal_lookup: Signals. * gtk_signal_name: Signals. * gtk_signal_new: Signals. * gtk_signal_set_funcs: Signals. * GTK_STATUSBAR: GtkStatusbar. * GTK_STATUSBAR_CLASS: GtkStatusbar. * gtk_statusbar_get_type: GtkStatusbar. * gtk_statusbar_new: GtkStatusbar. * gtk_statusbar_pop: GtkStatusbar. * gtk_statusbar_push: GtkStatusbar. * GTK_TABLE: GtkTable. * gtk_table_attach: GtkTable. * gtk_table_attach_defaults: GtkTable. * GTK_TABLE_CLASS: GtkTable. * gtk_table_get_type: GtkTable. * gtk_table_new: GtkTable. * gtk_table_set_col_spacing: GtkTable. * gtk_table_set_col_spacings: GtkTable. * gtk_table_set_row_spacing: GtkTable. * gtk_table_set_row_spacings: GtkTable. * GTK_TEXT: GtkText. * gtk_text_backward_delete: GtkText. * GTK_TEXT_CLASS: GtkText. * gtk_text_forward_delete: GtkText. * gtk_text_freeze: GtkText. * gtk_text_get_length: GtkText. * gtk_text_get_point: GtkText. * gtk_text_get_type: GtkText. * gtk_text_insert: GtkText. * gtk_text_new: GtkText. * gtk_text_set_adjustments: GtkText. * gtk_text_set_editable: GtkText. * gtk_text_set_point: GtkText. * gtk_text_thaw: GtkText. * GTK_TOGGLE_BUTTON: GtkToggleButton. * GTK_TOGGLE_BUTTON_CLASS: GtkToggleButton. * gtk_toggle_button_get_type: GtkToggleButton. * gtk_toggle_button_new: GtkToggleButton. * gtk_toggle_button_new_with_label: GtkToggleButton. * gtk_toggle_button_set_mode: GtkToggleButton. * gtk_toggle_button_set_state: GtkToggleButton. * gtk_toggle_button_toggled: GtkToggleButton. * GTK_TOOLBAR: GtkToolbar. * gtk_toolbar_append_item: GtkToolbar. * gtk_toolbar_append_space: GtkToolbar. * GTK_TOOLBAR_CLASS: GtkToolbar. * gtk_toolbar_get_type: GtkToolbar. * gtk_toolbar_insert_item: GtkToolbar. * gtk_toolbar_insert_space: GtkToolbar. * gtk_toolbar_new: GtkToolbar. * gtk_toolbar_prepend_item: GtkToolbar. * gtk_toolbar_prepend_space: GtkToolbar. * gtk_toolbar_set_orientation: GtkToolbar. * gtk_toolbar_set_space_size: GtkToolbar. * gtk_toolbar_set_style: GtkToolbar. * gtk_toolbar_set_tooltips: GtkToolbar. * GTK_TOOLTIPS: GtkTooltips. * GTK_TOOLTIPS_CLASS: GtkTooltips. * gtk_tooltips_disable: GtkTooltips. * gtk_tooltips_enable: GtkTooltips. * gtk_tooltips_free_string: GtkTooltips. * gtk_tooltips_new: GtkTooltips. * gtk_tooltips_ref: GtkTooltips. * gtk_tooltips_set_colors: GtkTooltips. * gtk_tooltips_set_delay: GtkTooltips. * gtk_tooltips_unref: GtkTooltips. * GTK_TREE: GtkTree. * gtk_tree_append: GtkTree. * gtk_tree_child_position: GtkTree. * GTK_TREE_CLASS: GtkTree. * gtk_tree_clear_items: GtkTree. * gtk_tree_get_type: GtkTree. * gtk_tree_insert: GtkTree. * GTK_TREE_ITEM: GtkTreeItem. * GTK_TREE_ITEM_CLASS: GtkTreeItem. * gtk_tree_item_collapse: GtkTreeItem. * gtk_tree_item_deselect: GtkTreeItem. * gtk_tree_item_expand: GtkTreeItem. * gtk_tree_item_get_type: GtkTreeItem. * gtk_tree_item_new: GtkTreeItem. * gtk_tree_item_new_with_label: GtkTreeItem. * gtk_tree_item_remove_subtree: GtkTreeItem. * gtk_tree_item_select: GtkTreeItem. * gtk_tree_item_set_subtree: GtkTreeItem. * gtk_tree_new: GtkTree. * gtk_tree_prepend: GtkTree. * gtk_tree_remove_items: GtkTree. * gtk_tree_select_child: GtkTree. * gtk_tree_select_item: GtkTree. * gtk_tree_set_selection_mode: GtkTree. * gtk_tree_set_view_lines: GtkTree. * gtk_tree_set_view_mode: GtkTree. * gtk_tree_unselect_child: GtkTree. * gtk_tree_unselect_item: GtkTree. * gtk_type_class: Basics. * gtk_type_describe_heritage: Basics. * gtk_type_describe_tree: Basics. * gtk_type_from_name: Basics. * gtk_type_is_a: Basics. * gtk_type_name: Basics. * gtk_type_new: Basics. * gtk_type_parent: Basics. * GTK_TYPE_SEQNO: Basics. * gtk_type_unique: Basics. * GTK_VBOX: GtkVBox. * GTK_VBOX_CLASS: GtkVBox. * gtk_vbox_get_type: GtkVBox. * gtk_vbox_new: GtkVBox. * GTK_VBUTTON_BOX: GtkVButtonBox. * GTK_VBUTTON_BOX_CLASS: GtkVButtonBox. * gtk_vbutton_box_get_layout_default: GtkVButtonBox. * gtk_vbutton_box_get_spacing_default: GtkVButtonBox. * gtk_vbutton_box_get_type: GtkVButtonBox. * gtk_vbutton_box_new: GtkVButtonBox. * gtk_vbutton_box_set_layout_default: GtkVButtonBox. * gtk_vbutton_box_set_spacing_default: GtkVButtonBox. * GTK_VIEWPORT: GtkViewport. * GTK_VIEWPORT_CLASS: GtkViewport. * gtk_viewport_get_hadjustment: GtkViewport. * gtk_viewport_get_type: GtkViewport. * gtk_viewport_get_vadjustment: GtkViewport. * gtk_viewport_new: GtkViewport. * gtk_viewport_set_hadjustment: GtkViewport. * gtk_viewport_set_shadow_type: GtkViewport. * gtk_viewport_set_vadjustment: GtkViewport. * GTK_VPANED: GtkVPaned. * GTK_VPANED_CLASS: GtkVPaned. * gtk_vpaned_get_type: GtkVPaned. * gtk_vpaned_new: GtkVPaned. * GTK_VRULER: GtkVRuler. * GTK_VRULER_CLASS: GtkVRuler. * gtk_vruler_get_type: GtkVRuler. * gtk_vruler_new: GtkVRuler. * GTK_VSCALE: GtkVScale. * GTK_VSCALE_CLASS: GtkVScale. * gtk_vscale_get_type: GtkVScale. * gtk_vscale_new: GtkVScale. * GTK_VSCROLLBAR: GtkVScrollbar. * GTK_VSCROLLBAR_CLASS: GtkVScrollbar. * gtk_vscrollbar_get_type: GtkVScrollbar. * gtk_vscrollbar_new: GtkVScrollbar. * GTK_VSEPARATOR: GtkVSeparator. * GTK_VSEPARATOR_CLASS: GtkVSeparator. * gtk_vseparator_get_type: GtkVSeparator. * gtk_vseparator_new: GtkVSeparator. * GTK_WIDGET: GtkWidget. * GTK_WIDGET_CLASS: GtkWidget. * gtk_widget_class_init: GtkWidget. * gtk_widget_destroy: GtkWidget. * gtk_widget_draw: GtkWidget. * gtk_widget_draw_children: GtkWidget. * gtk_widget_draw_focus: GtkWidget. * gtk_widget_event: GtkWidget. * gtk_widget_get_ancestor: GtkWidget. * gtk_widget_get_colormap: GtkWidget. * gtk_widget_get_style: GtkWidget. * gtk_widget_get_toplevel: GtkWidget. * gtk_widget_get_type: GtkWidget. * gtk_widget_get_visual: GtkWidget. * gtk_widget_grab_default: GtkWidget. * gtk_widget_grab_focus: GtkWidget. * gtk_widget_hide: GtkWidget. * gtk_widget_init: GtkWidget. * gtk_widget_install_accelerator: GtkWidget. * gtk_widget_intersect: GtkWidget. * gtk_widget_map: GtkWidget. * gtk_widget_popup: GtkWidget. * gtk_widget_realize: GtkWidget. * gtk_widget_remove_accelerator: GtkWidget. * gtk_widget_reparent: GtkWidget. * gtk_widget_restore_state: GtkWidget. * gtk_widget_set_name: GtkWidget. * gtk_widget_set_parent: GtkWidget. * gtk_widget_set_sensitive: GtkWidget. * gtk_widget_set_state: GtkWidget. * gtk_widget_set_style: GtkWidget. * gtk_widget_set_uposition: GtkWidget. * gtk_widget_set_usize: GtkWidget. * gtk_widget_show: GtkWidget. * gtk_widget_size_allocate: GtkWidget. * gtk_widget_size_request: GtkWidget. * gtk_widget_unmap: GtkWidget. * gtk_widget_unrealize: GtkWidget. * GTK_WINDOW: GtkWindow. * gtk_window_add_accelerator_table: GtkWindow. * GTK_WINDOW_CLASS: GtkWindow. * gtk_window_get_type: GtkWindow. * gtk_window_new: GtkWindow. * gtk_window_position: GtkWindow. * gtk_window_remove_accelerator_table: GtkWindow. * gtk_window_set_default: GtkWindow. * gtk_window_set_focus: GtkWindow. * gtk_window_set_policy: GtkWindow. * gtk_window_set_title: GtkWindow. * GtkButton::clicked: GtkButton. * GtkButton::enter: GtkButton. * GtkButton::leave: GtkButton. * GtkButton::pressed: GtkButton. * GtkButton::released: GtkButton. * GtkCheckMenuItem::toggled: GtkCheckMenuItem. * GtkContainer::add: GtkContainer. * GtkContainer::focus: GtkContainer. * GtkContainer::foreach: GtkContainer. * GtkContainer::need_resize: GtkContainer. * GtkContainer::remove: GtkContainer. * GtkCTree::tree_collapse: GtkCTree. * GtkCTree::tree_expand: GtkCTree. * GtkCTree::tree_move: GtkCTree. * GtkCTree::tree_select_row: GtkCTree. * GtkCTree::tree_unselect_row: GtkCTree. * GtkEntry::activate: GtkEntry. * GtkEntry::changed: GtkEntry. * GtkEntry::delete_text: GtkEntry. * GtkEntry::insert_text: GtkEntry. * GtkEntry::set_text: GtkEntry. * GtkInputDialog::disable_device: GtkInputDialog. * GtkInputDialog::enable_device: GtkInputDialog. * GtkItem::deselect: GtkItem. * GtkItem::select: GtkItem. * GtkItem::toggle: GtkItem. * GtkList::select_child: GtkList. * GtkList::selection_changed: GtkList. * GtkList::unselect_child: GtkList. * GtkMenuItem::activate: GtkMenuItem. * GtkMenuShell::deactivate: GtkMenuShell. * GtkToggleButton::toggled: GtkToggleButton. * GtkWidget::button_press_event: GtkWidget. * GtkWidget::button_release_event: GtkWidget. * GtkWidget::configure_event: GtkWidget. * GtkWidget::delete_event: GtkWidget. * GtkWidget::destroy_event: GtkWidget. * GtkWidget::drag_begin_event: GtkWidget. * GtkWidget::draw: GtkWidget. * GtkWidget::draw_default: GtkWidget. * GtkWidget::draw_focus: GtkWidget. * GtkWidget::drop_event: GtkWidget. * GtkWidget::enter_notify_event: GtkWidget. * GtkWidget::event: GtkWidget. * GtkWidget::expose_event: GtkWidget. * GtkWidget::focus_in_event: GtkWidget. * GtkWidget::focus_out_event: GtkWidget. * GtkWidget::hide: GtkWidget. * GtkWidget::install_accelerator: GtkWidget. * GtkWidget::key_press_event: GtkWidget. * GtkWidget::key_release_event: GtkWidget. * GtkWidget::leave_notify_event: GtkWidget. * GtkWidget::map: GtkWidget. * GtkWidget::map_event: GtkWidget. * GtkWidget::motion_notify_event: GtkWidget. * GtkWidget::other_event: GtkWidget. * GtkWidget::property_notify_event: GtkWidget. * GtkWidget::realize: GtkWidget. * GtkWidget::remove_accelerator: GtkWidget. * GtkWidget::selection_clear_event: GtkWidget. * GtkWidget::selection_notify_event: GtkWidget. * GtkWidget::selection_request_event: GtkWidget. * GtkWidget::show: GtkWidget. * GtkWidget::size_allocate: GtkWidget. * GtkWidget::size_request: GtkWidget. * GtkWidget::state_changed: GtkWidget. * GtkWidget::unmap: GtkWidget. * GtkWidget::unmap_event: GtkWidget. * GtkWidget::unrealize: GtkWidget. * GtkWindow::move_resize: GtkWindow. * GtkWindow::set_focus: GtkWindow.  File: gtk.info, Node: Concept Index, Prev: Function Index, Up: Top Concept Index ************* * Menu: * class: Types. * Copying: Copying. * Object Implementation: Object Implementation. * Overview: Overview. * Signal Implementation: Signal Implementation. * Signals: Signals. * type: Types. * type system: Types. * Using GTK: Examples. * Widget Implementation: Widget Implementation. * Widgets: Widgets. 0707010001bb00000081a40000000a0000000a000000013d12d39c0002e546000000880000000300000000000000000000001cff350892reloc/doc/gtk/docs/gtk.texi\input texinfo @c -*-texinfo-*- @c Copyright (C) 1996 by Peter Mattis. All rights reserved. @c Portions Copyright (C) 1998 Marius Vollmer @c @c %**start of header @setfilename gtk.info @settitle GTK @setchapternewpage odd @include macros.texi @c %**end of header @set edition 1.0 @set update-date 23 August 1998 @set update-month August 1998 @ifinfo This file documents GTK, the GIMP Toolkit Copyright (C) 1996 Peter Mattis Copyright (C) 1997 Peter Mattis Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies @ignore Permission is granted to process this file through TeX and print the results, provided the printed document carries copying permission notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Peter Mattis. @end ifinfo @titlepage @title The GIMP Toolkit @subtitle Version @value{edition} @subtitle @value{update-month} @author by Peter Mattis and the GTK+ team @page @vskip 0pt plus 1filll Copyright @copyright{} 1996 Peter Mattis @vskip 0pt plus 1fill Copyright @copyright{} 1997 Peter Mattis Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Peter Mattis. @end titlepage @dircategory User Interface Toolkit @direntry * GTK: (gtk). The GIMP Toolkit @end direntry @node Top, Copying, (dir), (dir) @top The GIMP Toolkit @ifinfo This is edition @value{edition} of the GTK documentation, @w{@value{update-date}}. @end ifinfo @c FIXME: Do an introduction to the GTK? @menu * Copying:: Your rights. * Overview:: What is GTK? * Types:: * Objects:: * Signals:: Signals overview. * Widgets:: Widget overview. * Other Objects:: Utility objects. * Miscellaneous:: Initialization, exit and other features. * Examples:: Using GTK. * Object Implementation:: Object internals. * Signal Implementation:: Signal internals. * Widget Implementation:: Widget internals. * Function Index:: Index of functions. * Concept Index:: Index of concepts. @end menu @node Copying, Overview, Top, Top @comment node-name, next, previous, up @chapter Copying @cindex Copying GTK is @dfn{free}; this means that everyone is free to use it and free to redistribute it on a free basis. GTK is not in the public domain; it is copyrighted and there are restrictions on its distribution, but these restrictions are designed to permit everything that a good cooperating citizen would want to do. What is not allowed is to try to prevent others from further sharing any version of GTK that they might get from you. Specifically, we want to make sure that you have the right to give away copies of GTK, that you receive source code or else can get it if you want it, that you can change GTK or use pieces of it in new free programs, and that you know you can do these things. To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of GTK, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. Also, for our own protection, we must make certain that everyone finds out that there is no warranty for GTK. If GTK is modified by someone else and passed on, we want their recipients to know that what they have is not what we distributed, so that any problems introduced by others will no reflect on our reputation. The precise conditions of the licenses for GTK are found in the General Public Licenses that accompany it. @node Overview, Types, Copying, Top @comment node-name, next, previous, up @chapter What is GTK? @cindex Overview GTK is a library for creating graphical user interfaces similar to the Motif ``look and feel''. It is designed to be small and efficient, but still flexible enough to allow the programmer freedom in the interfaces created. GTK allows the programmer to use a variety of standard user interface widgets (@pxref{Widgets}) such as push, radio and check buttons, menus, lists and frames. It also provides several ``container'' widgets which can be used to control the layout of the user interface elements. GTK provides some unique features. (At least, I know of no other widget library which provides them). For example, a button does not contain a label, it contains a child widget, which in most instances will be a label. However, the child widget can also be a pixmap, image or any combination possible the programmer desires. This flexibility is adhered to throughout the library. @c I think the next paragraph takes unproportionally much space for @c the thing it wants to say (compared to the rest of this overview). @c So Somebody please extend this overview with more generally interesting @c stuff. - mvo To make life easier for you, GTK presents this flexibility in a uniform framework. Specifically, it implements its own support for object oriented programming that is well adapted to the purposes of a user interface toolkit and it aims at providing a reasonable sane and disciplined programming interface. This uniformity and discipline is intended to make it easy and reliable to access GTK from languages other than C. Especially more dynamic languages like Perl, Python or Scheme will find amble support, and in fact, bindings to these languages already exist. @node Types, Objects, Overview, Top @comment node-name, next, previous, up @chapter Types @cindex type @cindex type system @cindex class @flushright Other kid's games are all such a bore! They've gotta have rules and they gotta keep score! @* -- Calvin about CalvinBall(tm) @end flushright GTK implements a semi-simple type system with an associated class mechanism for widgets and several other useful objects. This type system is intended to be general enough to allow both a smooth binding of dynamically typed languages to Gtk, as well as to serve for a rigorous and formalistic definition of the larger part of the Gtk API. @c The GtkObject @c type is the root of the class hierarchy. It provides a few items needed @c by all classes, the foundation for the signal (@pxref{Signals}) @c mechanism and the ``destroy'' method. The classes for the individual widgets are by far the most important part of this type system, but before we get to them, we describe the basics of the type system itself. This is mostly of interest for widget writers and language binders, so you might want to skip ahead to the next chapter, which talks about the object oriented stuff. @menu * Type introduction:: * Basics:: * Simple types:: * Enumerations and flags:: * Strings:: * Boxed types:: * Callbacks:: * Composite types:: @end menu @node Type introduction, Basics, Types, Types @section Introduction to the Type System Gtk defines its own system of types, much like a computer language defines what types it supports. Of course, the Gtk type system is build on top of the types that C provides, so it includes members like @samp{int}, @samp{long} and @samp{float}. But, compared to C, it allows only few carefully selected types and specifies a lot of restrictions on the way you can use values of these types. For example, there is no general facility for specifying @emph{pointer to X}. Instead, we take a more higher level approach and define such things as @samp{string}, which is just like a @code{char*} but with additional rules about how to manage the memory that it points to. The type system has two purposes: to define a formal system with which to describe the various exported features of Gtk; and to implement this system at run-time so that we get sound and flexible @dfn{dynamic} types for the dynamic languages that want to interface with Gtk. Let me restate this with different words, because I think it is important to understand this idea. We will see in a moment that the type system is indeed well defined and all this detail is implemented with functions and data structures in Gtk. For example, every type (and there can be any number of them) can be represented with a unique integer and Gtk has support for the necessary bookkeeping for this. Every type also has a name and there are functions for converting between the name of a type and its unique number. Maybe more useful, there is a big discriminated union that can be used to pass around a value of any representable type, together with its precise type. This is the run-time or dynamic side of the type system. Mostly, you do not need to use it when you don't want to. The compile-time or static side of the type system can is used to statically define the programming interface of Gtk. For example, suppose there is function @code{gtk_foo} in the Gtk API that has a prototype @example char *gtk_foo (char *); @end example This looks like it does something with strings. But what does it do with the memory of the string that has been passed in, and what are we supposed or allowed to do with the memory that the returned pointer points to? The more restricted type @samp{string} from the Gtk type system can be used to be more precise. In fact, the definition of @samp{string} below includes the rule that when a @samp{string} is passed to a function, that function is not allowed to retain a pointer into the string beyond the life time of that function call. So we are safe to deallocate it or override it when the function has returned. Likewise, the definition specifies that the memory of a @samp{string} that is returned from a function becomes the sole property of the calling function. The calling function is responsible for deallocating it eventually and it can be sure that nobody else scribbles in it. When @samp{gtk_foo} really obeys these rules, we can say that it takes one argument, which is a @samp{string}, and it returns a @samp{string}. Now we can understand why it makes sense to have a more restrictive type system than that of C. With it, it is possible to be more precise and we actually have a framework where we can be sure that as long as we stay inside this framework we are not gratuitously causing trouble for languages that are more disciplined than C. Of course, you are not restricted to making all your interfaces expressible within the framework. There are valid reasons for breaking it, for performance or simply for convenience. But please try to provide all the functionality of your module in such a way that it can be described with this type system and treat the non-conforming functions as additional goodies that are nice to have but not essential. The reward is an instant accessibility of your code from a huge number of scripting and extension languages such as Perl, Python, and Guile. These formal specifications of the Gtk interface are contained in special declarations in the header files of Gtk. They are ignored by the C compiler, but can be used by other language processors. For extra convenience, these declarations are also available in a more condensed form that is easier to parse. Tools for generating bindings of Gtk to other languages can read these declarations and---because all the important details are defined---automatically generate the bulk of the needed glue code. It is also possible to feed these declarations into a running application (an interface builder, say) and thus make it aware of new widgets and functions without recompiling anything. The run-time side of the type system is also somewhat introspective. This means that you can query Gtk about all the members of an enumeration for example. Gtk provides tools that help you provide this introspection for your definitions also. Types are not enough to completely specify an interface, so GTK also has @dfn{modes}. A mode specifies what happens to a value when it crosses a module boundary; it can be @samp{in}, @samp{out}, or @samp{inout}. Most fundamental types (and their derived types) support only mode @samp{in}. The modes @samp{out} and @samp{inout} can only be used with the composite types: lists and vectors. When argument of these types are marked as @samp{out} or @samp{inout} it means that the called module is allowed to change the contents of the composite value and that these changes need to be propagated back to the originator of the value. Mode @samp{out} means that the argument has no meaningful value at the beginning and should not be read. Mode @samp{in} specifies that the called module is not allowed to change the value in any way. The type system allows for an unbounded number of types. Every widget is a type for example and you can add new widget types at any time without confusing the run-time implementation of the type system. Nevertheless, all types are derived from a certain @dfn{fundamental} type, and there are only a small and finite number of fundamental types. We only specify rules for the fundamental types and all other types inherit these rules from their fundamental type. For example, @samp{int} is a fundamental type, as is @samp{GtkObject}. All widgets derive from @samp{GtkObject} and so the rules for @samp{GtkObject} apply to all widgets as well. This derivation defines a type hierarchy, but this hierarchy is not completely general. You can't derive from @samp{int} for example, and you can only have one level of derivation from @samp{enum}. The fundamental type @samp{GtkObject}, however, is the basis for the large and deep hierarchy of widget types. The individual fundamental types are defined and explained in the following sections. Here is a complete list of them: @table @samp @item none The not-a-value type, similar to @samp{void}. @item char A character. Internationalization issues are still undecided. @item bool True or false. @item byte, ubyte, int, uint, long, ulong, float, double The usual assortment of scalar types. @item string A string. Internationalization issues are still undecided. @item enum, flags Enumerations with a fixed set of literals. Either used to express a single choice from this set or to individually turn on and off several flags. @item boxed A pointer to an opaque structure that can be copied and destroyed. @item callback A pointer to a function with enough extra information so that it can also be used for functions written in languages completely different from C. @item GtkObject A pointer to a GtkObject or derived type. The fun starts here. @item args, slist, dlist, cvec, tvec An assortment of composite types like linked lists and counted or zero-terminated arrays. @item pointer, signal, c_callback Obsolete types. @end table @node Basics, Simple types, Type introduction, Types @section Basic Concepts The basis for the type system are the fundamental types. At run-time, they are represented by members of the @code{GtkFundamentalType} enumeration. For the static declarations, they are identified with a unique name. @deftp {Enumeration} GtkFundamentalType This enumeration contains a member for each defined fundamental type. Most members are listed along with the description of their semantics, but one is listed here: @table @code @item GTK_TYPE_INVALID No valid type is derived from this. Use @code{GTK_TYPE_INVALID} to express exceptional situations. This member does not really correspond to a fundamental type and thus there is no name for it. @end table @end deftp @deftp {Data type} GtkType The type @code{GtkType} holds the run-time representation of a type. It is an integer of a certain size. The follwing macros are defined to access the basic properties of a @code{GtkType}: @deftypefn {Macro} {unsigned int} GTK_TYPE_SEQNO (GtkType type) Returns the sequence number of @var{type}. The sequence numbers are guaranteed to be dense, i.e., you can use them to index a table and the table need not be much larger than the number of different GtkTypes that you might encounter. @end deftypefn @deftypefn {Macro} GtkFundamentalType GTK_FUNDAMENTAL_TYPE (GtkType type) Returns the fundamental type of @var{type}. @end deftypefn Both macros simply access different bit-fields of a @code{GtkType}, so they are very efficient. @end deftp New types are registered with the @code{gtk_type_unique} function. Any kind oftype can be registered with @code{gtk_type_unique} but there are convenience functions for most fundamental types. Each fundamental type has its own interpretation of the rules below and these convenience functions should be used to automatically get the type registration right. So, don't be put off by the apparent complexity of the interface to @code{gtk_type_unique}. You will be using it only for new widgets, and there the rules are simple. The @code{GtkTypeInfo} structure is used to communicate information to @code{gtk_type_unique} as opposed to passing in large numbers of parameters. @example typedef struct _GtkTypeInfo GtkTypeInfo; struct _GtkTypeInfo @{ gchar *type_name; guint object_size; guint class_size; GtkClassInitFunc class_init_func; GtkObjectInitFunc object_init_func; gpointer reserved_1; gpointer reserved_2; GtkClassInitFunc base_class_init_func; @} @end example @itemize @bullet @item The @code{type_name} field refers to the name of the type. This is the same name that is used in the static definitions. It is convention for the type name to be closely related to the name of the underlying C type. For example, the type name of the @code{GtkObject} structure is ``GtkObject'', and the name of the @code{GtkWindowType} enumeration is ``GtkWindowType''. Note that the C type corresponding to ``GtkObject'' is really a pointer to a @code{GtkObject} struct, but the name has no ``*'' in it. @item The @code{object_size} field refers to the size in bytes of the C structure for types that have such a structure. The easiest (and portable) means of computing this size is by using the C @code{sizeof} operator. For instance, the sizeof of the @code{GtkObject} structure is computed by doing @code{sizeof (GtkObject)}. When the type has no associated structure or when you do not want to support the @code{gtk_type_new} function for the new type, set @code{object_size} to 0. Only types derived from GTK_TYPE_OBJECT can be handled by @code{gtk_type_new}, anyway. @item The @code{class_size} field refers to the size in bytes of the C structure for the class. Again, the @code{sizeof} operator should be used to compute this value. If you don't want to have a class structure for this type, set the field to 0. @code{gtk_type_class} will then always return @code{NULL}. @item The @code{class_init_func} and @code{base_class_init_func} fields are callbacks which are used by the type mechanism to initialize class specific fields. The single argument these functions take is a pointer to a class structure. When you do not need one or both of them, set the corresponding field to @code{NULL}. The @code{class_init_func} will be called at most once, right after the class structure of size @code{class_size} has been allocated. The interaction between @code{class_init_func} and @code{base_class_init_func} is only really useful for the full-fledged object system. It is described there @pxref{Objects}. @item The @code{object_init_func} field is a callback which is used by the type mechanism to initialize object specific fields for structures that have been allocated via @code{gtk_type_new}. The single argument this functions takes is a pointer to an object structure. If you do not want any special object initialization to take place, set this to @code{NULL}. All object initialization functions for all types that are part of the inheritance chain are called, starting with the most basic type. @end itemize @deftypefun guint gtk_type_unique (GtkType @var{parent_type}, GtkTypeInfo *@var{type_info}) The @var{parent_type} is simply the new types parent type. If @var{parent_type} is GTK_TYPE_INVALID, then the new type is a new fundamental type. You should @b{never} register new fundamental types. @var{type_info} is a pointer to a structure which contains necessary information for construction of the new type. You can only register a specific name once. @end deftypefun @deftypefun gchar* gtk_type_name (GtkType @var{type}) The returned string is the name of @var{type} as specified to @code{gtk_type_unique}. @end deftypefun @deftypefun GtkType gtk_type_from_name (guchar *@var{name}) Return the type associated with @var{name}. If there is no type associated with @var{name}, then GTK_TYPE_INVALID will be returned. @end deftypefun @deftypefun GtkType gtk_type_parent (GtkType @var{type}) Returns the parent type of @var{type} or GTK_TYPE_INVALID if @var{type} is a fundamental type. @end deftypefun @deftypefun gpointer gtk_type_class (GtkType @var{type}) Returns the initialized class structure for @var{type}. The class structure is actually created and initialized the first time it is needed. Refer to @pxref{Objects} for details on how this initialization works for GTK_TYPE_OBJECT derived types. @c If creation and initialization occurs, the @code{class_size} @c field of the @code{GtkTypeInfo} structure used to initialize this type @c is used to determine how large the class structure is. The @c @code{class_init_func} field from the @code{GtkTypeInfo} structure is @c called for all the members in the types ancestry, including the @c type. The order of this invocation proceeds from the root on down. For @c example, the @code{GtkWidgetClass} is first initialized as an @c @code{GtkObjectClass} by the object class initialization routine and @c then by the widget class initialization routine. This allows the widget @c class initialization routine to override values set by the object class @c initialization routine. The returned structure is shared by all objects of @var{type} and, as such, should not be modified. @end deftypefun @deftypefun gpointer gtk_type_new (GtkType @var{type}) Returns a new instance of an @var{type} object. This works only for GTK_TYPE_OBJECT derived types. Please see @pxref{Objects}. @c The @code{object_size} @c and @code{object_init_func} fields of the @code{GtkTypeInfo} structure @c are used to determine the objects allocated size and the object specific @c initialization routine. Similarly to the class initialization, all the @c object initialization routines from the root on down to the particular @c type being created are invoked. @end deftypefun @deftypefun void gtk_type_describe_heritage (GtkType @var{type}) Prints the type heritage for @var{type}. The heritage for a type includes the type and all its parent types up the type tree. @end deftypefun @deftypefun void gtk_type_describe_tree (GtkType @var{type}, gboolean @var{show_size}) Prints the type tree which starts at @var{type}. @var{show_size} is a boolean which determines whether type sizes are printed. @end deftypefun @deftypefun gboolean gtk_type_is_a (GtkType @var{type}, GtkType @var{is_a_type}) A predicate function which determines whether the relation @var{type} is_a @var{is_a_type} is true. @end deftypefun @c @deftypefun void gtk_type_get_arg (GtkObject *@var{object}, GtkType @var{type}, GtkArg *@var{arg}, guint @var{arg_id}) @c @end deftypefun @c @deftypefun void gtk_type_set_arg (GtkObject *@var{object}, GtkType @var{type}, GtkArg *@var{arg}, guint @var{arg_id}) @c @end deftypefun Values of all types can be handled uniformly by storing them into a @code{GtkArg} structure. The @code{GtkArg} has the following fields: @table @code @item gchar *name This can be used to give the value represented by this @code{GtkArg} structure a name. It is not used much. @item GtkType type The type of this value. @item union d A big union that has (at least conceptually) one member for each fundamental type. You should not access these members directly. Rather, use the @code{GTK_VALUE_*} macros. There is one macro for each fundamental type, and its name is derived from the name of the GtkFundamentalType enumeration members simply by replacing ``Gtk_TYPE'' with ``GTK_VALUE''. All @code{GTK_VALUE_*} macros take a @code{GtkArg} structure as their only parameter (@emph{not} a pointer) and evaluate to a lvalue. @end table For example, the accessor for the fundamental type GTK_TYPE_INT is called GTK_VALUE_INT and you could use it like this: @example GtkArg value; value.name = NULL; value.type = GTK_TYPE_INT; GTK_VALUE_INT(value) = 7; @end example @node Simple types, Enumerations and flags, Basics, Types @section Simple Types The Gtk type system has a full set of the usual simple types: integers, floating point numbers, but also boolean and character. You can not derive new types from these. @multitable {GTK_TYPE_POINTER} {"gpointer"} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} @item Enum @tab Name @tab Description @item GTK_TYPE_NONE @tab "void" @tab A type without value. @item GTK_TYPE_CHAR @tab "char" @tab A 8-bit unsigned number representing a character. Numbers between 0 and 127 are ASCII, the rest is undefined. @item GTK_TYPE_BOOL @tab "gboolean" @tab The boolean type. It is some small integer where the number 0 represents false and 1 is true. No other values are allowed. @item GTK_TYPE_INT @tab "gint" @tab A signed integer with at least 32 bits. @item GTK_TYPE_UINT @tab "guint" @tab A unsigned integer with at least 32 bits. @item GTK_TYPE_LONG @tab "glong" @tab A signed integer with at least 32 bits. @item GTK_TYPE_ULONG @tab "gulong" @tab A unsigned integer with at least 32 bits. This is large enough to hold a coerced pointer. @item GTK_TYPE_FLOAT @tab "gfloat" @tab A single precision floating point number. @item GTK_TYPE_DOUBLE @tab "gfloat" @tab A souble precision floating point number. @item GTK_TYPE_POINTER @tab "gpointer" @tab A untyped pointer. Do not use this if you can avoid it. @end multitable The values of these types are all represented `directly' with the C types that are indicated in the `name' column above. @pxref{Boxed types} for a discussion of this. @node Enumerations and flags, Strings, Simple types, Types @section Enumerations and Flags @node Strings, Boxed types, Enumerations and flags, Types @section Strings @node Boxed types, Callbacks, Strings, Types @section Boxed Types @node Callbacks, Composite types, Boxed types, Types @section Callbacks @node Composite types, , Callbacks, Types @section Composite Types @node Objects, Signals, Types, Top @chapter Objects @section Object functions The GtkObject type is the root of the type hierarchy used by GTK. It provides a minimal set of fields used to implement the actual object, class and signal mechanisms, as well as several utility routines which make dealing with objects easier. For the adventurous, see @ref{Object Implementation}. @deftypefun guint gtk_object_get_type (void) Returns the @code{GtkObject} type identifier. @end deftypefun @deftypefun void gtk_object_class_add_signals (GtkObjectClass *@var{class}, gint *@var{signals}, gint @var{nsignals}) Adds @var{signals} to the @code{signals} field in the GtkObjectClass structure @var{class}. @xref{Signals}. @end deftypefun @deftypefun GtkObject* gtk_object_new (guint @var{type}, @dots{}) @end deftypefun @deftypefun GtkObject* gtk_object_newv (guint @var{type}, guint @var{nargs}, GtkArg *@var{args}) @end deftypefun @deftypefun void gtk_object_ref (GtkObject *@var{object}); @end deftypefun @deftypefun void gtk_object_unref (GtkObject *@var{object}); @end deftypefun @deftypefun void gtk_object_getv (GtkObject *@var{object}, guint @var{nargs}, GtkArg *@var{args}) @end deftypefun @deftypefun void gtk_object_set (GtkObject *@var{object}, @dots{}) @end deftypefun @deftypefun void gtk_object_setv (GtkObject *@var{object}, guint @var{nargs}, GtkArg *@var{args}) @end deftypefun @deftypefun GtkArg* gtk_object_query_args (GtkType @var{class_type}, guint *@var{nargs}) @end deftypefun @deftypefun void gtk_object_add_arg_type (gchar *@var{arg_name}, GtkType @var{arg_type}, guint @var{arg_id}) @end deftypefun @deftypefun GtkType gtk_object_get_arg_type (gchar *@var{arg_name}) @end deftypefun @deftypefun void gtk_object_destroy (GtkObject *@var{object}) Performs checks to make sure it is alright to destroy @var{object} and then emits the @code{destroy} signal. The check which is performed is to make sure @var{object} is not already processing another signal. If this were the case then destroying the object immediately would undoubtedly cause problems as the other signal would not be able to tell the object was destroyed. The solution is that if @var{object} is processing another signal we mark @var{object} is needing to be destroyed. When we finish processing of the other signal we check whether the object needs to be destroyed. @end deftypefun The GtkObject type provides a mechanism for associating arbitrary amounts of data with an object. The data is associated with the object using a character string key. The functions @code{gtk_object_set_data}, @code{gtk_object_get_data}, and @code{gtk_object_remove_data} are the interface to this mechanism. Two other routines, @code{gtk_object_set_user_data} and @code{gtk_object_get_user_data}, exist as convenience functions which simply use the same mechanism. @deftypefun void gtk_object_set_data (GtkObject *@var{object}, const char *@var{key}, gpointer @var{data}) Associate @var{data} with @var{key} in the data list of @var{object}. @end deftypefun @deftypefun gpointer gtk_object_get_data (GtkObject *@var{object}, const char *@var{key}) Retrieve the data associated with @var{key} in the data list of @var{object}. @end deftypefun @deftypefun void gtk_object_remove_data (GtkObject *@var{object}, const char *@var{key}) Remove the data associated with @var{key} in the data list of @var{object}. @end deftypefun @deftypefun void gtk_object_set_user_data (GtkObject *@var{object}, gpointer @var{data}) Sets @var{data} into the @code{user_data} field of @var{object}. @end deftypefun @deftypefun gpointer gtk_object_get_user_data (GtkObject *@var{object}) Returns the @code{user_data} field of @var{object}. @end deftypefun @c ------------ Is this deprecated? ----------------- The GtkObject type also provides a mechanism for specifying initialization values for fields. This general mechanism is called object value stacks. The reason for using value stacks is that they can simplify the life of the programmer. For instance, by default widgets are non-visible when created. However, the ``visible'' value for widgets may be specified so that widgets are made visible when created. (FIXME: unfinished). @deftypefun void gtk_object_value_stack_new (guint @var{object_type}, const gchar *@var{value_id}, GtkParamType @var{value_type}) @end deftypefun @deftypefun void gtk_object_push_value (guint @var{object_type}, const gchar *@var{value_id}, @dots{}) Push a value on the value stack specified by @var{object_type} and @var{value_id}. The type of value is implicitly given in the context of @var{object_type} and @var{value_id}. (That is, it is not specified explicitly in the function call). Only a single extra argument is expected which is the data which is to be placed on the stack. @end deftypefun @deftypefun void gtk_object_pop_value (guint @var{object_type}, const gchar *@var{value_id}) Pop a value of the value stack specified by @var{object_type} and @var{value_id}. @end deftypefun @deftypefun gint gtk_object_peek_value (guint @var{object_type}, const gchar *@var{value_id}, gpointer @var{data}) Peek at the value on the top of the value stack specified by @var{object_type} and @var{value_id}. The @var{data} argument is interpreted as the location of where to place the ``peeked'' data. For instance, if the peeked data is of type @code{GTK_PARAM_POINTER}, then @var{data} will be a pointer to a pointer. If the value stack is empty or does not exist or an error occurs, @code{gtk_object_peek_value} will return @code{FALSE}. On success it will return @code{TRUE}. @end deftypefun @node Signals, Widgets, Objects, Top @comment node-name, next, previous, up @chapter Signals Overview @cindex Signals Signals are GTK's method for objects to perform callbacks. A signal is an event which occurs upon an object. The programmer can connect to a signal of an object which involves specifying a function to be called when that signal is emitted in the specified object. When a signal is emitted, both the class function associated with the signal (when it was defined) and all signal handlers installed for that signal on the particular object emitting the signal are called. The widget programmer can specify whether the class function is to be called before after or both before and after the signal handlers installed by the widget user. The widget user can, however, specify that their signal handler is to be run after the class function (using the ``_after'' signal connection routines). Any signal handling function can emit the same signal on the same object while it is running causing that signal emission to either restart or to run recursively. Additionally, signal emission can be terminated prematurely. While both such abilities are rarely used, they do allow for greater flexibility in regards to signals. For instance, a programmer can attach to the key press event signal and intercept all tab key presses from a widget. This particular example is used in the file selection dialog to implement tab completion of filenames and prevent the entry widget from inserting the tab into its buffer. Signals are selected using either an integer identifier or a character string name. It is convention to name the signal the same as the class function which is associated with it. There are two versions of most of the signal functions, one which takes an integer identifier and one which takes a character string name for the signal. @deftypefun gint gtk_signal_new (gchar *@var{name}, GtkSignalRunType @var{run_type}, gint @var{object_type}, gint @var{function_offset}, GtkSignalMarshaller @var{marshaller}, GtkParamType @var{return_val}, gint @var{nparams}, @dots{}) Create a new signal and give it the character string identifier @var{name}. @var{name} needs to be unique in the context of @var{object_type}'s branch of the class hierarchy. That is, @var{object_type} cannot create a signal type with the same name as a signal type created by one of its parent types. @var{run_type} specifies whether the class function should be run before (@code{GTK_RUN_FIRST}), after (@code{GTK_RUN_LAST}) or both before and after normal signal handlers (@code{GTK_RUN_BOTH}). Additionally, the @code{GTK_RUN_NO_RECURSE} value can be or'ed with any of those values to specify that the signal should not be recursive. By default, emitting the same signal on the same widget will cause the signal to be emitted twice. However, if the @code{GTK_RUN_NO_RECURSE} flag is specified, emitting the same signal on the same widget will cause the current signal emission to be restarted. This allows the widget programmer to specify the semantics of signal emission on a per signal basis. (The @code{GTK_RUN_NO_RECURSE} flag is used by the GtkAdjustment widget). The @var{function_offset} is the byte offset from the start of the class structure to the class function field within the class structure. The easiest means to compute this offset is by using the @code{GTK_SIGNAL_OFFSET} macro which takes the class structure type as the first argument and the field as the second argument. For example, @code{GTK_SIGNAL_OFFSET (GtkObjectClass, destroy)} will give the offset of the @code{destroy} class function within the @code{GtkObjectClass}. Note: An offset is specified instead of an absolute location since there will be multiple instances of a class structure being referenced. (The @code{GtkWidgetClass} structure ``is a'' @code{GtkObjectClass} structure, etc.) The @var{marshaller} function is used to invoke a signal handler. Since signal handlers may take different parameters and return values and a general mechanism for invoking them is not apparent, the approach of making the signal creator responsible for invoking the signal handler was taken. (FIXME: unfinished). The @var{return_val} and @var{nparams} and the remaining arguments specify the return value and the arguments to the signal handler respectively. Note: There is an implicit first argument to every signal handler which is the widget the signal has been emitted from. The variable argument list (@var{@dots{}}) specifies the types of the arguments. These can be one of @code{GTK_PARAM_CHAR}, @code{GTK_PARAM_SHORT}, @code{GTK_PARAM_INT}, @code{GTK_PARAM_LONG}, @code{GTK_PARAM_POINTER} or @code{GTK_PARAM_FUNCTION}. It is undefined to specify @code{GTK_PARAM_NONE} as an argument type, however it is OK to use @code{GTK_PARAM_NONE} for @var{return_val}. (This corresponds to returning a @code{void}). @code{gtk_signal_new} returns the integer identifier of the newly created signal. Signal identifiers start numbering at 1 and increase upwards. A value of -1 will be returned if an error occurs. @strong{Note:} @code{gtk_signal_new} is only needed by widget writers. A normal user of GTK will never needed to invoke this function. @end deftypefun @deftypefun gint gtk_signal_lookup (gchar *@var{name}, gint @var{object_type}) Returns the integer identifier for the signal referenced by @var{name} and @var{object_type}. If @var{object_type} does not define the signal @var{name}, then the signal is looked for in @var{object_type}'s parent type recursively. @end deftypefun @deftypefun gchar* gtk_signal_name (gint @var{signal_num}) @end deftypefun @deftypefun gint gtk_signal_emit (GtkObject *@var{object}, gint @var{signal_type}, @dots{}) Emit the signal specified by the integer identifier @var{signal_type} from @var{object}. If an error occurs, @code{gtk_signal_emit} will return @code{FALSE} and will return @code{TRUE} on success. The signal definition determines the parameters passed in the variable argument list (@code{@dots{}}). For example, if the signal is defined as: @example gint (* event) (GtkWidget *widget, GdkEvent *event); @end example Then a call to emit the ``event'' signal would look like: @example GdkEvent event; gint return_val; @dots{} gtk_signal_emit (some_object, gtk_signal_lookup ("event", GTK_OBJECT_TYPE (some_object)), &event, &return_val); @end example Notice that the @code{widget} argument is implicit in that the first argument to every signal is a type derived from @code{GtkObject}. The @var{return_val} argument is actually a pointer to the return value type since the signal mechanism needs to be able to place the return value in an actual location. And lastly, the @code{gtk_signal_lookup} call is normally avoided by using the @code{gtk_signal_emit_by_name} function instead. @code{gtk_signal_emit} is normally used internally by widgets which know the signal identifier (since they defined the signal) and can therefore side-step the cost of calling @code{gtk_signal_lookup}. @end deftypefun @deftypefun gint gtk_signal_emit_by_name (GtkObject *@var{object}, gchar *@var{name}, @dots{}) Similar to @code{gtk_signal_emit} except that the signal is referenced by @var{name} instead of by its integer identifier. @end deftypefun @deftypefun void gtk_signal_emit_stop (GtkObject *@var{object}, gint @var{signal_type}) Stop the emission of the signal @var{signal_type} on @var{object}. @var{signal_type} is the integer identifier for the signal and can be determined using the function @code{gtk_signal_lookup}. Alternatively, the function @code{gtk_signal_emit_stop_by_name} can be used to refer to the signal by name. Attempting to stop the emission of a signal that isn't being emitted does nothing. @end deftypefun @deftypefun void gtk_signal_emit_stop_by_name (GtkObject *@var{object}, gchar *@var{name}) Similar to @code{gtk_signal_emit_stop} except that the signal is referenced by @var{name} instead of by its integer identifier. @end deftypefun @deftypefun gint gtk_signal_connect (GtkObject *@var{object}, gchar *@var{name}, GtkSignalFunc @var{func}, gpointer @var{func_data}) Connects a signal handling function to a signal emitting object. @var{func} is connected to the signal @var{name} emitted by @var{object}. The arguments and returns type of @var{func} should match the arguments and return type of the signal @var{name}. However, @var{func} may take the extra argument of @var{func_data}. Due to the C calling convention it is OK to ignore the extra argument. (It is OK to ignore all the arguments in fact). @code{gtk_signal_connect} returns an integer identifier for the connection which can be used to refer to it in the future. Specifically it is useful for removing the connection and/or blocking it from being used. @end deftypefun @deftypefun gint gtk_signal_connect_after (GtkObject *@var{object}, gchar *@var{name}, GtkSignalFunc @var{func}, gpointer @var{func_data}) Similar to @code{gtk_signal_connect} except the signal handler is connected in the ``after'' slot. This allows a signal handler to be guaranteed to run after other signal handlers connected to the same signal on the same object and after the class function associated with the signal. Like @code{gtk_signal_connect}, @code{gtk_signal_connect_after} returns an integer identifier which can be used to refer to the connection. @end deftypefun @deftypefun gint gtk_signal_connect_object (GtkObject *@var{object}, gchar *@var{name}, GtkSignalFunc @var{func}, GtkObject *@var{slot_object}) Connects @var{func} to the signal @var{name} emitted by @var{object}. Similar to @code{gtk_signal_connect} with the difference that @var{slot_object} is passed as the first parameter to @var{func} instead of the signal emitting object. This can be useful for connecting a signal emitted by one object to a signal in another object. A common usage is to connect the ``destroy'' signal of dialog to the ``clicked'' signal emitted by a ``close'' button in the dialog. That is, the ``clicked'' signal emitted by the button will caused the ``destroy'' signal to be emitted for the dialog. This is also the ``right'' way to handle closing of a dialog since the ``destroy'' signal will be sent if the dialog is deleted using a window manager function and this enables the two methods of closing the window to be handled by the same mechanism. Returns an integer identifier which can be used to refer to the connection. @end deftypefun @deftypefun gint gtk_signal_connect_object_after (GtkObject *@var{object}, gchar *@var{name}, GtkSignalFunc @var{func}, GtkObject *@var{slot_object}) Similar to @code{gtk_signal_connect_object} except the signal handler is connected in the ``after'' slot. This allows a signal handler to be guaranteed to run after other signal handlers connected to the same signal on the same object and after the class function associated with the signal. Returns an integer identifier which can be used to refer to the connection. @end deftypefun @deftypefun gint gtk_signal_connect_interp (GtkObject *@var{object}, gchar *@var{name}, GtkCallbackMarshal @var{func}, gpointer @var{data}, GtkDestroyNotify @var{destroy_func}, gint @var{after}) @end deftypefun @deftypefun void gtk_signal_disconnect (GtkObject *@var{object}, gint @var{id}) Disconnects a signal handler from an object. The signal handler is identified by the integer @var{id} which is returned by the @code{gtk_signal_connect*} family of functions. @end deftypefun @deftypefun void gtk_signal_disconnect_by_data (GtkObject *@var{object}, gpointer @var{data}) Disconnects a signal handler from an object. The signal handler is identified by the @var{data} argument specified as the @var{func_data} argument to the @code{gtk_signal_connect*} family of functions. For the @code{gtk_signal_connect_object*} functions, @var{data} refers to the @var{slot_object}. @strong{Note:} This will remove all signal handlers connected to @var{object} which were connected using @var{data} as their @var{func_data} argument. Multiple signal handlers may be disconnected with this call. @end deftypefun @deftypefun void gtk_signal_handler_block (GtkObject *@var{object}, gint @var{id}) Blocks calling of a signal handler during signal emission. The signal handler is identified by the integer @var{id} which is returned by the @code{gtk_signal_connect*} family of functions. If the signal is already blocked no change is made. @end deftypefun @deftypefun void gtk_signal_handler_block_by_data (GtkObject *@var{object}, gint @var{data}) Blocks calling of a signal handler during signal emission. The signal handler is identified by the @var{data} argument specified as the @var{func_data} argument to the @code{gtk_signal_connect*} family of functions. For the @code{gtk_signal_connect_object*} functions, @var{data} refers to the @var{slot_object}. If the signal is already blocked no change is made. @strong{Note:} This will block all signal handlers connected to @var{object} which were connected using @var{data} as their @var{func_data} argument. Multiple signal handlers may be blocked with this call. @end deftypefun @deftypefun void gtk_signal_handler_unblock (GtkObject *@var{object}, gint @var{id}) Unblocks calling of a signal handler during signal emission. The signal handler is identified by the integer @var{id} which is returned by the @code{gtk_signal_connect*} family of functions. If the signal is already unblocked no change is made. @end deftypefun @deftypefun void gtk_signal_handler_unblock_by_data (GtkObject *@var{object}, gint @var{data}) Unblocks calling of a signal handler during signal emission. The signal handler is identified by the @var{data} argument specified as the @var{func_data} argument to the @code{gtk_signal_connect*} family of functions. For the @code{gtk_signal_connect_object*} functions, @var{data} refers to the @var{slot_object}. If the signal is already unblocked no change is made. @strong{Note:} This will unblock all signal handlers connected to @var{object} which were connected using @var{data} as their @var{func_data} argument. Multiple signal handlers may be unblocked with this call. @end deftypefun @deftypefun void gtk_signal_handlers_destroy (GtkObject *@var{object}) Destroy all of the signal handlers connected to @var{object}. There should normally never be reason to call this function as it is called automatically when @var{object} is destroyed. @end deftypefun @deftypefun void gtk_signal_default_marshaller (GtkObject *@var{object}, GtkSignalFunc @var{func}, gpointer @var{func_data}, GtkSignalParam *@var{params}) @code{gtk_signal_new} requires a callback in order to actually call a signal handler for a particular signal. The vast majority of signals are of the particular form: @example (* std_signal) (gpointer std_arg); @end example @code{gtk_signal_default_marshaller} is a signal marshaller which marshals arguments for a signal of that form. @end deftypefun @deftypefun void gtk_signal_set_funcs (GtkSignalMarshal @var{marshal_func}, GtkSignalDestroy @var{destroy_fun}) @end deftypefun @node Widgets, Other Objects, Signals, Top @comment node-name, next, previous, up @chapter Widget Overview @cindex Widgets Widgets are the general term used to describe user interface objects. A widget defines a class interface that all user interface objects conform to. This interface allows a uniform method for dealing with operations common to all objects such as hiding and showing, size requisition and allocation and events. The common interface that widgets must adhere to is described by the GtkWidget and GtkWidgetClass structure. For the purposes of using GTK these structures can be considered read-only and, for the most part, opaque. All widget creation routines in GTK return pointers to GtkWidget structures. In reality, all widget creation routines create structures that can be viewed as equivalent to the GtkWidget structure, but often have contain additional information. @xref{Object Implementation}. The widgets available for use are implemented in a hierarchy. Several widgets exist solely as common bases for more specific widgets. For example, it is not possible to create a ruler widget itself, but the ruler widget provides a base and functionality common to the horizontal and vertical rulers. The available widgets (in alphabetical order): @menu * GtkAlignment:: The alignment widget. * GtkArrow:: The arrow widget. * GtkAspectFrame:: The aspect frame widget. * GtkBin:: The bin widget. * GtkBox:: The box widget. * GtkButtonBox:: The button box widget. * GtkButton:: The button widget. * GtkCheckButton:: The check button widget. * GtkCheckMenuItem:: The check menu item widget. * GtkCList:: The compound list widget. * GtkColorSelection:: The color selector widget. * GtkCombo:: The combo box widget. * GtkContainer:: The container widget. * GtkCTree:: The multi-column tree widget. * GtkCurve:: The curve widget. * GtkGammaCurve:: The gamma curve widget. * GtkDialog:: The dialog widget. * GtkDrawingArea:: The drawing area widget. * GtkEntry:: The entry widget. * GtkEventBox:: The event box widget. * GtkFileSelection:: The file selection dialog widget. * GtkFixed:: The fixed widget. * GtkFrame:: The frame widget. * GtkGamma:: The gamma widget. * GtkHBox:: The horizontal box widget. * GtkHButtonBox:: The horizontal button box widget. * GtkHPaned:: The horizontal paned widget. * GtkHRuler:: The horizontal ruler widget. * GtkHScale:: The horizontal scale widget. * GtkHScrollbar:: The horizontal scrollbar widget. * GtkHSeparator:: The horizontal separator widget. * GtkImage:: The image widget. * GtkInputDialog:: The input dialog widget. * GtkItem:: The item widget. * GtkLabel:: The label widget. * GtkList:: The list widget. * GtkListItem:: The list item widget. * GtkMenu:: The menu widget. * GtkMenuBar:: The menu bar widget. * GtkMenuItem:: The menu item widget. * GtkMenuShell:: The menu shell widget. * GtkMisc:: The misc widget. * GtkNotebook:: The notebook widget. * GtkOptionMenu:: The option menu widget. * GtkPaned:: The paned widget. * GtkPixmap:: The pixmap widget. * GtkPreview:: The preview widget. * GtkProgressBar:: The progress bar widget. * GtkRadioButton:: The radio button widget. * GtkRadioMenuItem:: The radio menu item widget. * GtkRange:: The range widget. * GtkRuler:: The ruler widget. * GtkScale:: The scale widget. * GtkScrollbar:: The scrollbar widget. * GtkScrolledWindow:: The scrolled window widget. * GtkSeparator:: The separator widget. * GtkStatusbar:: The statusbar widget. * GtkTable:: The table widget. * GtkText:: The text widget. * GtkToggleButton:: The toggle button widget. * GtkToolbar:: The tool bar widget. * GtkTooltips:: The tool tips widget. * GtkTree:: The tree widget. * GtkTreeItem:: The tree item widget. * GtkVBox:: The vertical box widget. * GtkVButtonBox:: The vertical button box widget. * GtkViewport:: The viewport widget. * GtkVPaned:: The vertical paned widget. * GtkVRuler:: The vertical ruler widget. * GtkVScale:: The vertical scale widget. * GtkVScrollbar:: The vertical scrollbar widget. * GtkVSeparator:: The vertical separator widget. * GtkWidget:: The base widget type. * GtkWindow:: The window widget. @end menu @node GtkAlignment, GtkArrow, Widgets, Widgets @comment node-name, next, previous, up @section The alignment widget @subsection Description The alignment widget is a container (@pxref{GtkContainer}) derived from the bin widget (@pxref{GtkBin}). Its entire purpose is to give the programmer flexibility in how the child it manages is positioned when a window is resized. Normally, a widget is allocated at least as much size as it requests. (@pxref{GtkContainer} for a discussion of geometry management). When a widget is allocated more size than it requests there is a question of how the widget should expand. By convention, most GTK widgets expand to fill their allocated space. Sometimes this behavior is not desired. The alignment widget allows the programmer to specify how a widget should expand and position itself to fill the area it is allocated. @subsection Options @defopt xscale @defoptx yscale The @var{xscale} and @var{yscale} options specify how to scale the child widget. If the scale value is 0.0, the child widget is allocated exactly the size it requested in that dimension. If the scale value is 1.0, the child widget is allocated all of the space in a dimension. A scale value of 1.0 for both x and y is equivalent to not using an alignment widget. @end defopt @defopt xalign @defoptx yalign The @var{xalign} and @var{yalign} options specify how to position the child widget when it is not allocated all the space available to it (because the @var{xscale} and/or @var{yscale} options are less than 1.0). If an alignment value is 0.0 the widget is positioned to the left (or top) of its allocated space. An alignment value of 1.0 positions the widget to the right (or bottom) of its allocated space. A common usage is to specify @var{xalign} and @var{yalign} to be 0.5 which causes the widget to be centered within its allocated area. @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_alignment_get_type (void) Returns the @code{GtkAlignment} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_alignment_new (gfloat @var{xalign}, gfloat @var{yalign}, gfloat @var{xscale}, gfloat @var{yscale}) Create a new @code{GtkAlignment} object and initialize it with the values @var{xalign}, @var{yalign}, @var{xscale} and @var{yscale}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_alignment_set (GtkAlignment *@var{alignment}, gfloat @var{xalign}, gfloat @var{yalign}, gfloat @var{xscale}, gfloat @var{yscale}) Set the @var{xalign}, @var{yalign}, @var{xscale} and @var{yscale} options of an alignment widget. It is important to not set the fields of the @code{GtkAlignment} structure directly (or, for that matter, any type derived from @code{GtkObject}). @end deftypefun @gtkstdmacros{Alignment, ALIGNMENT} @page @node GtkArrow, GtkAspectFrame, GtkAlignment, Widgets @comment node-name, next, previous, up @section The arrow widget @subsection Description The arrow widget is derived from the misc widget (@pxref{GtkMisc}) and is intended for use where a directional arrow (in one of the four cardinal directions) is desired. As such, it has very limited functionality and basically only draws itself in a particular direction and with a particular shadow type. The arrow widget will expand to fill all the space it is allocated. @subsection Options @defopt arrow_type The @var{arrow_type} option specifies which direction the arrow will point. It can be one of @code{GTK_ARROW_UP}, @code{GTK_ARROW_DOWN}, @code{GTK_ARROW_LEFT} or @code{GTK_ARROW_RIGHT}. This will set the arrow pointing in the direction specified. @end defopt @defopt shadow_type The @var{shadow_type} option specifies how to draw the shadow for the arrow. Currently, only the @code{GTK_SHADOW_IN} and @code{GTK_SHADOW_OUT} shadow types are supported for drawing arrows. Other shadow types will cause nothing to be drawn. @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_arrow_get_type (void) Returns the @code{GtkArrow} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_arrow_new (GtkArrowType @var{arrow_type}, GtkShadowType @var{shadow_type}) Create a new @code{GtkArrow} object and initialize it with the values @var{arrow_type} and @var{shadow_type}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_arrow_set (GtkArrow *@var{arrow}, GtkArrowType @var{arrow_type}, GtkShadowType @var{shadow_type}) Set the @var{arrow_type} and @var{shadow_type} options of an arrow widget. It is important to not set the fields of the @code{GtkArrow} structure directly (or, for that matter, any type derived from @code{GtkObject}). @end deftypefun @gtkstdmacros{Arrow, ARROW} @page @node GtkAspectFrame, GtkBin, GtkArrow, Widgets @comment node-name, next, previous, upa @section The aspect frame widget @subsection Description Ensure that the child window has a specified aspect ratio or, if obey_child, has the same aspect ratio as its requested size. Derived from @pxref{GtkFrame}). @subsection Options @defopt label @end defopt @defopt xalign @end defopt @defopt yalign @end defopt @defopt ratio @end defopt @defopt obey_child @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_aspect_frame_get_type (void) Returns the @code{GtkAspectFrame} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_aspect_frame_new (gchar *@var{label}, gfloat @var{xalign}, gfloat @var{yalign}, gfloat @var{ratio}, gint @var{obey_child}) Create a new @code{GtkAspectFrame} object and initialize it with the values @var{label}, @var{xalign}, @var{yalign}, @var{ratio} and @var{obey_child}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_aspect_frame_set (GtkAspectFrame *@var{aspect_frame}, gfloat @var{xalign}, gfloat @var{yalign}, gfloat @var{ratio}, gint @var{obey_child}) @end deftypefun @gtkstdmacros{AspectFrame, ASPECT_FRAME} @page @node GtkBin, GtkBox, GtkAspectFrame, Widgets @comment node-name, next, previous, up @section The bin widget @subsection Description The bin widget is a container (@pxref{GtkContainer}) derived from the container widget. It is an abstract base class. That is, it is not possible to create an actual bin widget. It exists only to provide a base of functionality for other widgets. Specifically, the bin widget provides a base for several other widgets that contain only a single child. These widgets include alignments (@pxref{GtkAlignment}), frames (@pxref{GtkFrame}), items (@pxref{GtkItem}), viewports (@pxref{GtkViewport}) and windows (@pxref{GtkWindow}) @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_bin_get_type (void) Returns the @code{GtkBin} type identifier. @end deftypefun @gtkstdmacros{Bin, BIN} @page @node GtkBox, GtkButtonBox, GtkBin, Widgets @comment node-name, next, previous, up @section The box widget @subsection Description The box widget is a container (@pxref{GtkContainer}) derived from the container widget. It is an abstract base class used by the horizontal box (@pxref{GtkHBox}), the vertical box (@pxref{GtkVBox}) and the (@pxref{GtkButtonBox}) widgets to provide a base of common functionality. A box provides an abstraction for organizing the position and size of widgets. Widgets in a box are laid out horizontally or vertically. By using a box widget appropriately, a programmer can control how widgets are positioned and how they will be allocated space when a window gets resized. The key attribute of boxes is that they position their children in a single row (horizontal boxes) or column (vertical boxes). In the case of horizontal boxes, all children are stretched vertically. The vertical size of the box is determined by the largest vertical requisition of all of its children. Similarly, a vertical box stretches all of its children horizontally. The horizontal size (of the vertical box) is determined by the largest horizontal requisition of all of its children. An alignment widget (@pxref{GtkAlignment}) can be used to control child allocation more precisely on a per child basis. The second attribute of boxes is how they expand children. In the case of a horizontal box, the main control is over how children are expanded horizontally to fill the allocated area. (The rest of this discussion will focus on horizontal boxes but it applies to vertical boxes as well). There are two flags which can be set controlling how a widget is expanded horizontally in a horizontal box. These are the @code{expand} and @code{fill}. There operation is fairly simple. If @code{expand} is set, the child's potentially allocated area will expand to fill available space. If @code{fill} is set, the child's actual allocated area will be its potentially allocated area. There is a difference between the potentially area (which is the area the box widget sets aside for the child) and the actual allocated area (which is the area the box widget actual allocates for the widget via @code{gtk_widget_size_allocate}). The allocation of space to children occurs as follows (for horizontal boxes): @enumerate @item All children are allocated at least their requested size horizontally and the maximum requested child size vertically. @item Any child with the @code{expand} flag set is allocated @code{extra_width / nexpand_children} extra pixels horizontally. If the @code{homogeneous} flag was set, all children are considered to have the @code{expand} flag set. That is, all children will be allocated the same area.The horizontal box is a fair widget and, as such, divides up any extra allocated space evenly among the ``expand'' children. (Those children which have the @code{expand} flag set). The exception occurs when @code{extra_width / nexpand_children} does not divide cleanly. The extra space is given to the last widget. @item @code{spacing} number of pixels separate each child. Note: The separation is between the potentially allocated area for each child and not the actual allocated area. The @code{padding} value associated with each child causes that many pixels to be left empty to each side of the child. @item If a child has the @code{fill} flag set it is allocated its potentially allocated area. If it does not, it is allocated its requested size horizontally and centered within its potentially allocated area. Its vertical allocation is still the maximum requested size of any child. @item Children placed at the start of the box are placed in order of addition to the box from left to right in the boxes allocated area.. Children placed at the end of the box are placed in order of addition from right to left in the boxes allocated area. @end enumerate @xref{GtkHBox}, and @ref{GtkVBox}, for code examples of using horizontal and vertical boxes. @subsection Options @defopt expand @end defopt @defopt fill @end defopt @defopt padding @end defopt @defopt expand @end defopt @c FIXME: options for GtkBox @subsection Signals @subsection Functions @deftypefun guint gtk_box_get_type (void) Returns the @code{GtkBox} type identifier. @end deftypefun @deftypefun void gtk_box_pack_start (GtkBox *@var{box}, GtkWidget *@var{child}, gint @var{expand}, gint @var{fill}, gint @var{padding}) Add @var{child} to the front of @var{box}. The flags @var{expand} and @var{fill} and the padding value of @var{padding} are associated with @var{child}. @end deftypefun @deftypefun void gtk_box_pack_end (GtkBox *@var{box}, GtkWidget *@var{child}, gint @var{expand}, gint @var{fill}, gint @var{padding}) Add @var{child} to the end of @var{box}. The flags @var{expand} and @var{fill} and the padding value of @var{padding} are associated with @var{child}. @end deftypefun @deftypefun void gtk_box_pack_start_defaults (GtkBox *@var{box}, GtkWidget *@var{widget}) A convenience function which is equivalent to the following: @example gtk_box_pack_start (@var{box}, @var{widget}, TRUE, TRUE, 0); @end example @end deftypefun @deftypefun void gtk_box_pack_end_defaults (GtkBox *@var{box}, GtkWidget *@var{widget}) A convenience function which is equivalent to the following: @example gtk_box_pack_start (@var{box}, @var{widget}, TRUE, TRUE, 0); @end example @end deftypefun @deftypefun void gtk_box_set_homogeneous (GtkBox *@var{box}, gint @var{homogeneous}) Set the homogeneous setting of this box to @var{homogeneous}. @end deftypefun @deftypefun void gtk_box_set_spacing (GtkBox *@var{box}, gint @var{spacing}) @end deftypefun @deftypefun void gtk_box_reorder_child (GtkBox *@var{box}, GtkWidget *@var{child}, guint @var{pos}) @end deftypefun @deftypefun void gtk_box_query_child_packing (GtkBox *@var{box}, GtkWidget *@var{child}, gint *@var{expand}, gint *@var{fill}, gint *@var{padding}, GtkPackType *@var{pack_type}) @end deftypefun @deftypefun void gtk_box_set_child_packing (GtkBox *@var{box}, GtkWidget *@var{child}, gint @var{expand}, gint @var{fill}, gint @var{padding}, GtkPackType *@var{pack_type}) @end deftypefun @gtkstdmacros{Box, BOX} @page @node GtkButtonBox, GtkButton, GtkBox, Widgets @comment node-name, next, previous, up @section The button box widget @subsection Description The button box widget is a container (@pxref{GtkContainer}) derived from the (@pxref{GtkBox}) widget. It is an abstract base class used by the horizontal button box (@pxref{GtkHButtonBox}) and the vertical button box (@pxref{GtkVButtonBox}) widgets to provide a base of common functionality. The button box, like the box widget, (@pxref{GtkBox}) provides an abstraction for organizing position and size of widgets. In the case of the button box it is targeted at the button widget,(@pxref{GtkButton}). Button widgets are laid out in the box horizontally or vertically. By using a button box widget appropriately, a programmer can control how the button widgets are positioned and how they will be allocated space when a window gets resized. @subsection Options @defopt layout_style @itemize @bullet @itemize @bullet @item @code{GTK_BUTTONBOX_SPREAD} @end itemize @item The layout style @code{GTK_BUTTONBOX_SPREAD} will spread the buttons out evenly within the button box. When the parent window is resized they will re-adjust to the new window dimensions. The @code{gtk_button_box_set_spacing} function will set the minimum space that the buttons will leave between themselves. @itemize @bullet @item @code{GTK_BUTTONBOX_EDGE} @end itemize @item @itemize @bullet @item @code{GTK_BUTTONBOX_START} @end itemize @item The layout style @code{GTK_BUTTONBOX_START} will place the buttons at the start of the button box, taking into account the spacing as set by the @code{gtk_button_box_set_spacing} function. The buttons will not move when the parent window is re-sized. @itemize @bullet @item @code{GTK_BUTTONBOX_END} @end itemize @item The layout style @code{GTK_BUTTONBOX_END} will place the buttons at the end of the button box, taking into account the spacing as set by the @code{gtk_button_box_set_spacing} function. Again like the @code{GTK_BUTTONBOX_START} layout style the buttons will not move when the parent window is re-sized. @end itemize @end defopt @defopt width @end defopt @defopt height @end defopt @defopt ipad_x @defoptx ipad_y @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_button_box_get_type (void) Returns the @code{GtkButtonBox} type identifier. @end deftypefun @deftypefun void gtk_button_box_set_child_size_default (gint @var{width}, gint@var{height}) @end deftypefun @deftypefun void gtk_button_box_set_child_ipadding_default (gint @var{ipad_x}, gint @var{ipad_y}) @end deftypefun @deftypefun void gtk_button_box_get_child_size_default (gint *@var{width}, gint *@var{height}) @end deftypefun @deftypefun void gtk_button_box_get_child_ipadding_default (gint *@var{ipad_x}, gint *@var{ipad_y}) @end deftypefun @deftypefun void gtk_button_box_set_child_size (GtkButtonBox *@var{widget}, gint @var{width}, gint @var{height}) @end deftypefun @deftypefun void gtk_button_box_set_child_ipadding (GtkButtonBox *@var{widget}, gint @var{ipad_x}, gint @var{ipad_y}) @end deftypefun @deftypefun void gtk_button_box_set_layout (GtkButtonBox *@var{widget}, gint @var{layout_style}) This will set the layout style of the buttons within this box. Currently it can be set to one of @code{GTK_BUTTONBOX_SPREAD}, @code{GTK_BUTTONBOX_EDGE}, @code{GTK_BUTTONBOX_START} or @code{GTK_BUTTONBOX_END}. The following example: @example gtk_button_box_set_layout (GTK_BUTTON_BOX (box), GTK_BUTTONBOX_SPREAD); @end example Will set the @var{box} argument to the @dfn{SPREAD} layout style described above. @end deftypefun @deftypefun gint gtk_button_box_get_spacing (GtkButtonBox *@var{widget}) Get the per widget value for spacing within the button box. This value is the amount of space that will be between the individual buttons contained by this box. @end deftypefun @deftypefun void gtk_button_box_get_child_size (GtkButtonBox *@var{widget}, gint *@var{width}, gint *@var{height}) @end deftypefun @deftypefun void gtk_button_box_get_child_ipadding (GtkButtonBox *@var{widget}, gint *@var{ipad_x}, gint *@var{ipad_y}) Get the per widget value for the padding inside the buttons. This value controls how large the buttons will be within the box. @end deftypefun @deftypefun gint gtk_button_box_get_layout (GtkButtonBox *@var{widget}) Get the @var{layout_style} for the @code{GtkButtonBox} object passed to this function in the @var{widget} variable. @example layout = gtk_button_box_get_layout(GTK_BUTTON_BOX (box)); @end example @end deftypefun @gtkstdmacros{ButtonBox, BUTTON_BOX} @page @node GtkButton, GtkCheckButton, GtkButtonBox, Widgets @comment node-name, next, previous, up @section The button widget @subsection Description A pressable button. Contains a widget. Changes its appearance (hilites) when it gets the focus. Changes its appearance (pressed) when activated. Derived from @pxref{GtkContainer}. @subsection Signals @deftypefn Signal void GtkButton::pressed (GtkButton *@var{button}) @end deftypefn @deftypefn Signal void GtkButton::released (GtkButton *@var{button}) @end deftypefn @deftypefn Signal void GtkButton::clicked (GtkButton *@var{button}) @end deftypefn @deftypefn Signal void GtkButton::enter (GtkButton *@var{button}) @end deftypefn @deftypefn Signal void GtkButton::leave (GtkButton *@var{button}) @end deftypefn @subsection Functions @deftypefun guint gtk_button_get_type (void) Returns the @code{GtkButton} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_button_new (void) Create a new @code{GtkButton} object. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun GtkWidget* gtk_button_new_with_label (gchar *@var{label}) Create a new @code{GtkButton} object and set the text that is on the button to @var{label}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_button_pressed (GtkButton *@var{button}) @end deftypefun @deftypefun void gtk_button_released (GtkButton *@var{button}) @end deftypefun @deftypefun void gtk_button_clicked (GtkButton *@var{button}) @end deftypefun @deftypefun void gtk_button_enter (GtkButton *@var{button}) @end deftypefun @deftypefun void gtk_button_leave (GtkButton *@var{button}) @end deftypefun @gtkstdmacros{Button, BUTTON} @page @node GtkCheckButton, GtkCheckMenuItem, GtkButton, Widgets @comment node-name, next, previous, up @section The check button widget @subsection Description Another form of toggle button (@pxref{GtkToggleButton}) with an indicator. Contains a widget to the right of the indicator. Changes its appearance (hilites) when it gets the focus. @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_check_button_get_type (void) Returns the @code{GtkCheckButton} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_check_button_new (void) Create a new @code{GtkCheckButton} object and initialize it with the default values in the library. The new widget is returned as a pointer to a @code{GtkWidget} object. A @code{NULL} is returned on failure. @end deftypefun @deftypefun GtkWidget* gtk_check_button_new_with_label (gchar *@var{label}) Create a new @code{GtkCheckButton} object and initialize it with the values @var{label}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on any failure. @end deftypefun @deftypefun GtkCheckButton* GTK_CHECK_BUTTON (gpointer @var{obj}) @end deftypefun @deftypefun GtkCheckButtonClass* GTK_CHECK_BUTTON_CLASS (gpointer @var{class}) @end deftypefun @deftypefun gint GTK_IS_CHECK_BUTTON (gpointer @var{obj}) @end deftypefun @gtkstdmacros{CheckButton, CHECK_BUTTON} @page @node GtkCheckMenuItem, GtkCList, GtkCheckButton, Widgets @comment node-name, next, previous, up @section The check menu item widget @subsection Description Derived from @pxref{GtkMenuItem}. Very similar to a checkbutton (@pxref{GtkCheckButton}), except that it's a menu item. Has a toggled state which is displayed in a small rectangle to the left of the contained widget. @subsection Options @defopt label @end defopt @defopt state @end defopt @subsection Signals @deftypefn Signal void GtkCheckMenuItem::toggled (GtkCheckMenuItem *@var{check_menu_item}) @end deftypefn @subsection Functions @deftypefun guint gtk_check_menu_item_get_type (void) Returns the @code{GtkCheckMenuItem} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_check_menu_item_new (void) Create a new @code{GtkCheckMenuItem} object. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun GtkWidget* gtk_check_menu_item_new_with_label (gchar *@var{label}) Create a new @code{GtkCheckMenuItem} object and initialize it with the values @var{label}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_check_menu_item_set_state (GtkCheckMenuItem *@var{check_menu_item}, gint @var{state}) @end deftypefun @deftypefun void gtk_check_menu_item_toggled (GtkCheckMenuItem *@var{check_menu_item}) @end deftypefun @gtkstdmacros{CheckMenuItem, CHECK_MENU_ITEM} @page @node GtkCList, GtkColorSelection, GtkCheckMenuItem, Widgets @comment node-name, next, previous, up @section The compound list widget @subsection Description A list of rows of columns, with a title row. You can insert rows, and delete rows. The user can scroll around and select a row. Derived from @pxref{GtkContainer}. Cells can be empty, have a text and/or pixmap, or be a widget. @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_clist_get_type (void) Returns the @code{GtkCList} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_clist_new (int @var{columns}) Create a new @code{GtkCList} initializing it with the value @var{columns}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun GtkWidget* gtk_clist_new_with_titles (int @var{columns}, gchar *@var{titles[]}) @end deftypefun @deftypefun void gtk_clist_set_border (GtkCList *@var{clist}, GtkShadowType @var{border}) Set the border style of the @var{clist} to the shadow type @var{border}. @end deftypefun @deftypefun void gtk_clist_set_selection_mode (GtkCList *@var{clist} GtkSelectionMode @var{mode}) Set the selection mode on the @var{clist} to the @var{mode} selection mode. @end deftypefun @deftypefun void gtk_clist_set_policy (GtkCList *@var{clist}, GtkPolicyType @var{vscrollbar_policy}, GtkPolicyType @var{hscrollbar_policy}) Set the policy on the scrollbars on the @var{clist} to @var{vscrollbar_policy} and @var{hscrollbar_policy}. @end deftypefun @deftypefun void gtk_clist_freeze (GtkCList *@var{clist}) Stop all visual updates of the @var{clist}. Useful for when making a large number of changes to a @code{GtkCList}. @end deftypefun @deftypefun void gtk_clist_thaw (GtkCList *@var{clist}) Allow all visual updates of the @var{clist} to resume. @end deftypefun @deftypefun void gtk_clist_column_titles_show (GtkCList *@var{clist}) Show the column title buttons on the @var{clist}. @end deftypefun @deftypefun void gtk_clist_column_titles_hide (GtkCList *@var{clist}) Hide the column title buttons on the @var{clist}. @end deftypefun @deftypefun void gtk_clist_set_column_title (GtkCList *@var{clist}, gint @var{column}, gchar *@var{title}) Set the title in column @var{column} of the @var{clist} button to @var{title}. @end deftypefun @deftypefun void gtk_clist_set_column_widget (GtkCList *@var{clist}, gint @var{column}, GtkWidget *@var{widget}) Set the @var{widget} instead of the title button for the column @var{column} in the @var{clist}. @end deftypefun @deftypefun void gtk_clist_set_column_justification (GtkCList *@var{clist}, gint @var{column}, GtkJustification @var{justification}) Set the @var{column}'s justification, in the @var{clist} to @var{justification}. @end deftypefun @deftypefun void gtk_clist_set_column_width (GtkCList *@var{clist}, gint @var{column}, gint @var{width}) Set the pixel width of column @var{column} in the @code{GtkCList} @var{clist} to @var{width}. This function is a necessary step in creating a @code{GtkCList} because otherwise the column width is chosen from the width of the column title, which is almost never correct. @end deftypefun @deftypefun void gtk_clist_set_row_height (GtkCList *@var{clist}, gint @var{height}) Change the height of the rows in the @var{clist} to @var{height}. The default is the height of the current font. @end deftypefun @deftypefun void gtk_clist_moveto (GtkCList *@var{clist}, gint @var{row}, gint@var{column}, gfloat @var{row_align}, gfloat @var{col_align}) Scroll the viewing area of the @code{GtkClist} in @var{clist} to @var{column} and @var{row}. The @var{row_align} and @var{col_align} are between zero and one, representing the location the row should appear on screen. Setting @var{row_align} or the @var{col_align} to 0.0 will be the top or left of the viewing area. Setting the @var{row_align} or @var{col_align} to 1.0 will be the bottom or right of the viewing area. If the @var{row} or @var{column} is -1 then there is no change. @end deftypefun @deftypefun void gtk_clist_set_text (GtkCList *@var{clist}, gint @var{row}, gint @var{column}, gchar *@var{text}) Set a given cell's text, located by the @var{row} and @var{column}, to @var{text} replacing its current contents. @end deftypefun @deftypefun void gtk_clist_set_pixmap (GtkCList *@var{clist}, gint @var{row}, gint @var{column}, GdkPixmap *@var{pixmap}, GdkBitmap *@var{mask}) Set a given cell's text, located by the @var{column} and @var{row} arguments, to the pixmap described by the @var{pixmap} argument using the @var{mask} as its mask. The current contents of the cell will be replaced. @end deftypefun @deftypefun void gtk_clist_setpixtext (GtkCList *@var{clist}, gint @var{row}, gint @var{column}, gchar *@var{text}, guint8 @var{spacing}, GdkPixmap *@var{pixmap}, GdkBitmap *@var{mask}) Set a given cell's text and pixmap, located by the @var{row} and @var{column} arguments, to the text and pixmap described by the @var{pixmap} and @var{text} arguments. The @var{mask} will be used for the pixmap mask and the @var{spacing} argument specifies the spacing between the two. @end deftypefun @deftypefun void gtk_clist_set_foreground (GtkCList *@var{clist}, gint @var{row}, GdkColor *@var{color}) Set the foreground color of row @var{row} to @var{color} in the @code{GtkCList} @var{clist}. The @var{color} must already be allocated. @end deftypefun @deftypefun void gtk_clist_set_background (GtkCList *@var{clist}, gint @var{row}, GdkColor *@var{color}) Set the background color of row @var{row} to @var{color} in the @code{GtkCList} pointed to by @var{clist}. The color must be previously allocated. @end deftypefun @deftypefun void gtk_clist_set_shift (GtkCList *@var{clist}, gint @var{row}, gint @var{column}, gint @var{vertical}, gint @var{horizontal}) Set the horizontal and vertical shift for drawing the contents of the cell located at @var{row} and @var{column}. The @var{vertical} and @var{horizontal} arguments can be positive or negative. @end deftypefun @deftypefun gint gtk_clist_append (GtkCList *@var{clist}, gchar *@var{text[]}) Append the given text, in the @var{text[]} argument, to the @code{GtkCList} pointed to by the @var{clist}. The return value is the index of the row that was just added. @end deftypefun @deftypefun void gtk_clist_insert (GtkCList *@var{clist}, gint @var{row}, gchar *@var{text[]}) Insert a row into the @code{GtkCList} pointed to by @var{clist} at row @var{row} with the text in @var{text[]}. @end deftypefun @deftypefun void gtk_clist_remove (GtkCList *@var{clist}, gint @var{row}) Remove row index @var{row} from the @var{clist}. @end deftypefun @deftypefun void gtk_clist_set_row_data (GtkCList *@var{clist}, gint @var{row}, gpointer @var{data}) Will set an arbitrary data pointer, @var{data}, for row @var{row} in the @code{GtkCList} pointed to by @var{clist}. @end deftypefun @deftypefun gpointer gtk_clist_get_row_data (GtkCList *@var{clist}, gint @var{row}) Return the data that was set for row @var{row} from the @code{GtkCList} pointed to by @var{clist}. @code{NULL} is returned if no data was set. @end deftypefun @deftypefun void gtk_clist_select_row (GtkCList *@var{clist}, gint @var{row}, gint @var{column}) Force selection of a row, located by @var{row} and @var{column}, in the @code{GtkCList} pointed to by @var{clist}. @end deftypefun @deftypefun void gtk_clist_unselect_row (GtkCList *@var{clist}, gint @var{row}, gint @var{column}) Force the unselection of a row, located by @var{row} and @var{column}, in the @code{GtkCList} pointed to by @var{clist}. @end deftypefun @deftypefun void gtk_clist_clear (GtkCList *@var{clist}) Clear the entire contents of the @code{GtkCList} pointed to by @var{clist}. This is much faster then removing each item separately with @code{gtk_clist_remove}. @end deftypefun @gtkstdmacros{CList, CLIST} @page @node GtkColorSelection, GtkCombo, GtkCList, Widgets @comment node-name, next, previous, up @section The color selector widget @subsection Description A widget that allows a user to pick a color in one of many ways. They can click on a color wheel or saturation bar. They can change hue, saturation, value, red, green, or blue with a slider, or by entering values. Also allows the user to set an alpha (opacity) value. Derived from @pxref{GtkVBox}. @subsection Options @defopt policy @itemize @bullet @item GTK_UPDATE_CONTINUOUS @item GTK_UPDATE_DISCONTINUOUS @item GTK_UPDATE_DELAYED @end itemize @end defopt @defopt color @end defopt @defopt use_opacity @end defopt @defopt title @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_color_selection_get_type (void) Returns the @code{GtkColorSelection} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_color_selection_new (void) Create a new @code{GtkColorSelection} object. The new object is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_color_selection_set_update_policy (GtkColorSelection *@var{colorsel}, GtkUpdateType @var{policy}) @end deftypefun @deftypefun void gtk_color_selection_set_color (GtkColorSelection *@var{colorsel}, gdouble *@var{color}) @end deftypefun @deftypefun void gtk_color_selection_get_color (GtkColorSelection *@var{colorsel}, gdouble *@var{color}) @end deftypefun @deftypefun void gtk_color_selection_set_opacity (GtkColorSelection *@var{colorsel}, gint @var{use_opacity}) @end deftypefun @deftypefun guint gtk_color_selection_dialog_get_type (void) Returns the @code{GtkColorSelection} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_color_selection_dialog_new (gchar *@var{title}) Create a new @code{GtkColorSelection} object initializing the title bar of the resulting dialog to @var{title}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @gtkstdmacros{ColorSelection, COLOR_SELECTION} @page @node GtkCombo, GtkContainer, GtkColorSelection, Widgets @comment node-name, next, previous, up @section The combo widget @subsection Description Text input box which also lets you choose from pre-defined values from a drop-down menu. Derived from @pxref{GtkHBox}. @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_combo_get_type (void) Returns the @code{GtkCombo} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_combo_new (void) Create a new @code{GtkCombo} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_combo_set_value_in_list (GtkCombo *@var{combo}, gint @var{val}, gint @var{ok_if_empty}) @end deftypefun @deftypefun void gtk_combo_set_use_arrows (GtkCombo *@var{combo}, gint @var{val}) @end deftypefun @deftypefun void gtk_combo_set_use_arrows_always (GtkCombo *@var{combo}, gint @var{val}) @end deftypefun @deftypefun void gtk_combo_set_case_sensitive (GtkCombo *@var{combo}, gint @var{val}) @end deftypefun @deftypefun void gtk_combo_set_item_string (GtkCombo *@var{combo}, GtkItem *@var{item}, gchar *@var{item_value}) @end deftypefun @deftypefun void gtk_combo_set_popdown_strings (GtkCombo *@var{combo}, GList *@var{strings}) @end deftypefun @gtkstdmacros{Combo, COMBO} @page @node GtkContainer, GtkCTree, GtkCombo, Widgets @comment node-name, next, previous, up @section The container widget @subsection Description A base class for objects that are built out of other widgets. Many widgets are containers. For example, a button contains a widget. That widget might be a text label (usually is), or a pixmap, or even an hbox which has a label and a pixmap. @subsection Options @defopt border_width @end defopt @subsection Signals @deftypefn Signal void GtkContainer::add (GtkContainer *@var{container}, GtkWidget *@var{widget}) @end deftypefn @deftypefn Signal void GtkContainer::remove (GtkContainer *@var{container}, GtkWidget *@var{widget}) @end deftypefn @deftypefn Signal void GtkContainer::need_resize (GtkContainer *@var{container}, GtkWidget *@var{widget}) @end deftypefn @deftypefn Signal void GtkContainer::foreach (GtkContainer *@var{container}, GtkCallback @var{callback}, gpointer @var{callback_data}) @end deftypefn @deftypefn Signal gint GtkContainer::focus (GtkContainer *@var{container}, GtkDirectionType @var{direction}) @end deftypefn @subsection Functions @deftypefun guint gtk_container_get_type (void) Returns the @code{GtkContainer} type identifier. @end deftypefun @deftypefun void gtk_container_border_width (GtkContainer *@var{container}, gint @var{border_width}) @end deftypefun @deftypefun void gtk_container_add (GtkContainer *@var{container}, GtkWidget *@var{widget}) Add @var{widget} to the @var{container}. @end deftypefun @deftypefun void gtk_container_remove (GtkContainer *@var{container}, GtkWidget *@var{widget}) Remove @var{widget} from @var{container}. @end deftypefun @deftypefun void gtk_container_disable_resize (GtkContainer *@var{container}) @end deftypefun @deftypefun void gtk_container_enable_resize (GtkContainer *@var{container}) @end deftypefun @deftypefun void gtk_container_block_resize (GtkContainer *@var{container}) @end deftypefun @deftypefun void gtk_container_unblock_resize (GtkContainer *@var{container}) @end deftypefun @deftypefun gint gtk_container_need_resize (GtkContainer *@var{container}, GtkWidget *@var{widget}) @end deftypefun @deftypefun void gtk_container_check_resize (GtkContainer *@var{container}, GtkWidget *@var{widget}) @end deftypefun @deftypefun void gtk_container_foreach (GtkContainer *@var{container}, GtkCallback @var{callback}, gpointer @var{callback_data}) @end deftypefun @deftypefun void gtk_container_focus (GtkContainer *@var{container}, GtkDirectionType @var{direction}) @end deftypefun @deftypefun GList* gtk_container_children (GtkContainer @var{container}) @end deftypefun @gtkstdmacros{Container, CONTAINER} @page @node GtkCTree, GtkCurve, GtkContainer, Widgets @comment node-name, next, previous, up @section The multi-column tree widget @subsection Description The GtkCTree widget is a multi-columned list with a designated column, the @code{tree column}, to display hierarchically-organized data. Each node is either a folder (a branch of the tree) or a leaf. Nodes can be (recursively) expanded, collapsed, (un)selected, removed, moved, sorted etc. GtkCTree is a descendant of @pxref{GtkCList}. Therefore, a cell in a column other than the tree column can only contain a string, a pixmap, both or nothing. A node in the tree column can contain a string and up to two pixmaps and masks, indicating the "folder openend" and "folder closed" status. Compared to GtkCList, there is no concept of row numbers. Therefore, a number of GtkCList methods had to be re-implemented taking @code{GList *node} arguments instead of @code{gint row}. @subsection Options @subsection Signals @deftypefn Signal void GtkCTree::tree_expand (GtkCTree *@var{ctree}, GList *@var{node}) @end deftypefn @deftypefn Signal void GtkCTree::tree_collapse (GtkCTree *@var{ctree}, GList *@var{node}) @end deftypefn @deftypefn Signal void GtkCTree::tree_move (GtkCTree *@var{ctree}, GList *@var{node}, GList *@var{new_parent}, GList *@var{new_sibling}) @end deftypefn @deftypefn Signal void GtkCTree::tree_select_row (GtkCTree *@var{ctree}, GList *@var{row}, gint @var{column}) @end deftypefn @deftypefn Signal void GtkCTree::tree_unselect_row (GtkCTree *@var{ctree}, GList *@var{row}, gint @var{column}) @end deftypefn @subsection Functions @deftypefun GtkType gtk_ctree_get_type (void) Returns the @code{GtkCTree} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_ctree_new (gint @var{columns}, gint @var{tree_column}) Creates a new GtkCTree widget with the given number of columns and the given tree column. On success, a pointer to the newly created widget is returned, and @code{NULL} otherwise. @end deftypefun @deftypefun GtkWidget* gtk_ctree_new_with_titles (gint @var{columns}, gint @var{tree_column}, gchar *@var{titles[]}) Creates a new GtkCTree widget with the given number of columns and the given tree column. The column titles are initialized to the strings of the array @var{titles}. On success, a pointer to the newly created widget is returned, and @code{NULL} otherwise. @end deftypefun @deftypefun GList* gtk_ctree_insert (GtkCTree *@var{ctree}, GList *@var{parent}, GList *@var{sibling}, gchar *@var{text[]}, guint8 @var{spacing}, GdkPixmap *@var{pixmap_closed}, GdkPixmap *@var{mask_closed}, GdkPixmap *@var{pixmap_opened}, GdkPixmap *@var{mask_opened}, gboolean @var{is_leaf}, gboolean @var{expanded}) Inserts a new node at the given position. If @var{parent} == NULL, the node is inserted at root level. If @var{sibling} == NULL, the node is appended to the existing list of siblings. Otherwise, the node is inserted before @var{sibling}. If not NULL, the two pixmaps/masks are used to indicate the opened/closed status of the node. @var{spacing} is the number of pixels between pixmap and text. If @var{is_leaf} == TRUE, the node cannot have any children. The initial expanded/collapsed status is given by @var{expanded}. On success, the pointer to the newly inserted node is returned, and NULL otherwise. @end deftypefun @deftypefun void gtk_ctree_remove (GtkCTree *@var{ctree}, GList *@var{node}) Removes the given node and all its children. @end deftypefun @deftypefun void gtk_ctree_clear (GtkCTree *@var{ctree}) Removes all nodes of @var{ctree}. @end deftypefun @deftypefun void gtk_ctree_post_recursive (GtkCTree *@var{ctree}, GList *@var{node}, GtkCTreeFunc @var{func}, gpointer @var{data}) Apply @var{func} to @var{node} and all its children, traversing @var{ctree} in post-order. @end deftypefun @deftypefun void gtk_ctree_pre_recursive (GtkCTree *@var{ctree}, GList *@var{node}, GtkCTreeFunc @var{func}, gpointer @var{data}) Apply @var{func} to @var{node} and all its children, traversing @var{ctree} in pre-order. @end deftypefun @deftypefun gboolean gtk_ctree_is_visible (GtkCTree *@var{ctree}, GList *@var{node}) Returns the visibility status of the given node. A node is said to be visible if in the chain of parent nodes every node is expanded. Or : the node is currently being displayed (but not necessarily inside the viewing area). @end deftypefun @c @deftypefun void gtk_ctree_scroll_to (GtkCTree *@var{ctree}, gint @var{row}, gint@var{column}, gfloat @var{row_align}, gfloat @var{col_align}) @c Scroll the viewing area of the @code{GtkCtree} in @var{ctree} to @var{column} @c and @var{row}. The @var{row_align} and @var{col_align} are between zero and @c one, representing the location the row should appear on screen. Setting @c @var{row_align} or the @var{col_align} to 0.0 will be the top or left of the @c viewing area. Setting the @var{row_align} or @var{col_align} to 1.0 will @c be the bottom or right of the viewing area. If the @var{row} or @var{column} @c is -1 then there is no change. @c @end deftypefun @gtkstdmacros{CTree, CTREE} @page @node GtkCurve, GtkGammaCurve, GtkCTree, Widgets @comment node-name, next, previous, up @section The curve widget @subsection Description Derived from @pxref{GtkDrawingArea}. @subsection Options @defopt type @itemize @bullet @item GTK_CURVE_TYPE_LINEAR @item GTK_CURVE_TYPE_SPLINE @item GTK_CURVE_TYPE_FREE @end itemize @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_curve_get_type (void) Returns the @code{GtkCurve} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_curve_new (void) Create a new @code{GtkCurve} returning the new widget as a pointer to a @code{GtkWidget} object. @end deftypefun @deftypefun void gtk_curve_reset (GtkCurve *@var{curve}) @end deftypefun @deftypefun void gtk_curve_set_gamma (GtkCurve *@var{curve}, gfloat @var{gamma}) @end deftypefun @deftypefun void gtk_curve_set_range (GtkCurve *@var{curve}, gfloat @var{min_x}, gfloat @var{max_x}, gfloat @var{min_y}, gfloat @var{max_y}) @end deftypefun @deftypefun void gtk_curve_get_vector (GtkCurve *@var{curve}, int @var{veclen}, gfloat @var{vector[]}) @end deftypefun @deftypefun void gtk_curve_set_vector (GtkCurve *@var{curve}, int @var{veclen}, gfloat @var{vector[]}) @end deftypefun @deftypefun void gtk_curve_set_curve_type (GtkCurve *@var{curve}, GtkCurveType @var{type}) @end deftypefun @gtkstdmacros{Curve, CURVE} @page @node GtkGammaCurve, GtkDialog, GtkCurve, Widgets @comment node-name, next, previous, up @section The gamma curve widget @subsection Description Lets the user edit a gamma curve (a one-to-one mapping usually used to adjust the intensity of an image to the physical characteristics of the output device). You can set the minimum and maximum values for input and output. You can set the initial vector as well. You are guaranteed that every input value will have a (not necessarily unique) output value specified. Derived from @pxref{GtkVBox}. Makes use of @pxref{GtkCurve} to draw the curve. @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_gamma_curve_get_type (void) Returns the @code{GtkGamma} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_gamma_curve_new (void) Create a new @code{GtkGamma} returning the new widget as a pointer to a @code{GtkWidget} object. @end deftypefun @gtkstdmacros{GammaCurve, GAMMACURVE} @page @node GtkDialog, GtkDrawingArea, GtkGammaCurve, Widgets @comment node-name, next, previous, up @section The dialog widget @subsection Description The dialog widget is a window (@pxref{GtkWindow}) that has a vertical box (@pxref{GtkVBox}), a horizontal box (@pxref{GtkHBox}), separated with a horizontal separator (@pxref{GtkHSeparator}). @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_dialog_get_type (void) Returns the @code{GtkDialog} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_dialog_new (void) Create a new @code{GtkDialog} object and return the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @gtkstdmacros{Dialog, DIALOG} @page @node GtkDrawingArea, GtkEntry, GtkDialog, Widgets @comment node-name, next, previous, up @section The drawing area widget @subsection Description A base class for widgets that need a box to draw into. So far, only used by GtkCurve. @subsection Options @defopt width @end defopt @defopt height @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_drawing_area_get_type (void) Returns the @code{GtkDrawingArea} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_drawing_area_new (void) Create a new @code{GtkDrawingArea} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_drawing_area_size (GtkDrawingArea *@var{darea}, gint @var{width}, gint @var{height}) Set the size of the @var{darea} widget, created previously, to @var{width} and @var{height}. @end deftypefun @gtkstdmacros{DrawingArea, DRAWING_AREA} @page @node GtkEntry, GtkEventBox, GtkDrawingArea, Widgets @comment node-name, next, previous, up @section The entry widget @subsection Description @comment Enter text into this widget. Derived from @pxref{GtkEditable}. Can be @comment set so it isn't editable. Enter text into this widget. Derived from GtkEditable. Can be set so it isn't editable. @subsection Options @defopt max With this option it is possible to set the @var{text_max_length} to the value specified in the @var{max} option. This value is a guint16 value. @end defopt @defopt text With this option it is possible to 'preload' the text that will be displayed in the @code{entry} widget to the string pointed to by @var{text}. @end defopt @subsection Signals @deftypefn Signal void GtkEntry::insert_text (GtkEntry *@var{entry}, gchar *@var{text}, gint @var{length}, gint *@var{position}) @end deftypefn @deftypefn Signal void GtkEntry::delete_text (GtkEntry *@var{entry}, gint @var{start_pos}, gint @var{end_pos}) @end deftypefn @deftypefn Signal void GtkEntry::changed (GtkEntry *@var{entry}) @end deftypefn @deftypefn Signal void GtkEntry::set_text (GtkEntry *@var{entry}) @end deftypefn @deftypefn Signal void GtkEntry::activate (GtkEntry *@var{entry}) @end deftypefn @subsection Functions @deftypefun guint gtk_entry_get_type (void) Returns the @code{GtkEntry} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_entry_new (void) Create a new @code{GtkEntry} object. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun GtkWidget* gtk_entry_new_with_max_length (guint16 @var{max}) Create a new @code{GtkEntry} object initializing it with the value @var{max}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_entry_set_text (GtkEntry *@var{entry}, gchar *@var{text}) Will set the text in the previously created @code{GtkEntry} object to @var{text}. It is important to not set the fields of the @code{GtkEntry} structure directly (or, for that matter, any type derived from @code{GtkObject}). @end deftypefun @deftypefun void gtk_entry_append_text (GtkEntry *@var{entry}, gchar *@var{text}) Append the text that is in the @var{text} argument to the widgets text. It is important to not set the fields of the @code{GtkEntry} structure directly. @end deftypefun @deftypefun void gtk_entry_prepend_text (GtkEntry *@var{entry}, gchar *@var{text}) Add the text in the @var{text} argument to the text in the @code{GtkEntry} widget. It is important to not set the fields of the @code{GtkEntry} structure directly. @end deftypefun @deftypefun void gtk_entry_set_position (GtkEntry *@var{entry}, gint @var{position}) @end deftypefun @deftypefun void gtk_entry_set_visibility (GtkEntry *@var{entry}, gint @var{visible}) Will make the keystrokes entered into the @code{GtkEntry} object invisible when @var{visible} is @code{TRUE}. Defaults to @code{FALSE}. @end deftypefun @deftypefun gchar* gtk_entry_get_text (GtkEntry *@var{entry}) Returns the text that is contained in the @code{GtkEntry} as a pointer to a @code{gchar} variable. @end deftypefun @gtkstdmacros{Entry, ENTRY} @page @node GtkEventBox, GtkFileSelection, GtkEntry, Widgets @comment node-name, next, previous, up @section The event box widget @subsection Description Derived from @pxref{GtkBin}. Used by @pxref{GtkTreeItem}. @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_event_box_get_type (void) Returns the @code{GtkEventBox} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_event_box_new (void) Create a new @code{GtkEventBox} returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @gtkstdmacros{GtkEventBox, EVENT_BOX} @page @node GtkFileSelection, GtkFixed, GtkEventBox, Widgets @comment node-name, next, previous, up @section The file selection dialog widget @subsection Description @subsection Options @defopt title @end defopt @defopt filename @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_file_selection_get_type (void) Returns the @code{GtkFileSelection} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_file_selection_new (gchar *@var{title}) Create a new @code{GtkFileSelection} object and return the new widget as a pointer to a @code{GtkWidget}. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_file_selection_set_filename (GtkFileSelection *@var{filesel}, gchar *@var{filename}) @end deftypefun @deftypefun gchar* gtk_file_selection_get_filename (GtkFileSelection *@var{filesel}) @end deftypefun @gtkstdmacros{FileSelection, FILE_SELECTION} @page @node GtkFixed, GtkFrame, GtkFileSelection, Widgets @comment node-name, next, previous, up @section The fixed widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_fixed_get_type (void) Returns the @code{GtkFixed} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_fixed_new (void) Create a new @code{GtkFixed} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_fixed_put_new (GtkFixed *@var{fixed}, GtkWidget *@var{widget}, gint16 @var{x}, gint16 @var{y}) @end deftypefun @deftypefun void gtk_fixed_move (GtkFixed *@var{fixed}, GtkWidget *@var{widget}, gint16 @var{x}, gint16 @var{y}) @end deftypefun @gtkstdmacros{Fixed, FIXED} @page @node GtkFrame, GtkGamma, GtkFixed, Widgets @comment node-name, next, previous, up @section The frame widget @subsection Options @defopt label @end defopt @defopt xalign @end defopt @defopt yalign @end defopt @defopt type @end defopt @subsection Description @subsection Signals @subsection Functions @deftypefun guint gtk_frame_get_type (void) Returns the @code{GtkFrame} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_frame_new (gchar *@var{label}) Create a new @code{GtkFrame} object initializing it with the value in @var{label}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_frame_set_label (GtkFrame *@var{frame}, gchar *@var{label}) @end deftypefun @deftypefun void gtk_frame_set_label_align (GtkFrame *@var{frame}, gfloat @var{xalign}, gfloat @var{yalign}) @end deftypefun @deftypefun void gtk_frame_set_shadow_type (GtkFrame *@var{frame}, GtkShadowType @var{type}) @end deftypefun @gtkstdmacros{Frame, FRAME} @page @node GtkGamma, GtkHBox, GtkFrame, Widgets @comment node-name, next, previous, up @section The gamma widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_gamma_curve_get_type (void) Returns the @code{GtkGamma} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_gamma_curve_new (void) Create a new @code{GtkGamma} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @gtkstdmacros{Gamma, GAMMA} @page @node GtkHBox, GtkHButtonBox, GtkGamma, Widgets @comment node-name, next, previous, up @section The horizontal box widget @subsection Description @subsection Options @defopt homogeneous This option controls whether each object in the box has the same size. In the case of the @code{GtkHBox}, this effects the width. If this option is set then the @var{expand} option to the @code{gtk_box_pack} (@pxref{GtkBox}) routines is always set to @code{TRUE}. @end defopt @defopt spacing This option controls the amount of space that is added between the objects packed into this @code{GtkVBox} object. @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_hbox_get_type (void) Returns the @code{GtkHBox} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_hbox_new (gint @var{homogeneous}, gint @var{spacing}) Create a new @code{GtkHBox} object initializing it with the values in @var{homogeneous} and @var{spacing}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @gtkstdmacros{HBox, HBOX} @page @node GtkHButtonBox, GtkHPaned, GtkHBox, Widgets @comment node-name, next, previous, up @section The horizontal button box widget @subsection Description @subsection Options @defopt spacing @end defopt @defopt layout @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_hbutton_box_get_type (void) Returns the @code{GtkHButtonBox} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_hbutton_box_new (void) Create a new @code{GtkHButtonBox} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_hbutton_box_set_spacing_default (gint @var{spacing}) @end deftypefun @deftypefun void gtk_hbutton_box_set_layout_default (gint @var{layout}) @end deftypefun @deftypefun gint gtk_hbutton_box_get_spacing_default (void) @end deftypefun @deftypefun gint gtk_hbutton_box_get_layout_default (void) @end deftypefun @gtkstdmacros {HButtonBox, HBUTTON_BOX} @page @node GtkHPaned, GtkHRuler, GtkHButtonBox, Widgets @comment node-name, next, previous, up @section The horizontal paned widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun void gtk_hpaned_get_type (void) Returns the @code{GtkHPaned} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_hpaned_new (void) Create a new @code{GtkHPaned} object returning the new widget as a pointer to a @code{GtkWidget} object. @end deftypefun @gtkstdmacros{HPaned, HPANED} @page @node GtkHRuler, GtkHScale, GtkHPaned, Widgets @comment node-name, next, previous, up @section The horizontal ruler widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_hruler_get_type (void) Returns the @code{GtkHRuler} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_hruler_new (void) Create a new @code{GtkHRuler} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @gtkstdmacros{HRuler, HRULER} @page @node GtkHScale, GtkHScrollbar, GtkHRuler, Widgets @comment node-name, next, previous, up @section The horizontal scale widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_hscale_get_type (void) Returns the @code{GtkHScale} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_hscale_new (GtkAdjustment *@var{adjustment}) Create a new @code{GtkHScale} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @gtkstdmacros{HScale, HSCALE} @page @node GtkHScrollbar, GtkHSeparator, GtkHScale, Widgets @comment node-name, next, previous, up @section The horizontal scrollbar widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_hscrollbar_get_type (void) Returns the @code{GtkHScrollbar} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_hscrollbar_new (GtkAdjustment *@var{adjustment}) Create a new @code{GtkHScrollbar} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @gtkstdmacros{HScrollbar, HSCROLLBAR} @page @node GtkHSeparator, GtkImage, GtkHScrollbar, Widgets @comment node-name, next, previous, up @section The horizontal separator widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_hseparator_get_type (void) Returns the @code{GtkHSeparator} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_hseparator_new (void) Create a new @code{GtkHSeparator} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @gtkstdmacros{HSeparator, HSEPARATOR} @page @node GtkImage, GtkInputDialog, GtkHSeparator, Widgets @comment node-name, next, previous, up @section The image widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_image_get_type (void) Returns the @code{GtkImage} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_image_new (GdkImage *@var{val}, GdkBitmap *@var{mask}) Create a new @code{GtkImage} object initializing it with the values in @var{val} and @var{mask}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_image_set (GtkImage *@var{image}, GdkImage *@var{val}, GdkBitmap *@var{mask}) @end deftypefun @deftypefun void gtk_image_get (GtkImage *@var{image}, GdkImage **@var{val}, GdkBitmap **@var{mask}) @end deftypefun @gtkstdmacros{Image, IMAGE} @page @node GtkInputDialog, GtkItem, GtkImage, Widgets @comment node-name, next, previous, up @section The input dialog widget @subsection Description @subsection Options @subsection Signals @deftypefn Signal void GtkInputDialog::enable_device (GtkInputDialog *@var{inputd}, guint32 @var{devid}, gpointer *@var{data}) @end deftypefn @deftypefn Signal void GtkInputDialog::disable_device (GtkInputDialog *@var{inputd}, guint32 @var{devid}, gpointer *@var{data}) @end deftypefn @subsection Functions @deftypefun guint gtk_input_dialog_get_type (void) Returns the @code{GtkInputDialog} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_input_dialog_new (void) Create a new @code{GtkInputDialog} object and return the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @gtkstdmacros{InputDialog, INPUTDIALOG} @page @node GtkItem, GtkLabel, GtkInputDialog, Widgets @comment node-name, next, previous, up @section The item widget @subsection Description @subsection Signals @deftypefn Signal void GtkItem::select (GtkItem *@var{item}) @end deftypefn @deftypefn Signal void GtkItem::deselect (GtkItem *@var{item}) @end deftypefn @deftypefn Signal void GtkItem::toggle (GtkItem *@var{toggle}) @end deftypefn @subsection Functions @deftypefun guint gtk_item_get_type (void) Returns the @code{GtkItem} type identifier. @end deftypefun @deftypefun void gtk_item_select (GtkItem *@var{item}) @end deftypefun @deftypefun void gtk_item_deselect (GtkItem *@var{item}) @end deftypefun @deftypefun void gtk_item_toggle (GtkItem *@var{item}) @end deftypefun @gtkstdmacros{Item, ITEM} @page @node GtkLabel, GtkList, GtkItem, Widgets @comment node-name, next, previous, up @section The label widget @subsection Description @subsection Options @defopt str @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_label_get_type (void) Returns the @code{GtkLabel} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_label_new (GtkLabel *@var{label}, gchar *@var{str}) Create a new @code{GtkLabel} object and initialize it with the text in @var{str}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_label_set (GtkLabel *@var{label}, gchar *@var{str}) Set the @code{GtkLabel} label value to the value passed in the @var{str} argument. @end deftypefun @deftypefun void gtk_label_get (GtkLabel *@var{label}, gchar **@var{str}) Copies the current value in the @code{GtkLabel} label field to the variable passed in the @var{str} argument. @end deftypefun @gtkstdmacros{Label, LABEL} @page @node GtkList, GtkListItem, GtkLabel, Widgets @comment node-name, next, previous, up @section The list widget @subsection Description @subsection Signals @deftypefn Signal void GtkList::selection_changed (GtkList *@var{list}) @end deftypefn @deftypefn Signal void GtkList::select_child (GtkList *@var{list}, GtkWidget *@var{child}) @end deftypefn @deftypefn Signal void GtkList::unselect_child (GtkList *@var{list}, GtkWidget *@var{child}) @end deftypefn @subsection Functions @deftypefun guint gtk_list_get_type (void) Returns the @code{GtkList} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_list_new (void) Create a new @code{GtkList} object and return the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_list_insert_items (GtkList *@var{list}, GList *@var{items}, gint @var{position}) @end deftypefun @deftypefun void gtk_list_append_items (GtkList *@var{list}, GList *@var{items}) @end deftypefun @deftypefun void gtk_list_prepend_items (GtkList *@var{list}, GList *@var{items}) @end deftypefun @deftypefun void gtk_list_remove_items (GtkList *@var{list}, GList *@var{items}) @end deftypefun @deftypefun void gtk_list_clear_items (GtkList *@var{list}, gint @var{start}, gint @var{end}) @end deftypefun @deftypefun void gtk_list_select_item (GtkList *@var{list}, gint @var{item}) @end deftypefun @deftypefun void gtk_list_unselect_item (GtkList *@var{list}, gint @var{item}) @end deftypefun @deftypefun void gtk_list_select_child (GtkList *@var{list}, GtkWidget *@var{child}) @end deftypefun @deftypefun void gtk_list_unselect_child (GtkList *@var{list}, GtkWidget *@var{child}) @end deftypefun @deftypefun gint gtk_list_child_position (GtkList *@var{list}, GtkWidget *@var{child}) @end deftypefun @deftypefun void gtk_list_set_selection_mode (GtkList *@var{list}, GtkSelectionMode @var{mode}) @end deftypefun @gtkstdmacros{List, LIST} @page @node GtkListItem, GtkMenu, GtkList, Widgets @comment node-name, next, previous, up @section The list item widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_list_item_get_type (void) Returns the @code{GtkListItem} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_list_item_new (void) Create a new @code{GtkListItem} object and return the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun GtkWidget* gtk_list_item_new_with_label (gchar *@var{label}) Create a new @code{GtkListItem} object initializing with the value @var{label}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_list_item_select (GtkListItem *@var{list_item}) @end deftypefun @deftypefun void gtk_list_item_deselect (GtkListItem *@var{list_item}) @end deftypefun @gtkstdmacros{ListItem, LIST_ITEM} @page @node GtkMenu, GtkMenuBar, GtkListItem, Widgets @comment node-name, next, previous, up @section The menu widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_menu_get_type (void) Returns the @code{GtkMenu} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_menu_new (void) Create a new @code{GtkMenu} object returning the new widget as a pointer to a @code{GtkWidget}. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_menu_append (GtkMenu *@var{menu}, GtkWidget *@var{child}) @end deftypefun @deftypefun void gtk_menu_prepend (GtkMenu *@var{menu}, GtkWidget *@var{child}) @end deftypefun @deftypefun void gtk_menu_insert (GtkMenu *@var{menu}, GtkWidget *@var{child}, gint @var{position}) @end deftypefun @deftypefun void gtk_menu_popup (GtkMenu *@var{menu}, GtkWidget *@var{parent_menu_shell}, GtkWidget *@var{parent_menu_item}, GtkMenuPositionFunc @var{func}, gpointer @var{data}, gint @var{button}) @end deftypefun @deftypefun void gtk_menu_popdown (GtkMenu *@var{menu}) @end deftypefun @deftypefun GtkWidget* gtk_menu_get_active (GtkMenu *@var{menu}) @end deftypefun @deftypefun void gtk_menu_set_active (GtkMenu *@var{menu}) @end deftypefun @deftypefun void gtk_menu_set_accelerator_table (GtkMenu *@var{menu}, GtkAcceleratorTable *@var{table}) @end deftypefun @gtkstdmacros{Menu, MENU} @page @node GtkMenuBar, GtkMenuItem, GtkMenu, Widgets @comment node-name, next, previous, up @section The menu bar widget @subsection Description @subsection Options @defopt position @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_menu_bar_get_type (void) Returns the @code{GtkMenuBar} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_menu_bar_new (void) Create a new @code{GtkMenuBar} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_menu_bar_append (GtkMenuBar *@var{menu_bar}, GtkWidget *@var{child}) @end deftypefun @deftypefun void gtk_menu_bar_prepend (GtkMenuBar *@var{menu_bar}, GtkWidget *@var{child}) @end deftypefun @deftypefun void gtk_menu_bar_insert (GtkMenuBar *@var{menu_bar}, GtkWidget *@var{child}, gint @var{position}) @end deftypefun @gtkstdmacros{MenuBar, MENU_BAR} @page @node GtkMenuItem, GtkMenuShell, GtkMenuBar, Widgets @comment node-name, next, previous, up @section The menu item widget @subsection Description @subsection Options @subsection Signals @deftypefn Signal void GtkMenuItem::activate (GtkMenuItem *@var{menu_item}) @end deftypefn @subsection Functions @deftypefun guint gtk_menu_item_get_type (void) Returns the @code{GtkMenuItem} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_menu_item_new (void) Create a new @code{GtkMenuItem} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun GtkWidget* gtk_menu_item_new_with_label (gchar *@var{label}) Create a new @code{GtkMenuItem} object initializing it with the value in @var{label}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_menu_item_set_submenu (GtkMenuItem *@var{menu_item}, GtkWidget *@var{submenu}) @end deftypefun @deftypefun void gtk_menu_item_set_placement (GtkMenuItem *@var{menu_item}, GtkSubmenuPlacement @var{placement}) @end deftypefun @deftypefun void gtk_menu_item_accelerator_size (GtkMenuItem *@var{menu_item}) @end deftypefun @deftypefun void gtk_menu_item_accelerator_text (GtkMenuItem *@var{menu_item}, gchar *@var{buffer}) @end deftypefun @deftypefun void gtk_menu_item_configure (GtkMenuItem *@var{menu_item}, gint @var{show_toggle_indicator}, gint @var{show_submenu_indicator}) @end deftypefun @deftypefun void gtk_menu_item_select (GtkMenuItem *@var{menu_item}) @end deftypefun @deftypefun void gtk_menu_item_deselect (GtkMenuItem *@var{menu_item}) @end deftypefun @deftypefun void gtk_menu_item_activate (GtkMenuItem *@var{menu_item}) @end deftypefun @gtkstdmacros{MenuItem, MENU_ITEM} @page @node GtkMenuShell, GtkMisc, GtkMenuItem, Widgets @comment node-name, next, previous, up @section The menu shell widget @subsection Description @subsection Options @subsection Signals @deftypefn Signal void GtkMenuShell::deactivate (GtkMenuShell *@var{menu_shell}) @end deftypefn @subsection Functions @deftypefun guint gtk_menu_shell_get_type (void) Returns the @code{GtkMenuShell} type identifier. @end deftypefun @deftypefun void gtk_menu_shell_append (GtkMenuShell *@var{menu_shell}, GtkWidget *@var{child}) @end deftypefun @deftypefun void gtk_menu_shell_prepend (GtkMenuShell *@var{menu_shell}, GtkWidget *@var{child}) @end deftypefun @deftypefun void gtk_menu_shell_insert (GtkMenuShell *@var{menu_shell}, GtkWidget *@var{child}, gint @var{position}) @end deftypefun @deftypefun void gtk_menu_shell_deactivate (GtkMenuShell *@var{menu_shell}) @end deftypefun @gtkstdmacros{MenuShell, MENU_SHELL} @page @node GtkMisc, GtkNotebook, GtkMenuShell, Widgets @comment node-name, next, previous, up @section The misc widget @subsection Description @subsection Options @defopt xalign @end defopt @defopt yalign @end defopt @defopt xpad @end defopt @defopt ypad @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_misc_get_type (void) Returns the @code{GtkMisc} type identifier. @end deftypefun @deftypefun void gtk_misc_set_alignment (GtkMisc *@var{misc}, gfloat @var{xalign}, gfloat @var{yalign}) @end deftypefun @deftypefun void gtk_misc_set_padding (GtkMisc *@var{misc}, gint @var{xpad}, gint @var{ypad}) @end deftypefun @gtkstdmacros{Misc, MISC} @page @node GtkNotebook, GtkOptionMenu, GtkMisc, Widgets @comment node-name, next, previous, up @section The notebook widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_notebook_get_type (void) Returns the @code{GtkNotebook} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_notebook_new (void) Create a new @code{GtkNotebook} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on a failure. @end deftypefun @deftypefun void gtk_notebook_append_page (GtkNotebook *@var{notebook}, GtkWidget *@var{child}, GtkWidget *@var{tab_label}) @end deftypefun @deftypefun void gtk_notebook_prepend_page (GtkNotebook *@var{notebook}, GtkWidget *@var{child}, GtkWidget *@var{tab_label}) @end deftypefun @deftypefun void gtk_notebook_insert_page (GtkNotebook *@var{notebook}, GtkWidget *@var{child}, GtkWidget *@var{tab_label}, gint @var{position}) @end deftypefun @deftypefun void gtk_notebook_remove_page (GtkNotebook *@var{notebook}, gint @var{page_num}) @end deftypefun @deftypefun void gtk_notebook_set_page (GtkNotebook *@var{notebook}, gint @var{page_num}) @end deftypefun @deftypefun void gtk_notebook_next_page (GtkNotebook *@var{notebook}) @end deftypefun @deftypefun void gtk_notebook_prev_page (GtkNotebook *@var{notebook}) @end deftypefun @deftypefun void gtk_notebook_set_tab_pos (GtkNotebook *@var{notebook}, GtkPositionType @var{pos}) @end deftypefun @deftypefun void gtk_notebook_set_show_tabs (GtkNotebook *@var{notebook}, gint @var{show_tabs}) @end deftypefun @deftypefun void gtk_notebook_set_show_border (GtkNotebook *@var{notebook}, gint @var{show_border}) @end deftypefun @gtkstdmacros{Notebook, NOTEBOOK} @page @node GtkOptionMenu, GtkPaned, GtkNotebook, Widgets @comment node-name, next, previous, up @section The option menu widget @subsection Description @subsection Options @defopt index @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_option_menu_get_type (void) Returns the @code{GtkOptionMenu} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_option_menu_new (void) Create a new @code{GtkOptionMenu} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun GtkWidget* gtk_option_menu_get_menu (GtkOptionMenu *@var{option_menu}) @end deftypefun @deftypefun void gtk_option_menu_set_menu (GtkOptionMenu *@var{option_menu}, GtkWidget *@var{menu}) @end deftypefun @deftypefun void gtk_option_menu_remove_menu (GtkOptionMenu *@var{option_menu}) @end deftypefun @deftypefun void gtk_option_menu_set_history (GtkOptionMenu *@var{option_menu}, gint @var{index}) @end deftypefun @gtkstdmacros{OptionMenu, OPTION_MENU} @page @node GtkPaned, GtkPixmap, GtkOptionMenu, Widgets @comment node-name, next, previous, up @section The paned widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_paned_get_type (void) Returns the @code{GtkPaned} type identifier. @end deftypefun @deftypefun void gtk_paned_add1 (GtkPaned *@var{paned}, GtkWidget *@var{child}) @end deftypefun @deftypefun void gtk_paned_add2 (GtkPaned *@var{paned}, GtkWidget *@var{child}) @end deftypefun @deftypefun void gtk_paned_handle_size (GtkPaned *@var{paned}, guint16 @var{size}) @end deftypefun @deftypefun void gtk_paned_gutter_size (GtkPaned *@var{paned}, guint16 @var{size}) @end deftypefun @gtkstdmacros{Paned, PANED} @page @node GtkPixmap, GtkPreview, GtkPaned, Widgets @comment node-name, next, previous, up @section The pixmap widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_pixmap_get_type (void) Returns the @code{GtkPixmap} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_pixmap_new (GdkPixmap *@var{normal}, GdkPixmap *@var{active}, GdkPixmap *@var{prelight}, GdkPixmap *@var{selected}, GdkPixmap *@var{insensitive}) @end deftypefun @deftypefun void gtk_pixmap_set (GtkPixmap *@var{pixmap}, GdkPixmap *@var{val}, GtkStateType @var{state}) @end deftypefun @deftypefun void gtk_pixmap_get (GtkPixmap *@var{pixmap}, GdkPixmap **@var{val}, GtkStateType @var{state}) @end deftypefun @gtkstdmacros{Pixmap, PIXMAP} @page @node GtkPreview, GtkProgressBar, GtkPixmap, Widgets @comment node-name, next, previous, up @section The preview widget @subsection Description @subsection Options @defopt type @end defopt @defopt width @end defopt @defopt height @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_preview_get_type (void) Returns the @code{GtkPreview} type identifier. @end deftypefun @deftypefun void gtk_preview_uninit (void) @end deftypefun @deftypefun GtkWidget* gtk_preview_new (GtkPreviewType @var{type}) Create a new @code{GtkPreview} object initializing it with the values in @var{type}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_preview_size (GtkPreview *@var{preview}, gint @var{width}, gint @var{height}) Set the size of the @var{preview} object to @var{width} and @var{height}. @end deftypefun @deftypefun void gtk_preview_put (GtkPreview *@var{preview}, GdkWindow *@var{window}, GdkGC *@var{gc}, gint @var{srcx}, gint @var{srcy}, gint @var{destx}, gint @var{desty}, gint @var{width}, gint @var{height}) @end deftypefun @deftypefun void gtk_preview_put_row (GtkPreview *@var{preview}, guchar *@var{src}, guchar *@var{dest}, gint @var{x}, gint @var{y}, gint @var{w}) @end deftypefun @deftypefun void gtk_preview_draw_row (GtkPreview *@var{preview}, guchar @var{data}, gint @var{x}, gint @var{y}, gint @var{w}) @end deftypefun @deftypefun void gtk_preview_set_expand (GtkPreview *@var{preview}, gint @var{expand}) @end deftypefun @deftypefun void gtk_preview_set_gamma (double @var{gamma}) @end deftypefun @deftypefun void gtk_preview_set_color_cube (guint @var{nred_shades}, guint @var{ngreen_shades}, guint @var{nblue_shades}, guint @var{ngray_shades}) @end deftypefun @deftypefun void gtk_preview_set_install_cmap (gint @var{install_cmap}) @end deftypefun @deftypefun void gtk_preview_set_reserved (gint @var{nreserved}) @end deftypefun @deftypefun GdkVisual* gtk_preview_get_visual (void) @end deftypefun @deftypefun GdkColormap* gtk_preview_get_cmap (void) @end deftypefun @deftypefun GtkPreviewInfo* gtk_preview_get_info (void) @end deftypefun @gtkstdmacros{Preview, PREVIEW} @page @node GtkProgressBar, GtkRadioButton, GtkPreview, Widgets @comment node-name, next, previous, up @section The progress bar widget @subsection Description @subsection Options @defopt percentage @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_progress_bar_get_type (void) Returns the @code{GtkProgressBar} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_progress_bar_new (void) Create a new @code{GtkProgressBar} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_progress_bar_update (GtkProgressBar *@var{pbar}, gfloat @var{percentage}) Cause the @code{GtkProgressBar} to update its visual appearance to reflect the @var{percentage}. @end deftypefun @gtkstdmacros{ProgressBar, PROGRESS_BAR} @page @node GtkRadioButton, GtkRadioMenuItem, GtkProgressBar, Widgets @comment node-name, next, previous, up @section The radio button widget @subsection Description @subsection Options @defopt group @end defopt @defopt label @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_radio_button_get_type (void) Returns the @code{GtkRadioButton} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_radio_button_new (GSList *@var{group}) Create a new @code{GtkRadioButton} object initializing it with the value in the @var{group} argument. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun GtkWidget* gtk_radio_button_new_with_label (GSList *@var{group}, gchar *@var{label}) Create a new @code{GtkRadioButton} object initializing it with the values in the @var{group} and @var{label} arguments. The new widget is returned as a pointer to @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun GSList* gtk_radio_button_group (GtkRadioButton *@var{radio_button}) @end deftypefun @gtkstdmacros{RadioButton, RADIO_BUTTON} @page @node GtkRadioMenuItem, GtkRange, GtkRadioButton, Widgets @comment node-name, next, previous, up @section The radio button widget @subsection Description @subsection Options @defopt group @end defopt @defopt label @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_radio_menu_item_get_type (void) Returns the @code{GtkRadioMenuItem} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_radio_menu_item_new (GSList *@var{group}) Create a new @code{GtkRadioMenuItem} object and initialize it with the values in @var{group}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun GtkWidget* gtk_radio_menu_item_new_with_label (GSList *@var{group}, gchar *@var{label}) @end deftypefun @deftypefun GSList* gtk_radio_menu_item_group (GtkRadioMenuItem *@var{radio_menu_item}) @end deftypefun @gtkstdmacros{RadioMenuItem, RADIO_MENU_ITEM} @page @node GtkRange, GtkRuler, GtkRadioMenuItem, Widgets @comment node-name, next, previous, up @section The range widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_range_get_type (void) Returns the @code{GtkRange} type identifier. @end deftypefun @deftypefun GtkAdjustment* gtk_range_get_adjustment (GtkRange *@var{range}) @end deftypefun @deftypefun void gtk_range_set_update_policy (GtkRange *@var{range}, GtkUpdatePolicy @var{policy}) @end deftypefun @deftypefun void gtk_range_set_adjustment (GtkRange *@var{range}, GtkAdjustment *@var{adjustment}) @end deftypefun @deftypefun void gtk_range_draw_background (GtkRange *@var{range}) @end deftypefun @deftypefun void gtk_range_draw_trough (GtkRange *@var{range}) @end deftypefun @deftypefun void gtk_range_draw_slider (GtkRange *@var{range}) @end deftypefun @deftypefun void gtk_range_draw_step_forw (GtkRange *@var{range}) @end deftypefun @deftypefun void gtk_range_draw_step_back (GtkRange *@var{range}) @end deftypefun @deftypefun void gtk_range_slider_update (GtkRange *@var{range}) @end deftypefun @deftypefun gint gtk_range_trough_click (GtkRange *@var{range}, gint @var{x}, gint @var{y}) @end deftypefun @deftypefun void gtk_range_default_hslider_update (GtkRange *@var{range}) @end deftypefun @deftypefun void gtk_range_default_vslider_update (GtkRange *@var{range}) @end deftypefun @deftypefun gint gtk_range_default_htrough_click (GtkRange *@var{range}, gint @var{x}, gint @var{y}) @end deftypefun @deftypefun gint gtk_range_default_vtrough_click (GtkRange *@var{range}, gint @var{x}, gint @var{y}) @end deftypefun @deftypefun void gtk_range_default_hmotion (GtkRange *@var{range}, gint @var{xdelta}, gint @var{ydelta}) @end deftypefun @deftypefun void gtk_range_default_vmotion (GtkRange *@var{range}, gint @var{xdelta}, gint @var{ydelta}) @end deftypefun @deftypefun gfloat gtk_range_calc_value (GtkRange *@var{range}, gint @var{position}) @end deftypefun @gtkstdmacros{Range, RANGE} @page @node GtkRuler, GtkScale, GtkRange, Widgets @comment node-name, next, previous, up @section The ruler widget @subsection Description @subsection Options @defopt metric @end defopt @defopt lower @end defopt @defopt upper @end defopt @defopt position @end defopt @defopt max_size @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_ruler_get_type (void) Returns the @code{GtkRuler} type identifier. @end deftypefun @deftypefun void gtk_ruler_set_metric (GtkRuler *@var{ruler}, GtkMetricType @var{metric}) @end deftypefun @deftypefun void gtk_ruler_set_range (GtkRuler *@var{ruler}, gfloat @var{lower}, gfloat @var{upper}, gfloat @var{position}, gfloat @var{max_size}) @end deftypefun @deftypefun void gtk_ruler_draw_ticks (GtkRuler *@var{ruler}) @end deftypefun @deftypefun void gtk_ruler_draw_pos (GtkRuler *@var{ruler}) @end deftypefun @gtkstdmacros{Ruler, RULER} @page @node GtkScale, GtkScrollbar, GtkRuler, Widgets @comment node-name, next, previous, up @section The scale widget @subsection Description @subsection Options @defopt digits @end defopt @defopt draw_value @end defopt @defopt pos @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_scale_get_type (void) Returns the @code{GtkScale} type identifier. @end deftypefun @deftypefun void gtk_scale_set_digits (GtkScale *@var{scale}, gint @var{digits}) @end deftypefun @deftypefun void gtk_scale_set_draw_value (GtkScale *@var{scale}, gint @var{draw_value}) @end deftypefun @deftypefun void gtk_scale_set_value_pos (GtkScale *@var{scale}, gint @var{pos}) @end deftypefun @deftypefun gint gtk_scale_value_width (GtkScale *@var{scale}) @end deftypefun @deftypefun void gtk_scale_draw_value (GtkScale *@var{scale}) @end deftypefun @gtkstdmacros{Scale, SCALE} @page @node GtkScrollbar, GtkScrolledWindow, GtkScale, Widgets @comment node-name, next, previous, up @section The scrollbar widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_scrollbar_get_type (void)a Returns the @code{GtkScrollbar} type identifier. @end deftypefun @gtkstdmacros{Scrollbar, SCROLLBAR} @page @node GtkScrolledWindow, GtkSeparator, GtkScrollbar, Widgets @comment node-name, next, previous, up @section The scrolled window widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_scrolled_window_get_type (void) Returns the @code{GtkScrolledWindow} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_scrolled_window_new (GtkAdjustment *@var{hadjustment}, GtkAdjustment *@var{vadjustment}) Create a new @code{GtkScrolledWindow} object initializing it with the values in @var{adjustment} and @var{adjustment}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun GtkAdjustment* gtk_scrolled_window_get_hadjustment (GtkScrolledWindow *@var{scrolled_window}) @end deftypefun @deftypefun GtkAdjustment* gtk_scrolled_window_get_vadjustment (GtkScrolledWindow *@var{scrolled_window}) @end deftypefun @deftypefun void gtk_scrolled_window_set_policy (GtkScrolledWindow *@var{scrolled_window}, GtkPolicyType @var{hscrollbar_policy}, GtkPolicyType @var{vscrollbar_policy}) @end deftypefun @gtkstdmacros{ScrolledWindow, SCROLLED_WINDOW} @page @node GtkSeparator, GtkStatusbar, GtkScrolledWindow, Widgets @comment node-name, next, previous, up @section The separator widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_separator_get_type (void) Returns the @code{GtkSeparator} type identifier. @end deftypefun @gtkstdmacros{Separator, SEPARATOR} @page @node GtkStatusbar, GtkTable, GtkSeparator, Widgets @comment node-name, next, previous, up @section The statusbar widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_statusbar_get_type (void) Returns the @code{GtkStatusbar} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_statusbar_new (void) Create a new @code{GtkStatusbar} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun gint gtk_statusbar_push (GtkStatusbar *@var{statusbar}, gchar *@var{text}) @end deftypefun @deftypefun void gtk_statusbar_pop (GtkStatusbar *@var{statusbar}, gint @var{context_id}) @end deftypefun @gtkstdmacros{Statusbar, STATUSBAR} @page @node GtkTable, GtkText, GtkStatusbar, Widgets @comment node-name, next, previous, up @section The table widget @subsection Description @subsection Options @defopt rows @end defopt @defopt columns @end defopt @defopt homogeneous This option controls whether all child widgets in the @code{GtkTable} will be of the same size. The child widgets will be the size of the largest child. @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_table_get_type (void) Returns the @code{GtkTable} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_table_new (gint @var{rows}, gint @var{columns}, gint @var{homogeneous}) Create a new @code{GtkTable} object initializing it with the values in @var{rows}, @var{columns} and @var{homogeneous}. The new widget is returned as a pointer to a @code{GtkWidget}. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_table_attach (GtkTable *@var{table}, GtkWidget *@var{child}, gint @var{left_attach}, gint @var{right_attach}, gint @var{top_attach}, gint @var{bottom_attach}, gint @var{xoptions}, gint @var{yoptions}, gint @var{xpadding}, gint @var{ypadding}) @end deftypefun @deftypefun void gtk_table_attach_defaults (GtkTable *@var{table}, GtkWidget *@var{widget}, gint @var{left_attach}, gint @var{right_attach}, gint @var{top_attach}, gint @var{bottom_attach}) @end deftypefun @deftypefun void gtk_table_set_row_spacing (GtkTable *@var{table}, gint @var{row}, gint @var{spacing}) @end deftypefun @deftypefun void gtk_table_set_col_spacing (GtkTable *@var{table}, gint @var{col}, gint @var{spacing}) @end deftypefun @deftypefun void gtk_table_set_row_spacings (GtkTable *@var{table}, gint @var{spacing}) @end deftypefun @deftypefun void gtk_table_set_col_spacings (GtkTable *@var{table}, gint @var{spacing}) @end deftypefun @gtkstdmacros{Table, TABLE} @page @node GtkText, GtkToggleButton, GtkTable, Widgets @comment node-name, next, previous, up @section The text widget @subsection Description @subsection Signals @subsection Functions @deftypefun guint gtk_text_get_type (void) Returns the @code{GtkText} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_text_new (GtkAdjustment *@var{hadj}, GtkAdjustment *@var{vadj}); Create a new @code{GtkText} object initializing it with the values in @var{hadj} and @var{vadj}. The new widget is returned as a pointer to a @code{GtkWidget}. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_text_set_editable (GtkText *@var{text}, gint @var{editable}) @end deftypefun @deftypefun void gtk_text_set_adjustments (GtkText *@var{text}, GtkAdjustment *@var{hadj}, GtkAdjustment *@var{vadj}) @end deftypefun @deftypefun void gtk_text_set_point (GtkText *@var{text}, guint @var{index}) @end deftypefun @deftypefun guint gtk_text_get_point (GtkText *@var{text}) @end deftypefun @deftypefun guint gtk_text_get_length (GtkText *@var{text}) @end deftypefun @deftypefun void gtk_text_freeze (GtkText *@var{text}) @end deftypefun @deftypefun void gtk_text_thaw (GtkText *@var{text}) @end deftypefun @deftypefun void gtk_text_insert (GtkText *@var{text}, GdkFont *@var{font}, GdkColor *@var{fore}, GdkColor *@var{back}, char *@var{chars}, gint @var{length}) @end deftypefun @deftypefun gint gtk_text_forward_delete (GtkText *@var{text}, guint @var{nchars}) @end deftypefun @deftypefun gint gtk_text_backward_delete (GtkText *@var{text}, guint @var{nchars}) @end deftypefun @gtkstdmacros{Text, TEXT} @page @node GtkToggleButton, GtkToolbar, GtkText, Widgets @comment node-name, next, previous, up @section The toggle button widget @subsection Description Another form of button (@pxref{GtkButton}) with two states: on and off. The appearance is that of a button which stays pressed on the first click, and is released on the second click. @subsection Options @defopt state @end defopt @subsection Signals @deftypefn Signal void GtkToggleButton::toggled (GtkToggleButton *@var{toggle_button}) @end deftypefn @subsection Functions @deftypefun guint gtk_toggle_button_get_type (void) Returns the @code{GtkToggleButton} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_toggle_button_new (void) Create a new @code{GtkToggleButton} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun GtkWidget* gtk_toggle_button_new_with_label (gchar *@var{label}) Create a new @code{GtkToggleButton} object initializing it with the values in @var{label}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_toggle_button_set_mode (GtkToggleButton *@var{toggle_button}, gint @var{draw_indicator}) @end deftypefun @deftypefun void gtk_toggle_button_set_state (GtkToggleButton *@var{toggle_button}, gint @var{state}) @end deftypefun @deftypefun void gtk_toggle_button_toggled (GtkToggleButton *@var{toggle_button}) @end deftypefun @gtkstdmacros{ToggleButton, TOGGLE_BUTTON} @page @node GtkToolbar, GtkTooltips, GtkToggleButton, Widgets @comment node-name, next, previous, up @section The tool bar widget @subsection Description @subsection Options @defopt orientation @itemize @bullet @item GTK_ORIENTATION_HORIZONTAL @item GTK_ORIENTATION_VERTICAL @end itemize @end defopt @defopt style @itemize @bullet @item GTK_TOOLBAR_ICONS @item GTK_TOOLBAR_TEXT @item GTK_TOOLBAR_BOTH @end itemize @end defopt @defopt space_size @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_toolbar_get_type (void) Returns the @code{GtkToolbar} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_toolbar_new (GtkOrientation @var{orientation}, GtkToolbarStyle @var{style}) Create a new @code{GtkToolbar} object initializing it with the values @var{orientation} and @var{style}. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_toolbar_append_item (GtkToolbar *@var{toolbar}, char *@var{text}, char *@var{tooltip_text}, GtkPixmap *@var{icon}, GtkSignalFunc @var{callback}, gpointer @var{user_data}) @end deftypefun @deftypefun void gtk_toolbar_prepend_item (GtkToolbar *@var{toolbar}, char *@var{text}, char *@var{tooltip_text}, GtkPixmap *@var{icon}, GtkSignalFunc @var{callback}, gpointer @var{user_data}) @end deftypefun @deftypefun void gtk_toolbar_insert_item (GtkToolbar *@var{toolbar}, char *@var{text}, char *@var{tooltip_text}, GtkPixmap *@var{icon}, GtkSignalFunc @var{callback}, gpointer @var{user_data}, gint @var{position}) @end deftypefun @deftypefun void gtk_toolbar_append_space (GtkToolbar *@var{toolbar}) @end deftypefun @deftypefun void gtk_toolbar_prepend_space (GtkToolbar *@var{toolbar}) @end deftypefun @deftypefun void gtk_toolbar_insert_space (GtkToolbar *@var{toolbar}, gint @var{position}) @end deftypefun @deftypefun void gtk_toolbar_set_orientation (GtkToolbar *@var{toolbar}, GtkOrientation @var{orientation}) @end deftypefun @deftypefun void gtk_toolbar_set_style (GtkToolbar *@var{toolbar}, GtkToolbarStyle @var{style}) Set the @var{style} of the @var{toolbar} to @var{style}. @end deftypefun @deftypefun void gtk_toolbar_set_space_size (GtkToolbar *@var{toolbar}, gint @var{space_size}) @end deftypefun @deftypefun void gtk_toolbar_set_tooltips (GtkToolbar *@var{toolbar}, gint @var{enable}) @end deftypefun @gtkstdmacros{Toolbar, TOOLBAR} @page @node GtkTooltips, GtkTree, GtkToolbar, Widgets @comment node-name, next, previous, up @section The tool tips widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun GtkTooltips* gtk_tooltips_new (void) Create a new @code{GtkTooltips} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun GtkTooltips* gtk_tooltips_ref (GtkTooltips *@var{tooltips}) @end deftypefun @deftypefun void gtk_tooltips_unref (GtkTooltips *@var{tooltips}) @end deftypefun @deftypefun void gtk_tooltips_free_string (gpointer @var{data}, gpointer @var{user_data}) @end deftypefun @deftypefun void gtk_tooltips_enable (GtkTooltips *@var{tooltips}) @end deftypefun @deftypefun void gtk_tooltips_disable (GtkTooltips *@var{tooltips}) @end deftypefun @deftypefun void gtk_tooltips_set_delay (GtkTooltips *@var{tooltips}, GtkWidget *@var{widget}, gchar *@var{tips_text}) @end deftypefun @deftypefun void gtk_tooltips_set_colors (GtkTooltips *@var{tooltips}, GdkColor *@var{background}, GdkColor *@var{foreground}) @end deftypefun @gtkstdmacros{Tooltips, TOOLTIPS} @page @node GtkTree, GtkTreeItem, GtkTooltips, Widgets @comment node-name, next, previous, up @section The tree widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_tree_get_type (void) Returns the @code{GtkTree} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_tree_new (void) Create a new @code{GtkTree} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_tree_append (GtkTree *@var{tree}, GtkWidget *@var{child}) @end deftypefun @deftypefun void gtk_tree_prepend (GtkTree *@var{tree}, GtkWidget *@var{child}) @end deftypefun @deftypefun void gtk_tree_insert (GtkTree *@var{tree}, GtkWidget *@var{child}, gint @var{position}) @end deftypefun @deftypefun gint gtk_tree_child_position (GtkTree *@var{tree}, GtkWidget *@var{child}) @end deftypefun @deftypefun void gtk_tree_clear_items (GtkTree *@var{tree}, gint @var{start}, gint @var{end}) @end deftypefun @deftypefun void gtk_tree_remove_items (GtkTree *@var{tree}, GList *@var{items}) @end deftypefun @deftypefun void gtk_tree_select_child (GtkTree *@var{tree}, GtkWidget *@var{child}) @end deftypefun @deftypefun void gtk_tree_select_item (GtkTree *@var{tree}, gint @var{item}) @end deftypefun @deftypefun void gtk_tree_unselect_child (GtkTree *@var{tree}, GtkWidget *@var{child}) @end deftypefun @deftypefun void gtk_tree_unselect_item (GtkTree *@var{tree}, gint @var{item}) @end deftypefun @deftypefun void gtk_tree_set_selection_mode (GtkTree *@var{tree}, GtkSelectionMode @var{mode}) @end deftypefun @deftypefun void gtk_tree_set_view_mode (GtkTree *@var{tree}, GtkTreeViewMode @var{mode}) @end deftypefun @deftypefun void gtk_tree_set_view_lines (GtkTree *@var{tree}, guint @var{flag}) @end deftypefun @gtkstdmacros{Tree, TREE} @page @node GtkTreeItem, GtkVBox, GtkTree, Widgets @comment node-name, next, previous, up @section The tree item widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_tree_item_get_type (void) Returns the @code{GtkTreeItem} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_tree_item_new (void) Create a new @code{GtkTreeItem} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun GtkWidget* gtk_tree_item_new_with_label (gchar *@var{label}) Create a new @code{GtkTreeItem} object initializing it with the values in @var{label}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_tree_item_set_subtree (GtkTreeItem *@var{tree_item}, GtkWidget *@var{subtree}) @end deftypefun @deftypefun void gtk_tree_item_select (GtkTreeItem *@var{tree_item}) @end deftypefun @deftypefun void gtk_tree_item_deselect (GtkTreeItem *@var{tree_item}) @end deftypefun @deftypefun void gtk_tree_item_expand (GtkTreeItem *@var{tree_item}) @end deftypefun @deftypefun void gtk_tree_item_collapse (GtkTreeItem *@var{tree_item}) @end deftypefun @deftypefun void gtk_tree_item_remove_subtree (GtkTreeItem *@var{item}) @end deftypefun @gtkstdmacros{TreeItem, TREE_ITEM} @page @node GtkVBox, GtkVButtonBox, GtkTreeItem, Widgets @comment node-name, next, previous, up @section The vertical box widget @subsection Description @subsection Options @defopt homogeneous This option controls whether each object in the box has the same size. In the case of the @code{GtkVBox}, this refers to the height. If this option is set then the @var{expand} option to the @code{gtk_box_pack} (@pxref{GtkBox}) routines is always turned on. @end defopt @defopt spacing This option sets the amount of space that is added between the objects packed into this @code{GtkVBox} object. @end defopt @subsection Signals This widget does not define any new signals. @subsection Functions @deftypefun guint gtk_vbox_get_type (void) Returns the @code{GtkVBox} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_vbox_new (gint @var{homogeneous}, gint @var{spacing}) Create a new @code{GtkVBox} object initializing it with the values in @var{homogeneous} and @var{spacing}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @gtkstdmacros{VBox, VBOX} @page @node GtkVButtonBox, GtkViewport, GtkVBox, Widgets @comment node-name, next, previous, up @section The vertical button box widget @subsection Description @subsection Options @defopt spacing @end defopt @defopt layout @end defopt @subsection Signals @subsection Functions @deftypefun guint gtk_vbutton_box_get_type (void) Returns the @code{GtkVButtonBox} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_vbutton_box_new (void) Create a new @code{GtkVButtonBox} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @deftypefun void gtk_vbutton_box_set_spacing_default (gint @var{spacing}) @end deftypefun @deftypefun void gtk_vbutton_box_set_layout_default (gint @var{layout}) @end deftypefun @deftypefun gint gtk_vbutton_box_get_spacing_default (void) @end deftypefun @deftypefun gint gtk_vbutton_box_get_layout_default (void) @end deftypefun @gtkstdmacros{VButtonBox, VBUTTON_BOX} @page @node GtkViewport, GtkVPaned, GtkVButtonBox, Widgets @comment node-name, next, previous, up @section The viewport widget @subsection Description @subsection Signals @subsection Functions @deftypefun guint gtk_viewport_get_type (void) Returns the @code{GtkViewport} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_viewport_new (GtkAdjustment *@var{hadjustment}, GtkAdjustment *@var{vadjustment}) @end deftypefun @deftypefun GtkAdjustment* gtk_viewport_get_hadjustment (GtkViewport *@var{viewport}) @end deftypefun @deftypefun GtkAdjustment* gtk_viewport_get_vadjustment (GtkViewport *@var{viewport}) @end deftypefun @deftypefun void gtk_viewport_set_hadjustment (GtkViewport *@var{viewport}, GtkAdjustment *@var{adjustment}) @end deftypefun @deftypefun void gtk_viewport_set_vadjustment (GtkViewport *@var{viewport}, GtkAdjustment *@var{adjustment}) @end deftypefun @deftypefun void gtk_viewport_set_shadow_type (GtkViewport *@var{viewport}, GtkShadowType @var{type}) @end deftypefun @gtkstdmacros{Viewport, VIEWPORT} @page @node GtkVPaned, GtkVRuler, GtkViewport, Widgets @comment node-name, next, previous, up @section The vertical paned widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_vpaned_get_type (void) Returns the @code{GtkVPaned} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_vpaned_new (void) Create a new @code{GtkVPaned} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @gtkstdmacros{VPaned, VPANED} @page @node GtkVRuler, GtkVScale, GtkVPaned, Widgets @comment node-name, next, previous, up @section The vertical ruler widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_vruler_get_type (void) Returns the @code{GtkVRuler} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_vruler_new (void) Create a new @code{GtkVRuler} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @gtkstdmacros{VRuler, VRULER} @page @node GtkVScale, GtkVScrollbar, GtkVRuler, Widgets @comment node-name, next, previous, up @section The vertical ruler widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_vscale_get_type (void) Returns the @code{GtkVScale} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_vscale_new (GtkAdjustment *@var{adjustment}) Create a new @code{GtkVScale} object returning the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @gtkstdmacros{VScale, VSCALE} @page @node GtkVScrollbar, GtkVSeparator, GtkVScale, Widgets @comment node-name, next, previous, up @section The vertical scrollbar widget @subsection Description @subsection Options @subsection Signals @subsection Functions @deftypefun guint gtk_vscrollbar_get_type (void) Returns the @code{GtkVScrollbar} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_vscrollbar_new (GtkAdjustment *@var{adjustment}) Create a new @code{GtkVScrollbar} object initializing it with the values in @var{adjustment}. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @gtkstdmacros{VScrollbar, VSCROLLBAR} @page @node GtkVSeparator, GtkWidget, GtkVScrollbar, Widgets @comment node-name, next, previous, up @section The vertical separator widget @subsection Description @subsection Signals @subsection Functions @deftypefun guint gtk_vseparator_get_type (void) Returns the @code{GtkVSeparator} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_vseparator_new (void) Create a new @code{GtkVSeparator} object and return the new widget as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. @end deftypefun @gtkstdmacros{VSeparator, VSEPARATOR} @page @node GtkWidget, GtkWindow, GtkVSeparator, Widgets @comment node-name, next, previous, up @section The base widget @subsection Description @subsection Signals @deftypefn Signal void GtkWidget::show (GtkWidget *@var{widget}) @end deftypefn @deftypefn Signal void GtkWidget::hide (GtkWidget *@var{widget}) @end deftypefn @deftypefn Signal void GtkWidget::map (GtkWidget *@var{widget}) @end deftypefn @deftypefn Signal void GtkWidget::unmap (GtkWidget *@var{widget}) @end deftypefn @deftypefn Signal void GtkWidget::realize (GtkWidget *@var{widget}) @end deftypefn @deftypefn Signal void GtkWidget::unrealize (GtkWidget *@var{widget}) @end deftypefn @deftypefn Signal void GtkWidget::draw (GtkWidget *@var{widget}, GdkRectangle *@var{area}) @end deftypefn @deftypefn Signal void GtkWidget::draw_focus (GtkWidget *@var{widget}) @end deftypefn @deftypefn Signal void GtkWidget::draw_default (GtkWidget *@var{widget}) @end deftypefn @deftypefn Signal void GtkWidget::size_request (GtkWidget *@var{widget}, GtkRequisition *@var{requisition}) @end deftypefn @deftypefn Signal void GtkWidget::size_allocate (GtkWidget *@var{widget}, GtkAllocation *@var{allocation}) @end deftypefn @deftypefn Signal void GtkWidget::state_changed (GtkWidget *@var{widget}) @end deftypefn @deftypefn Signal gint GtkWidget::install_accelerator (GtkWidget *@var{widget}, gchar *@var{signal_name}, gchar @var{key}, guint8 @var{modifiers}) @end deftypefn @deftypefn Signal void GtkWidget::remove_accelerator (GtkWidget *@var{widget}, gchar *@var{signal_name}) @end deftypefn @deftypefn Signal gint GtkWidget::event (GtkWidget *@var{widget}, GdkEvent *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::button_press_event (GtkWidget *@var{widget}, GdkEventButton *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::button_release_event (GtkWidget *@var{widget}, GdkEventButton *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::motion_notify_event (GtkWidget *@var{widget}, GdkEventMotion *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::delete_event (GtkWidget *@var{widget}, GdkEventAny *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::destroy_event (GtkWidget *@var{widget}, GdkEventAny *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::expose_event (GtkWidget *@var{widget}, GdkEventExpose *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::key_press_event (GtkWidget *@var{widget}, GdkEventKey *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::key_release_event (GtkWidget *@var{widget}, GdkEventKey *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::enter_notify_event (GtkWidget *@var{widget}, GdkEventCrossing *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::leave_notify_event (GtkWidget *@var{widget}, GdkEventCrossing *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::configure_event (GtkWidget *@var{widget}, GdkEventConfigure *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::focus_in_event (GtkWidget *@var{widget}, GdkEventFocus *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::focus_out_event (GtkWidget *@var{widget}, GdkEventFocus *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::map_event (GtkWidget *@var{widget}, GdkEventAny *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::unmap_event (GtkWidget *@var{widget}, GdkEventAny *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::property_notify_event (GtkWidget *@var{widget}, GdkEventProperty *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::selection_clear_event (GtkWidget *@var{widget}, GdkEventSelection *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::selection_request_event (GtkWidget *@var{widget}, GdkEventSelection *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::selection_notify_event (GtkWidget *@var{widget}, GdkEventSelection *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::drop_event (GtkWidget *@var{widget}, GdkEventDrop *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::drag_begin_event (GtkWidget *@var{widget}, GdkEventDragBegin *@var{event}) @end deftypefn @deftypefn Signal gint GtkWidget::other_event (GtkWidget *@var{widget}, GdkEventOther *@var{event}) @end deftypefn @subsection Functions @deftypefun guint gtk_widget_get_type (void) Returns the @code{GtkWidget} type identifier. @end deftypefun @deftypefun void gtk_widget_class_init (GtkWidgetClass *@var{class}) @end deftypefun @deftypefun void gtk_widget_init (GtkWidget *@var{widget}) @end deftypefun @deftypefun void gtk_widget_destroy (GtkWidget *@var{widget}) @end deftypefun @deftypefun void gtk_widget_show (GtkWidget *@var{widget}) @end deftypefun @deftypefun void gtk_widget_hide (GtkWidget *@var{widget}) @end deftypefun @deftypefun void gtk_widget_map (GtkWidget *@var{widget}) @end deftypefun @deftypefun void gtk_widget_unmap (GtkWidget *@var{widget}) @end deftypefun @deftypefun void gtk_widget_realize (GtkWidget *@var{widget}) @end deftypefun @deftypefun void gtk_widget_unrealize (GtkWidget *@var{widget}) @end deftypefun @deftypefun void gtk_widget_draw (GtkWidget *@var{widget}, GdkRectangle *@var{area}) @end deftypefun @deftypefun void gtk_widget_draw_focus (GtkWidget *@var{widget}) @end deftypefun @deftypefun void gtk_widget_draw_children (GtkWidget *@var{widget}) @end deftypefun @deftypefun void gtk_widget_size_request (GtkWidget *@var{widget}, GtkRequisition *@var{requisition}) @end deftypefun @deftypefun void gtk_widget_size_allocate (GtkWidget *@var{widget}, GtkAllocation *@var{allocation}) @end deftypefun @deftypefun void gtk_widget_install_accelerator (GtkWidget *@var{widget}, GtkAcceleratorTable *@var{table}, gchar *@var{signal_name}, gchar @var{key}, guint8 @var{modifiers}) @end deftypefun @deftypefun void gtk_widget_remove_accelerator (GtkWidget *@var{widget}, GtkAcceleratorTable *@var{table}, gchar *@var{signal_name}) @end deftypefun @deftypefun gint gtk_widget_event (GtkWidget *@var{widget}, GdkEvent *@var{event}) @end deftypefun @deftypefun void gtk_widget_reparent (GtkWidget *@var{widget}, GtkWidget *@var{new_parent}) @end deftypefun @deftypefun void gtk_widget_popup (GtkWidget *@var{widget}, gint @var{x}, gint @var{y}) @end deftypefun @deftypefun gint gtk_widget_intersect (GtkWidget *@var{widget}, GdkRectangle *@var{area}, GdkRectangle *@var{intersection}) @end deftypefun @deftypefun void gtk_widget_grab_focus (GtkWidget *@var{widget}) @end deftypefun @deftypefun void gtk_widget_grab_default (GtkWidget *@var{widget}) @end deftypefun @deftypefun void gtk_widget_restore_state (GtkWidget *@var{widget}) @end deftypefun @deftypefun void gtk_widget_set_name (GtkWidget *@var{widget}, gchar *@var{name}) @end deftypefun @deftypefun void gtk_widget_set_state (GtkWidget *@var{widget}, GtkStateType @var{state}) @end deftypefun @deftypefun void gtk_widget_set_sensitive (GtkWidget *@var{widget}, gint sensitive) @end deftypefun @deftypefun void gtk_widget_set_parent (GtkWidget *@var{widget}, GtkWidget *@var{parent}) @end deftypefun @deftypefun void gtk_widget_set_style (GtkWidget *@var{widget}, GtkStyle *@var{style}) @end deftypefun @deftypefun void gtk_widget_set_uposition (GtkWidget *@var{widget}, gint @var{x}, gint @var{y}) @end deftypefun @deftypefun void gtk_widget_set_usize (GtkWidget *@var{widget}, gint @var{width}, gint @var{height}) @end deftypefun @deftypefun GtkWidget* gtk_widget_get_toplevel (GtkWidget *@var{widget}) @end deftypefun @deftypefun GtkWidget* gtk_widget_get_ancestor (GtkWidget *@var{widget}, gint @var{type}) @end deftypefun @deftypefun GdkColormap* gtk_widget_get_colormap (GtkWidget *@var{widget}) @end deftypefun @deftypefun GdkVisual* gtk_widget_get_visual (GtkWidget *@var{visual}) @end deftypefun @deftypefun GtkStyle* gtk_widget_get_style (GtkWidget *@var{style}) @end deftypefun @gtkstdmacros{Widget, WIDGET} @page @node GtkWindow, , GtkWidget, Widgets @comment node-name, next, previous, up @section The window widget @subsection Description @subsection Options @defopt type The @var{type} options specify how this widget will interact with the window manager. Currently the following types and the effect they have on the window to window manager interaction is as follows. @itemize @bullet @item @code{GTK_WINDOW_TOPLEVEL} @itemize @bullet @item The option @code{GTK_WINDOW_TOPLEVEL} is usually used for the main application window that will remain for the entire application run. @end itemize @item @code{GTK_WINDOW_DIALOG} @itemize @bullet @item The option @code{GTK_WINDOW_DIALOG} is usually used for transient windows. These windows will open up, gather some input or provide some application specific updates, then close. The window manager is free not to provide all the 'normal' window functions to this window. @end itemize @item @code{GTK_WINDOW_POPUP} @itemize @bullet @item The option @code{GTK_WINDOW_POPUP} is usually used for transient windows. These windows are typically used for when no user interaction is required, to notify the user of some condition. Other uses for these types of windows are for 'about windows', startup windows and the like. Typically the window manager will @strong{not} provide the usual widgets that surround the window. At the most all that will be provided is a border. Also note that windows that set this @var{type} will not be in any window list of the window manager. Though this window will @strong{not} get the kill and close widgets of the window manager they still can receive said events and should be taken into account. @end itemize @end itemize @end defopt @defopt title The @var{title} option will set the title of the window in the window manager. @strong{Note:} On windows that have the @var{type} option set to @code{GTK_WINDOW_POPUP} there is a strong possibility that this will text will not be seen. @end defopt @defopt position The @var{position} option will determine where the window will be displayed when it is finally drawn to the screen. Currently the following positions and the effect they have on window placement can be specified. @itemize @bullet @item @code{GTK_WIN_POS_NONE} @itemize @bullet @item This @var{position} type will allow the window manager full freedom, depending on the current settings in the window manager. As to where the window will be placed. @end itemize @item @code{GTK_WIN_POS_CENTER} @itemize @bullet @item This @var{position} option will cause the window to center itself on the the screen. This option setting will take into account the @var{virtual screen} size when calculating the center. This is @strong{not} the same as the @var{virtual desktop} setting of many window managers. It will center itself on the current @var{virtual desktop}. @end itemize @item @code{GTK_WIN_POS_MOUSE} @itemize @bullet This @var{position} option will cause the window to center itself under the mouse pointers' current location. Typical uses for this setting is in warning/error/informational dialogs where user interaction is desired. @end itemize @end itemize @end defopt @subsection Signals @deftypefn Signal void GtkWindow::move_resize (GtkWindow *@var{window}, gint *@var{x}, gint *@var{y}, gint @var{width}, gint @var{height}) @end deftypefn @deftypefn Signal void GtkWindow::set_focus (GtkWindow *@var{window}, GtkWidget *@var{focus}) @end deftypefn @subsection Functions @deftypefun guint gtk_window_get_type (void) Returns the @code{GtkWindow} type identifier. @end deftypefun @deftypefun GtkWidget* gtk_window_new (GtkWindowType @var{type}) Create a new @code{GtkWindow} object. The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure. The @var{type} can be one of @code{GTK_WINDOW_TOPLEVEL}, @code{GTK_WINDOW_DIALOG} or, @code{GTK_WINDOW_POPUP}. The @var{type} value determines how this widget will interact with the window manager. @end deftypefun @deftypefun void gtk_window_set_title (GtkWindow *@var{window}, gchar *@var{title}) Set the title of this window to the text in the @var{title} argument. It is important to not set the fields of the @code{GtkWindow} structure directly. @end deftypefun @deftypefun void gtk_window_set_focus (GtkWindow *@var{window}, GtkWidget *@var{focus}) @end deftypefun @deftypefun void gtk_window_set_default (GtkWindow *@var{window}, GtkWidget *@var{defaultw}) @end deftypefun @deftypefun void gtk_window_set_policy (GtkWindow *@var{window}, gint @var{allow_shrink}, gint @var{allow_grow}, gint @var{auto_shrink}) @end deftypefun @deftypefun void gtk_window_add_accelerator_table (GtkWindow *@var{window}, GtkAcceleratorTable *@var{table}) @end deftypefun @deftypefun void gtk_window_remove_accelerator_table (GtkWindow *@var{window}, GtkAcceleratorTable *@var{table}) @end deftypefun @deftypefun void gtk_window_position (GtkWindow *@var{window}, GtkWindowPosition @var{position}) Set the position that the window will be at when it is finally drawn to the screen. The @var{position} argument effects the the position as described above. @end deftypefun @gtkstdmacros{Window, WINDOW} @node Other Objects, Miscellaneous, Widgets, Top @comment node-name, next, previous, up @chapter Utility objects @menu * GtkAcceleratorTable:: The accelerator table object. * GtkAdjustment:: The adjustment object. * GtkGC:: The GC object. * GtkData:: The data object. * GtkStyle:: The style object. @end menu @node GtkAcceleratorTable, GtkAdjustment, Other Objects, Other Objects @comment node-name, next, previous, up @section The accelerator table object @subsection Description @subsection Functions @deftypefun GtkAcceleratorTable* gtk_accelerator_table_new (void) @end deftypefun @deftypefun GtkAcceleratorTable* gtk_accelerator_table_find (GtkObject *@var{object}, gchar *@var{signal_name}, guchar @var{accelerator_key}, guint8 @var{accelerator_mods}) @end deftypefun @deftypefun GtkAccelerator *gtk_accelerator_table_ref (GtkAcceleratorTable *@var{table}) @end deftypefun @deftypefun void gtk_accelerator_table_unref (GtkAcceleratorTable *@var{table}) @end deftypefun @deftypefun void gtk_accelerator_table_install (GtkAcceleratorTable *@var{table}, GtkObject *@var{object}, gchar *@var{signal_name}, guchar @var{accelerator_key}, guint8 @var{accelerator_mods}) @end deftypefun @deftypefun void gtk_accelerator_table_remove (GtkAcceleratorTable *@var{table}, GtkObject *@var{object}, gchar *@var{signal_name}) @end deftypefun @deftypefun void gtk_accelerator_table_check (GtkAcceleratorTable *@var{table}, guchar @var{accelerator_key}, guint8 @var{accelerator_mods}) @end deftypefun @deftypefun void gtk_accelerator_table_set_mod_mask (GtkAcceleratorTable *@var{table}, guint8 @var{modifier_mask}) @end deftypefun @page @node GtkAdjustment, GtkGC, GtkAcceleratorTable, Other Objects @comment node-name, next, previous, up @section The adjustment object @subsection Description @subsection Functions @deftypefun guint gtk_adjustment_get_type (void) Returns the @code{GtkAdjustment} type identifier. @end deftypefun @deftypefun GtkObject* gtk_adjustment_new (gfloat @var{value}, gfloat @var{lower}, gfloat @var{upper}, gfloat @var{step_increment}, gfloat @var{page_increment}, gfloat @var{page_size}) @end deftypefun @gtkstdmacros{GtkAdjustment, ADJUSTMENT} @page @node GtkGC, GtkData, GtkAdjustment, Other Objects @section The GC object @subsection Description @subsection Functions @deftypefun GdkGC* gtk_gc_get (gint @var{depth}, GdkColormap *@var{colormap}, GdkGCValues *@var{values}, GdkGCValuesMask @var{values_mask}) @end deftypefun @deftypefun void gtk_gc_release (GdkGC *@var{gc}) @end deftypefun @page @node GtkData, GtkStyle, GtkGC, Other Objects @comment node-name, next, previous, up @section The data object @subsection Description @subsection Functions @deftypefun guint gtk_data_get_type (void) Returns the @code{GtkData} type identifier. @end deftypefun @gtkstdmacros{Data, DATA} @page @node GtkStyle, , GtkData, Other Objects @section The style object @subsection Description @subsection Functions @page @node Miscellaneous, Examples, Other Objects, Top @comment node-name, next, previous, up @chapter Initialization, exit and other features @menu * Initialization and exit:: Initializing and exiting GTK. * Customization:: Customizing the library. * Menu Factories:: Simplified menu creation. * Tree Factories:: Simplified tree creation. * Tool Tips:: Pop up help mechanism. * Resource Files:: Resource files. * Standard Macros:: Macros defined by all objects. @end menu @node Initialization and exit, Customization, Miscellaneous, Miscellaneous @comment node-name, next, previous, up @section Initializing and exiting GTK @subsection Initializing Before any GTK functions can be utilized the library must be initialized. This can be accomplished by calling the @code{gtk_init} function. The arguments you pass to this function should be the same arguments that were passed to your application. This function will parse the arguments that it understands and handle initializing the GDK library for you. @subsection Exiting @subsection Functions @deftypefun void gtk_init (int *@var{argc}, char **@var{argv}) Function to initialize GTK and GDK for you. This function will remove any command line arguments from @var{argc} and @var{argv} that it understands. @example int main (int argc, char *argv[]) @{ @dots{Any local variables or non GTK/GDK initialization} /* Initialize GTK. */ gtk_init(&argc, &argc); @} @end example @end deftypefun @deftypefun void gtk_exit (int @var{error_code}) Exit GTK and perform any necessary cleanup. @code{gtk_exit} will call the systems @code{exit} function passing @var{error_code} as the parameter. @end deftypefun @deftypefun gint gtk_events_pending (void) Returns the number of events pending on the event queue. @end deftypefun @deftypefun void gtk_main (void) @end deftypefun @deftypefun guint gtk_main_level (void) @end deftypefun @deftypefun void gtk_main_quit (void) A call to this function will cause the @code{gtk_main} function to exit, thereby allowing your application to exit. @end deftypefun @page @node Customization, Menu Factories, Initialization and exit, Miscellaneous @comment node-name, next, previous, up @section Customization of the library @subsection Description Like other X-windows applications the GTK library provides a way for the user and application programmer to change the colors of just about any widget. You can also specify what pixmap should be tiled onto the background of some widgets. All this is handled through a similar method as in the standard X-windows environment, through the use of 'rc' files. The format and functions available in these files is discussed below. @subsection Functions The following functions are available to handle the rc files. @deftypefun void gtk_rc_parse (char *@var{filename}) This function will parse the @var{filename} that is passed to it as its argument. It will use the style settings for the widget types defined there. @end deftypefun @deftypefun void gtk_rc_init (void) This function will initialize the rc file parser, normally this need not be called directly as the @code{gtk_rc_parse} function will handle this for you. @end deftypefun @page @node Menu Factories, Tree Factories, Customization, Miscellaneous @comment node-name, next, previous, up @section Simplified menu creation @page @node Tree Factories, Tool Tips, Menu Factories, Miscellaneous @comment node-name, next, previous, up @section Simplified tree creation @page @node Tool Tips, Resource Files, Tree Factories, Miscellaneous @comment node-name, next, previous, up @section Pop up help mechanism @subsection Description @page @node Resource Files, Standard Macros, Tool Tips, Miscellaneous @comment node-name, next, previous, up @section Resource Files @page @node Standard Macros, , Resource Files, Miscellaneous @comment node-name, next, previous, up @section Macros defined by all objects There are three macros that are defined by all object types. The first two are used for performing casts and the last is for querying whether an object is of a particular type. These macros are both conveniences and debugging tools. If the GTK library was compiled with @code{NDEBUG} defined as a preprocessor symbol (via the -DNDEBUG to cc), then the macros check the object type and emit a warning if the cast is invalid. Doing such checking is fairly expensive since the cast macros are used everywhere in GTK and would normally be turned off in a public release of a product. Note: The functions below are indeed macros, but they may be considered functions for most purposes. @deftypefun Gtk* GTK_ (gpointer @var{obj}) Cast a generic pointer to @code{Gtk*}. This function is provided in order to be able to provide checking during development stages of code development since it is possible to examine the actual type of object (using @code{gtk_type_is_a}) before performing the cast. @end deftypefun @deftypefun GtkClass* GTK__CLASS (gpointer @var{class}) Cast a generic pointer to @code{GtkClass*}. Like @code{GTK_}, this function is, in reality, a macro. @end deftypefun @deftypefun gint GTK_IS_ (gpointer @var{obj}) Determine if a generic pointer refers to a @code{Gtk} object. This function is, in reality, a macro wrapper around the @code{gtk_type_is_a} function (@pxref{Types}). @end deftypefun @node Examples, Object Implementation, Miscellaneous, Top @comment node-name, next, previous, up @chapter Using GTK @cindex Using GTK @menu * Simple:: The simplest GTK program. * Hello World:: Hello world in GTK. * Hello World II:: An enhanced hello world. * Hello World III:: Making Hello World II robust. @end menu @node Simple, Hello World, Examples, Examples @comment node-name, next, previous, up @section The simplest GTK program The 16 line GTK program shown below is just about the simplest possible program which uses GTK. (Well, technically, you don't have to create the window and it would still be a program which uses GTK). The program, when compiled and run, will create a single window 200x200 pixels in size. The program does not exit until its is explicitly killed using the shell or a window manager function. @example #include int main (int argc, char *argv[]) @{ GtkWidget *window; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_show (window); gtk_main (); return 0; @} @end example The first point of interest in this program is the standard initialization line. @example gtk_init (&argc, &argv); @end example Almost every GTK program will contain such a line. GTK will initialize itself and GDK and remove any command line arguments it recognizes from @var{argc} and @var{argv}. The next two lines of code create and display a window. @example window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_show (window); @end example The @code{GTK_WINDOW_TOPLEVEL} argument specifies that we want the window to undergo window manager decoration and placement. One might be lead to think that the window, since it has no children, would be 0x0 pixels in size. But, this is not the case because a window that has no children defaults to 200x200 pixels in size. Mainly because 0x0 windows are annoying to manipulate or even see in some cases. The last line enters the GTK main processing loop. @example gtk_main (); @end example Normally, @code{gtk_main} is called once and the program should exit when it returns. @xref{Initialization and exit}. @node Hello World, Hello World II, Simple, Examples @comment node-name, next, previous, up @section Hello world in GTK @example #include int main (int argc, char *argv[]) @{ GtkWidget *window; GtkWidget *label; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_border_width (GTK_CONTAINER (window), 10); label = gtk_label_new ("Hello World"); gtk_container_add (GTK_CONTAINER (window), label); gtk_widget_show (label); gtk_widget_show (window); gtk_main (); return 0; @} @end example @node Hello World II, Hello World III, Hello World, Examples @comment node-name, next, previous, up @section An enhanced hello world @example #include "gtk.h" void hello (void) @{ g_print ("Hello World\n"); gtk_exit (0); @} int main (int argc, char *argv[]) @{ GtkWidget *window; GtkWidget *button; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_border_width (GTK_CONTAINER (window), 10); button = gtk_button_new_with_label ("Hello World"); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (hello), NULL); gtk_container_add (GTK_CONTAINER (window), button); gtk_widget_show (button); gtk_widget_show (window); gtk_main (); return 0; @} @end example @node Hello World III, , Hello World II, Examples @comment node-name, next, previous, up @section Making Hello World II robust @example #include "gtk.h" void hello (void) @{ g_print ("Hello World\n"); gtk_exit (0); @} void destroy (void) @{ gtk_exit (0); @} int main (int argc, char *argv[]) @{ GtkWidget *window; GtkWidget *button; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (destroy), NULL); gtk_container_border_width (GTK_CONTAINER (window), 10); button = gtk_button_new_with_label ("Hello World"); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (hello), NULL); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); gtk_container_add (GTK_CONTAINER (window), button); gtk_widget_show (button); gtk_widget_show (window); gtk_main (); return 0; @} @end example @node Object Implementation, Signal Implementation, Examples, Top @comment node-name, next, previous, up @chapter Object internals @cindex Object Implementation Objects (or the @code{GtkObject} type) and the class hierarchy in general is implemented via a hierarchy of structs and type casting. Be aware that when classes are mentioned it is the conceptual idea of classes that is being referred to. GTK is written entirely in C which provides no direct support for classes. The first part to the class mechanism is the object fields. These are fields that will be used on a per object basis. For example, the widget type contains a field for the widgets parent. Every derived type needs a reference to its parent type. A descendant class of @code{GtkObject} would define itself like: @example struct Descendant @{ GtkObject object; @dots{} @}; @end example It is important to note that the @code{GtkObject} field needs to appear first in the descendant type structure. This allows pointers to objects of type @code{Descendant} to be cast to pointers to @code{GtkObject}'s and vice-versa. The second part to the class mechanism is the class fields. These fields are defined on a per class basis. In the case of widgets, the class fields are all the ``virtual'' functions for widgets. The @code{GtkObject} class defines the @code{destroy} virtual function and the necessary fields for the signal mechanism as well as a field for determining the runtime type of an object. A virtual function is semantically the same as it is in C++. That is, the actual function that is called is determined based on the type of the object. Or, more specifically, the actual function call depends on the class structure that is pointed to by the @code{klass} field of the @code{GtkObject} structure. To see how the class fields work it is necessary to see the object fields for a @code{GtkObject}. The @code{GtkObject} type is defined as follows: @example typedef struct _GtkObject GtkObject; struct _GtkObject @{ guint32 flags; GtkObjectClass *klass; gpointer object_data; @}; @end example The @code{class} field actually points to a class structure derived from @code{GtkObjectClass}. By convention, each new type defines its own class structure even if it is unnecessary. As an example, the hypothetical @code{Descendant} class would define its class structure as: @example struct DescendantClass @{ GtkObjectClass parent_class; @dots{} @}; @end example It is convention to name the parent class field (@code{GtkObjectClass} in this case), @code{parent_class}. For the same reason as stated above for the object structure, the parent class field must be the first field in the class structure. @strong{Note:} GTK assumes that the first field in a structure will be placed by the compiler at the start of the structure. This is certainly true for gcc, however, from my precursory reading of the C standard I was unable to come to a definite conclusion as to whether this was required or simply done for simplicity. I'm not too worried about this assumption, though, as every C compiler I've ever encountered would work with GTK. The @code{flags} field of the @code{GtkObject} structure is used to keep track of a relatively few object flags and is also used by the @code{GtkWidget} type to store additional flags. At this time, the upper 16 bits of the flags field are reserved but unused. The @code{object_data} field of the @code{GtkObject} structure is an opaque pointer used by the object data mechanism. In truth, it is a pointer to the beginning of the data list which is composed of the following structures. @example typedef struct _GtkObjectData GtkObjectData; struct _GtkObjectData @{ guint id; gpointer data; GtkObjectData *next; @}; @end example The data mechanism allows arbitrary data to be associated with a character string key in any object. A hash table is used to transform the character string key into the data id and then a search through the list is made to see if the data exists. The assumption being that the data list will usually be short and therefore a linear search is OK. Future work on the data mechanism might make use of a resizable array instead of a linked list. This would shrink the overhead of the @code{GtkObjectData} structure by 4 bytes on 32 bit architectures. @node Signal Implementation, Widget Implementation, Object Implementation, Top @comment node-name, next, previous, up @chapter Signal internals @cindex Signal Implementation @node Widget Implementation, Function Index, Signal Implementation, Top @comment node-name, next, previous, up @chapter Widget internals @cindex Widget Implementation @node Function Index, Concept Index, Widget Implementation, Top @comment node-name, next, previous, up @unnumbered Function Index @printindex fn @node Concept Index, , Function Index, Top @comment node-name, next, previous, up @unnumbered Concept Index @printindex cp @summarycontents @contents @bye @c LocalWords: Gtk API formalistic 0707010001bb01000081a40000000a0000000a000000013d12d39d000977bc0000008800000003000000000000000000000020ff350892reloc/doc/gtk/docs/gtk_tut.sgml
GTK v1.2 Tutorial <author> Tony Gale <tt><htmlurl url="mailto:gale@gtk.org" name="<gale@gtk.org>"></tt>, Ian Main <tt><htmlurl url="mailto:imain@gtk.org" name="<imain@gtk.org>"></tt> <date>February 23rd, 2000 <abstract> This is a tutorial on how to use GTK (the GIMP Toolkit) through its C interface. </abstract> <!-- Table of contents --> <!-- Older versions of this tutorial did not have a table of contents, but the tutorial is now so large that having one is very useful. --> <toc> <!-- ***************************************************************** --> <sect>Introduction <!-- ***************************************************************** --> <p> GTK (GIMP Toolkit) is a library for creating graphical user interfaces. It is licensed using the LGPL license, so you can develop open software, free software, or even commercial non-free software using GTK without having to spend anything for licenses or royalties. It's called the GIMP toolkit because it was originally written for developing the GNU Image Manipulation Program (GIMP), but GTK has now been used in a large number of software projects, including the GNU Network Object Model Environment (GNOME) project. GTK is built on top of GDK (GIMP Drawing Kit) which is basically a wrapper around the low-level functions for accessing the underlying windowing functions (Xlib in the case of the X windows system). The primary authors of GTK are: <itemize> <item> Peter Mattis <tt><htmlurl url="mailto:petm@xcf.berkeley.edu" name="petm@xcf.berkeley.edu"></tt> <item> Spencer Kimball <tt><htmlurl url="mailto:spencer@xcf.berkeley.edu" name="spencer@xcf.berkeley.edu"></tt> <item> Josh MacDonald <tt><htmlurl url="mailto:jmacd@xcf.berkeley.edu" name="jmacd@xcf.berkeley.edu"></tt> </itemize> GTK is essentially an object oriented application programmers interface (API). Although written completely in C, it is implemented using the idea of classes and callback functions (pointers to functions). There is also a third component called GLib which contains a few replacements for some standard calls, as well as some additional functions for handling linked lists, etc. The replacement functions are used to increase GTK's portability, as some of the functions implemented here are not available or are nonstandard on other unixes such as g_strerror(). Some also contain enhancements to the libc versions, such as g_malloc that has enhanced debugging utilities. This tutorial describes the C interface to GTK. There are GTK bindings for many other languages including C++, Guile, Perl, Python, TOM, Ada95, Objective C, Free Pascal, and Eiffel. If you intend to use another language's bindings to GTK, look at that binding's documentation first. In some cases that documentation may describe some important conventions (which you should know first) and then refer you back to this tutorial. There are also some cross-platform APIs (such as wxWindows and V) which use GTK as one of their target platforms; again, consult their documentation first. If you're developing your GTK application in C++, a few extra notes are in order. There's a C++ binding to GTK called GTK--, which provides a more C++-like interface to GTK; you should probably look into this instead. If you don't like that approach for whatever reason, there are two alternatives for using GTK. First, you can use only the C subset of C++ when interfacing with GTK and then use the C interface as described in this tutorial. Second, you can use GTK and C++ together by declaring all callbacks as static functions in C++ classes, and again calling GTK using its C interface. If you choose this last approach, you can include as the callback's data value a pointer to the object to be manipulated (the so-called "this" value). Selecting between these options is simply a matter of preference, since in all three approaches you get C++ and GTK. None of these approaches requires the use of a specialized preprocessor, so no matter what you choose you can use standard C++ with GTK. This tutorial is an attempt to document as much as possible of GTK, but it is by no means complete. This tutorial assumes a good understanding of C, and how to create C programs. It would be a great benefit for the reader to have previous X programming experience, but it shouldn't be necessary. If you are learning GTK as your first widget set, please comment on how you found this tutorial, and what you had trouble with. There are also C++, Objective C, ADA, Guile and other language bindings available, but I don't follow these. This document is a "work in progress". Please look for updates on <htmlurl url="http://www.gtk.org/" name="http://www.gtk.org/">. I would very much like to hear of any problems you have learning GTK from this document, and would appreciate input as to how it may be improved. Please see the section on <ref id="sec_Contributing" name="Contributing"> for further information. <!-- ***************************************************************** --> <sect>Getting Started <!-- ***************************************************************** --> <p> The first thing to do, of course, is download the GTK source and install it. You can always get the latest version from ftp.gtk.org in /pub/gtk. You can also view other sources of GTK information on <htmlurl url="http://www.gtk.org/" name="http://www.gtk.org/">. GTK uses GNU autoconf for configuration. Once untar'd, type ./configure --help to see a list of options. The GTK source distribution also contains the complete source to all of the examples used in this tutorial, along with Makefiles to aid compilation. To begin our introduction to GTK, we'll start with the simplest program possible. This program will create a 200x200 pixel window and has no way of exiting except to be killed by using the shell. <tscreen><verb> /* example-start base base.c */ #include <gtk/gtk.h> int main( int argc, char *argv[] ) { GtkWidget *window; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_show (window); gtk_main (); return(0); } /* example-end */ </verb></tscreen> You can compile the above program with gcc using: <tscreen><verb> gcc base.c -o base `gtk-config --cflags --libs` </verb></tscreen> The meaning of the unusual compilation options is explained below in <ref id="sec_compiling" name="Compiling Hello World">. All programs will of course include gtk/gtk.h which declares the variables, functions, structures, etc. that will be used in your GTK application. The next line: <tscreen><verb> gtk_init (&argc, &argv); </verb></tscreen> calls the function gtk_init(gint *argc, gchar ***argv) which will be called in all GTK applications. This sets up a few things for us such as the default visual and color map and then proceeds to call gdk_init(gint *argc, gchar ***argv). This function initializes the library for use, sets up default signal handlers, and checks the arguments passed to your application on the command line, looking for one of the following: <itemize> <item> <tt/--gtk-module/ <item> <tt/--g-fatal-warnings/ <item> <tt/--gtk-debug/ <item> <tt/--gtk-no-debug/ <item> <tt/--gdk-debug/ <item> <tt/--gdk-no-debug/ <item> <tt/--display/ <item> <tt/--sync/ <item> <tt/--no-xshm/ <item> <tt/--name/ <item> <tt/--class/ </itemize> It removes these from the argument list, leaving anything it does not recognize for your application to parse or ignore. This creates a set of standard arguments accepted by all GTK applications. The next two lines of code create and display a window. <tscreen><verb> window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_show (window); </verb></tscreen> The <tt/GTK_WINDOW_TOPLEVEL/ argument specifies that we want the window to undergo window manager decoration and placement. Rather than create a window of 0x0 size, a window without children is set to 200x200 by default so you can still manipulate it. The gtk_widget_show() function lets GTK know that we are done setting the attributes of this widget, and that it can display it. The last line enters the GTK main processing loop. <tscreen><verb> gtk_main (); </verb></tscreen> gtk_main() is another call you will see in every GTK application. When control reaches this point, GTK will sleep waiting for X events (such as button or key presses), timeouts, or file IO notifications to occur. In our simple example, however, events are ignored. <!-- ----------------------------------------------------------------- --> <sect1>Hello World in GTK <p> Now for a program with a widget (a button). It's the classic hello world a la GTK. <tscreen><verb> /* example-start helloworld helloworld.c */ #include <gtk/gtk.h> /* This is a callback function. The data arguments are ignored * in this example. More on callbacks below. */ void hello( GtkWidget *widget, gpointer data ) { g_print ("Hello World\n"); } gint delete_event( GtkWidget *widget, GdkEvent *event, gpointer data ) { /* If you return FALSE in the "delete_event" signal handler, * GTK will emit the "destroy" signal. Returning TRUE means * you don't want the window to be destroyed. * This is useful for popping up 'are you sure you want to quit?' * type dialogs. */ g_print ("delete event occurred\n"); /* Change TRUE to FALSE and the main window will be destroyed with * a "delete_event". */ return(TRUE); } /* Another callback */ void destroy( GtkWidget *widget, gpointer data ) { gtk_main_quit(); } int main( int argc, char *argv[] ) { /* GtkWidget is the storage type for widgets */ GtkWidget *window; GtkWidget *button; /* This is called in all GTK applications. Arguments are parsed * from the command line and are returned to the application. */ gtk_init(&argc, &argv); /* create a new window */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); /* When the window is given the "delete_event" signal (this is given * by the window manager, usually by the "close" option, or on the * titlebar), we ask it to call the delete_event () function * as defined above. The data passed to the callback * function is NULL and is ignored in the callback function. */ gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (delete_event), NULL); /* Here we connect the "destroy" event to a signal handler. * This event occurs when we call gtk_widget_destroy() on the window, * or if we return FALSE in the "delete_event" callback. */ gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (destroy), NULL); /* Sets the border width of the window. */ gtk_container_set_border_width (GTK_CONTAINER (window), 10); /* Creates a new button with the label "Hello World". */ button = gtk_button_new_with_label ("Hello World"); /* When the button receives the "clicked" signal, it will call the * function hello() passing it NULL as its argument. The hello() * function is defined above. */ gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (hello), NULL); /* This will cause the window to be destroyed by calling * gtk_widget_destroy(window) when "clicked". Again, the destroy * signal could come from here, or the window manager. */ gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); /* This packs the button into the window (a gtk container). */ gtk_container_add (GTK_CONTAINER (window), button); /* The final step is to display this newly created widget. */ gtk_widget_show (button); /* and the window */ gtk_widget_show (window); /* All GTK applications must have a gtk_main(). Control ends here * and waits for an event to occur (like a key press or * mouse event). */ gtk_main (); return(0); } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Compiling Hello World <label id="sec_compiling"> <p> To compile use: <tscreen><verb> gcc -Wall -g helloworld.c -o helloworld `gtk-config --cflags` \ `gtk-config --libs` </verb></tscreen> This uses the program <tt/gtk-config/, which comes with GTK. This program "knows" what compiler switches are needed to compile programs that use GTK. <tt/gtk-config --cflags/ will output a list of include directories for the compiler to look in, and <tt>gtk-config --libs</> will output the list of libraries for the compiler to link with and the directories to find them in. In the above example they could have been combined into a single instance, such as <tt/`gtk-config --cflags --libs`/. Note that the type of single quote used in the compile command above is significant. The libraries that are usually linked in are: <itemize> <item>The GTK library (-lgtk), the widget library, based on top of GDK. <item>The GDK library (-lgdk), the Xlib wrapper. <item>The gmodule library (-lgmodule), which is used to load run time extensions. <item>The GLib library (-lglib), containing miscellaneous functions; only g_print() is used in this particular example. GTK is built on top of glib so you will always require this library. See the section on <ref id="sec_glib" name="GLib"> for details. <item>The Xlib library (-lX11) which is used by GDK. <item>The Xext library (-lXext). This contains code for shared memory pixmaps and other X extensions. <item>The math library (-lm). This is used by GTK for various purposes. </itemize> <!-- ----------------------------------------------------------------- --> <sect1>Theory of Signals and Callbacks <p> Before we look in detail at <em>helloworld</em>, we'll discuss signals and callbacks. GTK is an event driven toolkit, which means it will sleep in gtk_main until an event occurs and control is passed to the appropriate function. This passing of control is done using the idea of "signals". (Note that these signals are not the same as the Unix system signals, and are not implemented using them, although the terminology is almost identical.) When an event occurs, such as the press of a mouse button, the appropriate signal will be "emitted" by the widget that was pressed. This is how GTK does most of its useful work. There are signals that all widgets inherit, such as "destroy", and there are signals that are widget specific, such as "toggled" on a toggle button. To make a button perform an action, we set up a signal handler to catch these signals and call the appropriate function. This is done by using a function such as: <tscreen><verb> gint gtk_signal_connect( GtkObject *object, gchar *name, GtkSignalFunc func, gpointer func_data ); </verb></tscreen> where the first argument is the widget which will be emitting the signal, and the second the name of the signal you wish to catch. The third is the function you wish to be called when it is caught, and the fourth, the data you wish to have passed to this function. The function specified in the third argument is called a "callback function", and should generally be of the form <tscreen><verb> void callback_func( GtkWidget *widget, gpointer callback_data ); </verb></tscreen> where the first argument will be a pointer to the widget that emitted the signal, and the second a pointer to the data given as the last argument to the gtk_signal_connect() function as shown above. Note that the above form for a signal callback function declaration is only a general guide, as some widget specific signals generate different calling parameters. For example, the CList "select_row" signal provides both row and column parameters. Another call used in the <em>helloworld</em> example, is: <tscreen><verb> gint gtk_signal_connect_object( GtkObject *object, gchar *name, GtkSignalFunc func, GtkObject *slot_object ); </verb></tscreen> gtk_signal_connect_object() is the same as gtk_signal_connect() except that the callback function only uses one argument, a pointer to a GTK object. So when using this function to connect signals, the callback should be of the form <tscreen><verb> void callback_func( GtkObject *object ); </verb></tscreen> where the object is usually a widget. We usually don't setup callbacks for gtk_signal_connect_object however. They are usually used to call a GTK function that accepts a single widget or object as an argument, as is the case in our <em>helloworld</em> example. The purpose of having two functions to connect signals is simply to allow the callbacks to have a different number of arguments. Many functions in the GTK library accept only a single GtkWidget pointer as an argument, so you want to use the gtk_signal_connect_object() for these, whereas for your functions, you may need to have additional data supplied to the callbacks. <!-- ----------------------------------------------------------------- --> <sect1>Events <p> In addition to the signal mechanism described above, there is a set of <em>events</em> that reflect the X event mechanism. Callbacks may also be attached to these events. These events are: <itemize> <item> event <item> button_press_event <item> button_release_event <item> motion_notify_event <item> delete_event <item> destroy_event <item> expose_event <item> key_press_event <item> key_release_event <item> enter_notify_event <item> leave_notify_event <item> configure_event <item> focus_in_event <item> focus_out_event <item> map_event <item> unmap_event <item> property_notify_event <item> selection_clear_event <item> selection_request_event <item> selection_notify_event <item> proximity_in_event <item> proximity_out_event <item> drag_begin_event <item> drag_request_event <item> drag_end_event <item> drop_enter_event <item> drop_leave_event <item> drop_data_available_event <item> other_event </itemize> In order to connect a callback function to one of these events, you use the function gtk_signal_connect, as described above, using one of the above event names as the <tt/name/ parameter. The callback function for events has a slightly different form than that for signals: <tscreen><verb> void callback_func( GtkWidget *widget, GdkEvent *event, gpointer callback_data ); </verb></tscreen> GdkEvent is a C <tt/union/ structure whose type will depend upon which of the above events has occurred. In order for us to tell which event has been issued each of the possible alternatives has a <tt/type/ parameter which reflects the event being issued. The other components of the event structure will depend upon the type of the event. Possible values for the type are: <tscreen><verb> GDK_NOTHING GDK_DELETE GDK_DESTROY GDK_EXPOSE GDK_MOTION_NOTIFY GDK_BUTTON_PRESS GDK_2BUTTON_PRESS GDK_3BUTTON_PRESS GDK_BUTTON_RELEASE GDK_KEY_PRESS GDK_KEY_RELEASE GDK_ENTER_NOTIFY GDK_LEAVE_NOTIFY GDK_FOCUS_CHANGE GDK_CONFIGURE GDK_MAP GDK_UNMAP GDK_PROPERTY_NOTIFY GDK_SELECTION_CLEAR GDK_SELECTION_REQUEST GDK_SELECTION_NOTIFY GDK_PROXIMITY_IN GDK_PROXIMITY_OUT GDK_DRAG_BEGIN GDK_DRAG_REQUEST GDK_DROP_ENTER GDK_DROP_LEAVE GDK_DROP_DATA_AVAIL GDK_CLIENT_EVENT GDK_VISIBILITY_NOTIFY GDK_NO_EXPOSE GDK_OTHER_EVENT /* Deprecated, use filters instead */ </verb></tscreen> So, to connect a callback function to one of these events we would use something like: <tscreen><verb> gtk_signal_connect( GTK_OBJECT(button), "button_press_event", GTK_SIGNAL_FUNC(button_press_callback), NULL); </verb></tscreen> This assumes that <tt/button/ is a Button widget. Now, when the mouse is over the button and a mouse button is pressed, the function <tt/button_press_callback/ will be called. This function may be declared as: <tscreen><verb> static gint button_press_callback( GtkWidget *widget, GdkEventButton *event, gpointer data ); </verb></tscreen> Note that we can declare the second argument as type <tt/GdkEventButton/ as we know what type of event will occur for this function to be called. The value returned from this function indicates whether the event should be propagated further by the GTK event handling mechanism. Returning TRUE indicates that the event has been handled, and that it should not propagate further. Returning FALSE continues the normal event handling. See the section on <ref id="sec_Adv_Events_and_Signals" name="Advanced Event and Signal Handling"> for more details on this propagation process. For details on the GdkEvent data types, see the appendix entitled <ref id="sec_GDK_Event_Types" name="GDK Event Types">. <!-- ----------------------------------------------------------------- --> <sect1>Stepping Through Hello World <p> Now that we know the theory behind this, let's clarify by walking through the example <em>helloworld</em> program. Here is the callback function that will be called when the button is "clicked". We ignore both the widget and the data in this example, but it is not hard to do things with them. The next example will use the data argument to tell us which button was pressed. <tscreen><verb> void hello( GtkWidget *widget, gpointer data ) { g_print ("Hello World\n"); } </verb></tscreen> The next callback is a bit special. The "delete_event" occurs when the window manager sends this event to the application. We have a choice here as to what to do about these events. We can ignore them, make some sort of response, or simply quit the application. The value you return in this callback lets GTK know what action to take. By returning TRUE, we let it know that we don't want to have the "destroy" signal emitted, keeping our application running. By returning FALSE, we ask that "destroy" be emitted, which in turn will call our "destroy" signal handler. <tscreen><verb> gint delete_event( GtkWidget *widget, GdkEvent *event, gpointer data ) { g_print ("delete event occurred\n"); return (TRUE); } </verb></tscreen> Here is another callback function which causes the program to quit by calling gtk_main_quit(). This function tells GTK that it is to exit from gtk_main when control is returned to it. <tscreen><verb> void destroy( GtkWidget *widget, gpointer data ) { gtk_main_quit (); } </verb></tscreen> I assume you know about the main() function... yes, as with other applications, all GTK applications will also have one of these. <tscreen><verb> int main( int argc, char *argv[] ) { </verb></tscreen> This next part declares pointers to a structure of type GtkWidget. These are used below to create a window and a button. <tscreen><verb> GtkWidget *window; GtkWidget *button; </verb></tscreen> Here is our gtk_init again. As before, this initializes the toolkit, and parses the arguments found on the command line. Any argument it recognizes from the command line, it removes from the list, and modifies argc and argv to make it look like they never existed, allowing your application to parse the remaining arguments. <tscreen><verb> gtk_init (&argc, &argv); </verb></tscreen> Create a new window. This is fairly straightforward. Memory is allocated for the GtkWidget *window structure so it now points to a valid structure. It sets up a new window, but it is not displayed until we call gtk_widget_show(window) near the end of our program. <tscreen><verb> window = gtk_window_new (GTK_WINDOW_TOPLEVEL); </verb></tscreen> Here are two examples of connecting a signal handler to an object, in this case, the window. Here, the "delete_event" and "destroy" signals are caught. The first is emitted when we use the window manager to kill the window, or when we use the gtk_widget_destroy() call passing in the window widget as the object to destroy. The second is emitted when, in the "delete_event" handler, we return FALSE. The <tt/GTK_OBJECT/ and <tt/GTK_SIGNAL_FUNC/ are macros that perform type casting and checking for us, as well as aid the readability of the code. <tscreen><verb> gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (delete_event), NULL); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (destroy), NULL); </verb></tscreen> This next function is used to set an attribute of a container object. This just sets the window so it has a blank area along the inside of it 10 pixels wide where no widgets will go. There are other similar functions which we will look at in the section on <ref id="sec_setting_widget_attributes" name="Setting Widget Attributes"> And again, <tt/GTK_CONTAINER/ is a macro to perform type casting. <tscreen><verb> gtk_container_set_border_width (GTK_CONTAINER (window), 10); </verb></tscreen> This call creates a new button. It allocates space for a new GtkWidget structure in memory, initializes it, and makes the button pointer point to it. It will have the label "Hello World" on it when displayed. <tscreen><verb> button = gtk_button_new_with_label ("Hello World"); </verb></tscreen> Here, we take this button, and make it do something useful. We attach a signal handler to it so when it emits the "clicked" signal, our hello() function is called. The data is ignored, so we simply pass in NULL to the hello() callback function. Obviously, the "clicked" signal is emitted when we click the button with our mouse pointer. <tscreen><verb> gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (hello), NULL); </verb></tscreen> We are also going to use this button to exit our program. This will illustrate how the "destroy" signal may come from either the window manager, or our program. When the button is "clicked", same as above, it calls the first hello() callback function, and then this one in the order they are set up. You may have as many callback functions as you need, and all will be executed in the order you connected them. Because the gtk_widget_destroy() function accepts only a GtkWidget *widget as an argument, we use the gtk_signal_connect_object() function here instead of straight gtk_signal_connect(). <tscreen><verb> gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); </verb></tscreen> This is a packing call, which will be explained in depth later on in <ref id="sec_packing_widgets" name="Packing Widgets">. But it is fairly easy to understand. It simply tells GTK that the button is to be placed in the window where it will be displayed. Note that a GTK container can only contain one widget. There are other widgets, that are described later, which are designed to layout multiple widgets in various ways. <tscreen><verb> gtk_container_add (GTK_CONTAINER (window), button); </verb></tscreen> Now we have everything set up the way we want it to be. With all the signal handlers in place, and the button placed in the window where it should be, we ask GTK to "show" the widgets on the screen. The window widget is shown last so the whole window will pop up at once rather than seeing the window pop up, and then the button form inside of it. Although with such a simple example, you'd never notice. <tscreen><verb> gtk_widget_show (button); gtk_widget_show (window); </verb></tscreen> And of course, we call gtk_main() which waits for events to come from the X server and will call on the widgets to emit signals when these events come. <tscreen><verb> gtk_main (); </verb></tscreen> And the final return. Control returns here after gtk_quit() is called. <tscreen><verb> return (0); </verb></tscreen> Now, when we click the mouse button on a GTK button, the widget emits a "clicked" signal. In order for us to use this information, our program sets up a signal handler to catch that signal, which dispatches the function of our choice. In our example, when the button we created is "clicked", the hello() function is called with a NULL argument, and then the next handler for this signal is called. This calls the gtk_widget_destroy() function, passing it the window widget as its argument, destroying the window widget. This causes the window to emit the "destroy" signal, which is caught, and calls our destroy() callback function, which simply exits GTK. Another course of events is to use the window manager to kill the window, which will cause the "delete_event" to be emitted. This will call our "delete_event" handler. If we return TRUE here, the window will be left as is and nothing will happen. Returning FALSE will cause GTK to emit the "destroy" signal which of course calls the "destroy" callback, exiting GTK. <!-- ***************************************************************** --> <sect>Moving On <!-- ***************************************************************** --> <!-- ----------------------------------------------------------------- --> <sect1>Data Types <p> There are a few things you probably noticed in the previous examples that need explaining. The gint, gchar, etc. that you see are typedefs to int and char, respectively, that are part of the GLlib system. This is done to get around that nasty dependency on the size of simple data types when doing calculations. A good example is "gint32" which will be typedef'd to a 32 bit integer for any given platform, whether it be the 64 bit alpha, or the 32 bit i386. The typedefs are very straightforward and intuitive. They are all defined in glib/glib.h (which gets included from gtk.h). You'll also notice GTK's ability to use GtkWidget when the function calls for an Object. GTK is an object oriented design, and a widget is an object. <!-- ----------------------------------------------------------------- --> <sect1>More on Signal Handlers <p> Lets take another look at the gtk_signal_connect declaration. <tscreen><verb> gint gtk_signal_connect( GtkObject *object, gchar *name, GtkSignalFunc func, gpointer func_data ); </verb></tscreen> Notice the gint return value? This is a tag that identifies your callback function. As stated above, you may have as many callbacks per signal and per object as you need, and each will be executed in turn, in the order they were attached. This tag allows you to remove this callback from the list by using: <tscreen><verb> void gtk_signal_disconnect( GtkObject *object, gint id ); </verb></tscreen> So, by passing in the widget you wish to remove the handler from, and the tag returned by one of the signal_connect functions, you can disconnect a signal handler. You can also temporarily disable signal handlers with the gtk_signal_handler_block() and gtk_signal_handler_unblock() family of functions. <tscreen><verb> void gtk_signal_handler_block( GtkObject *object, guint handler_id ); void gtk_signal_handler_block_by_func( GtkObject *object, GtkSignalFunc func, gpointer data ); void gtk_signal_handler_block_by_data( GtkObject *object, gpointer data ); void gtk_signal_handler_unblock( GtkObject *object, guint handler_id ); void gtk_signal_handler_unblock_by_func( GtkObject *object, GtkSignalFunc func, gpointer data ); void gtk_signal_handler_unblock_by_data( GtkObject *object, gpointer data); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>An Upgraded Hello World <p> Let's take a look at a slightly improved <em>helloworld</em> with better examples of callbacks. This will also introduce us to our next topic, packing widgets. <tscreen><verb> /* example-start helloworld2 helloworld2.c */ #include <gtk/gtk.h> /* Our new improved callback. The data passed to this function * is printed to stdout. */ void callback( GtkWidget *widget, gpointer data ) { g_print ("Hello again - %s was pressed\n", (char *) data); } /* another callback */ gint delete_event( GtkWidget *widget, GdkEvent *event, gpointer data ) { gtk_main_quit(); return(FALSE); } int main( int argc, char *argv[] ) { /* GtkWidget is the storage type for widgets */ GtkWidget *window; GtkWidget *button; GtkWidget *box1; /* This is called in all GTK applications. Arguments are parsed * from the command line and are returned to the application. */ gtk_init (&argc, &argv); /* Create a new window */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); /* This is a new call, which just sets the title of our * new window to "Hello Buttons!" */ gtk_window_set_title (GTK_WINDOW (window), "Hello Buttons!"); /* Here we just set a handler for delete_event that immediately * exits GTK. */ gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (delete_event), NULL); /* Sets the border width of the window. */ gtk_container_set_border_width (GTK_CONTAINER (window), 10); /* We create a box to pack widgets into. This is described in detail * in the "packing" section. The box is not really visible, it * is just used as a tool to arrange widgets. */ box1 = gtk_hbox_new(FALSE, 0); /* Put the box into the main window. */ gtk_container_add (GTK_CONTAINER (window), box1); /* Creates a new button with the label "Button 1". */ button = gtk_button_new_with_label ("Button 1"); /* Now when the button is clicked, we call the "callback" function * with a pointer to "button 1" as its argument */ gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (callback), (gpointer) "button 1"); /* Instead of gtk_container_add, we pack this button into the invisible * box, which has been packed into the window. */ gtk_box_pack_start(GTK_BOX(box1), button, TRUE, TRUE, 0); /* Always remember this step, this tells GTK that our preparation for * this button is complete, and it can now be displayed. */ gtk_widget_show(button); /* Do these same steps again to create a second button */ button = gtk_button_new_with_label ("Button 2"); /* Call the same callback function with a different argument, * passing a pointer to "button 2" instead. */ gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (callback), (gpointer) "button 2"); gtk_box_pack_start(GTK_BOX(box1), button, TRUE, TRUE, 0); /* The order in which we show the buttons is not really important, but I * recommend showing the window last, so it all pops up at once. */ gtk_widget_show(button); gtk_widget_show(box1); gtk_widget_show (window); /* Rest in gtk_main and wait for the fun to begin! */ gtk_main (); return(0); } /* example-end */ </verb></tscreen> Compile this program using the same linking arguments as our first example. You'll notice this time there is no easy way to exit the program, you have to use your window manager or command line to kill it. A good exercise for the reader would be to insert a third "Quit" button that will exit the program. You may also wish to play with the options to gtk_box_pack_start() while reading the next section. Try resizing the window, and observe the behavior. Just as a side note, there is another useful define for gtk_window_new() - <tt/GTK_WINDOW_DIALOG/. This interacts with the window manager a little differently and should be used for transient windows. <!-- ***************************************************************** --> <sect>Packing Widgets <label id="sec_packing_widgets"> <!-- ***************************************************************** --> <p> When creating an application, you'll want to put more than one widget inside a window. Our first <em>helloworld</em> example only used one widget so we could simply use a gtk_container_add call to "pack" the widget into the window. But when you want to put more than one widget into a window, how do you control where that widget is positioned? This is where packing comes in. <!-- ----------------------------------------------------------------- --> <sect1>Theory of Packing Boxes <p> Most packing is done by creating boxes as in the example above. These are invisible widget containers that we can pack our widgets into which come in two forms, a horizontal box, and a vertical box. When packing widgets into a horizontal box, the objects are inserted horizontally from left to right or right to left depending on the call used. In a vertical box, widgets are packed from top to bottom or vice versa. You may use any combination of boxes inside or beside other boxes to create the desired effect. To create a new horizontal box, we use a call to gtk_hbox_new(), and for vertical boxes, gtk_vbox_new(). The gtk_box_pack_start() and gtk_box_pack_end() functions are used to place objects inside of these containers. The gtk_box_pack_start() function will start at the top and work its way down in a vbox, and pack left to right in an hbox. gtk_box_pack_end() will do the opposite, packing from bottom to top in a vbox, and right to left in an hbox. Using these functions allows us to right justify or left justify our widgets and may be mixed in any way to achieve the desired effect. We will use gtk_box_pack_start() in most of our examples. An object may be another container or a widget. In fact, many widgets are actually containers themselves, including the button, but we usually only use a label inside a button. By using these calls, GTK knows where you want to place your widgets so it can do automatic resizing and other nifty things. There are also a number of options as to how your widgets should be packed. As you can imagine, this method gives us a quite a bit of flexibility when placing and creating widgets. <!-- ----------------------------------------------------------------- --> <sect1>Details of Boxes <p> Because of this flexibility, packing boxes in GTK can be confusing at first. There are a lot of options, and it's not immediately obvious how they all fit together. In the end, however, there are basically five different styles. <? <CENTER> > <? <IMG SRC="gtk_tut_packbox1.gif" VSPACE="15" HSPACE="10" WIDTH="528" HEIGHT="235" ALT="Box Packing Example Image"> > <? </CENTER> > Each line contains one horizontal box (hbox) with several buttons. The call to gtk_box_pack is shorthand for the call to pack each of the buttons into the hbox. Each of the buttons is packed into the hbox the same way (i.e., same arguments to the gtk_box_pack_start() function). This is the declaration of the gtk_box_pack_start function. <tscreen><verb> void gtk_box_pack_start( GtkBox *box, GtkWidget *child, gint expand, gint fill, gint padding ); </verb></tscreen> The first argument is the box you are packing the object into, the second is the object. The objects will all be buttons for now, so we'll be packing buttons into boxes. The expand argument to gtk_box_pack_start() and gtk_box_pack_end() controls whether the widgets are laid out in the box to fill in all the extra space in the box so the box is expanded to fill the area allotted to it (TRUE); or the box is shrunk to just fit the widgets (FALSE). Setting expand to FALSE will allow you to do right and left justification of your widgets. Otherwise, they will all expand to fit into the box, and the same effect could be achieved by using only one of gtk_box_pack_start or gtk_box_pack_end. The fill argument to the gtk_box_pack functions control whether the extra space is allocated to the objects themselves (TRUE), or as extra padding in the box around these objects (FALSE). It only has an effect if the expand argument is also TRUE. When creating a new box, the function looks like this: <tscreen><verb> GtkWidget *gtk_hbox_new (gint homogeneous, gint spacing); </verb></tscreen> The homogeneous argument to gtk_hbox_new (and the same for gtk_vbox_new) controls whether each object in the box has the same size (i.e., the same width in an hbox, or the same height in a vbox). If it is set, the gtk_box_pack routines function essentially as if the <tt/expand/ argument was always turned on. What's the difference between spacing (set when the box is created) and padding (set when elements are packed)? Spacing is added between objects, and padding is added on either side of an object. The following figure should make it clearer: <? <CENTER> > <? <IMG ALIGN="center" SRC="gtk_tut_packbox2.gif" WIDTH="509" HEIGHT="213" VSPACE="15" HSPACE="10" ALT="Box Packing Example Image"> > <? </CENTER> > Here is the code used to create the above images. I've commented it fairly heavily so I hope you won't have any problems following it. Compile it yourself and play with it. <!-- ----------------------------------------------------------------- --> <sect1>Packing Demonstration Program <p> <tscreen><verb> /* example-start packbox packbox.c */ #include <stdio.h> #include <stdlib.h> #include "gtk/gtk.h" gint delete_event( GtkWidget *widget, GdkEvent *event, gpointer data ) { gtk_main_quit(); return(FALSE); } /* Make a new hbox filled with button-labels. Arguments for the * variables we're interested are passed in to this function. * We do not show the box, but do show everything inside. */ GtkWidget *make_box( gint homogeneous, gint spacing, gint expand, gint fill, gint padding ) { GtkWidget *box; GtkWidget *button; char padstr[80]; /* Create a new hbox with the appropriate homogeneous * and spacing settings */ box = gtk_hbox_new (homogeneous, spacing); /* Create a series of buttons with the appropriate settings */ button = gtk_button_new_with_label ("gtk_box_pack"); gtk_box_pack_start (GTK_BOX (box), button, expand, fill, padding); gtk_widget_show (button); button = gtk_button_new_with_label ("(box,"); gtk_box_pack_start (GTK_BOX (box), button, expand, fill, padding); gtk_widget_show (button); button = gtk_button_new_with_label ("button,"); gtk_box_pack_start (GTK_BOX (box), button, expand, fill, padding); gtk_widget_show (button); /* Create a button with the label depending on the value of * expand. */ if (expand == TRUE) button = gtk_button_new_with_label ("TRUE,"); else button = gtk_button_new_with_label ("FALSE,"); gtk_box_pack_start (GTK_BOX (box), button, expand, fill, padding); gtk_widget_show (button); /* This is the same as the button creation for "expand" * above, but uses the shorthand form. */ button = gtk_button_new_with_label (fill ? "TRUE," : "FALSE,"); gtk_box_pack_start (GTK_BOX (box), button, expand, fill, padding); gtk_widget_show (button); sprintf (padstr, "%d);", padding); button = gtk_button_new_with_label (padstr); gtk_box_pack_start (GTK_BOX (box), button, expand, fill, padding); gtk_widget_show (button); return box; } int main( int argc, char *argv[]) { GtkWidget *window; GtkWidget *button; GtkWidget *box1; GtkWidget *box2; GtkWidget *separator; GtkWidget *label; GtkWidget *quitbox; int which; /* Our init, don't forget this! :) */ gtk_init (&argc, &argv); if (argc != 2) { fprintf (stderr, "usage: packbox num, where num is 1, 2, or 3.\n"); /* This just does cleanup in GTK and exits with an exit status of 1. */ gtk_exit (1); } which = atoi (argv[1]); /* Create our window */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); /* You should always remember to connect the delete_event signal * to the main window. This is very important for proper intuitive * behavior */ gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (delete_event), NULL); gtk_container_set_border_width (GTK_CONTAINER (window), 10); /* We create a vertical box (vbox) to pack the horizontal boxes into. * This allows us to stack the horizontal boxes filled with buttons one * on top of the other in this vbox. */ box1 = gtk_vbox_new (FALSE, 0); /* which example to show. These correspond to the pictures above. */ switch (which) { case 1: /* create a new label. */ label = gtk_label_new ("gtk_hbox_new (FALSE, 0);"); /* Align the label to the left side. We'll discuss this function and * others in the section on Widget Attributes. */ gtk_misc_set_alignment (GTK_MISC (label), 0, 0); /* Pack the label into the vertical box (vbox box1). Remember that * widgets added to a vbox will be packed one on top of the other in * order. */ gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 0); /* Show the label */ gtk_widget_show (label); /* Call our make box function - homogeneous = FALSE, spacing = 0, * expand = FALSE, fill = FALSE, padding = 0 */ box2 = make_box (FALSE, 0, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); /* Call our make box function - homogeneous = FALSE, spacing = 0, * expand = TRUE, fill = FALSE, padding = 0 */ box2 = make_box (FALSE, 0, TRUE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); /* Args are: homogeneous, spacing, expand, fill, padding */ box2 = make_box (FALSE, 0, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); /* Creates a separator, we'll learn more about these later, * but they are quite simple. */ separator = gtk_hseparator_new (); /* Pack the separator into the vbox. Remember each of these * widgets is being packed into a vbox, so they'll be stacked * vertically. */ gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 5); gtk_widget_show (separator); /* Create another new label, and show it. */ label = gtk_label_new ("gtk_hbox_new (TRUE, 0);"); gtk_misc_set_alignment (GTK_MISC (label), 0, 0); gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 0); gtk_widget_show (label); /* Args are: homogeneous, spacing, expand, fill, padding */ box2 = make_box (TRUE, 0, TRUE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); /* Args are: homogeneous, spacing, expand, fill, padding */ box2 = make_box (TRUE, 0, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); /* Another new separator. */ separator = gtk_hseparator_new (); /* The last 3 arguments to gtk_box_pack_start are: * expand, fill, padding. */ gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 5); gtk_widget_show (separator); break; case 2: /* Create a new label, remember box1 is a vbox as created * near the beginning of main() */ label = gtk_label_new ("gtk_hbox_new (FALSE, 10);"); gtk_misc_set_alignment (GTK_MISC (label), 0, 0); gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 0); gtk_widget_show (label); /* Args are: homogeneous, spacing, expand, fill, padding */ box2 = make_box (FALSE, 10, TRUE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); /* Args are: homogeneous, spacing, expand, fill, padding */ box2 = make_box (FALSE, 10, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); separator = gtk_hseparator_new (); /* The last 3 arguments to gtk_box_pack_start are: * expand, fill, padding. */ gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 5); gtk_widget_show (separator); label = gtk_label_new ("gtk_hbox_new (FALSE, 0);"); gtk_misc_set_alignment (GTK_MISC (label), 0, 0); gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 0); gtk_widget_show (label); /* Args are: homogeneous, spacing, expand, fill, padding */ box2 = make_box (FALSE, 0, TRUE, FALSE, 10); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); /* Args are: homogeneous, spacing, expand, fill, padding */ box2 = make_box (FALSE, 0, TRUE, TRUE, 10); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); separator = gtk_hseparator_new (); /* The last 3 arguments to gtk_box_pack_start are: expand, fill, padding. */ gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 5); gtk_widget_show (separator); break; case 3: /* This demonstrates the ability to use gtk_box_pack_end() to * right justify widgets. First, we create a new box as before. */ box2 = make_box (FALSE, 0, FALSE, FALSE, 0); /* Create the label that will be put at the end. */ label = gtk_label_new ("end"); /* Pack it using gtk_box_pack_end(), so it is put on the right * side of the hbox created in the make_box() call. */ gtk_box_pack_end (GTK_BOX (box2), label, FALSE, FALSE, 0); /* Show the label. */ gtk_widget_show (label); /* Pack box2 into box1 (the vbox remember ? :) */ gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); /* A separator for the bottom. */ separator = gtk_hseparator_new (); /* This explicitly sets the separator to 400 pixels wide by 5 pixels * high. This is so the hbox we created will also be 400 pixels wide, * and the "end" label will be separated from the other labels in the * hbox. Otherwise, all the widgets in the hbox would be packed as * close together as possible. */ gtk_widget_set_usize (separator, 400, 5); /* pack the separator into the vbox (box1) created near the start * of main() */ gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 5); gtk_widget_show (separator); } /* Create another new hbox.. remember we can use as many as we need! */ quitbox = gtk_hbox_new (FALSE, 0); /* Our quit button. */ button = gtk_button_new_with_label ("Quit"); /* Setup the signal to terminate the program when the button is clicked */ gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_main_quit), GTK_OBJECT (window)); /* Pack the button into the quitbox. * The last 3 arguments to gtk_box_pack_start are: * expand, fill, padding. */ gtk_box_pack_start (GTK_BOX (quitbox), button, TRUE, FALSE, 0); /* pack the quitbox into the vbox (box1) */ gtk_box_pack_start (GTK_BOX (box1), quitbox, FALSE, FALSE, 0); /* Pack the vbox (box1) which now contains all our widgets, into the * main window. */ gtk_container_add (GTK_CONTAINER (window), box1); /* And show everything left */ gtk_widget_show (button); gtk_widget_show (quitbox); gtk_widget_show (box1); /* Showing the window last so everything pops up at once. */ gtk_widget_show (window); /* And of course, our main function. */ gtk_main (); /* Control returns here when gtk_main_quit() is called, but not when * gtk_exit is used. */ return(0); } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Packing Using Tables <p> Let's take a look at another way of packing - Tables. These can be extremely useful in certain situations. Using tables, we create a grid that we can place widgets in. The widgets may take up as many spaces as we specify. The first thing to look at, of course, is the gtk_table_new function: <tscreen><verb> GtkWidget *gtk_table_new( gint rows, gint columns, gint homogeneous ); </verb></tscreen> The first argument is the number of rows to make in the table, while the second, obviously, is the number of columns. The homogeneous argument has to do with how the table's boxes are sized. If homogeneous is TRUE, the table boxes are resized to the size of the largest widget in the table. If homogeneous is FALSE, the size of a table boxes is dictated by the tallest widget in its same row, and the widest widget in its column. The rows and columns are laid out from 0 to n, where n was the number specified in the call to gtk_table_new. So, if you specify rows = 2 and columns = 2, the layout would look something like this: <tscreen><verb> 0 1 2 0+----------+----------+ | | | 1+----------+----------+ | | | 2+----------+----------+ </verb></tscreen> Note that the coordinate system starts in the upper left hand corner. To place a widget into a box, use the following function: <tscreen><verb> void gtk_table_attach( GtkTable *table, GtkWidget *child, gint left_attach, gint right_attach, gint top_attach, gint bottom_attach, gint xoptions, gint yoptions, gint xpadding, gint ypadding ); </verb></tscreen> The first argument ("table") is the table you've created and the second ("child") the widget you wish to place in the table. The left and right attach arguments specify where to place the widget, and how many boxes to use. If you want a button in the lower right table entry of our 2x2 table, and want it to fill that entry ONLY, left_attach would be = 1, right_attach = 2, top_attach = 1, bottom_attach = 2. Now, if you wanted a widget to take up the whole top row of our 2x2 table, you'd use left_attach = 0, right_attach = 2, top_attach = 0, bottom_attach = 1. The xoptions and yoptions are used to specify packing options and may be bitwise OR'ed together to allow multiple options. These options are: <itemize> <item><tt/GTK_FILL/ - If the table box is larger than the widget, and <tt/GTK_FILL/ is specified, the widget will expand to use all the room available. <item><tt/GTK_SHRINK/ - If the table widget was allocated less space then was requested (usually by the user resizing the window), then the widgets would normally just be pushed off the bottom of the window and disappear. If <tt/GTK_SHRINK/ is specified, the widgets will shrink with the table. <item><tt/GTK_EXPAND/ - This will cause the table to expand to use up any remaining space in the window. </itemize> Padding is just like in boxes, creating a clear area around the widget specified in pixels. gtk_table_attach() has a LOT of options. So, there's a shortcut: <tscreen><verb> void gtk_table_attach_defaults( GtkTable *table, GtkWidget *widget, gint left_attach, gint right_attach, gint top_attach, gint bottom_attach ); </verb></tscreen> The X and Y options default to <tt/GTK_FILL | GTK_EXPAND/, and X and Y padding are set to 0. The rest of the arguments are identical to the previous function. We also have gtk_table_set_row_spacing() and gtk_table_set_col_spacing(). These places spacing between the rows at the specified row or column. <tscreen><verb> void gtk_table_set_row_spacing( GtkTable *table, gint row, gint spacing ); </verb></tscreen> and <tscreen><verb> void gtk_table_set_col_spacing ( GtkTable *table, gint column, gint spacing ); </verb></tscreen> Note that for columns, the space goes to the right of the column, and for rows, the space goes below the row. You can also set a consistent spacing of all rows and/or columns with: <tscreen><verb> void gtk_table_set_row_spacings( GtkTable *table, gint spacing ); </verb></tscreen> And, <tscreen><verb> void gtk_table_set_col_spacings( GtkTable *table, gint spacing ); </verb></tscreen> Note that with these calls, the last row and last column do not get any spacing. <!-- ----------------------------------------------------------------- --> <sect1>Table Packing Example <p> Here we make a window with three buttons in a 2x2 table. The first two buttons will be placed in the upper row. A third, quit button, is placed in the lower row, spanning both columns. Which means it should look something like this: <? <CENTER> > <? <IMG SRC="gtk_tut_table.gif" VSPACE="15" HSPACE="10" ALT="Table Packing Example Image" WIDTH="180" HEIGHT="120"> > <? </CENTER> > Here's the source code: <tscreen><verb> /* example-start table table.c */ #include <gtk/gtk.h> /* Our callback. * The data passed to this function is printed to stdout */ void callback( GtkWidget *widget, gpointer data ) { g_print ("Hello again - %s was pressed\n", (char *) data); } /* This callback quits the program */ gint delete_event( GtkWidget *widget, GdkEvent *event, gpointer data ) { gtk_main_quit (); return(FALSE); } int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *button; GtkWidget *table; gtk_init (&argc, &argv); /* Create a new window */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); /* Set the window title */ gtk_window_set_title (GTK_WINDOW (window), "Table"); /* Set a handler for delete_event that immediately * exits GTK. */ gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (delete_event), NULL); /* Sets the border width of the window. */ gtk_container_set_border_width (GTK_CONTAINER (window), 20); /* Create a 2x2 table */ table = gtk_table_new (2, 2, TRUE); /* Put the table in the main window */ gtk_container_add (GTK_CONTAINER (window), table); /* Create first button */ button = gtk_button_new_with_label ("button 1"); /* When the button is clicked, we call the "callback" function * with a pointer to "button 1" as its argument */ gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (callback), (gpointer) "button 1"); /* Insert button 1 into the upper left quadrant of the table */ gtk_table_attach_defaults (GTK_TABLE(table), button, 0, 1, 0, 1); gtk_widget_show (button); /* Create second button */ button = gtk_button_new_with_label ("button 2"); /* When the button is clicked, we call the "callback" function * with a pointer to "button 2" as its argument */ gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (callback), (gpointer) "button 2"); /* Insert button 2 into the upper right quadrant of the table */ gtk_table_attach_defaults (GTK_TABLE(table), button, 1, 2, 0, 1); gtk_widget_show (button); /* Create "Quit" button */ button = gtk_button_new_with_label ("Quit"); /* When the button is clicked, we call the "delete_event" function * and the program exits */ gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (delete_event), NULL); /* Insert the quit button into the both * lower quadrants of the table */ gtk_table_attach_defaults (GTK_TABLE(table), button, 0, 2, 1, 2); gtk_widget_show (button); gtk_widget_show (table); gtk_widget_show (window); gtk_main (); return 0; } /* example-end */ </verb></tscreen> <!-- ***************************************************************** --> <sect>Widget Overview <!-- ***************************************************************** --> <p> The general steps to creating a widget in GTK are: <enum> <item> gtk_*_new - one of various functions to create a new widget. These are all detailed in this section. <item> Connect all signals and events we wish to use to the appropriate handlers. <item> Set the attributes of the widget. <item> Pack the widget into a container using the appropriate call such as gtk_container_add() or gtk_box_pack_start(). <item> gtk_widget_show() the widget. </enum> gtk_widget_show() lets GTK know that we are done setting the attributes of the widget, and it is ready to be displayed. You may also use gtk_widget_hide to make it disappear again. The order in which you show the widgets is not important, but I suggest showing the window last so the whole window pops up at once rather than seeing the individual widgets come up on the screen as they're formed. The children of a widget (a window is a widget too) will not be displayed until the window itself is shown using the gtk_widget_show() function. <!-- ----------------------------------------------------------------- --> <sect1> Casting <p> You'll notice as you go on that GTK uses a type casting system. This is always done using macros that both test the ability to cast the given item, and perform the cast. Some common ones you will see are: <tscreen><verb> GTK_WIDGET(widget) GTK_OBJECT(object) GTK_SIGNAL_FUNC(function) GTK_CONTAINER(container) GTK_WINDOW(window) GTK_BOX(box) </verb></tscreen> These are all used to cast arguments in functions. You'll see them in the examples, and can usually tell when to use them simply by looking at the function's declaration. As you can see below in the class hierarchy, all GtkWidgets are derived from the Object base class. This means you can use a widget in any place the function asks for an object - simply use the <tt/GTK_OBJECT()/ macro. For example: <tscreen><verb> gtk_signal_connect( GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(callback_function), callback_data); </verb></tscreen> This casts the button into an object, and provides a cast for the function pointer to the callback. Many widgets are also containers. If you look in the class hierarchy below, you'll notice that many widgets derive from the Container class. Any one of these widgets may be used with the <tt/GTK_CONTAINER/ macro to pass them to functions that ask for containers. Unfortunately, these macros are not extensively covered in the tutorial, but I recommend taking a look through the GTK header files. It can be very educational. In fact, it's not difficult to learn how a widget works just by looking at the function declarations. <!-- ----------------------------------------------------------------- --> <sect1>Widget Hierarchy <p> For your reference, here is the class hierarchy tree used to implement widgets. <tscreen><verb> GtkObject +GtkWidget | +GtkMisc | | +GtkLabel | | | +GtkAccelLabel | | | `GtkTipsQuery | | +GtkArrow | | +GtkImage | | `GtkPixmap | +GtkContainer | | +GtkBin | | | +GtkAlignment | | | +GtkFrame | | | | `GtkAspectFrame | | | +GtkButton | | | | +GtkToggleButton | | | | | `GtkCheckButton | | | | | `GtkRadioButton | | | | `GtkOptionMenu | | | +GtkItem | | | | +GtkMenuItem | | | | | +GtkCheckMenuItem | | | | | | `GtkRadioMenuItem | | | | | `GtkTearoffMenuItem | | | | +GtkListItem | | | | `GtkTreeItem | | | +GtkWindow | | | | +GtkColorSelectionDialog | | | | +GtkDialog | | | | | `GtkInputDialog | | | | +GtkDrawWindow | | | | +GtkFileSelection | | | | +GtkFontSelectionDialog | | | | `GtkPlug | | | +GtkEventBox | | | +GtkHandleBox | | | +GtkScrolledWindow | | | `GtkViewport | | +GtkBox | | | +GtkButtonBox | | | | +GtkHButtonBox | | | | `GtkVButtonBox | | | +GtkVBox | | | | +GtkColorSelection | | | | `GtkGammaCurve | | | `GtkHBox | | | +GtkCombo | | | `GtkStatusbar | | +GtkCList | | | `GtkCTree | | +GtkFixed | | +GtkNotebook | | | `GtkFontSelection | | +GtkPaned | | | +GtkHPaned | | | `GtkVPaned | | +GtkLayout | | +GtkList | | +GtkMenuShell | | | +GtkMenuBar | | | `GtkMenu | | +GtkPacker | | +GtkSocket | | +GtkTable | | +GtkToolbar | | `GtkTree | +GtkCalendar | +GtkDrawingArea | | `GtkCurve | +GtkEditable | | +GtkEntry | | | `GtkSpinButton | | `GtkText | +GtkRuler | | +GtkHRuler | | `GtkVRuler | +GtkRange | | +GtkScale | | | +GtkHScale | | | `GtkVScale | | `GtkScrollbar | | +GtkHScrollbar | | `GtkVScrollbar | +GtkSeparator | | +GtkHSeparator | | `GtkVSeparator | +GtkPreview | `GtkProgress | `GtkProgressBar +GtkData | +GtkAdjustment | `GtkTooltips `GtkItemFactory </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Widgets Without Windows <p> The following widgets do not have an associated window. If you want to capture events, you'll have to use the EventBox. See the section on the <ref id="sec_EventBox" name="EventBox"> widget. <tscreen><verb> GtkAlignment GtkArrow GtkBin GtkBox GtkImage GtkItem GtkLabel GtkPixmap GtkScrolledWindow GtkSeparator GtkTable GtkAspectFrame GtkFrame GtkVBox GtkHBox GtkVSeparator GtkHSeparator </verb></tscreen> We'll further our exploration of GTK by examining each widget in turn, creating a few simple functions to display them. Another good source is the testgtk.c program that comes with GTK. It can be found in gtk/testgtk.c. <!-- ***************************************************************** --> <sect>The Button Widget <!-- ***************************************************************** --> <!-- ----------------------------------------------------------------- --> <sect1>Normal Buttons <p> We've almost seen all there is to see of the button widget. It's pretty simple. There are however two ways to create a button. You can use the gtk_button_new_with_label() to create a button with a label, or use gtk_button_new() to create a blank button. It's then up to you to pack a label or pixmap into this new button. To do this, create a new box, and then pack your objects into this box using the usual gtk_box_pack_start, and then use gtk_container_add to pack the box into the button. Here's an example of using gtk_button_new to create a button with a picture and a label in it. I've broken up the code to create a box from the rest so you can use it in your programs. There are further examples of using pixmaps later in the tutorial. <tscreen><verb> /* example-start buttons buttons.c */ #include <gtk/gtk.h> /* Create a new hbox with an image and a label packed into it * and return the box. */ GtkWidget *xpm_label_box( GtkWidget *parent, gchar *xpm_filename, gchar *label_text ) { GtkWidget *box1; GtkWidget *label; GtkWidget *pixmapwid; GdkPixmap *pixmap; GdkBitmap *mask; GtkStyle *style; /* Create box for xpm and label */ box1 = gtk_hbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (box1), 2); /* Get the style of the button to get the * background color. */ style = gtk_widget_get_style(parent); /* Now on to the xpm stuff */ pixmap = gdk_pixmap_create_from_xpm (parent->window, &mask, &style->bg[GTK_STATE_NORMAL], xpm_filename); pixmapwid = gtk_pixmap_new (pixmap, mask); /* Create a label for the button */ label = gtk_label_new (label_text); /* Pack the pixmap and label into the box */ gtk_box_pack_start (GTK_BOX (box1), pixmapwid, FALSE, FALSE, 3); gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 3); gtk_widget_show(pixmapwid); gtk_widget_show(label); return(box1); } /* Our usual callback function */ void callback( GtkWidget *widget, gpointer data ) { g_print ("Hello again - %s was pressed\n", (char *) data); } int main( int argc, char *argv[] ) { /* GtkWidget is the storage type for widgets */ GtkWidget *window; GtkWidget *button; GtkWidget *box1; gtk_init (&argc, &argv); /* Create a new window */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Pixmap'd Buttons!"); /* It's a good idea to do this for all windows. */ gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_exit), NULL); gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (gtk_exit), NULL); /* Sets the border width of the window. */ gtk_container_set_border_width (GTK_CONTAINER (window), 10); gtk_widget_realize(window); /* Create a new button */ button = gtk_button_new (); /* Connect the "clicked" signal of the button to our callback */ gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (callback), (gpointer) "cool button"); /* This calls our box creating function */ box1 = xpm_label_box(window, "info.xpm", "cool button"); /* Pack and show all our widgets */ gtk_widget_show(box1); gtk_container_add (GTK_CONTAINER (button), box1); gtk_widget_show(button); gtk_container_add (GTK_CONTAINER (window), button); gtk_widget_show (window); /* Rest in gtk_main and wait for the fun to begin! */ gtk_main (); return(0); } /* example-end */ </verb></tscreen> The xpm_label_box function could be used to pack xpm's and labels into any widget that can be a container. Notice in <tt/xpm_label_box/ how there is a call to <tt/gtk_widget_get_style/. Every widget has a "style", consisting of foreground and background colors for a variety of situations, font selection, and other graphics data relevant to a widget. These style values are defaulted in each widget, and are required by many GDK function calls, such as <tt/gdk_pixmap_create_from_xpm/, which here is given the "normal" background color. The style data of widgets may be customized, using <ref id="sec_gtkrc_files" name="GTK's rc files">. Also notice the call to <tt/gtk_widget_realize/ after setting the window's border width. This function uses GDK to create the X windows related to the widget. The function is automatically called when you invoke <tt/gtk_widget_show/ for a widget, and so has not been shown in earlier examples. But the call to <tt/gdk_pixmap_create_from_xpm/ requires that its <tt/window/ argument refer to a real X window, so it is necessary to realize the widget before this GDK call. The Button widget has the following signals: <itemize> <item><tt/pressed/ - emitted when pointer button is pressed within Button widget <item><tt/released/ - emitted when pointer button is released within Button widget <item><tt/clicked/ - emitted when pointer button is pressed and then released within Button widget <item><tt/enter/ - emitted when pointer enters Button widget <item><tt/leave/ - emitted when pointer leaves Button widget </itemize> <!-- ----------------------------------------------------------------- --> <sect1> Toggle Buttons <p> Toggle buttons are derived from normal buttons and are very similar, except they will always be in one of two states, alternated by a click. They may be depressed, and when you click again, they will pop back up. Click again, and they will pop back down. Toggle buttons are the basis for check buttons and radio buttons, as such, many of the calls used for toggle buttons are inherited by radio and check buttons. I will point these out when we come to them. Creating a new toggle button: <tscreen><verb> GtkWidget *gtk_toggle_button_new( void ); GtkWidget *gtk_toggle_button_new_with_label( gchar *label ); </verb></tscreen> As you can imagine, these work identically to the normal button widget calls. The first creates a blank toggle button, and the second, a button with a label widget already packed into it. To retrieve the state of the toggle widget, including radio and check buttons, we use a construct as shown in our example below. This tests the state of the toggle, by accessing the <tt/active/ field of the toggle widget's structure, after first using the <tt/GTK_TOGGLE_BUTTON/ macro to cast the widget pointer into a toggle widget pointer. The signal of interest to us emitted by toggle buttons (the toggle button, check button, and radio button widgets) is the "toggled" signal. To check the state of these buttons, set up a signal handler to catch the toggled signal, and access the structure to determine its state. The callback will look something like: <tscreen><verb> void toggle_button_callback (GtkWidget *widget, gpointer data) { if (GTK_TOGGLE_BUTTON (widget)->active) { /* If control reaches here, the toggle button is down */ } else { /* If control reaches here, the toggle button is up */ } } </verb></tscreen> To force the state of a toggle button, and its children, the radio and check buttons, use this function: <tscreen><verb> void gtk_toggle_button_set_active( GtkToggleButton *toggle_button, gint state ); </verb></tscreen> The above call can be used to set the state of the toggle button, and its children the radio and check buttons. Passing in your created button as the first argument, and a TRUE or FALSE for the second state argument to specify whether it should be down (depressed) or up (released). Default is up, or FALSE. Note that when you use the gtk_toggle_button_set_active() function, and the state is actually changed, it causes the "clicked" signal to be emitted from the button. <tscreen><verb> void gtk_toggle_button_toggled (GtkToggleButton *toggle_button); </verb></tscreen> This simply toggles the button, and emits the "toggled" signal. <!-- ----------------------------------------------------------------- --> <sect1> Check Buttons <p> Check buttons inherit many properties and functions from the the toggle buttons above, but look a little different. Rather than being buttons with text inside them, they are small squares with the text to the right of them. These are often used for toggling options on and off in applications. The two creation functions are similar to those of the normal button. <tscreen><verb> GtkWidget *gtk_check_button_new( void ); GtkWidget *gtk_check_button_new_with_label ( gchar *label ); </verb></tscreen> The new_with_label function creates a check button with a label beside it. Checking the state of the check button is identical to that of the toggle button. <!-- ----------------------------------------------------------------- --> <sect1> Radio Buttons <label id="sec_Radio_Buttons"> <p> Radio buttons are similar to check buttons except they are grouped so that only one may be selected/depressed at a time. This is good for places in your application where you need to select from a short list of options. Creating a new radio button is done with one of these calls: <tscreen><verb> GtkWidget *gtk_radio_button_new( GSList *group ); GtkWidget *gtk_radio_button_new_with_label( GSList *group, gchar *label ); </verb></tscreen> You'll notice the extra argument to these calls. They require a group to perform their duty properly. The first call to gtk_radio_button_new_with_label or gtk_radio_button_new_with_label should pass NULL as the first argument. Then create a group using: <tscreen><verb> GSList *gtk_radio_button_group( GtkRadioButton *radio_button ); </verb></tscreen> The important thing to remember is that gtk_radio_button_group must be called for each new button added to the group, with the previous button passed in as an argument. The result is then passed into the next call to gtk_radio_button_new or gtk_radio_button_new_with_label. This allows a chain of buttons to be established. The example below should make this clear. You can shorten this slightly by using the following syntax, which removes the need for a variable to hold the list of buttons. This form is used in the example to create the third button: <tscreen><verb> button2 = gtk_radio_button_new_with_label( gtk_radio_button_group (GTK_RADIO_BUTTON (button1)), "button2"); </verb></tscreen> It is also a good idea to explicitly set which button should be the default depressed button with: <tscreen><verb> void gtk_toggle_button_set_active( GtkToggleButton *toggle_button, gint state ); </verb></tscreen> This is described in the section on toggle buttons, and works in exactly the same way. Once the radio buttons are grouped together, only one of the group may be active at a time. If the user clicks on one radio button, and then on another, the first radio button will first emit a "toggled" signal (to report becoming inactive), and then the second will emit its "toggled" signal (to report becoming active). The following example creates a radio button group with three buttons. <tscreen><verb> /* example-start radiobuttons radiobuttons.c */ #include <gtk/gtk.h> #include <glib.h> gint close_application( GtkWidget *widget, GdkEvent *event, gpointer data ) { gtk_main_quit(); return(FALSE); } int main( int argc, char *argv[] ) { GtkWidget *window = NULL; GtkWidget *box1; GtkWidget *box2; GtkWidget *button; GtkWidget *separator; GSList *group; gtk_init(&argc,&argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC(close_application), NULL); gtk_window_set_title (GTK_WINDOW (window), "radio buttons"); gtk_container_set_border_width (GTK_CONTAINER (window), 0); box1 = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window), box1); gtk_widget_show (box1); box2 = gtk_vbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); gtk_widget_show (box2); button = gtk_radio_button_new_with_label (NULL, "button1"); gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); gtk_widget_show (button); group = gtk_radio_button_group (GTK_RADIO_BUTTON (button)); button = gtk_radio_button_new_with_label(group, "button2"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); gtk_widget_show (button); button = gtk_radio_button_new_with_label( gtk_radio_button_group (GTK_RADIO_BUTTON (button)), "button3"); gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); gtk_widget_show (button); separator = gtk_hseparator_new (); gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0); gtk_widget_show (separator); box2 = gtk_vbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0); gtk_widget_show (box2); button = gtk_button_new_with_label ("close"); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC(close_application), GTK_OBJECT (window)); gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_grab_default (button); gtk_widget_show (button); gtk_widget_show (window); gtk_main(); return(0); } /* example-end */ </verb></tscreen> <!-- TODO: check out gtk_radio_button_new_from_widget function - TRG --> <!-- ***************************************************************** --> <sect> Adjustments <label id="sec_Adjustment"> <!-- ***************************************************************** --> <p> GTK has various widgets that can be visually adjusted by the user using the mouse or the keyboard, such as the range widgets, described in the <ref id="sec_Range_Widgets" name="Range Widgets"> section. There are also a few widgets that display some adjustable portion of a larger area of data, such as the text widget and the viewport widget. Obviously, an application needs to be able to react to changes the user makes in range widgets. One way to do this would be to have each widget emit its own type of signal when its adjustment changes, and either pass the new value to the signal handler, or require it to look inside the widget's data structure in order to ascertain the value. But you may also want to connect the adjustments of several widgets together, so that adjusting one adjusts the others. The most obvious example of this is connecting a scrollbar to a panning viewport or a scrolling text area. If each widget has its own way of setting or getting the adjustment value, then the programmer may have to write their own signal handlers to translate between the output of one widget's signal and the "input" of another's adjustment setting function. GTK solves this problem using the Adjustment object, which is not a widget but a way for widgets to store and pass adjustment information in an abstract and flexible form. The most obvious use of Adjustment is to store the configuration parameters and values of range widgets, such as scrollbars and scale controls. However, since Adjustments are derived from Object, they have some special powers beyond those of normal data structures. Most importantly, they can emit signals, just like widgets, and these signals can be used not only to allow your program to react to user input on adjustable widgets, but also to propagate adjustment values transparently between adjustable widgets. You will see how adjustments fit in when you see the other widgets that incorporate them: <ref id="sec_ProgressBar" name="Progress Bars">, <ref id="sec_Viewports" name="Viewports">, <ref id="sec_ScrolledWindow" name="Scrolled Windows">, and others. <sect1> Creating an Adjustment <p> Many of the widgets which use adjustment objects do so automatically, but some cases will be shown in later examples where you may need to create one yourself. You create an adjustment using: <tscreen><verb> GtkObject *gtk_adjustment_new( gfloat value, gfloat lower, gfloat upper, gfloat step_increment, gfloat page_increment, gfloat page_size ); </verb></tscreen> The <tt/value/ argument is the initial value you want to give to the adjustment, usually corresponding to the topmost or leftmost position of an adjustable widget. The <tt/lower/ argument specifies the lowest value which the adjustment can hold. The <tt/step_increment/ argument specifies the "smaller" of the two increments by which the user can change the value, while the <tt/page_increment/ is the "larger" one. The <tt/page_size/ argument usually corresponds somehow to the visible area of a panning widget. The <tt/upper/ argument is used to represent the bottom most or right most coordinate in a panning widget's child. Therefore it is <em/not/ always the largest number that <tt/value/ can take, since the <tt/page_size/ of such widgets is usually non-zero. <!-- ----------------------------------------------------------------- --> <sect1> Using Adjustments the Easy Way <p> The adjustable widgets can be roughly divided into those which use and require specific units for these values and those which treat them as arbitrary numbers. The group which treats the values as arbitrary numbers includes the range widgets (scrollbars and scales, the progress bar widget, and the spin button widget). These widgets are all the widgets which are typically "adjusted" directly by the user with the mouse or keyboard. They will treat the <tt/lower/ and <tt/upper/ values of an adjustment as a range within which the user can manipulate the adjustment's <tt/value/. By default, they will only modify the <tt/value/ of an adjustment. The other group includes the text widget, the viewport widget, the compound list widget, and the scrolled window widget. All of these widgets use pixel values for their adjustments. These are also all widgets which are typically "adjusted" indirectly using scrollbars. While all widgets which use adjustments can either create their own adjustments or use ones you supply, you'll generally want to let this particular category of widgets create its own adjustments. Usually, they will eventually override all the values except the <tt/value/ itself in whatever adjustments you give them, but the results are, in general, undefined (meaning, you'll have to read the source code to find out, and it may be different from widget to widget). Now, you're probably thinking, since text widgets and viewports insist on setting everything except the <tt/value/ of their adjustments, while scrollbars will <em/only/ touch the adjustment's <tt/value/, if you <em/share/ an adjustment object between a scrollbar and a text widget, manipulating the scrollbar will automagically adjust the text widget? Of course it will! Just like this: <tscreen><verb> /* creates its own adjustments */ text = gtk_text_new (NULL, NULL); /* uses the newly-created adjustment for the scrollbar as well */ vscrollbar = gtk_vscrollbar_new (GTK_TEXT(text)->vadj); </verb></tscreen> </sect1> <!-- ----------------------------------------------------------------- --> <sect1> Adjustment Internals <p> Ok, you say, that's nice, but what if I want to create my own handlers to respond when the user adjusts a range widget or a spin button, and how do I get at the value of the adjustment in these handlers? To answer these questions and more, let's start by taking a look at <tt>struct _GtkAdjustment</tt> itself: <tscreen><verb> struct _GtkAdjustment { GtkData data; gfloat lower; gfloat upper; gfloat value; gfloat step_increment; gfloat page_increment; gfloat page_size; }; </verb></tscreen> The first thing you should know is that there aren't any handy-dandy macros or accessor functions for getting the <tt/value/ out of an Adjustment, so you'll have to (horror of horrors) do it like a <em/real/ C programmer. Don't worry - the <tt>GTK_ADJUSTMENT (Object)</tt> macro does run-time type checking (as do all the GTK type-casting macros, actually). Since, when you set the <tt/value/ of an adjustment, you generally want the change to be reflected by every widget that uses this adjustment, GTK provides this convenience function to do this: <tscreen><verb> void gtk_adjustment_set_value( GtkAdjustment *adjustment, gfloat value ); </verb></tscreen> As mentioned earlier, Adjustment is a subclass of Object just like all the various widgets, and thus it is able to emit signals. This is, of course, why updates happen automagically when you share an adjustment object between a scrollbar and another adjustable widget; all adjustable widgets connect signal handlers to their adjustment's <tt/value_changed/ signal, as can your program. Here's the definition of this signal in <tt/struct _GtkAdjustmentClass/: <tscreen><verb> void (* value_changed) (GtkAdjustment *adjustment); </verb></tscreen> The various widgets that use the Adjustment object will emit this signal on an adjustment whenever they change its value. This happens both when user input causes the slider to move on a range widget, as well as when the program explicitly changes the value with <tt/gtk_adjustment_set_value()/. So, for example, if you have a scale widget, and you want to change the rotation of a picture whenever its value changes, you would create a callback like this: <tscreen><verb> void cb_rotate_picture (GtkAdjustment *adj, GtkWidget *picture) { set_picture_rotation (picture, adj->value); ... </verb></tscreen> and connect it to the scale widget's adjustment like this: <tscreen><verb> gtk_signal_connect (GTK_OBJECT (adj), "value_changed", GTK_SIGNAL_FUNC (cb_rotate_picture), picture); </verb></tscreen> What about when a widget reconfigures the <tt/upper/ or <tt/lower/ fields of its adjustment, such as when a user adds more text to a text widget? In this case, it emits the <tt/changed/ signal, which looks like this: <tscreen><verb> void (* changed) (GtkAdjustment *adjustment); </verb></tscreen> Range widgets typically connect a handler to this signal, which changes their appearance to reflect the change - for example, the size of the slider in a scrollbar will grow or shrink in inverse proportion to the difference between the <tt/lower/ and <tt/upper/ values of its adjustment. You probably won't ever need to attach a handler to this signal, unless you're writing a new type of range widget. However, if you change any of the values in a Adjustment directly, you should emit this signal on it to reconfigure whatever widgets are using it, like this: <tscreen><verb> gtk_signal_emit_by_name (GTK_OBJECT (adjustment), "changed"); </verb></tscreen> Now go forth and adjust! </sect1> </sect> <!-- ***************************************************************** --> <sect> Range Widgets<label id="sec_Range_Widgets"> <!-- ***************************************************************** --> <p> The category of range widgets includes the ubiquitous scrollbar widget and the less common "scale" widget. Though these two types of widgets are generally used for different purposes, they are quite similar in function and implementation. All range widgets share a set of common graphic elements, each of which has its own X window and receives events. They all contain a "trough" and a "slider" (what is sometimes called a "thumbwheel" in other GUI environments). Dragging the slider with the pointer moves it back and forth within the trough, while clicking in the trough advances the slider towards the location of the click, either completely, or by a designated amount, depending on which mouse button is used. As mentioned in <ref id="sec_Adjustment" name="Adjustments"> above, all range widgets are associated with an adjustment object, from which they calculate the length of the slider and its position within the trough. When the user manipulates the slider, the range widget will change the value of the adjustment. <!-- ----------------------------------------------------------------- --> <sect1> Scrollbar Widgets <p> These are your standard, run-of-the-mill scrollbars. These should be used only for scrolling some other widget, such as a list, a text box, or a viewport (and it's generally easier to use the scrolled window widget in most cases). For other purposes, you should use scale widgets, as they are friendlier and more featureful. There are separate types for horizontal and vertical scrollbars. There really isn't much to say about these. You create them with the following functions, defined in <tt><gtk/gtkhscrollbar.h></tt> and <tt><gtk/gtkvscrollbar.h></tt>: <tscreen><verb> GtkWidget *gtk_hscrollbar_new( GtkAdjustment *adjustment ); GtkWidget *gtk_vscrollbar_new( GtkAdjustment *adjustment ); </verb></tscreen> and that's about it (if you don't believe me, look in the header files!). The <tt/adjustment/ argument can either be a pointer to an existing Adjustment, or NULL, in which case one will be created for you. Specifying NULL might actually be useful in this case, if you wish to pass the newly-created adjustment to the constructor function of some other widget which will configure it for you, such as a text widget. </sect1> <!-- ----------------------------------------------------------------- --> <sect1> Scale Widgets <p> Scale widgets are used to allow the user to visually select and manipulate a value within a specific range. You might want to use a scale widget, for example, to adjust the magnification level on a zoomed preview of a picture, or to control the brightness of a color, or to specify the number of minutes of inactivity before a screensaver takes over the screen. <!-- ----------------------------------------------------------------- --> <sect2>Creating a Scale Widget <p> As with scrollbars, there are separate widget types for horizontal and vertical scale widgets. (Most programmers seem to favour horizontal scale widgets.) Since they work essentially the same way, there's no need to treat them separately here. The following functions, defined in <tt><gtk/gtkvscale.h></tt> and <tt><gtk/gtkhscale.h></tt>, create vertical and horizontal scale widgets, respectively: <tscreen> <verb> GtkWidget *gtk_vscale_new( GtkAdjustment *adjustment ); GtkWidget *gtk_hscale_new( GtkAdjustment *adjustment ); </verb> </tscreen> The <tt/adjustment/ argument can either be an adjustment which has already been created with <tt/gtk_adjustment_new()/, or <tt/NULL/, in which case, an anonymous Adjustment is created with all of its values set to <tt/0.0/ (which isn't very useful in this case). In order to avoid confusing yourself, you probably want to create your adjustment with a <tt/page_size/ of <tt/0.0/ so that its <tt/upper/ value actually corresponds to the highest value the user can select. (If you're <em/already/ thoroughly confused, read the section on <ref id="sec_Adjustment" name="Adjustments"> again for an explanation of what exactly adjustments do and how to create and manipulate them.) <!-- ----------------------------------------------------------------- --> <sect2> Functions and Signals (well, functions, at least) <p> Scale widgets can display their current value as a number beside the trough. The default behaviour is to show the value, but you can change this with this function: <tscreen><verb> void gtk_scale_set_draw_value( GtkScale *scale, gint draw_value ); </verb></tscreen> As you might have guessed, <tt/draw_value/ is either <tt/TRUE/ or <tt/FALSE/, with predictable consequences for either one. The value displayed by a scale widget is rounded to one decimal point by default, as is the <tt/value/ field in its GtkAdjustment. You can change this with: <tscreen> <verb> void gtk_scale_set_digits( GtkScale *scale, gint digits ); </verb> </tscreen> where <tt/digits/ is the number of decimal places you want. You can set <tt/digits/ to anything you like, but no more than 13 decimal places will actually be drawn on screen. Finally, the value can be drawn in different positions relative to the trough: <tscreen> <verb> void gtk_scale_set_value_pos( GtkScale *scale, GtkPositionType pos ); </verb> </tscreen> The argument <tt/pos/ is of type <tt>GtkPositionType</tt>, which is defined in <tt><gtk/gtkenums.h></tt>, and can take one of the following values: <tscreen><verb> GTK_POS_LEFT GTK_POS_RIGHT GTK_POS_TOP GTK_POS_BOTTOM </verb></tscreen> If you position the value on the "side" of the trough (e.g., on the top or bottom of a horizontal scale widget), then it will follow the slider up and down the trough. All the preceding functions are defined in <tt><gtk/gtkscale.h></tt>. The header files for all GTK widgets are automatically included when you include <tt><gtk/gtk.h></tt>. But you should look over the header files of all widgets that interest you, </sect2> </sect1> <!-- ----------------------------------------------------------------- --> <sect1> Common Range Functions <label id="sec_Range_Functions"> <p> The Range widget class is fairly complicated internally, but, like all the "base class" widgets, most of its complexity is only interesting if you want to hack on it. Also, almost all of the functions and signals it defines are only really used in writing derived widgets. There are, however, a few useful functions that are defined in <tt><gtk/gtkrange.h></tt> and will work on all range widgets. <!-- ----------------------------------------------------------------- --> <sect2> Setting the Update Policy <p> The "update policy" of a range widget defines at what points during user interaction it will change the <tt/value/ field of its Adjustment and emit the "value_changed" signal on this Adjustment. The update policies, defined in <tt><gtk/gtkenums.h></tt> as type <tt>enum GtkUpdateType</tt>, are: <itemize> <item>GTK_UPDATE_POLICY_CONTINUOUS - This is the default. The "value_changed" signal is emitted continuously, i.e., whenever the slider is moved by even the tiniest amount. </item> <item>GTK_UPDATE_POLICY_DISCONTINUOUS - The "value_changed" signal is only emitted once the slider has stopped moving and the user has released the mouse button. </item> <item>GTK_UPDATE_POLICY_DELAYED - The "value_changed" signal is emitted when the user releases the mouse button, or if the slider stops moving for a short period of time. </item> </itemize> The update policy of a range widget can be set by casting it using the <tt>GTK_RANGE (Widget)</tt> macro and passing it to this function: <tscreen><verb> void gtk_range_set_update_policy( GtkRange *range, GtkUpdateType policy) ; </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect2>Getting and Setting Adjustments <p> Getting and setting the adjustment for a range widget "on the fly" is done, predictably, with: <tscreen><verb> GtkAdjustment* gtk_range_get_adjustment( GtkRange *range ); void gtk_range_set_adjustment( GtkRange *range, GtkAdjustment *adjustment ); </verb></tscreen> <tt/gtk_range_get_adjustment()/ returns a pointer to the adjustment to which <tt/range/ is connected. <tt/gtk_range_set_adjustment()/ does absolutely nothing if you pass it the adjustment that <tt/range/ is already using, regardless of whether you changed any of its fields or not. If you pass it a new Adjustment, it will unreference the old one if it exists (possibly destroying it), connect the appropriate signals to the new one, and call the private function <tt/gtk_range_adjustment_changed()/, which will (or at least, is supposed to...) recalculate the size and/or position of the slider and redraw if necessary. As mentioned in the section on adjustments, if you wish to reuse the same Adjustment, when you modify its values directly, you should emit the "changed" signal on it, like this: <tscreen><verb> gtk_signal_emit_by_name (GTK_OBJECT (adjustment), "changed"); </verb></tscreen> </sect2> </sect1> <!-- ----------------------------------------------------------------- --> <sect1> Key and Mouse bindings <p> All of the GTK range widgets react to mouse clicks in more or less the same way. Clicking button-1 in the trough will cause its adjustment's <tt/page_increment/ to be added or subtracted from its <tt/value/, and the slider to be moved accordingly. Clicking mouse button-2 in the trough will jump the slider to the point at which the button was clicked. Clicking any button on a scrollbar's arrows will cause its adjustment's value to change <tt/step_increment/ at a time. It may take a little while to get used to, but by default, scrollbars as well as scale widgets can take the keyboard focus in GTK. If you think your users will find this too confusing, you can always disable this by unsetting the <tt/GTK_CAN_FOCUS/ flag on the scrollbar, like this: <tscreen><verb> GTK_WIDGET_UNSET_FLAGS (scrollbar, GTK_CAN_FOCUS); </verb></tscreen> The key bindings (which are, of course, only active when the widget has focus) are slightly different between horizontal and vertical range widgets, for obvious reasons. They are also not quite the same for scale widgets as they are for scrollbars, for somewhat less obvious reasons (possibly to avoid confusion between the keys for horizontal and vertical scrollbars in scrolled windows, where both operate on the same area). <sect2> Vertical Range Widgets <p> All vertical range widgets can be operated with the up and down arrow keys, as well as with the <tt/Page Up/ and <tt/Page Down/ keys. The arrows move the slider up and down by <tt/step_increment/, while <tt/Page Up/ and <tt/Page Down/ move it by <tt/page_increment/. The user can also move the slider all the way to one end or the other of the trough using the keyboard. With the VScale widget, this is done with the <tt/Home/ and <tt/End/ keys, whereas with the VScrollbar widget, this is done by typing <tt>Control-Page Up</tt> and <tt>Control-Page Down</tt>. <!-- ----------------------------------------------------------------- --> <sect2> Horizontal Range Widgets <p> The left and right arrow keys work as you might expect in these widgets, moving the slider back and forth by <tt/step_increment/. The <tt/Home/ and <tt/End/ keys move the slider to the ends of the trough. For the HScale widget, moving the slider by <tt/page_increment/ is accomplished with <tt>Control-Left</tt> and <tt>Control-Right</tt>, while for HScrollbar, it's done with <tt>Control-Home</tt> and <tt>Control-End</tt>. </sect2> </sect1> <!-- ----------------------------------------------------------------- --> <sect1> Example<label id="sec_Range_Example"> <p> This example is a somewhat modified version of the "range controls" test from <tt/testgtk.c/. It basically puts up a window with three range widgets all connected to the same adjustment, and a couple of controls for adjusting some of the parameters mentioned above and in the section on adjustments, so you can see how they affect the way these widgets work for the user. <tscreen><verb> /* example-start rangewidgets rangewidgets.c */ #include <gtk/gtk.h> GtkWidget *hscale, *vscale; void cb_pos_menu_select( GtkWidget *item, GtkPositionType pos ) { /* Set the value position on both scale widgets */ gtk_scale_set_value_pos (GTK_SCALE (hscale), pos); gtk_scale_set_value_pos (GTK_SCALE (vscale), pos); } void cb_update_menu_select( GtkWidget *item, GtkUpdateType policy ) { /* Set the update policy for both scale widgets */ gtk_range_set_update_policy (GTK_RANGE (hscale), policy); gtk_range_set_update_policy (GTK_RANGE (vscale), policy); } void cb_digits_scale( GtkAdjustment *adj ) { /* Set the number of decimal places to which adj->value is rounded */ gtk_scale_set_digits (GTK_SCALE (hscale), (gint) adj->value); gtk_scale_set_digits (GTK_SCALE (vscale), (gint) adj->value); } void cb_page_size( GtkAdjustment *get, GtkAdjustment *set ) { /* Set the page size and page increment size of the sample * adjustment to the value specified by the "Page Size" scale */ set->page_size = get->value; set->page_increment = get->value; /* Now emit the "changed" signal to reconfigure all the widgets that * are attached to this adjustment */ gtk_signal_emit_by_name (GTK_OBJECT (set), "changed"); } void cb_draw_value( GtkToggleButton *button ) { /* Turn the value display on the scale widgets off or on depending * on the state of the checkbutton */ gtk_scale_set_draw_value (GTK_SCALE (hscale), button->active); gtk_scale_set_draw_value (GTK_SCALE (vscale), button->active); } /* Convenience functions */ GtkWidget *make_menu_item( gchar *name, GtkSignalFunc callback, gpointer data ) { GtkWidget *item; item = gtk_menu_item_new_with_label (name); gtk_signal_connect (GTK_OBJECT (item), "activate", callback, data); gtk_widget_show (item); return(item); } void scale_set_default_values( GtkScale *scale ) { gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_CONTINUOUS); gtk_scale_set_digits (scale, 1); gtk_scale_set_value_pos (scale, GTK_POS_TOP); gtk_scale_set_draw_value (scale, TRUE); } /* makes the sample window */ void create_range_controls( void ) { GtkWidget *window; GtkWidget *box1, *box2, *box3; GtkWidget *button; GtkWidget *scrollbar; GtkWidget *separator; GtkWidget *opt, *menu, *item; GtkWidget *label; GtkWidget *scale; GtkObject *adj1, *adj2; /* Standard window-creating stuff */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC(gtk_main_quit), NULL); gtk_window_set_title (GTK_WINDOW (window), "range controls"); box1 = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window), box1); gtk_widget_show (box1); box2 = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); gtk_widget_show (box2); /* value, lower, upper, step_increment, page_increment, page_size */ /* Note that the page_size value only makes a difference for * scrollbar widgets, and the highest value you'll get is actually * (upper - page_size). */ adj1 = gtk_adjustment_new (0.0, 0.0, 101.0, 0.1, 1.0, 1.0); vscale = gtk_vscale_new (GTK_ADJUSTMENT (adj1)); scale_set_default_values (GTK_SCALE (vscale)); gtk_box_pack_start (GTK_BOX (box2), vscale, TRUE, TRUE, 0); gtk_widget_show (vscale); box3 = gtk_vbox_new (FALSE, 10); gtk_box_pack_start (GTK_BOX (box2), box3, TRUE, TRUE, 0); gtk_widget_show (box3); /* Reuse the same adjustment */ hscale = gtk_hscale_new (GTK_ADJUSTMENT (adj1)); gtk_widget_set_usize (GTK_WIDGET (hscale), 200, 30); scale_set_default_values (GTK_SCALE (hscale)); gtk_box_pack_start (GTK_BOX (box3), hscale, TRUE, TRUE, 0); gtk_widget_show (hscale); /* Reuse the same adjustment again */ scrollbar = gtk_hscrollbar_new (GTK_ADJUSTMENT (adj1)); /* Notice how this causes the scales to always be updated * continuously when the scrollbar is moved */ gtk_range_set_update_policy (GTK_RANGE (scrollbar), GTK_UPDATE_CONTINUOUS); gtk_box_pack_start (GTK_BOX (box3), scrollbar, TRUE, TRUE, 0); gtk_widget_show (scrollbar); box2 = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); gtk_widget_show (box2); /* A checkbutton to control whether the value is displayed or not */ button = gtk_check_button_new_with_label("Display value on scale widgets"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC(cb_draw_value), NULL); gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); gtk_widget_show (button); box2 = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (box2), 10); /* An option menu to change the position of the value */ label = gtk_label_new ("Scale Value Position:"); gtk_box_pack_start (GTK_BOX (box2), label, FALSE, FALSE, 0); gtk_widget_show (label); opt = gtk_option_menu_new(); menu = gtk_menu_new(); item = make_menu_item ("Top", GTK_SIGNAL_FUNC(cb_pos_menu_select), GINT_TO_POINTER (GTK_POS_TOP)); gtk_menu_append (GTK_MENU (menu), item); item = make_menu_item ("Bottom", GTK_SIGNAL_FUNC (cb_pos_menu_select), GINT_TO_POINTER (GTK_POS_BOTTOM)); gtk_menu_append (GTK_MENU (menu), item); item = make_menu_item ("Left", GTK_SIGNAL_FUNC (cb_pos_menu_select), GINT_TO_POINTER (GTK_POS_LEFT)); gtk_menu_append (GTK_MENU (menu), item); item = make_menu_item ("Right", GTK_SIGNAL_FUNC (cb_pos_menu_select), GINT_TO_POINTER (GTK_POS_RIGHT)); gtk_menu_append (GTK_MENU (menu), item); gtk_option_menu_set_menu (GTK_OPTION_MENU (opt), menu); gtk_box_pack_start (GTK_BOX (box2), opt, TRUE, TRUE, 0); gtk_widget_show (opt); gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); gtk_widget_show (box2); box2 = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (box2), 10); /* Yet another option menu, this time for the update policy of the * scale widgets */ label = gtk_label_new ("Scale Update Policy:"); gtk_box_pack_start (GTK_BOX (box2), label, FALSE, FALSE, 0); gtk_widget_show (label); opt = gtk_option_menu_new(); menu = gtk_menu_new(); item = make_menu_item ("Continuous", GTK_SIGNAL_FUNC (cb_update_menu_select), GINT_TO_POINTER (GTK_UPDATE_CONTINUOUS)); gtk_menu_append (GTK_MENU (menu), item); item = make_menu_item ("Discontinuous", GTK_SIGNAL_FUNC (cb_update_menu_select), GINT_TO_POINTER (GTK_UPDATE_DISCONTINUOUS)); gtk_menu_append (GTK_MENU (menu), item); item = make_menu_item ("Delayed", GTK_SIGNAL_FUNC (cb_update_menu_select), GINT_TO_POINTER (GTK_UPDATE_DELAYED)); gtk_menu_append (GTK_MENU (menu), item); gtk_option_menu_set_menu (GTK_OPTION_MENU (opt), menu); gtk_box_pack_start (GTK_BOX (box2), opt, TRUE, TRUE, 0); gtk_widget_show (opt); gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); gtk_widget_show (box2); box2 = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (box2), 10); /* An HScale widget for adjusting the number of digits on the * sample scales. */ label = gtk_label_new ("Scale Digits:"); gtk_box_pack_start (GTK_BOX (box2), label, FALSE, FALSE, 0); gtk_widget_show (label); adj2 = gtk_adjustment_new (1.0, 0.0, 5.0, 1.0, 1.0, 0.0); gtk_signal_connect (GTK_OBJECT (adj2), "value_changed", GTK_SIGNAL_FUNC (cb_digits_scale), NULL); scale = gtk_hscale_new (GTK_ADJUSTMENT (adj2)); gtk_scale_set_digits (GTK_SCALE (scale), 0); gtk_box_pack_start (GTK_BOX (box2), scale, TRUE, TRUE, 0); gtk_widget_show (scale); gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); gtk_widget_show (box2); box2 = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (box2), 10); /* And, one last HScale widget for adjusting the page size of the * scrollbar. */ label = gtk_label_new ("Scrollbar Page Size:"); gtk_box_pack_start (GTK_BOX (box2), label, FALSE, FALSE, 0); gtk_widget_show (label); adj2 = gtk_adjustment_new (1.0, 1.0, 101.0, 1.0, 1.0, 0.0); gtk_signal_connect (GTK_OBJECT (adj2), "value_changed", GTK_SIGNAL_FUNC (cb_page_size), adj1); scale = gtk_hscale_new (GTK_ADJUSTMENT (adj2)); gtk_scale_set_digits (GTK_SCALE (scale), 0); gtk_box_pack_start (GTK_BOX (box2), scale, TRUE, TRUE, 0); gtk_widget_show (scale); gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); gtk_widget_show (box2); separator = gtk_hseparator_new (); gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0); gtk_widget_show (separator); box2 = gtk_vbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0); gtk_widget_show (box2); button = gtk_button_new_with_label ("Quit"); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC(gtk_main_quit), NULL); gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_grab_default (button); gtk_widget_show (button); gtk_widget_show (window); } int main( int argc, char *argv[] ) { gtk_init(&argc, &argv); create_range_controls(); gtk_main(); return(0); } /* example-end */ </verb></tscreen> You will notice that the program does not call <tt/gtk_signal_connect/ for the "delete_event", but only for the "destroy" signal. This will still perform the desired function, because an unhandled "delete_event" will result in a "destroy" signal being given to the window. </sect1> </sect> <!-- ***************************************************************** --> <sect> Miscellaneous Widgets <!-- ***************************************************************** --> <!-- ----------------------------------------------------------------- --> <sect1> Labels <p> Labels are used a lot in GTK, and are relatively simple. Labels emit no signals as they do not have an associated X window. If you need to catch signals, or do clipping, place it inside a <ref id="sec_EventBox" name="EventBox"> widget or a Button widget. To create a new label, use: <tscreen><verb> GtkWidget *gtk_label_new( char *str ); </verb></tscreen> The sole argument is the string you wish the label to display. To change the label's text after creation, use the function: <tscreen><verb> void gtk_label_set_text( GtkLabel *label, char *str ); </verb></tscreen> The first argument is the label you created previously (cast using the <tt/GTK_LABEL()/ macro), and the second is the new string. The space needed for the new string will be automatically adjusted if needed. You can produce multi-line labels by putting line breaks in the label string. To retrieve the current string, use: <tscreen><verb> void gtk_label_get( GtkLabel *label, char **str ); </verb></tscreen> The first argument is the label you've created, and the second, the return for the string. Do not free the return string, as it is used internally by GTK. The label text can be justified using: <tscreen><verb> void gtk_label_set_justify( GtkLabel *label, GtkJustification jtype ); </verb></tscreen> Values for <tt/jtype/ are: <tscreen><verb> GTK_JUSTIFY_LEFT GTK_JUSTIFY_RIGHT GTK_JUSTIFY_CENTER (the default) GTK_JUSTIFY_FILL </verb></tscreen> The label widget is also capable of line wrapping the text automatically. This can be activated using: <tscreen><verb> void gtk_label_set_line_wrap (GtkLabel *label, gboolean wrap); </verb></tscreen> The <tt/wrap/ argument takes a TRUE or FALSE value. If you want your label underlined, then you can set a pattern on the label: <tscreen><verb> void gtk_label_set_pattern (GtkLabel *label, const gchar *pattern); </verb></tscreen> The pattern argument indicates how the underlining should look. It consists of a string of underscore and space characters. An underscore indicates that the corresponding character in the label should be underlined. For example, the string <verb/"__ __"/ would underline the first two characters and eight and ninth characters. Below is a short example to illustrate these functions. This example makes use of the Frame widget to better demonstrate the label styles. You can ignore this for now as the <ref id="sec_Frames" name="Frame"> widget is explained later on. <tscreen><verb> /* example-start label label.c */ #include <gtk/gtk.h> int main( int argc, char *argv[] ) { static GtkWidget *window = NULL; GtkWidget *hbox; GtkWidget *vbox; GtkWidget *frame; GtkWidget *label; /* Initialise GTK */ gtk_init(&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC(gtk_main_quit), NULL); gtk_window_set_title (GTK_WINDOW (window), "Label"); vbox = gtk_vbox_new (FALSE, 5); hbox = gtk_hbox_new (FALSE, 5); gtk_container_add (GTK_CONTAINER (window), hbox); gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (window), 5); frame = gtk_frame_new ("Normal Label"); label = gtk_label_new ("This is a Normal label"); gtk_container_add (GTK_CONTAINER (frame), label); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); frame = gtk_frame_new ("Multi-line Label"); label = gtk_label_new ("This is a Multi-line label.\nSecond line\n" \ "Third line"); gtk_container_add (GTK_CONTAINER (frame), label); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); frame = gtk_frame_new ("Left Justified Label"); label = gtk_label_new ("This is a Left-Justified\n" \ "Multi-line label.\nThird line"); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_container_add (GTK_CONTAINER (frame), label); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); frame = gtk_frame_new ("Right Justified Label"); label = gtk_label_new ("This is a Right-Justified\nMulti-line label.\n" \ "Fourth line, (j/k)"); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT); gtk_container_add (GTK_CONTAINER (frame), label); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); vbox = gtk_vbox_new (FALSE, 5); gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0); frame = gtk_frame_new ("Line wrapped label"); label = gtk_label_new ("This is an example of a line-wrapped label. It " \ "should not be taking up the entire " /* big space to test spacing */\ "width allocated to it, but automatically " \ "wraps the words to fit. " \ "The time has come, for all good men, to come to " \ "the aid of their party. " \ "The sixth sheik's six sheep's sick.\n" \ " It supports multiple paragraphs correctly, " \ "and correctly adds "\ "many extra spaces. "); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_container_add (GTK_CONTAINER (frame), label); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); frame = gtk_frame_new ("Filled, wrapped label"); label = gtk_label_new ("This is an example of a line-wrapped, filled label. " \ "It should be taking "\ "up the entire width allocated to it. " \ "Here is a sentence to prove "\ "my point. Here is another sentence. "\ "Here comes the sun, do de do de do.\n"\ " This is a new paragraph.\n"\ " This is another newer, longer, better " \ "paragraph. It is coming to an end, "\ "unfortunately."); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_FILL); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_container_add (GTK_CONTAINER (frame), label); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); frame = gtk_frame_new ("Underlined label"); label = gtk_label_new ("This label is underlined!\n" "This one is underlined in quite a funky fashion"); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_label_set_pattern (GTK_LABEL (label), "_________________________ _ _________ _ ______ __ _______ ___"); gtk_container_add (GTK_CONTAINER (frame), label); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show_all (window); gtk_main (); return(0); } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1> Arrows <p> The Arrow widget draws an arrowhead, facing in a number of possible directions and having a number of possible styles. It can be very useful when placed on a button in many applications. Like the Label widget, it emits no signals. There are only two functions for manipulating an Arrow widget: <tscreen><verb> GtkWidget *gtk_arrow_new( GtkArrowType arrow_type, GtkShadowType shadow_type ); void gtk_arrow_set( GtkArrow *arrow, GtkArrowType arrow_type, GtkShadowType shadow_type ); </verb></tscreen> The first creates a new arrow widget with the indicated type and appearance. The second allows these values to be altered retrospectively. The <tt/arrow_type/ argument may take one of the following values: <tscreen><verb> GTK_ARROW_UP GTK_ARROW_DOWN GTK_ARROW_LEFT GTK_ARROW_RIGHT </verb></tscreen> These values obviously indicate the direction in which the arrow will point. The <tt/shadow_type/ argument may take one of these values: <tscreen><verb> GTK_SHADOW_IN GTK_SHADOW_OUT (the default) GTK_SHADOW_ETCHED_IN GTK_SHADOW_ETCHED_OUT </verb></tscreen> Here's a brief example to illustrate their use. <tscreen><verb> /* example-start arrow arrow.c */ #include <gtk/gtk.h> /* Create an Arrow widget with the specified parameters * and pack it into a button */ GtkWidget *create_arrow_button( GtkArrowType arrow_type, GtkShadowType shadow_type ) { GtkWidget *button; GtkWidget *arrow; button = gtk_button_new(); arrow = gtk_arrow_new (arrow_type, shadow_type); gtk_container_add (GTK_CONTAINER (button), arrow); gtk_widget_show(button); gtk_widget_show(arrow); return(button); } int main( int argc, char *argv[] ) { /* GtkWidget is the storage type for widgets */ GtkWidget *window; GtkWidget *button; GtkWidget *box; /* Initialize the toolkit */ gtk_init (&argc, &argv); /* Create a new window */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Arrow Buttons"); /* It's a good idea to do this for all windows. */ gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_main_quit), NULL); /* Sets the border width of the window. */ gtk_container_set_border_width (GTK_CONTAINER (window), 10); /* Create a box to hold the arrows/buttons */ box = gtk_hbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (box), 2); gtk_container_add (GTK_CONTAINER (window), box); /* Pack and show all our widgets */ gtk_widget_show(box); button = create_arrow_button(GTK_ARROW_UP, GTK_SHADOW_IN); gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 3); button = create_arrow_button(GTK_ARROW_DOWN, GTK_SHADOW_OUT); gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 3); button = create_arrow_button(GTK_ARROW_LEFT, GTK_SHADOW_ETCHED_IN); gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 3); button = create_arrow_button(GTK_ARROW_RIGHT, GTK_SHADOW_ETCHED_OUT); gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 3); gtk_widget_show (window); /* Rest in gtk_main and wait for the fun to begin! */ gtk_main (); return(0); } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>The Tooltips Object <p> These are the little text strings that pop up when you leave your pointer over a button or other widget for a few seconds. They are easy to use, so I will just explain them without giving an example. If you want to see some code, take a look at the testgtk.c program distributed with GTK. Widgets that do not receive events (widgets that do not have their own window) will not work with tooltips. The first call you will use creates a new tooltip. You only need to do this once for a set of tooltips as the <tt/GtkTooltips/ object this function returns can be used to create multiple tooltips. <tscreen><verb> GtkTooltips *gtk_tooltips_new( void ); </verb></tscreen> Once you have created a new tooltip, and the widget you wish to use it on, simply use this call to set it: <tscreen><verb> void gtk_tooltips_set_tip( GtkTooltips *tooltips, GtkWidget *widget, const gchar *tip_text, const gchar *tip_private ); </verb></tscreen> The first argument is the tooltip you've already created, followed by the widget you wish to have this tooltip pop up for, and the text you wish it to say. The last argument is a text string that can be used as an identifier when using GtkTipsQuery to implement context sensitive help. For now, you can set it to NULL. <!-- TODO: sort out what how to do the context sensitive help --> Here's a short example: <tscreen><verb> GtkTooltips *tooltips; GtkWidget *button; . . . tooltips = gtk_tooltips_new (); button = gtk_button_new_with_label ("button 1"); . . . gtk_tooltips_set_tip (tooltips, button, "This is button 1", NULL); </verb></tscreen> There are other calls that can be used with tooltips. I will just list them with a brief description of what they do. <tscreen><verb> void gtk_tooltips_enable( GtkTooltips *tooltips ); </verb></tscreen> Enable a disabled set of tooltips. <tscreen><verb> void gtk_tooltips_disable( GtkTooltips *tooltips ); </verb></tscreen> Disable an enabled set of tooltips. <tscreen><verb> void gtk_tooltips_set_delay( GtkTooltips *tooltips, gint delay ); </verb></tscreen> Sets how many milliseconds you have to hold your pointer over the widget before the tooltip will pop up. The default is 500 milliseconds (half a second). <tscreen><verb> void gtk_tooltips_set_colors( GtkTooltips *tooltips, GdkColor *background, GdkColor *foreground ); </verb></tscreen> Set the foreground and background color of the tooltips. And that's all the functions associated with tooltips. More than you'll ever want to know :-) <!-- ----------------------------------------------------------------- --> <sect1> Progress Bars <label id="sec_ProgressBar"> <p> Progress bars are used to show the status of an operation. They are pretty easy to use, as you will see with the code below. But first lets start out with the calls to create a new progress bar. There are two ways to create a progress bar, one simple that takes no arguments, and one that takes an Adjustment object as an argument. If the former is used, the progress bar creates its own adjustment object. <tscreen><verb> GtkWidget *gtk_progress_bar_new( void ); GtkWidget *gtk_progress_bar_new_with_adjustment( GtkAdjustment *adjustment ); </verb></tscreen> The second method has the advantage that we can use the adjustment object to specify our own range parameters for the progress bar. The adjustment of a progress object can be changed dynamically using: <tscreen><verb> void gtk_progress_set_adjustment( GtkProgress *progress, GtkAdjustment *adjustment ); </verb></tscreen> Now that the progress bar has been created we can use it. <tscreen><verb> void gtk_progress_bar_update( GtkProgressBar *pbar, gfloat percentage ); </verb></tscreen> The first argument is the progress bar you wish to operate on, and the second argument is the amount "completed", meaning the amount the progress bar has been filled from 0-100%. This is passed to the function as a real number ranging from 0 to 1. GTK v1.2 has added new functionality to the progress bar that enables it to display its value in different ways, and to inform the user of its current value and its range. A progress bar may be set to one of a number of orientations using the function <tscreen><verb> void gtk_progress_bar_set_orientation( GtkProgressBar *pbar, GtkProgressBarOrientation orientation ); </verb></tscreen> The <tt/orientation/ argument may take one of the following values to indicate the direction in which the progress bar moves: <tscreen><verb> GTK_PROGRESS_LEFT_TO_RIGHT GTK_PROGRESS_RIGHT_TO_LEFT GTK_PROGRESS_BOTTOM_TO_TOP GTK_PROGRESS_TOP_TO_BOTTOM </verb></tscreen> When used as a measure of how far a process has progressed, the ProgressBar can be set to display its value in either a continuous or discrete mode. In continuous mode, the progress bar is updated for each value. In discrete mode, the progress bar is updated in a number of discrete blocks. The number of blocks is also configurable. The style of a progress bar can be set using the following function. <tscreen><verb> void gtk_progress_bar_set_bar_style( GtkProgressBar *pbar, GtkProgressBarStyle style ); </verb></tscreen> The <tt/style/ parameter can take one of two values: <tscreen><verb> GTK_PROGRESS_CONTINUOUS GTK_PROGRESS_DISCRETE </verb></tscreen> The number of discrete blocks can be set by calling <tscreen><verb> void gtk_progress_bar_set_discrete_blocks( GtkProgressBar *pbar, guint blocks ); </verb></tscreen> As well as indicating the amount of progress that has occured, the progress bar may be set to just indicate that there is some activity. This can be useful in situations where progress cannot be measured against a value range. Activity mode is not effected by the bar style that is described above, and overrides it. This mode is either TRUE or FALSE, and is selected by the following function. <tscreen><verb> void gtk_progress_set_activity_mode( GtkProgress *progress, guint activity_mode ); </verb></tscreen> The step size of the activity indicator, and the number of blocks are set using the following functions. <tscreen><verb> void gtk_progress_bar_set_activity_step( GtkProgressBar *pbar, guint step ); void gtk_progress_bar_set_activity_blocks( GtkProgressBar *pbar, guint blocks ); </verb></tscreen> When in continuous mode, the progress bar can also display a configurable text string within its trough, using the following function. <tscreen><verb> void gtk_progress_set_format_string( GtkProgress *progress, gchar *format); </verb></tscreen> The <tt/format/ argument is similiar to one that would be used in a C <tt/printf/ statement. The following directives may be used within the format string: <itemize> <item> %p - percentage <item> %v - value <item> %l - lower range value <item> %u - upper range value </itemize> The displaying of this text string can be toggled using: <tscreen><verb> void gtk_progress_set_show_text( GtkProgress *progress, gint show_text ); </verb></tscreen> The <tt/show_text/ argument is a boolean TRUE/FALSE value. The appearance of the text can be modified further using: <tscreen><verb> void gtk_progress_set_text_alignment( GtkProgress *progress, gfloat x_align, gfloat y_align ); </verb></tscreen> The <tt/x_align/ and <tt/y_align/ arguments take values between 0.0 and 1.0. Their values indicate the position of the text string within the trough. Values of 0.0 for both would place the string in the top left hand corner; values of 0.5 (the default) centres the text, and values of 1.0 places the text in the lower right hand corner. The current text setting of a progress object can be retrieved using the current or a specified adjustment value using the following two functions. The character string returned by these functions should be freed by the application (using the g_free() function). These functions return the formatted string that would be displayed within the trough. <tscreen><verb> gchar *gtk_progress_get_current_text( GtkProgress *progress ); gchar *gtk_progress_get_text_from_value( GtkProgress *progress, gfloat value ); </verb></tscreen> There is yet another way to change the range and value of a progress object using the following function: <tscreen><verb> void gtk_progress_configure( GtkProgress *progress, gfloat value, gfloat min, gfloat max ); </verb></tscreen> This function provides quite a simple interface to the range and value of a progress object. The remaining functions can be used to get and set the current value of a progess object in various types and formats: <tscreen><verb> void gtk_progress_set_percentage( GtkProgress *progress, gfloat percentage ); void gtk_progress_set_value( GtkProgress *progress, gfloat value ); gfloat gtk_progress_get_value( GtkProgress *progress ); gfloat gtk_progress_get_current_percentage( GtkProgress *progress ); gfloat gtk_progress_get_percentage_from_value( GtkProgress *progress, gfloat value ); </verb></tscreen> These functions are pretty self explanatory. The last function uses the the adjustment of the specified progess object to compute the percentage value of the given range value. Progress Bars are usually used with timeouts or other such functions (see section on <ref id="sec_timeouts" name="Timeouts, I/O and Idle Functions">) to give the illusion of multitasking. All will employ the gtk_progress_bar_update function in the same manner. Here is an example of the progress bar, updated using timeouts. This code also shows you how to reset the Progress Bar. <tscreen><verb> /* example-start progressbar progressbar.c */ #include <gtk/gtk.h> typedef struct _ProgressData { GtkWidget *window; GtkWidget *pbar; int timer; } ProgressData; /* Update the value of the progress bar so that we get * some movement */ gint progress_timeout( gpointer data ) { gfloat new_val; GtkAdjustment *adj; /* Calculate the value of the progress bar using the * value range set in the adjustment object */ new_val = gtk_progress_get_value( GTK_PROGRESS(data) ) + 1; adj = GTK_PROGRESS (data)->adjustment; if (new_val > adj->upper) new_val = adj->lower; /* Set the new value */ gtk_progress_set_value (GTK_PROGRESS (data), new_val); /* As this is a timeout function, return TRUE so that it * continues to get called */ return(TRUE); } /* Callback that toggles the text display within the progress * bar trough */ void toggle_show_text( GtkWidget *widget, ProgressData *pdata ) { gtk_progress_set_show_text (GTK_PROGRESS (pdata->pbar), GTK_TOGGLE_BUTTON (widget)->active); } /* Callback that toggles the activity mode of the progress * bar */ void toggle_activity_mode( GtkWidget *widget, ProgressData *pdata ) { gtk_progress_set_activity_mode (GTK_PROGRESS (pdata->pbar), GTK_TOGGLE_BUTTON (widget)->active); } /* Callback that toggles the continuous mode of the progress * bar */ void set_continuous_mode( GtkWidget *widget, ProgressData *pdata ) { gtk_progress_bar_set_bar_style (GTK_PROGRESS_BAR (pdata->pbar), GTK_PROGRESS_CONTINUOUS); } /* Callback that toggles the discrete mode of the progress * bar */ void set_discrete_mode( GtkWidget *widget, ProgressData *pdata ) { gtk_progress_bar_set_bar_style (GTK_PROGRESS_BAR (pdata->pbar), GTK_PROGRESS_DISCRETE); } /* Clean up allocated memory and remove the timer */ void destroy_progress( GtkWidget *widget, ProgressData *pdata) { gtk_timeout_remove (pdata->timer); pdata->timer = 0; pdata->window = NULL; g_free(pdata); gtk_main_quit(); } int main( int argc, char *argv[]) { ProgressData *pdata; GtkWidget *align; GtkWidget *separator; GtkWidget *table; GtkAdjustment *adj; GtkWidget *button; GtkWidget *check; GtkWidget *vbox; gtk_init (&argc, &argv); /* Allocate memory for the data that is passwd to the callbacks */ pdata = g_malloc( sizeof(ProgressData) ); pdata->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_policy (GTK_WINDOW (pdata->window), FALSE, FALSE, TRUE); gtk_signal_connect (GTK_OBJECT (pdata->window), "destroy", GTK_SIGNAL_FUNC (destroy_progress), pdata); gtk_window_set_title (GTK_WINDOW (pdata->window), "GtkProgressBar"); gtk_container_set_border_width (GTK_CONTAINER (pdata->window), 0); vbox = gtk_vbox_new (FALSE, 5); gtk_container_set_border_width (GTK_CONTAINER (vbox), 10); gtk_container_add (GTK_CONTAINER (pdata->window), vbox); gtk_widget_show(vbox); /* Create a centering alignment object */ align = gtk_alignment_new (0.5, 0.5, 0, 0); gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 5); gtk_widget_show(align); /* Create a Adjusment object to hold the range of the * progress bar */ adj = (GtkAdjustment *) gtk_adjustment_new (0, 1, 150, 0, 0, 0); /* Create the GtkProgressBar using the adjustment */ pdata->pbar = gtk_progress_bar_new_with_adjustment (adj); /* Set the format of the string that can be displayed in the * trough of the progress bar: * %p - percentage * %v - value * %l - lower range value * %u - upper range value */ gtk_progress_set_format_string (GTK_PROGRESS (pdata->pbar), "%v from [%l-%u] (=%p%%)"); gtk_container_add (GTK_CONTAINER (align), pdata->pbar); gtk_widget_show(pdata->pbar); /* Add a timer callback to update the value of the progress bar */ pdata->timer = gtk_timeout_add (100, progress_timeout, pdata->pbar); separator = gtk_hseparator_new (); gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0); gtk_widget_show(separator); /* rows, columns, homogeneous */ table = gtk_table_new (2, 3, FALSE); gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0); gtk_widget_show(table); /* Add a check button to select displaying of the trough text */ check = gtk_check_button_new_with_label ("Show text"); gtk_table_attach (GTK_TABLE (table), check, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 5, 5); gtk_signal_connect (GTK_OBJECT (check), "clicked", GTK_SIGNAL_FUNC (toggle_show_text), pdata); gtk_widget_show(check); /* Add a check button to toggle activity mode */ check = gtk_check_button_new_with_label ("Activity mode"); gtk_table_attach (GTK_TABLE (table), check, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 5, 5); gtk_signal_connect (GTK_OBJECT (check), "clicked", GTK_SIGNAL_FUNC (toggle_activity_mode), pdata); gtk_widget_show(check); separator = gtk_vseparator_new (); gtk_table_attach (GTK_TABLE (table), separator, 1, 2, 0, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 5, 5); gtk_widget_show(separator); /* Add a radio button to select continuous display mode */ button = gtk_radio_button_new_with_label (NULL, "Continuous"); gtk_table_attach (GTK_TABLE (table), button, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 5, 5); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (set_continuous_mode), pdata); gtk_widget_show (button); /* Add a radio button to select discrete display mode */ button = gtk_radio_button_new_with_label( gtk_radio_button_group (GTK_RADIO_BUTTON (button)), "Discrete"); gtk_table_attach (GTK_TABLE (table), button, 2, 3, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 5, 5); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (set_discrete_mode), pdata); gtk_widget_show (button); separator = gtk_hseparator_new (); gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0); gtk_widget_show(separator); /* Add a button to exit the program */ button = gtk_button_new_with_label ("close"); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", (GtkSignalFunc) gtk_widget_destroy, GTK_OBJECT (pdata->window)); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); /* This makes it so the button is the default. */ GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); /* This grabs this button to be the default button. Simply hitting * the "Enter" key will cause this button to activate. */ gtk_widget_grab_default (button); gtk_widget_show(button); gtk_widget_show (pdata->window); gtk_main (); return(0); } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1> Dialogs <p> The Dialog widget is very simple, and is actually just a window with a few things pre-packed into it for you. The structure for a Dialog is: <tscreen><verb> struct GtkDialog { GtkWindow window; GtkWidget *vbox; GtkWidget *action_area; }; </verb></tscreen> So you see, it simply creates a window, and then packs a vbox into the top, which contains a separator and then an hbox called the "action_area". The Dialog widget can be used for pop-up messages to the user, and other similar tasks. It is really basic, and there is only one function for the dialog box, which is: <tscreen><verb> GtkWidget *gtk_dialog_new( void ); </verb></tscreen> So to create a new dialog box, use, <tscreen><verb> GtkWidget *window; window = gtk_dialog_new (); </verb></tscreen> This will create the dialog box, and it is now up to you to use it. You could pack a button in the action_area by doing something like this: <tscreen><verb> button = ... gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area), button, TRUE, TRUE, 0); gtk_widget_show (button); </verb></tscreen> And you could add to the vbox area by packing, for instance, a label in it, try something like this: <tscreen><verb> label = gtk_label_new ("Dialogs are groovy"); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), label, TRUE, TRUE, 0); gtk_widget_show (label); </verb></tscreen> As an example in using the dialog box, you could put two buttons in the action_area, a Cancel button and an Ok button, and a label in the vbox area, asking the user a question or giving an error etc. Then you could attach a different signal to each of the buttons and perform the operation the user selects. If the simple functionality provided by the default vertical and horizontal boxes in the two areas doesn't give you enough control for your application, then you can simply pack another layout widget into the boxes provided. For example, you could pack a table into the vertical box. <!-- ----------------------------------------------------------------- --> <sect1> Pixmaps <label id="sec_Pixmaps"> <p> Pixmaps are data structures that contain pictures. These pictures can be used in various places, but most commonly as icons on the X desktop, or as cursors. A pixmap which only has 2 colors is called a bitmap, and there are a few additional routines for handling this common special case. To understand pixmaps, it would help to understand how X window system works. Under X, applications do not need to be running on the same computer that is interacting with the user. Instead, the various applications, called "clients", all communicate with a program which displays the graphics and handles the keyboard and mouse. This program which interacts directly with the user is called a "display server" or "X server." Since the communication might take place over a network, it's important to keep some information with the X server. Pixmaps, for example, are stored in the memory of the X server. This means that once pixmap values are set, they don't need to keep getting transmitted over the network; instead a command is sent to "display pixmap number XYZ here." Even if you aren't using X with GTK currently, using constructs such as Pixmaps will make your programs work acceptably under X. To use pixmaps in GTK, we must first build a GdkPixmap structure using routines from the GDK layer. Pixmaps can either be created from in-memory data, or from data read from a file. We'll go through each of the calls to create a pixmap. <tscreen><verb> GdkPixmap *gdk_bitmap_create_from_data( GdkWindow *window, gchar *data, gint width, gint height ); </verb></tscreen> This routine is used to create a single-plane pixmap (2 colors) from data in memory. Each bit of the data represents whether that pixel is off or on. Width and height are in pixels. The GdkWindow pointer is to the current window, since a pixmap's resources are meaningful only in the context of the screen where it is to be displayed. <tscreen><verb> GdkPixmap *gdk_pixmap_create_from_data( GdkWindow *window, gchar *data, gint width, gint height, gint depth, GdkColor *fg, GdkColor *bg ); </verb></tscreen> This is used to create a pixmap of the given depth (number of colors) from the bitmap data specified. <tt/fg/ and <tt/bg/ are the foreground and background color to use. <tscreen><verb> GdkPixmap *gdk_pixmap_create_from_xpm( GdkWindow *window, GdkBitmap **mask, GdkColor *transparent_color, const gchar *filename ); </verb></tscreen> XPM format is a readable pixmap representation for the X Window System. It is widely used and many different utilities are available for creating image files in this format. The file specified by filename must contain an image in that format and it is loaded into the pixmap structure. The mask specifies which bits of the pixmap are opaque. All other bits are colored using the color specified by transparent_color. An example using this follows below. <tscreen><verb> GdkPixmap *gdk_pixmap_create_from_xpm_d( GdkWindow *window, GdkBitmap **mask, GdkColor *transparent_color, gchar **data ); </verb></tscreen> Small images can be incorporated into a program as data in the XPM format. A pixmap is created using this data, instead of reading it from a file. An example of such data is <tscreen><verb> /* XPM */ static const char * xpm_data[] = { "16 16 3 1", " c None", ". c #000000000000", "X c #FFFFFFFFFFFF", " ", " ...... ", " .XXX.X. ", " .XXX.XX. ", " .XXX.XXX. ", " .XXX..... ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " ......... ", " ", " "}; </verb></tscreen> When we're done using a pixmap and not likely to reuse it again soon, it is a good idea to release the resource using gdk_pixmap_unref(). Pixmaps should be considered a precious resource, because they take up memory in the end-user's X server process. Even though the X client you write may run on a powerful "server" computer, the user may be running the X server on a small personal computer. Once we've created a pixmap, we can display it as a GTK widget. We must create a GTK pixmap widget to contain the GDK pixmap. This is done using <tscreen><verb> GtkWidget *gtk_pixmap_new( GdkPixmap *pixmap, GdkBitmap *mask ); </verb></tscreen> The other pixmap widget calls are <tscreen><verb> guint gtk_pixmap_get_type( void ); void gtk_pixmap_set( GtkPixmap *pixmap, GdkPixmap *val, GdkBitmap *mask ); void gtk_pixmap_get( GtkPixmap *pixmap, GdkPixmap **val, GdkBitmap **mask); </verb></tscreen> gtk_pixmap_set is used to change the pixmap that the widget is currently managing. Val is the pixmap created using GDK. The following is an example of using a pixmap in a button. <tscreen><verb> /* example-start pixmap pixmap.c */ #include <gtk/gtk.h> /* XPM data of Open-File icon */ static const char * xpm_data[] = { "16 16 3 1", " c None", ". c #000000000000", "X c #FFFFFFFFFFFF", " ", " ...... ", " .XXX.X. ", " .XXX.XX. ", " .XXX.XXX. ", " .XXX..... ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " ......... ", " ", " "}; /* when invoked (via signal delete_event), terminates the application. */ gint close_application( GtkWidget *widget, GdkEvent *event, gpointer data ) { gtk_main_quit(); return(FALSE); } /* is invoked when the button is clicked. It just prints a message. */ void button_clicked( GtkWidget *widget, gpointer data ) { g_print( "button clicked\n" ); } int main( int argc, char *argv[] ) { /* GtkWidget is the storage type for widgets */ GtkWidget *window, *pixmapwid, *button; GdkPixmap *pixmap; GdkBitmap *mask; GtkStyle *style; /* create the main window, and attach delete_event signal to terminating the application */ gtk_init( &argc, &argv ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_signal_connect( GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (close_application), NULL ); gtk_container_set_border_width( GTK_CONTAINER (window), 10 ); gtk_widget_show( window ); /* now for the pixmap from gdk */ style = gtk_widget_get_style( window ); pixmap = gdk_pixmap_create_from_xpm_d( window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **)xpm_data ); /* a pixmap widget to contain the pixmap */ pixmapwid = gtk_pixmap_new( pixmap, mask ); gtk_widget_show( pixmapwid ); /* a button to contain the pixmap widget */ button = gtk_button_new(); gtk_container_add( GTK_CONTAINER(button), pixmapwid ); gtk_container_add( GTK_CONTAINER(window), button ); gtk_widget_show( button ); gtk_signal_connect( GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(button_clicked), NULL ); /* show the window */ gtk_main (); return 0; } /* example-end */ </verb></tscreen> To load a file from an XPM data file called icon0.xpm in the current directory, we would have created the pixmap thus <tscreen><verb> /* load a pixmap from a file */ pixmap = gdk_pixmap_create_from_xpm( window->window, &mask, &style->bg[GTK_STATE_NORMAL], "./icon0.xpm" ); pixmapwid = gtk_pixmap_new( pixmap, mask ); gtk_widget_show( pixmapwid ); gtk_container_add( GTK_CONTAINER(window), pixmapwid ); </verb></tscreen> A disadvantage of using pixmaps is that the displayed object is always rectangular, regardless of the image. We would like to create desktops and applications with icons that have more natural shapes. For example, for a game interface, we would like to have round buttons to push. The way to do this is using shaped windows. A shaped window is simply a pixmap where the background pixels are transparent. This way, when the background image is multi-colored, we don't overwrite it with a rectangular, non-matching border around our icon. The following example displays a full wheelbarrow image on the desktop. <tscreen><verb> /* example-start wheelbarrow wheelbarrow.c */ #include <gtk/gtk.h> /* XPM */ static char * WheelbarrowFull_xpm[] = { "48 48 64 1", " c None", ". c #DF7DCF3CC71B", "X c #965875D669A6", "o c #71C671C671C6", "O c #A699A289A699", "+ c #965892489658", "@ c #8E38410330C2", "# c #D75C7DF769A6", "$ c #F7DECF3CC71B", "% c #96588A288E38", "& c #A69992489E79", "* c #8E3886178E38", "= c #104008200820", "- c #596510401040", "; c #C71B30C230C2", ": c #C71B9A699658", "> c #618561856185", ", c #20811C712081", "< c #104000000000", "1 c #861720812081", "2 c #DF7D4D344103", "3 c #79E769A671C6", "4 c #861782078617", "5 c #41033CF34103", "6 c #000000000000", "7 c #49241C711040", "8 c #492445144924", "9 c #082008200820", "0 c #69A618611861", "q c #B6DA71C65144", "w c #410330C238E3", "e c #CF3CBAEAB6DA", "r c #71C6451430C2", "t c #EFBEDB6CD75C", "y c #28A208200820", "u c #186110401040", "i c #596528A21861", "p c #71C661855965", "a c #A69996589658", "s c #30C228A230C2", "d c #BEFBA289AEBA", "f c #596545145144", "g c #30C230C230C2", "h c #8E3882078617", "j c #208118612081", "k c #38E30C300820", "l c #30C2208128A2", "z c #38E328A238E3", "x c #514438E34924", "c c #618555555965", "v c #30C2208130C2", "b c #38E328A230C2", "n c #28A228A228A2", "m c #41032CB228A2", "M c #104010401040", "N c #492438E34103", "B c #28A2208128A2", "V c #A699596538E3", "C c #30C21C711040", "Z c #30C218611040", "A c #965865955965", "S c #618534D32081", "D c #38E31C711040", "F c #082000000820", " ", " .XoO ", " +@#$%o& ", " *=-;#::o+ ", " >,<12#:34 ", " 45671#:X3 ", " +89<02qwo ", "e* >,67;ro ", "ty> 459@>+&& ", "$2u+ ><ipas8* ", "%$;=* *3:.Xa.dfg> ", "Oh$;ya *3d.a8j,Xe.d3g8+ ", " Oh$;ka *3d$a8lz,,xxc:.e3g54 ", " Oh$;kO *pd$%svbzz,sxxxxfX..&wn> ", " Oh$@mO *3dthwlsslszjzxxxxxxx3:td8M4 ", " Oh$@g& *3d$XNlvvvlllm,mNwxxxxxxxfa.:,B* ", " Oh$@,Od.czlllllzlmmqV@V#V@fxxxxxxxf:%j5& ", " Oh$1hd5lllslllCCZrV#r#:#2AxxxxxxxxxcdwM* ", " OXq6c.%8vvvllZZiqqApA:mq:Xxcpcxxxxxfdc9* ", " 2r<6gde3bllZZrVi7S@SV77A::qApxxxxxxfdcM ", " :,q-6MN.dfmZZrrSS:#riirDSAX@Af5xxxxxfevo", " +A26jguXtAZZZC7iDiCCrVVii7Cmmmxxxxxx%3g", " *#16jszN..3DZZZZrCVSA2rZrV7Dmmwxxxx&en", " p2yFvzssXe:fCZZCiiD7iiZDiDSSZwwxx8e*>", " OA1<jzxwwc:$d%NDZZZZCCCZCCZZCmxxfd.B ", " 3206Bwxxszx%et.eaAp77m77mmmf3&eeeg* ", " @26MvzxNzvlbwfpdettttttttttt.c,n& ", " *;16=lsNwwNwgsvslbwwvccc3pcfu<o ", " p;<69BvwwsszslllbBlllllllu<5+ ", " OS0y6FBlvvvzvzss,u=Blllj=54 ", " c1-699Blvlllllu7k96MMMg4 ", " *10y8n6FjvllllB<166668 ", " S-kg+>666<M<996-y6n<8* ", " p71=4 m69996kD8Z-66698&& ", " &i0ycm6n4 ogk17,0<6666g ", " N-k-<> >=01-kuu666> ", " ,6ky& &46-10ul,66, ", " Ou0<> o66y<ulw<66& ", " *kk5 >66By7=xu664 ", " <<M4 466lj<Mxu66o ", " *>> +66uv,zN666* ", " 566,xxj669 ", " 4666FF666> ", " >966666M ", " oM6668+ ", " *4 ", " ", " "}; /* When invoked (via signal delete_event), terminates the application */ gint close_application( GtkWidget *widget, GdkEvent *event, gpointer data ) { gtk_main_quit(); return(FALSE); } int main (int argc, char *argv[] ) { /* GtkWidget is the storage type for widgets */ GtkWidget *window, *pixmap, *fixed; GdkPixmap *gdk_pixmap; GdkBitmap *mask; GtkStyle *style; GdkGC *gc; /* Create the main window, and attach delete_event signal to terminate * the application. Note that the main window will not have a titlebar * since we're making it a popup. */ gtk_init (&argc, &argv); window = gtk_window_new( GTK_WINDOW_POPUP ); gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (close_application), NULL); gtk_widget_show (window); /* Now for the pixmap and the pixmap widget */ style = gtk_widget_get_default_style(); gc = style->black_gc; gdk_pixmap = gdk_pixmap_create_from_xpm_d( window->window, &mask, &style->bg[GTK_STATE_NORMAL], WheelbarrowFull_xpm ); pixmap = gtk_pixmap_new( gdk_pixmap, mask ); gtk_widget_show( pixmap ); /* To display the pixmap, we use a fixed widget to place the pixmap */ fixed = gtk_fixed_new(); gtk_widget_set_usize( fixed, 200, 200 ); gtk_fixed_put( GTK_FIXED(fixed), pixmap, 0, 0 ); gtk_container_add( GTK_CONTAINER(window), fixed ); gtk_widget_show( fixed ); /* This masks out everything except for the image itself */ gtk_widget_shape_combine_mask( window, mask, 0, 0 ); /* show the window */ gtk_widget_set_uposition( window, 20, 400 ); gtk_widget_show( window ); gtk_main (); return(0); } /* example-end */ </verb></tscreen> To make the wheelbarrow image sensitive, we could attach the button press event signal to make it do something. The following few lines would make the picture sensitive to a mouse button being pressed which makes the application terminate. <tscreen><verb> gtk_widget_set_events( window, gtk_widget_get_events( window ) | GDK_BUTTON_PRESS_MASK ); gtk_signal_connect( GTK_OBJECT(window), "button_press_event", GTK_SIGNAL_FUNC(close_application), NULL ); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Rulers <p> Ruler widgets are used to indicate the location of the mouse pointer in a given window. A window can have a vertical ruler spanning across the width and a horizontal ruler spanning down the height. A small triangular indicator on the ruler shows the exact location of the pointer relative to the ruler. A ruler must first be created. Horizontal and vertical rulers are created using <tscreen><verb> GtkWidget *gtk_hruler_new( void ); /* horizontal ruler */ GtkWidget *gtk_vruler_new( void ); /* vertical ruler */ </verb></tscreen> Once a ruler is created, we can define the unit of measurement. Units of measure for rulers can be<tt/GTK_PIXELS/, <tt/GTK_INCHES/ or <tt/GTK_CENTIMETERS/. This is set using <tscreen><verb> void gtk_ruler_set_metric( GtkRuler *ruler, GtkMetricType metric ); </verb></tscreen> The default measure is <tt/GTK_PIXELS/. <tscreen><verb> gtk_ruler_set_metric( GTK_RULER(ruler), GTK_PIXELS ); </verb></tscreen> Other important characteristics of a ruler are how to mark the units of scale and where the position indicator is initially placed. These are set for a ruler using <tscreen><verb> void gtk_ruler_set_range( GtkRuler *ruler, gfloat lower, gfloat upper, gfloat position, gfloat max_size ); </verb></tscreen> The lower and upper arguments define the extent of the ruler, and max_size is the largest possible number that will be displayed. Position defines the initial position of the pointer indicator within the ruler. A vertical ruler can span an 800 pixel wide window thus <tscreen><verb> gtk_ruler_set_range( GTK_RULER(vruler), 0, 800, 0, 800); </verb></tscreen> The markings displayed on the ruler will be from 0 to 800, with a number for every 100 pixels. If instead we wanted the ruler to range from 7 to 16, we would code <tscreen><verb> gtk_ruler_set_range( GTK_RULER(vruler), 7, 16, 0, 20); </verb></tscreen> The indicator on the ruler is a small triangular mark that indicates the position of the pointer relative to the ruler. If the ruler is used to follow the mouse pointer, the motion_notify_event signal should be connected to the motion_notify_event method of the ruler. To follow all mouse movements within a window area, we would use <tscreen><verb> #define EVENT_METHOD(i, x) GTK_WIDGET_CLASS(GTK_OBJECT(i)->klass)->x gtk_signal_connect_object( GTK_OBJECT(area), "motion_notify_event", (GtkSignalFunc)EVENT_METHOD(ruler, motion_notify_event), GTK_OBJECT(ruler) ); </verb></tscreen> The following example creates a drawing area with a horizontal ruler above it and a vertical ruler to the left of it. The size of the drawing area is 600 pixels wide by 400 pixels high. The horizontal ruler spans from 7 to 13 with a mark every 100 pixels, while the vertical ruler spans from 0 to 400 with a mark every 100 pixels. Placement of the drawing area and the rulers is done using a table. <tscreen><verb> /* example-start rulers rulers.c */ #include <gtk/gtk.h> #define EVENT_METHOD(i, x) GTK_WIDGET_CLASS(GTK_OBJECT(i)->klass)->x #define XSIZE 600 #define YSIZE 400 /* This routine gets control when the close button is clicked */ gint close_application( GtkWidget *widget, GdkEvent *event, gpointer data ) { gtk_main_quit(); return(FALSE); } /* The main routine */ int main( int argc, char *argv[] ) { GtkWidget *window, *table, *area, *hrule, *vrule; /* Initialize GTK and create the main window */ gtk_init( &argc, &argv ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC( close_application ), NULL); gtk_container_set_border_width (GTK_CONTAINER (window), 10); /* Create a table for placing the ruler and the drawing area */ table = gtk_table_new( 3, 2, FALSE ); gtk_container_add( GTK_CONTAINER(window), table ); area = gtk_drawing_area_new(); gtk_drawing_area_size( (GtkDrawingArea *)area, XSIZE, YSIZE ); gtk_table_attach( GTK_TABLE(table), area, 1, 2, 1, 2, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0 ); gtk_widget_set_events( area, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK ); /* The horizontal ruler goes on top. As the mouse moves across the * drawing area, a motion_notify_event is passed to the * appropriate event handler for the ruler. */ hrule = gtk_hruler_new(); gtk_ruler_set_metric( GTK_RULER(hrule), GTK_PIXELS ); gtk_ruler_set_range( GTK_RULER(hrule), 7, 13, 0, 20 ); gtk_signal_connect_object( GTK_OBJECT(area), "motion_notify_event", (GtkSignalFunc)EVENT_METHOD(hrule, motion_notify_event), GTK_OBJECT(hrule) ); /* GTK_WIDGET_CLASS(GTK_OBJECT(hrule)->klass)->motion_notify_event, */ gtk_table_attach( GTK_TABLE(table), hrule, 1, 2, 0, 1, GTK_EXPAND|GTK_SHRINK|GTK_FILL, GTK_FILL, 0, 0 ); /* The vertical ruler goes on the left. As the mouse moves across * the drawing area, a motion_notify_event is passed to the * appropriate event handler for the ruler. */ vrule = gtk_vruler_new(); gtk_ruler_set_metric( GTK_RULER(vrule), GTK_PIXELS ); gtk_ruler_set_range( GTK_RULER(vrule), 0, YSIZE, 10, YSIZE ); gtk_signal_connect_object( GTK_OBJECT(area), "motion_notify_event", (GtkSignalFunc) GTK_WIDGET_CLASS(GTK_OBJECT(vrule)->klass)-> motion_notify_event, GTK_OBJECT(vrule) ); gtk_table_attach( GTK_TABLE(table), vrule, 0, 1, 1, 2, GTK_FILL, GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0 ); /* Now show everything */ gtk_widget_show( area ); gtk_widget_show( hrule ); gtk_widget_show( vrule ); gtk_widget_show( table ); gtk_widget_show( window ); gtk_main(); return(0); } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Statusbars <p> Statusbars are simple widgets used to display a text message. They keep a stack of the messages pushed onto them, so that popping the current message will re-display the previous text message. In order to allow different parts of an application to use the same statusbar to display messages, the statusbar widget issues Context Identifiers which are used to identify different "users". The message on top of the stack is the one displayed, no matter what context it is in. Messages are stacked in last-in-first-out order, not context identifier order. A statusbar is created with a call to: <tscreen><verb> GtkWidget *gtk_statusbar_new( void ); </verb></tscreen> A new Context Identifier is requested using a call to the following function with a short textual description of the context: <tscreen><verb> guint gtk_statusbar_get_context_id( GtkStatusbar *statusbar, const gchar *context_description ); </verb></tscreen> There are three functions that can operate on statusbars: <tscreen><verb> guint gtk_statusbar_push( GtkStatusbar *statusbar, guint context_id, gchar *text ); void gtk_statusbar_pop( GtkStatusbar *statusbar) guint context_id ); void gtk_statusbar_remove( GtkStatusbar *statusbar, guint context_id, guint message_id ); </verb></tscreen> The first, gtk_statusbar_push, is used to add a new message to the statusbar. It returns a Message Identifier, which can be passed later to the function gtk_statusbar_remove to remove the message with the given Message and Context Identifiers from the statusbar's stack. The function gtk_statusbar_pop removes the message highest in the stack with the given Context Identifier. The following example creates a statusbar and two buttons, one for pushing items onto the statusbar, and one for popping the last item back off. <tscreen><verb> /* example-start statusbar statusbar.c */ #include <gtk/gtk.h> #include <glib.h> GtkWidget *status_bar; void push_item( GtkWidget *widget, gpointer data ) { static int count = 1; char buff[20]; g_snprintf(buff, 20, "Item %d", count++); gtk_statusbar_push( GTK_STATUSBAR(status_bar), GPOINTER_TO_INT(data), buff); return; } void pop_item( GtkWidget *widget, gpointer data ) { gtk_statusbar_pop( GTK_STATUSBAR(status_bar), GPOINTER_TO_INT(data) ); return; } int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *vbox; GtkWidget *button; gint context_id; gtk_init (&argc, &argv); /* create a new window */ window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_set_usize( GTK_WIDGET (window), 200, 100); gtk_window_set_title(GTK_WINDOW (window), "GTK Statusbar Example"); gtk_signal_connect(GTK_OBJECT (window), "delete_event", (GtkSignalFunc) gtk_exit, NULL); vbox = gtk_vbox_new(FALSE, 1); gtk_container_add(GTK_CONTAINER(window), vbox); gtk_widget_show(vbox); status_bar = gtk_statusbar_new(); gtk_box_pack_start (GTK_BOX (vbox), status_bar, TRUE, TRUE, 0); gtk_widget_show (status_bar); context_id = gtk_statusbar_get_context_id( GTK_STATUSBAR(status_bar), "Statusbar example"); button = gtk_button_new_with_label("push item"); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC (push_item), GINT_TO_POINTER(context_id) ); gtk_box_pack_start(GTK_BOX(vbox), button, TRUE, TRUE, 2); gtk_widget_show(button); button = gtk_button_new_with_label("pop last item"); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC (pop_item), GINT_TO_POINTER(context_id) ); gtk_box_pack_start(GTK_BOX(vbox), button, TRUE, TRUE, 2); gtk_widget_show(button); /* always display the window as the last step so it all splashes on * the screen at once. */ gtk_widget_show(window); gtk_main (); return 0; } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Text Entries <p> The Entry widget allows text to be typed and displayed in a single line text box. The text may be set with function calls that allow new text to replace, prepend or append the current contents of the Entry widget. There are two functions for creating Entry widgets: <tscreen><verb> GtkWidget *gtk_entry_new( void ); GtkWidget *gtk_entry_new_with_max_length( guint16 max ); </verb></tscreen> The first just creates a new Entry widget, whilst the second creates a new Entry and sets a limit on the length of the text within the Entry. There are several functions for altering the text which is currently within the Entry widget. <tscreen><verb> void gtk_entry_set_text( GtkEntry *entry, const gchar *text ); void gtk_entry_append_text( GtkEntry *entry, const gchar *text ); void gtk_entry_prepend_text( GtkEntry *entry, const gchar *text ); </verb></tscreen> The function gtk_entry_set_text sets the contents of the Entry widget, replacing the current contents. The functions gtk_entry_append_text and gtk_entry_prepend_text allow the current contents to be appended and prepended to. The next function allows the current insertion point to be set. <tscreen><verb> void gtk_entry_set_position( GtkEntry *entry, gint position ); </verb></tscreen> The contents of the Entry can be retrieved by using a call to the following function. This is useful in the callback functions described below. <tscreen><verb> gchar *gtk_entry_get_text( GtkEntry *entry ); </verb></tscreen> The value returned by this function is used internally, and must not be freed using either free() or g_free() If we don't want the contents of the Entry to be changed by someone typing into it, we can change its editable state. <tscreen><verb> void gtk_entry_set_editable( GtkEntry *entry, gboolean editable ); </verb></tscreen> The function above allows us to toggle the editable state of the Entry widget by passing in a TRUE or FALSE value for the <tt/editable/ argument. If we are using the Entry where we don't want the text entered to be visible, for example when a password is being entered, we can use the following function, which also takes a boolean flag. <tscreen><verb> void gtk_entry_set_visibility( GtkEntry *entry, gboolean visible ); </verb></tscreen> A region of the text may be set as selected by using the following function. This would most often be used after setting some default text in an Entry, making it easy for the user to remove it. <tscreen><verb> void gtk_entry_select_region( GtkEntry *entry, gint start, gint end ); </verb></tscreen> If we want to catch when the user has entered text, we can connect to the <tt/activate/ or <tt/changed/ signal. Activate is raised when the user hits the enter key within the Entry widget. Changed is raised when the text changes at all, e.g., for every character entered or removed. The following code is an example of using an Entry widget. <tscreen><verb> /* example-start entry entry.c */ #include <stdio.h> #include <gtk/gtk.h> void enter_callback( GtkWidget *widget, GtkWidget *entry ) { gchar *entry_text; entry_text = gtk_entry_get_text(GTK_ENTRY(entry)); printf("Entry contents: %s\n", entry_text); } void entry_toggle_editable( GtkWidget *checkbutton, GtkWidget *entry ) { gtk_entry_set_editable(GTK_ENTRY(entry), GTK_TOGGLE_BUTTON(checkbutton)->active); } void entry_toggle_visibility( GtkWidget *checkbutton, GtkWidget *entry ) { gtk_entry_set_visibility(GTK_ENTRY(entry), GTK_TOGGLE_BUTTON(checkbutton)->active); } int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *vbox, *hbox; GtkWidget *entry; GtkWidget *button; GtkWidget *check; gtk_init (&argc, &argv); /* create a new window */ window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_set_usize( GTK_WIDGET (window), 200, 100); gtk_window_set_title(GTK_WINDOW (window), "GTK Entry"); gtk_signal_connect(GTK_OBJECT (window), "delete_event", (GtkSignalFunc) gtk_exit, NULL); vbox = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window), vbox); gtk_widget_show (vbox); entry = gtk_entry_new_with_max_length (50); gtk_signal_connect(GTK_OBJECT(entry), "activate", GTK_SIGNAL_FUNC(enter_callback), entry); gtk_entry_set_text (GTK_ENTRY (entry), "hello"); gtk_entry_append_text (GTK_ENTRY (entry), " world"); gtk_entry_select_region (GTK_ENTRY (entry), 0, GTK_ENTRY(entry)->text_length); gtk_box_pack_start (GTK_BOX (vbox), entry, TRUE, TRUE, 0); gtk_widget_show (entry); hbox = gtk_hbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (vbox), hbox); gtk_widget_show (hbox); check = gtk_check_button_new_with_label("Editable"); gtk_box_pack_start (GTK_BOX (hbox), check, TRUE, TRUE, 0); gtk_signal_connect (GTK_OBJECT(check), "toggled", GTK_SIGNAL_FUNC(entry_toggle_editable), entry); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), TRUE); gtk_widget_show (check); check = gtk_check_button_new_with_label("Visible"); gtk_box_pack_start (GTK_BOX (hbox), check, TRUE, TRUE, 0); gtk_signal_connect (GTK_OBJECT(check), "toggled", GTK_SIGNAL_FUNC(entry_toggle_visibility), entry); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), TRUE); gtk_widget_show (check); button = gtk_button_new_with_label ("Close"); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC(gtk_exit), GTK_OBJECT (window)); gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_grab_default (button); gtk_widget_show (button); gtk_widget_show(window); gtk_main(); return(0); } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Spin Buttons <p> The Spin Button widget is generally used to allow the user to select a value from a range of numeric values. It consists of a text entry box with up and down arrow buttons attached to the side. Selecting one of the buttons causes the value to "spin" up and down the range of possible values. The entry box may also be edited directly to enter a specific value. The Spin Button allows the value to have zero or a number of decimal places and to be incremented/decremented in configurable steps. The action of holding down one of the buttons optionally results in an acceleration of change in the value according to how long it is depressed. The Spin Button uses an <ref id="sec_Adjustment" name="Adjustment"> object to hold information about the range of values that the spin button can take. This makes for a powerful Spin Button widget. Recall that an adjustment widget is created with the following function, which illustrates the information that it holds: <tscreen><verb> GtkObject *gtk_adjustment_new( gfloat value, gfloat lower, gfloat upper, gfloat step_increment, gfloat page_increment, gfloat page_size ); </verb></tscreen> These attributes of an Adjustment are used by the Spin Button in the following way: <itemize> <item> <tt/value/: initial value for the Spin Button <item> <tt/lower/: lower range value <item> <tt/upper/: upper range value <item> <tt/step_increment/: value to increment/decrement when pressing mouse button 1 on a button <item> <tt/page_increment/: value to increment/decrement when pressing mouse button 2 on a button <item> <tt/page_size/: unused </itemize> Additionally, mouse button 3 can be used to jump directly to the <tt/upper/ or <tt/lower/ values when used to select one of the buttons. Lets look at how to create a Spin Button: <tscreen><verb> GtkWidget *gtk_spin_button_new( GtkAdjustment *adjustment, gfloat climb_rate, guint digits ); </verb></tscreen> The <tt/climb_rate/ argument take a value between 0.0 and 1.0 and indicates the amount of acceleration that the Spin Button has. The <tt/digits/ argument specifies the number of decimal places to which the value will be displayed. A Spin Button can be reconfigured after creation using the following function: <tscreen><verb> void gtk_spin_button_configure( GtkSpinButton *spin_button, GtkAdjustment *adjustment, gfloat climb_rate, guint digits ); </verb></tscreen> The <tt/spin_button/ argument specifies the Spin Button widget that is to be reconfigured. The other arguments are as specified above. The adjustment can be set and retrieved independantly using the following two functions: <tscreen><verb> void gtk_spin_button_set_adjustment( GtkSpinButton *spin_button, GtkAdjustment *adjustment ); GtkAdjustment *gtk_spin_button_get_adjustment( GtkSpinButton *spin_button ); </verb></tscreen> The number of decimal places can also be altered using: <tscreen><verb> void gtk_spin_button_set_digits( GtkSpinButton *spin_button, guint digits) ; </verb></tscreen> The value that a Spin Button is currently displaying can be changed using the following function: <tscreen><verb> void gtk_spin_button_set_value( GtkSpinButton *spin_button, gfloat value ); </verb></tscreen> The current value of a Spin Button can be retrieved as either a floating point or integer value with the following functions: <tscreen><verb> gfloat gtk_spin_button_get_value_as_float( GtkSpinButton *spin_button ); gint gtk_spin_button_get_value_as_int( GtkSpinButton *spin_button ); </verb></tscreen> If you want to alter the value of a Spin Value relative to its current value, then the following function can be used: <tscreen><verb> void gtk_spin_button_spin( GtkSpinButton *spin_button, GtkSpinType direction, gfloat increment ); </verb></tscreen> The <tt/direction/ parameter can take one of the following values: <tscreen><verb> GTK_SPIN_STEP_FORWARD GTK_SPIN_STEP_BACKWARD GTK_SPIN_PAGE_FORWARD GTK_SPIN_PAGE_BACKWARD GTK_SPIN_HOME GTK_SPIN_END GTK_SPIN_USER_DEFINED </verb></tscreen> This function packs in quite a bit of functionality, which I will attempt to clearly explain. Many of these settings use values from the Adjustment object that is associated with a Spin Button. <tt/GTK_SPIN_STEP_FORWARD/ and <tt/GTK_SPIN_STEP_BACKWARD/ change the value of the Spin Button by the amount specified by <tt/increment/, unless <tt/increment/ is equal to 0, in which case the value is changed by the value of <tt/step_increment/ in theAdjustment. <tt/GTK_SPIN_PAGE_FORWARD/ and <tt/GTK_SPIN_PAGE_BACKWARD/ simply alter the value of the Spin Button by <tt/increment/. <tt/GTK_SPIN_HOME/ sets the value of the Spin Button to the bottom of the Adjustments range. <tt/GTK_SPIN_END/ sets the value of the Spin Button to the top of the Adjustments range. <tt/GTK_SPIN_USER_DEFINED/ simply alters the value of the Spin Button by the specified amount. We move away from functions for setting and retreving the range attributes of the Spin Button now, and move onto functions that effect the appearance and behaviour of the Spin Button widget itself. The first of these functions is used to constrain the text box of the Spin Button such that it may only contain a numeric value. This prevents a user from typing anything other than numeric values into the text box of a Spin Button: <tscreen><verb> void gtk_spin_button_set_numeric( GtkSpinButton *spin_button, gboolean numeric ); </verb></tscreen> You can set whether a Spin Button will wrap around between the upper and lower range values with the following function: <tscreen><verb> void gtk_spin_button_set_wrap( GtkSpinButton *spin_button, gboolean wrap ); </verb></tscreen> You can set a Spin Button to round the value to the nearest <tt/step_increment/, which is set within the Adjustment object used with the Spin Button. This is accomplished with the following function: <tscreen><verb> void gtk_spin_button_set_snap_to_ticks( GtkSpinButton *spin_button, gboolean snap_to_ticks ); </verb></tscreen> The update policy of a Spin Button can be changed with the following function: <tscreen><verb> void gtk_spin_button_set_update_policy( GtkSpinButton *spin_button, GtkSpinButtonUpdatePolicy policy ); </verb></tscreen> <!-- TODO: find out what this does - TRG --> The possible values of <tt/policy/ are either <tt/GTK_UPDATE_ALWAYS/ or <tt/GTK_UPDATE_IF_VALID/. These policies affect the behavior of a Spin Button when parsing inserted text and syncing its value with the values of the Adjustment. In the case of <tt/GTK_UPDATE_IF_VALID/ the Spin Button only value gets changed if the text input is a numeric value that is within the range specified by the Adjustment. Otherwise the text is reset to the current value. In case of <tt/GTK_UPDATE_ALWAYS/ we ignore errors while converting text into a numeric value. The appearance of the buttons used in a Spin Button can be changed using the following function: <tscreen><verb> void gtk_spin_button_set_shadow_type( GtkSpinButton *spin_button, GtkShadowType shadow_type ); </verb></tscreen> As usual, the <tt/shadow_type/ can be one of: <tscreen><verb> GTK_SHADOW_IN GTK_SHADOW_OUT GTK_SHADOW_ETCHED_IN GTK_SHADOW_ETCHED_OUT </verb></tscreen> Finally, you can explicitly request that a Spin Button update itself: <tscreen><verb> void gtk_spin_button_update( GtkSpinButton *spin_button ); </verb></tscreen> It's example time again. <tscreen><verb> /* example-start spinbutton spinbutton.c */ #include <stdio.h> #include <gtk/gtk.h> static GtkWidget *spinner1; void toggle_snap( GtkWidget *widget, GtkSpinButton *spin ) { gtk_spin_button_set_snap_to_ticks (spin, GTK_TOGGLE_BUTTON (widget)->active); } void toggle_numeric( GtkWidget *widget, GtkSpinButton *spin ) { gtk_spin_button_set_numeric (spin, GTK_TOGGLE_BUTTON (widget)->active); } void change_digits( GtkWidget *widget, GtkSpinButton *spin ) { gtk_spin_button_set_digits (GTK_SPIN_BUTTON (spinner1), gtk_spin_button_get_value_as_int (spin)); } void get_value( GtkWidget *widget, gpointer data ) { gchar buf[32]; GtkLabel *label; GtkSpinButton *spin; spin = GTK_SPIN_BUTTON (spinner1); label = GTK_LABEL (gtk_object_get_user_data (GTK_OBJECT (widget))); if (GPOINTER_TO_INT (data) == 1) sprintf (buf, "%d", gtk_spin_button_get_value_as_int (spin)); else sprintf (buf, "%0.*f", spin->digits, gtk_spin_button_get_value_as_float (spin)); gtk_label_set_text (label, buf); } int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *frame; GtkWidget *hbox; GtkWidget *main_vbox; GtkWidget *vbox; GtkWidget *vbox2; GtkWidget *spinner2; GtkWidget *spinner; GtkWidget *button; GtkWidget *label; GtkWidget *val_label; GtkAdjustment *adj; /* Initialise GTK */ gtk_init(&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_main_quit), NULL); gtk_window_set_title (GTK_WINDOW (window), "Spin Button"); main_vbox = gtk_vbox_new (FALSE, 5); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 10); gtk_container_add (GTK_CONTAINER (window), main_vbox); frame = gtk_frame_new ("Not accelerated"); gtk_box_pack_start (GTK_BOX (main_vbox), frame, TRUE, TRUE, 0); vbox = gtk_vbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); gtk_container_add (GTK_CONTAINER (frame), vbox); /* Day, month, year spinners */ hbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 5); vbox2 = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 5); label = gtk_label_new ("Day :"); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); adj = (GtkAdjustment *) gtk_adjustment_new (1.0, 1.0, 31.0, 1.0, 5.0, 0.0); spinner = gtk_spin_button_new (adj, 0, 0); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE); gtk_spin_button_set_shadow_type (GTK_SPIN_BUTTON (spinner), GTK_SHADOW_OUT); gtk_box_pack_start (GTK_BOX (vbox2), spinner, FALSE, TRUE, 0); vbox2 = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 5); label = gtk_label_new ("Month :"); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); adj = (GtkAdjustment *) gtk_adjustment_new (1.0, 1.0, 12.0, 1.0, 5.0, 0.0); spinner = gtk_spin_button_new (adj, 0, 0); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE); gtk_spin_button_set_shadow_type (GTK_SPIN_BUTTON (spinner), GTK_SHADOW_ETCHED_IN); gtk_box_pack_start (GTK_BOX (vbox2), spinner, FALSE, TRUE, 0); vbox2 = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 5); label = gtk_label_new ("Year :"); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); adj = (GtkAdjustment *) gtk_adjustment_new (1998.0, 0.0, 2100.0, 1.0, 100.0, 0.0); spinner = gtk_spin_button_new (adj, 0, 0); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), FALSE); gtk_spin_button_set_shadow_type (GTK_SPIN_BUTTON (spinner), GTK_SHADOW_IN); gtk_widget_set_usize (spinner, 55, 0); gtk_box_pack_start (GTK_BOX (vbox2), spinner, FALSE, TRUE, 0); frame = gtk_frame_new ("Accelerated"); gtk_box_pack_start (GTK_BOX (main_vbox), frame, TRUE, TRUE, 0); vbox = gtk_vbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); gtk_container_add (GTK_CONTAINER (frame), vbox); hbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 5); vbox2 = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 5); label = gtk_label_new ("Value :"); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); adj = (GtkAdjustment *) gtk_adjustment_new (0.0, -10000.0, 10000.0, 0.5, 100.0, 0.0); spinner1 = gtk_spin_button_new (adj, 1.0, 2); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner1), TRUE); gtk_widget_set_usize (spinner1, 100, 0); gtk_box_pack_start (GTK_BOX (vbox2), spinner1, FALSE, TRUE, 0); vbox2 = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 5); label = gtk_label_new ("Digits :"); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); adj = (GtkAdjustment *) gtk_adjustment_new (2, 1, 5, 1, 1, 0); spinner2 = gtk_spin_button_new (adj, 0.0, 0); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner2), TRUE); gtk_signal_connect (GTK_OBJECT (adj), "value_changed", GTK_SIGNAL_FUNC (change_digits), (gpointer) spinner2); gtk_box_pack_start (GTK_BOX (vbox2), spinner2, FALSE, TRUE, 0); hbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 5); button = gtk_check_button_new_with_label ("Snap to 0.5-ticks"); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (toggle_snap), spinner1); gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); button = gtk_check_button_new_with_label ("Numeric only input mode"); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (toggle_numeric), spinner1); gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); val_label = gtk_label_new (""); hbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 5); button = gtk_button_new_with_label ("Value as Int"); gtk_object_set_user_data (GTK_OBJECT (button), val_label); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (get_value), GINT_TO_POINTER (1)); gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 5); button = gtk_button_new_with_label ("Value as Float"); gtk_object_set_user_data (GTK_OBJECT (button), val_label); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (get_value), GINT_TO_POINTER (2)); gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (vbox), val_label, TRUE, TRUE, 0); gtk_label_set_text (GTK_LABEL (val_label), "0"); hbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, TRUE, 0); button = gtk_button_new_with_label ("Close"); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 5); gtk_widget_show_all (window); /* Enter the event loop */ gtk_main (); return(0); } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Combo Box <p> The combo box is another fairly simple widget that is really just a collection of other widgets. From the user's point of view, the widget consists of a text entry box and a pull down menu from which the user can select one of a set of predefined entries. Alternatively, the user can type a different option directly into the text box. The following extract from the structure that defines a Combo Box identifies several of the components: <tscreen><verb> struct _GtkCombo { GtkHBox hbox; GtkWidget *entry; GtkWidget *button; GtkWidget *popup; GtkWidget *popwin; GtkWidget *list; ... }; </verb></tscreen> As you can see, the Combo Box has two principal parts that you really care about: an entry and a list. First off, to create a combo box, use: <tscreen><verb> GtkWidget *gtk_combo_new( void ); </verb></tscreen> Now, if you want to set the string in the entry section of the combo box, this is done by manipulating the <tt/entry/ widget directly: <tscreen><verb> gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), "My String."); </verb></tscreen> To set the values in the popdown list, one uses the function: <tscreen><verb> void gtk_combo_set_popdown_strings( GtkCombo *combo, GList *strings ); </verb></tscreen> Before you can do this, you have to assemble a GList of the strings that you want. GList is a linked list implementation that is part of <ref id="sec_glib" name="GLib">, a library supporing GTK. For the moment, the quick and dirty explanation is that you need to set up a GList pointer, set it equal to NULL, then append strings to it with <tscreen><verb> GList *g_list_append( GList *glist, gpointer data ); </verb></tscreen> It is important that you set the initial GList pointer to NULL. The value returned from the g_list_append function must be used as the new pointer to the GList. Here's a typical code segment for creating a set of options: <tscreen><verb> GList *glist=NULL; glist = g_list_append(glist, "String 1"); glist = g_list_append(glist, "String 2"); glist = g_list_append(glist, "String 3"); glist = g_list_append(glist, "String 4"); gtk_combo_set_popdown_strings( GTK_COMBO(combo), glist) ; </verb></tscreen> The combo widget makes a copy of the strings passed to it in the glist structure. As a result, you need to make sure you free the memory used by the list if that is appropriate for your application. At this point you have a working combo box that has been set up. There are a few aspects of its behavior that you can change. These are accomplished with the functions: <tscreen><verb> void gtk_combo_set_use_arrows( GtkCombo *combo, gint val ); void gtk_combo_set_use_arrows_always( GtkCombo *combo, gint val ); void gtk_combo_set_case_sensitive( GtkCombo *combo, gint val ); </verb></tscreen> <tt/gtk_combo_set_use_arrows()/ lets the user change the value in the entry using the up/down arrow keys. This doesn't bring up the list, but rather replaces the current text in the entry with the next list entry (up or down, as your key choice indicates). It does this by searching in the list for the item corresponding to the current value in the entry and selecting the previous/next item accordingly. Usually in an entry the arrow keys are used to change focus (you can do that anyway using TAB). Note that when the current item is the last of the list and you press arrow-down it changes the focus (the same applies with the first item and arrow-up). If the current value in the entry is not in the list, then the function of <tt/gtk_combo_set_use_arrows()/ is disabled. <tt/gtk_combo_set_use_arrows_always()/ similarly allows the use the the up/down arrow keys to cycle through the choices in the dropdown list, except that it wraps around the values in the list, completely disabling the use of the up and down arrow keys for changing focus. <tt/gtk_combo_set_case_sensitive()/ toggles whether or not GTK searches for entries in a case sensitive manner. This is used when the Combo widget is asked to find a value from the list using the current entry in the text box. This completion can be performed in either a case sensitive or insensitive manner, depending upon the use of this function. The Combo widget can also simply complete the current entry if the user presses the key combination MOD-1 and "Tab". MOD-1 is often mapped to the "Alt" key, by the <tt/xmodmap/ utility. Note, however that some window managers also use this key combination, which will override its use within GTK. Now that we have a combo box, tailored to look and act how we want it, all that remains is being able to get data from the combo box. This is relatively straightforward. The majority of the time, all you are going to care about getting data from is the entry. The entry is accessed simply by <tt>GTK_ENTRY(GTK_COMBO(combo)->entry)</tt>. The two principal things that you are going to want to do with it are attach to the activate signal, which indicates that the user has pressed the Return or Enter key, and read the text. The first is accomplished using something like: <tscreen><verb> gtk_signal_connect(GTK_OBJECT(GTK_COMB(combo)->entry), "activate", GTK_SIGNAL_FUNC (my_callback_function), my_data); </verb></tscreen> Getting the text at any arbitrary time is accomplished by simply using the entry function: <tscreen><verb> gchar *gtk_entry_get_text(GtkEntry *entry); </verb></tscreen> Such as: <tscreen><verb> char *string; string = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(combo)->entry)); </verb></tscreen> That's about all there is to it. There is a function <tscreen><verb> void gtk_combo_disable_activate(GtkCombo *combo); </verb></tscreen> that will disable the activate signal on the entry widget in the combo box. Personally, I can't think of why you'd want to use it, but it does exist. <!-- There is also a function to set the string on a particular item, void gtk_combo_set_item_string(GtkCombo *combo, GtkItem *item, const gchar *item_value), but this requires that you have a pointer to the appropriate Item. Frankly, I have no idea how to do that. --> <!-- ----------------------------------------------------------------- --> <sect1> Calendar <p> The Calendar widget is an effective way to display and retrieve monthly date related information. It is a very simple widget to create and work with. Creating a GtkCalendar widget is a simple as: <tscreen><verb> GtkWidget *gtk_calendar_new(); </verb></tscreen> There might be times where you need to change a lot of information within this widget and the following functions allow you to make multiple change to a Calendar widget without the user seeing multiple on-screen updates. <tscreen><verb> void gtk_calendar_freeze( GtkCalendar *Calendar ); void gtk_calendar_thaw ( GtkCalendar *Calendar ); </verb></tscreen> They work just like the freeze/thaw functions of every other widget. The Calendar widget has a few options that allow you to change the way the widget both looks and operates by using the function <tscreen><verb> void gtk_calendar_display_options( GtkCalendar *calendar, GtkCalendarDisplayOptions flags ); </verb></tscreen> The <tt/flags/ argument can be formed by combining either of the following five options using the logical bitwise OR (|) operation: <itemize> <item> GTK_CALENDAR_SHOW_HEADING - this option specifies that the month and year should be shown when drawing the calendar. <item> GTK_CALENDAR_SHOW_DAY_NAMES - this option specifies that the three letter descriptions should be displayed for each day (eg MON,TUE...). <item> GTK_CALENDAR_NO_MONTH_CHANGE - this option states that the user should not and can not change the currently displayed month. This can be good if you only need to display a particular month such as if you are displaying 12 calendar widgets for every month in a particular year. <item> GTK_CALENDAR_SHOW_WEEK_NUMBERS - this option specifies that the number for each week should be displayed down the left side of the calendar. (eg. Jan 1 = Week 1,Dec 31 = Week 52). <item> GTK_CALENDAR_WEEK_START_MONDAY - this option states that the calander week will start on Monday instead of Sunday which is the default. This only affects the order in which days are displayed from left to right. </itemize> The following functions are used to set the the currently displayed date: <tscreen><verb> gint gtk_calendar_select_month( GtkCalendar *calendar, guint month, guint year ); void gtk_calendar_select_day( GtkCalendar *calendar, guint day ); </verb></tscreen> The return value from <tt/gtk_calendar_select_month()/ is a boolean value indicating whether the selection was successful. With <tt/gtk_calendar_select_day()/ the specified day number is selected within the current month, if that is possible. A <tt/day/ value of 0 will deselect any current selection. In addition to having a day selected, any number of days in the month may be "marked". A marked day is highlighted within the calendar display. The following functions are provided to manipulate marked days: <tscreen><verb> gint gtk_calendar_mark_day( GtkCalendar *calendar, guint day); gint gtk_calendar_unmark_day( GtkCalendar *calendar, guint day); void gtk_calendar_clear_marks( GtkCalendar *calendar); </verb></tscreen> The currently marked days are stored within an array within the GtkCalendar structure. This array is 31 elements long so to test whether a particular day is currently marked, you need to access the corresponding element of the array (don't forget in C that array elements are numbered 0 to n-1). For example: <tscreen><verb> GtkCalendar *calendar; calendar = gtk_calendar_new(); ... /* Is day 7 marked? */ if (calendar->marked_date[7-1]) /* day is marked */ </verb></tscreen> Note that marks are persistent across month and year changes. The final Calendar widget function is used to retrieve the currently selected date, month and/or year. <tscreen><verb> void gtk_calendar_get_date( GtkCalendar *calendar, guint *year, guint *month, guint *day ); </verb></tscreen> This function requires you to pass the addresses of <tt/guint/ variables, into which the result will be placed. Passing <tt/NULL/ as a value will result in the corresponding value not being returned. The Calendar widget can generate a number of signals indicating date selection and change. The names of these signals are self explanatory, and are: <itemize> <item> <tt/month_changed/ <item> <tt/day_selected/ <item> <tt/day_selected_double_click/ <item> <tt/prev_month/ <item> <tt/next_month/ <item> <tt/prev_year/ <item> <tt/next_year/ </itemize> That just leaves us with the need to put all of this together into example code. <tscreen><verb> /* example-start calendar calendar.c */ /* * Copyright (C) 1998 Cesar Miquel, Shawn T. Amundson, Mattias Grönlund * Copyright (C) 2000 Tony Gale * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <gtk/gtk.h> #include <stdio.h> #include <string.h> #include <time.h> #define DEF_PAD 10 #define DEF_PAD_SMALL 5 #define TM_YEAR_BASE 1900 typedef struct _CalendarData { GtkWidget *flag_checkboxes[5]; gboolean settings[5]; gchar *font; GtkWidget *font_dialog; GtkWidget *window; GtkWidget *prev2_sig; GtkWidget *prev_sig; GtkWidget *last_sig; GtkWidget *month; } CalendarData; enum { calendar_show_header, calendar_show_days, calendar_month_change, calendar_show_week, calendar_monday_first }; /* * GtkCalendar */ void calendar_date_to_string( CalendarData *data, char *buffer, gint buff_len ) { struct tm tm; time_t time; memset (&tm, 0, sizeof (tm)); gtk_calendar_get_date (GTK_CALENDAR(data->window), &tm.tm_year, &tm.tm_mon, &tm.tm_mday); tm.tm_year -= TM_YEAR_BASE; time = mktime(&tm); strftime (buffer, buff_len-1, "%x", gmtime(&time)); } void calendar_set_signal_strings( char *sig_str, CalendarData *data) { gchar *prev_sig; gtk_label_get (GTK_LABEL (data->prev_sig), &prev_sig); gtk_label_set (GTK_LABEL (data->prev2_sig), prev_sig); gtk_label_get (GTK_LABEL (data->last_sig), &prev_sig); gtk_label_set (GTK_LABEL (data->prev_sig), prev_sig); gtk_label_set (GTK_LABEL (data->last_sig), sig_str); } void calendar_month_changed( GtkWidget *widget, CalendarData *data ) { char buffer[256] = "month_changed: "; calendar_date_to_string (data, buffer+15, 256-15); calendar_set_signal_strings (buffer, data); } void calendar_day_selected( GtkWidget *widget, CalendarData *data ) { char buffer[256] = "day_selected: "; calendar_date_to_string (data, buffer+14, 256-14); calendar_set_signal_strings (buffer, data); } void calendar_day_selected_double_click( GtkWidget *widget, CalendarData *data ) { struct tm tm; char buffer[256] = "day_selected_double_click: "; calendar_date_to_string (data, buffer+27, 256-27); calendar_set_signal_strings (buffer, data); memset (&tm, 0, sizeof (tm)); gtk_calendar_get_date (GTK_CALENDAR(data->window), &tm.tm_year, &tm.tm_mon, &tm.tm_mday); tm.tm_year -= TM_YEAR_BASE; if(GTK_CALENDAR(data->window)->marked_date[tm.tm_mday-1] == 0) { gtk_calendar_mark_day(GTK_CALENDAR(data->window),tm.tm_mday); } else { gtk_calendar_unmark_day(GTK_CALENDAR(data->window),tm.tm_mday); } } void calendar_prev_month( GtkWidget *widget, CalendarData *data ) { char buffer[256] = "prev_month: "; calendar_date_to_string (data, buffer+12, 256-12); calendar_set_signal_strings (buffer, data); } void calendar_next_month( GtkWidget *widget, CalendarData *data ) { char buffer[256] = "next_month: "; calendar_date_to_string (data, buffer+12, 256-12); calendar_set_signal_strings (buffer, data); } void calendar_prev_year( GtkWidget *widget, CalendarData *data ) { char buffer[256] = "prev_year: "; calendar_date_to_string (data, buffer+11, 256-11); calendar_set_signal_strings (buffer, data); } void calendar_next_year( GtkWidget *widget, CalendarData *data ) { char buffer[256] = "next_year: "; calendar_date_to_string (data, buffer+11, 256-11); calendar_set_signal_strings (buffer, data); } void calendar_set_flags( CalendarData *calendar ) { gint i; gint options=0; for (i=0;i<5;i++) if (calendar->settings[i]) { options=options + (1<<i); } if (calendar->window) gtk_calendar_display_options (GTK_CALENDAR (calendar->window), options); } void calendar_toggle_flag( GtkWidget *toggle, CalendarData *calendar ) { gint i; gint j; j=0; for (i=0; i<5; i++) if (calendar->flag_checkboxes[i] == toggle) j = i; calendar->settings[j]=!calendar->settings[j]; calendar_set_flags(calendar); } void calendar_font_selection_ok( GtkWidget *button, CalendarData *calendar ) { GtkStyle *style; GdkFont *font; calendar->font = gtk_font_selection_dialog_get_font_name( GTK_FONT_SELECTION_DIALOG (calendar->font_dialog)); if (calendar->window) { font = gtk_font_selection_dialog_get_font(GTK_FONT_SELECTION_DIALOG(calendar->font_dialog)); if (font) { style = gtk_style_copy (gtk_widget_get_style (calendar->window)); gdk_font_unref (style->font); style->font = font; gdk_font_ref (style->font); gtk_widget_set_style (calendar->window, style); } } } void calendar_select_font( GtkWidget *button, CalendarData *calendar ) { GtkWidget *window; if (!calendar->font_dialog) { window = gtk_font_selection_dialog_new ("Font Selection Dialog"); g_return_if_fail(GTK_IS_FONT_SELECTION_DIALOG(window)); calendar->font_dialog = window; gtk_window_position (GTK_WINDOW (window), GTK_WIN_POS_MOUSE); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_widget_destroyed), &calendar->font_dialog); gtk_signal_connect (GTK_OBJECT (GTK_FONT_SELECTION_DIALOG (window)->ok_button), "clicked", GTK_SIGNAL_FUNC(calendar_font_selection_ok), calendar); gtk_signal_connect_object (GTK_OBJECT (GTK_FONT_SELECTION_DIALOG (window)->cancel_button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (calendar->font_dialog)); } window=calendar->font_dialog; if (!GTK_WIDGET_VISIBLE (window)) gtk_widget_show (window); else gtk_widget_destroy (window); } void create_calendar() { GtkWidget *window; GtkWidget *vbox, *vbox2, *vbox3; GtkWidget *hbox; GtkWidget *hbbox; GtkWidget *calendar; GtkWidget *toggle; GtkWidget *button; GtkWidget *frame; GtkWidget *separator; GtkWidget *label; GtkWidget *bbox; static CalendarData calendar_data; gint i; struct { char *label; } flags[] = { { "Show Heading" }, { "Show Day Names" }, { "No Month Change" }, { "Show Week Numbers" }, { "Week Start Monday" } }; calendar_data.window = NULL; calendar_data.font = NULL; calendar_data.font_dialog = NULL; for (i=0; i<5; i++) { calendar_data.settings[i]=0; } window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window), "GtkCalendar Example"); gtk_container_border_width (GTK_CONTAINER (window), 5); gtk_signal_connect(GTK_OBJECT(window), "destroy", GTK_SIGNAL_FUNC(gtk_main_quit), NULL); gtk_signal_connect(GTK_OBJECT(window), "delete-event", GTK_SIGNAL_FUNC(gtk_false), NULL); gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, TRUE); vbox = gtk_vbox_new(FALSE, DEF_PAD); gtk_container_add (GTK_CONTAINER (window), vbox); /* * The top part of the window, Calendar, flags and fontsel. */ hbox = gtk_hbox_new(FALSE, DEF_PAD); gtk_box_pack_start (GTK_BOX(vbox), hbox, TRUE, TRUE, DEF_PAD); hbbox = gtk_hbutton_box_new(); gtk_box_pack_start(GTK_BOX(hbox), hbbox, FALSE, FALSE, DEF_PAD); gtk_button_box_set_layout(GTK_BUTTON_BOX(hbbox), GTK_BUTTONBOX_SPREAD); gtk_button_box_set_spacing(GTK_BUTTON_BOX(hbbox), 5); /* Calendar widget */ frame = gtk_frame_new("Calendar"); gtk_box_pack_start(GTK_BOX(hbbox), frame, FALSE, TRUE, DEF_PAD); calendar=gtk_calendar_new(); calendar_data.window = calendar; calendar_set_flags(&calendar_data); gtk_calendar_mark_day ( GTK_CALENDAR(calendar), 19); gtk_container_add( GTK_CONTAINER( frame), calendar); gtk_signal_connect (GTK_OBJECT (calendar), "month_changed", GTK_SIGNAL_FUNC (calendar_month_changed), &calendar_data); gtk_signal_connect (GTK_OBJECT (calendar), "day_selected", GTK_SIGNAL_FUNC (calendar_day_selected), &calendar_data); gtk_signal_connect (GTK_OBJECT (calendar), "day_selected_double_click", GTK_SIGNAL_FUNC (calendar_day_selected_double_click), &calendar_data); gtk_signal_connect (GTK_OBJECT (calendar), "prev_month", GTK_SIGNAL_FUNC (calendar_prev_month), &calendar_data); gtk_signal_connect (GTK_OBJECT (calendar), "next_month", GTK_SIGNAL_FUNC (calendar_next_month), &calendar_data); gtk_signal_connect (GTK_OBJECT (calendar), "prev_year", GTK_SIGNAL_FUNC (calendar_prev_year), &calendar_data); gtk_signal_connect (GTK_OBJECT (calendar), "next_year", GTK_SIGNAL_FUNC (calendar_next_year), &calendar_data); separator = gtk_vseparator_new (); gtk_box_pack_start (GTK_BOX (hbox), separator, FALSE, TRUE, 0); vbox2 = gtk_vbox_new(FALSE, DEF_PAD); gtk_box_pack_start(GTK_BOX(hbox), vbox2, FALSE, FALSE, DEF_PAD); /* Build the Right frame with the flags in */ frame = gtk_frame_new("Flags"); gtk_box_pack_start(GTK_BOX(vbox2), frame, TRUE, TRUE, DEF_PAD); vbox3 = gtk_vbox_new(TRUE, DEF_PAD_SMALL); gtk_container_add(GTK_CONTAINER(frame), vbox3); for (i = 0; i < 5; i++) { toggle = gtk_check_button_new_with_label(flags[i].label); gtk_signal_connect (GTK_OBJECT (toggle), "toggled", GTK_SIGNAL_FUNC(calendar_toggle_flag), &calendar_data); gtk_box_pack_start (GTK_BOX (vbox3), toggle, TRUE, TRUE, 0); calendar_data.flag_checkboxes[i]=toggle; } /* Build the right font-button */ button = gtk_button_new_with_label("Font..."); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC(calendar_select_font), &calendar_data); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); /* * Build the Signal-event part. */ frame = gtk_frame_new("Signal events"); gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, DEF_PAD); vbox2 = gtk_vbox_new(TRUE, DEF_PAD_SMALL); gtk_container_add(GTK_CONTAINER(frame), vbox2); hbox = gtk_hbox_new (FALSE, 3); gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0); label = gtk_label_new ("Signal:"); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0); calendar_data.last_sig = gtk_label_new (""); gtk_box_pack_start (GTK_BOX (hbox), calendar_data.last_sig, FALSE, TRUE, 0); hbox = gtk_hbox_new (FALSE, 3); gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0); label = gtk_label_new ("Previous signal:"); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0); calendar_data.prev_sig = gtk_label_new (""); gtk_box_pack_start (GTK_BOX (hbox), calendar_data.prev_sig, FALSE, TRUE, 0); hbox = gtk_hbox_new (FALSE, 3); gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0); label = gtk_label_new ("Second previous signal:"); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0); calendar_data.prev2_sig = gtk_label_new (""); gtk_box_pack_start (GTK_BOX (hbox), calendar_data.prev2_sig, FALSE, TRUE, 0); bbox = gtk_hbutton_box_new (); gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 0); gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); button = gtk_button_new_with_label ("Close"); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_main_quit), NULL); gtk_container_add (GTK_CONTAINER (bbox), button); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_grab_default (button); gtk_widget_show_all(window); } int main(int argc, char *argv[] ) { gtk_set_locale (); gtk_init (&argc, &argv); create_calendar(); gtk_main(); return(0); } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1> Color Selection <p> The color selection widget is, not surprisingly, a widget for interactive selection of colors. This composite widget lets the user select a color by manipulating RGB (Red, Green, Blue) and HSV (Hue, Saturation, Value) triples. This is done either by adjusting single values with sliders or entries, or by picking the desired color from a hue-saturation wheel/value bar. Optionally, the opacity of the color can also be set. The color selection widget currently emits only one signal, "color_changed", which is emitted whenever the current color in the widget changes, either when the user changes it or if it's set explicitly through gtk_color_selection_set_color(). Lets have a look at what the color selection widget has to offer us. The widget comes in two flavours: gtk_color_selection and gtk_color_selection_dialog. <tscreen><verb> GtkWidget *gtk_color_selection_new( void ); </verb></tscreen> You'll probably not be using this constructor directly. It creates an orphan ColorSelection widget which you'll have to parent yourself. The ColorSelection widget inherits from the VBox widget. <tscreen><verb> GtkWidget *gtk_color_selection_dialog_new( const gchar *title ); </verb></tscreen> This is the most common color selection constructor. It creates a ColorSelectionDialog. It consists of a Frame containing a ColorSelection widget, an HSeparator and an HBox with three buttons, "Ok", "Cancel" and "Help". You can reach these buttons by accessing the "ok_button", "cancel_button" and "help_button" widgets in the ColorSelectionDialog structure, (i.e., <tt>GTK_COLOR_SELECTION_DIALOG(colorseldialog)->ok_button</tt>)). <tscreen><verb> void gtk_color_selection_set_update_policy( GtkColorSelection *colorsel, GtkUpdateType policy ); </verb></tscreen> This function sets the update policy. The default policy is <tt/GTK_UPDATE_CONTINUOUS/ which means that the current color is updated continuously when the user drags the sliders or presses the mouse and drags in the hue-saturation wheel or value bar. If you experience performance problems, you may want to set the policy to <tt/GTK_UPDATE_DISCONTINUOUS/ or <tt/GTK_UPDATE_DELAYED/. <tscreen><verb> void gtk_color_selection_set_opacity( GtkColorSelection *colorsel, gint use_opacity ); </verb></tscreen> The color selection widget supports adjusting the opacity of a color (also known as the alpha channel). This is disabled by default. Calling this function with use_opacity set to TRUE enables opacity. Likewise, use_opacity set to FALSE will disable opacity. <tscreen><verb> void gtk_color_selection_set_color( GtkColorSelection *colorsel, gdouble *color ); </verb></tscreen> You can set the current color explicitly by calling this function with a pointer to an array of colors (gdouble). The length of the array depends on whether opacity is enabled or not. Position 0 contains the red component, 1 is green, 2 is blue and opacity is at position 3 (only if opacity is enabled, see gtk_color_selection_set_opacity()). All values are between 0.0 and 1.0. <tscreen><verb> void gtk_color_selection_get_color( GtkColorSelection *colorsel, gdouble *color ); </verb></tscreen> When you need to query the current color, typically when you've received a "color_changed" signal, you use this function. Color is a pointer to the array of colors to fill in. See the gtk_color_selection_set_color() function for the description of this array. <!-- Need to do a whole section on DnD - TRG Drag and drop ------------- The color sample areas (right under the hue-saturation wheel) supports drag and drop. The type of drag and drop is "application/x-color". The message data consists of an array of 4 (or 5 if opacity is enabled) gdouble values, where the value at position 0 is 0.0 (opacity on) or 1.0 (opacity off) followed by the red, green and blue values at positions 1,2 and 3 respectively. If opacity is enabled, the opacity is passed in the value at position 4. --> Here's a simple example demonstrating the use of the ColorSelectionDialog. The program displays a window containing a drawing area. Clicking on it opens a color selection dialog, and changing the color in the color selection dialog changes the background color. <tscreen><verb> /* example-start colorsel colorsel.c */ #include <glib.h> #include <gdk/gdk.h> #include <gtk/gtk.h> GtkWidget *colorseldlg = NULL; GtkWidget *drawingarea = NULL; /* Color changed handler */ void color_changed_cb( GtkWidget *widget, GtkColorSelection *colorsel ) { gdouble color[3]; GdkColor gdk_color; GdkColormap *colormap; /* Get drawingarea colormap */ colormap = gdk_window_get_colormap (drawingarea->window); /* Get current color */ gtk_color_selection_get_color (colorsel,color); /* Fit to a unsigned 16 bit integer (0..65535) and * insert into the GdkColor structure */ gdk_color.red = (guint16)(color[0]*65535.0); gdk_color.green = (guint16)(color[1]*65535.0); gdk_color.blue = (guint16)(color[2]*65535.0); /* Allocate color */ gdk_color_alloc (colormap, &gdk_color); /* Set window background color */ gdk_window_set_background (drawingarea->window, &gdk_color); /* Clear window */ gdk_window_clear (drawingarea->window); } /* Drawingarea event handler */ gint area_event( GtkWidget *widget, GdkEvent *event, gpointer client_data ) { gint handled = FALSE; GtkWidget *colorsel; /* Check if we've received a button pressed event */ if (event->type == GDK_BUTTON_PRESS && colorseldlg == NULL) { /* Yes, we have an event and there's no colorseldlg yet! */ handled = TRUE; /* Create color selection dialog */ colorseldlg = gtk_color_selection_dialog_new("Select background color"); /* Get the ColorSelection widget */ colorsel = GTK_COLOR_SELECTION_DIALOG(colorseldlg)->colorsel; /* Connect to the "color_changed" signal, set the client-data * to the colorsel widget */ gtk_signal_connect(GTK_OBJECT(colorsel), "color_changed", (GtkSignalFunc)color_changed_cb, (gpointer)colorsel); /* Show the dialog */ gtk_widget_show(colorseldlg); } return handled; } /* Close down and exit handler */ gint destroy_window( GtkWidget *widget, GdkEvent *event, gpointer client_data ) { gtk_main_quit (); return(TRUE); } /* Main */ gint main( gint argc, gchar *argv[] ) { GtkWidget *window; /* Initialize the toolkit, remove gtk-related commandline stuff */ gtk_init (&argc,&argv); /* Create toplevel window, set title and policies */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW(window), "Color selection test"); gtk_window_set_policy (GTK_WINDOW(window), TRUE, TRUE, TRUE); /* Attach to the "delete" and "destroy" events so we can exit */ gtk_signal_connect (GTK_OBJECT(window), "delete_event", (GtkSignalFunc)destroy_window, (gpointer)window); /* Create drawingarea, set size and catch button events */ drawingarea = gtk_drawing_area_new (); gtk_drawing_area_size (GTK_DRAWING_AREA(drawingarea), 200, 200); gtk_widget_set_events (drawingarea, GDK_BUTTON_PRESS_MASK); gtk_signal_connect (GTK_OBJECT(drawingarea), "event", (GtkSignalFunc)area_event, (gpointer)drawingarea); /* Add drawingarea to window, then show them both */ gtk_container_add (GTK_CONTAINER(window), drawingarea); gtk_widget_show (drawingarea); gtk_widget_show (window); /* Enter the gtk main loop (this never returns) */ gtk_main (); /* Satisfy grumpy compilers */ return(0); } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1> File Selections <p> The file selection widget is a quick and simple way to display a File dialog box. It comes complete with Ok, Cancel, and Help buttons, a great way to cut down on programming time. To create a new file selection box use: <tscreen><verb> GtkWidget *gtk_file_selection_new( gchar *title ); </verb></tscreen> To set the filename, for example to bring up a specific directory, or give a default filename, use this function: <tscreen><verb> void gtk_file_selection_set_filename( GtkFileSelection *filesel, gchar *filename ); </verb></tscreen> To grab the text that the user has entered or clicked on, use this function: <tscreen><verb> gchar *gtk_file_selection_get_filename( GtkFileSelection *filesel ); </verb></tscreen> There are also pointers to the widgets contained within the file selection widget. These are: <tscreen><verb> dir_list file_list selection_entry selection_text main_vbox ok_button cancel_button help_button </verb></tscreen> Most likely you will want to use the ok_button, cancel_button, and help_button pointers in signaling their use. Included here is an example stolen from testgtk.c, modified to run on its own. As you will see, there is nothing much to creating a file selection widget. While in this example the Help button appears on the screen, it does nothing as there is not a signal attached to it. <tscreen><verb> /* example-start filesel filesel.c */ #include <gtk/gtk.h> /* Get the selected filename and print it to the console */ void file_ok_sel( GtkWidget *w, GtkFileSelection *fs ) { g_print ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs))); } void destroy( GtkWidget *widget, gpointer data ) { gtk_main_quit (); } int main( int argc, char *argv[] ) { GtkWidget *filew; gtk_init (&argc, &argv); /* Create a new file selection widget */ filew = gtk_file_selection_new ("File selection"); gtk_signal_connect (GTK_OBJECT (filew), "destroy", (GtkSignalFunc) destroy, &filew); /* Connect the ok_button to file_ok_sel function */ gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button), "clicked", (GtkSignalFunc) file_ok_sel, filew ); /* Connect the cancel_button to destroy the widget */ gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button), "clicked", (GtkSignalFunc) gtk_widget_destroy, GTK_OBJECT (filew)); /* Lets set the filename, as if this were a save dialog, and we are giving a default filename */ gtk_file_selection_set_filename (GTK_FILE_SELECTION(filew), "penguin.png"); gtk_widget_show(filew); gtk_main (); return 0; } /* example-end */ </verb></tscreen> <!-- ***************************************************************** --> <sect> Container Widgets <!-- ***************************************************************** --> <!-- ----------------------------------------------------------------- --> <sect1>The EventBox <label id="sec_EventBox"> <p> Some GTK widgets don't have associated X windows, so they just draw on their parents. Because of this, they cannot receive events and if they are incorrectly sized, they don't clip so you can get messy overwriting, etc. If you require more from these widgets, the EventBox is for you. At first glance, the EventBox widget might appear to be totally useless. It draws nothing on the screen and responds to no events. However, it does serve a function - it provides an X window for its child widget. This is important as many GTK widgets do not have an associated X window. Not having an X window saves memory and improves performance, but also has some drawbacks. A widget without an X window cannot receive events, and does not perform any clipping on its contents. Although the name <em/EventBox/ emphasizes the event-handling function, the widget can also be used for clipping. (and more, see the example below). To create a new EventBox widget, use: <tscreen><verb> GtkWidget *gtk_event_box_new( void ); </verb></tscreen> A child widget can then be added to this EventBox: <tscreen><verb> gtk_container_add( GTK_CONTAINER(event_box), child_widget ); </verb></tscreen> The following example demonstrates both uses of an EventBox - a label is created that is clipped to a small box, and set up so that a mouse-click on the label causes the program to exit. Resizing the window reveals varying amounts of the label. <tscreen><verb> /* example-start eventbox eventbox.c */ #include <gtk/gtk.h> int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *event_box; GtkWidget *label; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Event Box"); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_exit), NULL); gtk_container_set_border_width (GTK_CONTAINER (window), 10); /* Create an EventBox and add it to our toplevel window */ event_box = gtk_event_box_new (); gtk_container_add (GTK_CONTAINER(window), event_box); gtk_widget_show (event_box); /* Create a long label */ label = gtk_label_new ("Click here to quit, quit, quit, quit, quit"); gtk_container_add (GTK_CONTAINER (event_box), label); gtk_widget_show (label); /* Clip it short. */ gtk_widget_set_usize (label, 110, 20); /* And bind an action to it */ gtk_widget_set_events (event_box, GDK_BUTTON_PRESS_MASK); gtk_signal_connect (GTK_OBJECT(event_box), "button_press_event", GTK_SIGNAL_FUNC (gtk_exit), NULL); /* Yet one more thing you need an X window for ... */ gtk_widget_realize (event_box); gdk_window_set_cursor (event_box->window, gdk_cursor_new (GDK_HAND1)); gtk_widget_show (window); gtk_main (); return(0); } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>The Alignment widget <label id="sec_Alignment"> <p> The alignment widget allows you to place a widget within its window at a position and size relative to the size of the Alignment widget itself. For example, it can be very useful for centering a widget within the window. There are only two functions associated with the Alignment widget: <tscreen><verb> GtkWidget* gtk_alignment_new( gfloat xalign, gfloat yalign, gfloat xscale, gfloat yscale ); void gtk_alignment_set( GtkAlignment *alignment, gfloat xalign, gfloat yalign, gfloat xscale, gfloat yscale ); </verb></tscreen> The first function creates a new Alignment widget with the specified parameters. The second function allows the alignment paramters of an exisiting Alignment widget to be altered. All four alignment parameters are floating point numbers which can range from 0.0 to 1.0. The <tt/xalign/ and <tt/yalign/ arguments affect the position of the widget placed within the Alignment widget. The <tt/xscale/ and <tt/yscale/ arguments effect the amount of space allocated to the widget. A child widget can be added to this Alignment widget using: <tscreen><verb> gtk_container_add( GTK_CONTAINER(alignment), child_widget ); </verb></tscreen> For an example of using an Alignment widget, refer to the example for the <ref id="sec_ProgressBar" name="Progress Bar"> widget. <!-- ----------------------------------------------------------------- --> <sect1> Fixed Container <p> The Fixed container allows you to place widgets at a fixed position within its window, relative to its upper left hand corner. The position of the widgets can be changed dynamically. There are only three functions associated with the fixed widget: <tscreen><verb> GtkWidget* gtk_fixed_new( void ); void gtk_fixed_put( GtkFixed *fixed, GtkWidget *widget, gint16 x, gint16 y ); void gtk_fixed_move( GtkFixed *fixed, GtkWidget *widget, gint16 x, gint16 y ); </verb></tscreen> The function <tt/gtk_fixed_new/ allows you to create a new Fixed container. <tt/gtk_fixed_put/ places <tt/widget/ in the container <tt/fixed/ at the position specified by <tt/x/ and <tt/y/. <tt/gtk_fixed_move/ allows the specified widget to be moved to a new position. The following example illustrates how to use the Fixed Container. <tscreen><verb> /* example-start fixed fixed.c */ #include <gtk/gtk.h> /* I'm going to be lazy and use some global variables to * store the position of the widget within the fixed * container */ gint x=50; gint y=50; /* This callback function moves the button to a new position * in the Fixed container. */ void move_button( GtkWidget *widget, GtkWidget *fixed ) { x = (x+30)%300; y = (y+50)%300; gtk_fixed_move( GTK_FIXED(fixed), widget, x, y); } int main( int argc, char *argv[] ) { /* GtkWidget is the storage type for widgets */ GtkWidget *window; GtkWidget *fixed; GtkWidget *button; gint i; /* Initialise GTK */ gtk_init(&argc, &argv); /* Create a new window */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window), "Fixed Container"); /* Here we connect the "destroy" event to a signal handler */ gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_main_quit), NULL); /* Sets the border width of the window. */ gtk_container_set_border_width (GTK_CONTAINER (window), 10); /* Create a Fixed Container */ fixed = gtk_fixed_new(); gtk_container_add(GTK_CONTAINER(window), fixed); gtk_widget_show(fixed); for (i = 1 ; i <= 3 ; i++) { /* Creates a new button with the label "Press me" */ button = gtk_button_new_with_label ("Press me"); /* When the button receives the "clicked" signal, it will call the * function move_button() passing it the Fixed Container as its * argument. */ gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (move_button), fixed); /* This packs the button into the fixed containers window. */ gtk_fixed_put (GTK_FIXED (fixed), button, i*50, i*50); /* The final step is to display this newly created widget. */ gtk_widget_show (button); } /* Display the window */ gtk_widget_show (window); /* Enter the event loop */ gtk_main (); return(0); } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1> Layout Container <p> The Layout container is similar to the Fixed container except that it implements an infinite (where infinity is less than 2^32) scrolling area. The X window system has a limitation where windows can be at most 32767 pixels wide or tall. The Layout container gets around this limitation by doing some exotic stuff using window and bit gravities, so that you can have smooth scrolling even when you have many child widgets in your scrolling area. A Layout container is created using: <tscreen><verb> GtkWidget *gtk_layout_new( GtkAdjustment *hadjustment, GtkAdjustment *vadjustment ); </verb></tscreen> As you can see, you can optionally specify the Adjustment objects that the Layout widget will use for its scrolling. You can add and move widgets in the Layout container using the following two functions: <tscreen><verb> void gtk_layout_put( GtkLayout *layout, GtkWidget *widget, gint x, gint y ); void gtk_layout_move( GtkLayout *layout, GtkWidget *widget, gint x, gint y ); </verb></tscreen> The size of the Layout container can be set using the next function: <tscreen><verb> void gtk_layout_set_size( GtkLayout *layout, guint width, guint height ); </verb></tscreen> Layout containers are one of the very few widgets in the GTK widget set that actively repaint themselves on screen as they are changed using the above functions (the vast majority of widgets queue requests which are then processed when control returns to the <tt/gtk_main()/ function). When you want to make a large number of changes to a Layout container, you can use the following two functions to disable and re-enable this repainting functionality: <tscreen><verb> void gtk_layout_freeze( GtkLayout *layout ); void gtk_layout_thaw( GtkLayout *layout ); </verb></tscreen> The final four functions for use with Layout widgets are for manipulating the horizontal and vertical adjustment widgets: <tscreen><verb> GtkAdjustment* gtk_layout_get_hadjustment( GtkLayout *layout ); GtkAdjustment* gtk_layout_get_vadjustment( GtkLayout *layout ); void gtk_layout_set_hadjustment( GtkLayout *layout, GtkAdjustment *adjustment ); void gtk_layout_set_vadjustment( GtkLayout *layout, GtkAdjustment *adjustment); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1> Frames <label id="sec_Frames"> <p> Frames can be used to enclose one or a group of widgets with a box which can optionally be labelled. The position of the label and the style of the box can be altered to suit. A Frame can be created with the following function: <tscreen><verb> GtkWidget *gtk_frame_new( const gchar *label ); </verb></tscreen> The label is by default placed in the upper left hand corner of the frame. A value of NULL for the <tt/label/ argument will result in no label being displayed. The text of the label can be changed using the next function. <tscreen><verb> void gtk_frame_set_label( GtkFrame *frame, const gchar *label ); </verb></tscreen> The position of the label can be changed using this function: <tscreen><verb> void gtk_frame_set_label_align( GtkFrame *frame, gfloat xalign, gfloat yalign ); </verb></tscreen> <tt/xalign/ and <tt/yalign/ take values between 0.0 and 1.0. <tt/xalign/ indicates the position of the label along the top horizontal of the frame. <tt/yalign/ is not currently used. The default value of xalign is 0.0 which places the label at the left hand end of the frame. The next function alters the style of the box that is used to outline the frame. <tscreen><verb> void gtk_frame_set_shadow_type( GtkFrame *frame, GtkShadowType type); </verb></tscreen> The <tt/type/ argument can take one of the following values: <tscreen><verb> GTK_SHADOW_NONE GTK_SHADOW_IN GTK_SHADOW_OUT GTK_SHADOW_ETCHED_IN (the default) GTK_SHADOW_ETCHED_OUT </verb></tscreen> The following code example illustrates the use of the Frame widget. <tscreen><verb> /* example-start frame frame.c */ #include <gtk/gtk.h> int main( int argc, char *argv[] ) { /* GtkWidget is the storage type for widgets */ GtkWidget *window; GtkWidget *frame; GtkWidget *button; gint i; /* Initialise GTK */ gtk_init(&argc, &argv); /* Create a new window */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window), "Frame Example"); /* Here we connect the "destroy" event to a signal handler */ gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_main_quit), NULL); gtk_widget_set_usize(window, 300, 300); /* Sets the border width of the window. */ gtk_container_set_border_width (GTK_CONTAINER (window), 10); /* Create a Frame */ frame = gtk_frame_new(NULL); gtk_container_add(GTK_CONTAINER(window), frame); /* Set the frame's label */ gtk_frame_set_label( GTK_FRAME(frame), "GTK Frame Widget" ); /* Align the label at the right of the frame */ gtk_frame_set_label_align( GTK_FRAME(frame), 1.0, 0.0); /* Set the style of the frame */ gtk_frame_set_shadow_type( GTK_FRAME(frame), GTK_SHADOW_ETCHED_OUT); gtk_widget_show(frame); /* Display the window */ gtk_widget_show (window); /* Enter the event loop */ gtk_main (); return(0); } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1> Aspect Frames <p> The aspect frame widget is like a frame widget, except that it also enforces the aspect ratio (that is, the ratio of the width to the height) of the child widget to have a certain value, adding extra space if necessary. This is useful, for instance, if you want to preview a larger image. The size of the preview should vary when the user resizes the window, but the aspect ratio needs to always match the original image. To create a new aspect frame use: <tscreen><verb> GtkWidget *gtk_aspect_frame_new( const gchar *label, gfloat xalign, gfloat yalign, gfloat ratio, gint obey_child); </verb></tscreen> <tt/xalign/ and <tt/yalign/ specify alignment as with Alignment widgets. If <tt/obey_child/ is true, the aspect ratio of a child widget will match the aspect ratio of the ideal size it requests. Otherwise, it is given by <tt/ratio/. To change the options of an existing aspect frame, you can use: <tscreen><verb> void gtk_aspect_frame_set( GtkAspectFrame *aspect_frame, gfloat xalign, gfloat yalign, gfloat ratio, gint obey_child); </verb></tscreen> As an example, the following program uses an AspectFrame to present a drawing area whose aspect ratio will always be 2:1, no matter how the user resizes the top-level window. <tscreen><verb> /* example-start aspectframe aspectframe.c */ #include <gtk/gtk.h> int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *aspect_frame; GtkWidget *drawing_area; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Aspect Frame"); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_main_quit), NULL); gtk_container_set_border_width (GTK_CONTAINER (window), 10); /* Create an aspect_frame and add it to our toplevel window */ aspect_frame = gtk_aspect_frame_new ("2x1", /* label */ 0.5, /* center x */ 0.5, /* center y */ 2, /* xsize/ysize = 2 */ FALSE /* ignore child's aspect */); gtk_container_add (GTK_CONTAINER(window), aspect_frame); gtk_widget_show (aspect_frame); /* Now add a child widget to the aspect frame */ drawing_area = gtk_drawing_area_new (); /* Ask for a 200x200 window, but the AspectFrame will give us a 200x100 * window since we are forcing a 2x1 aspect ratio */ gtk_widget_set_usize (drawing_area, 200, 200); gtk_container_add (GTK_CONTAINER(aspect_frame), drawing_area); gtk_widget_show (drawing_area); gtk_widget_show (window); gtk_main (); return 0; } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1> Paned Window Widgets <p> The paned window widgets are useful when you want to divide an area into two parts, with the relative size of the two parts controlled by the user. A groove is drawn between the two portions with a handle that the user can drag to change the ratio. The division can either be horizontal (HPaned) or vertical (VPaned). To create a new paned window, call one of: <tscreen><verb> GtkWidget *gtk_hpaned_new (void); GtkWidget *gtk_vpaned_new (void); </verb></tscreen> After creating the paned window widget, you need to add child widgets to its two halves. To do this, use the functions: <tscreen><verb> void gtk_paned_add1 (GtkPaned *paned, GtkWidget *child); void gtk_paned_add2 (GtkPaned *paned, GtkWidget *child); </verb></tscreen> <tt/gtk_paned_add1()/ adds the child widget to the left or top half of the paned window. <tt/gtk_paned_add2()/ adds the child widget to the right or bottom half of the paned window. A paned widget can be changed visually using the following two functions. <tscreen><verb> void gtk_paned_set_handle_size( GtkPaned *paned, guint16 size); void gtk_paned_set_gutter_size( GtkPaned *paned, guint16 size); </verb></tscreen> The first of these sets the size of the handle and the second sets the size of the gutter that is between the two parts of the paned window. As an example, we will create part of the user interface of an imaginary email program. A window is divided into two portions vertically, with the top portion being a list of email messages and the bottom portion the text of the email message. Most of the program is pretty straightforward. A couple of points to note: text can't be added to a Text widget until it is realized. This could be done by calling <tt/gtk_widget_realize()/, but as a demonstration of an alternate technique, we connect a handler to the "realize" signal to add the text. Also, we need to add the <tt/GTK_SHRINK/ option to some of the items in the table containing the text window and its scrollbars, so that when the bottom portion is made smaller, the correct portions shrink instead of being pushed off the bottom of the window. <tscreen><verb> /* example-start paned paned.c */ #include <stdio.h> #include <gtk/gtk.h> /* Create the list of "messages" */ GtkWidget *create_list( void ) { GtkWidget *scrolled_window; GtkWidget *list; GtkWidget *list_item; int i; char buffer[16]; /* Create a new scrolled window, with scrollbars only if needed */ scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); /* Create a new list and put it in the scrolled window */ list = gtk_list_new (); gtk_scrolled_window_add_with_viewport ( GTK_SCROLLED_WINDOW (scrolled_window), list); gtk_widget_show (list); /* Add some messages to the window */ for (i=0; i<10; i++) { sprintf(buffer,"Message #%d",i); list_item = gtk_list_item_new_with_label (buffer); gtk_container_add (GTK_CONTAINER(list), list_item); gtk_widget_show (list_item); } return scrolled_window; } /* Add some text to our text widget - this is a callback that is invoked when our window is realized. We could also force our window to be realized with gtk_widget_realize, but it would have to be part of a hierarchy first */ void realize_text( GtkWidget *text, gpointer data ) { gtk_text_freeze (GTK_TEXT (text)); gtk_text_insert (GTK_TEXT (text), NULL, &text->style->black, NULL, "From: pathfinder@nasa.gov\n" "To: mom@nasa.gov\n" "Subject: Made it!\n" "\n" "We just got in this morning. The weather has been\n" "great - clear but cold, and there are lots of fun sights.\n" "Sojourner says hi. See you soon.\n" " -Path\n", -1); gtk_text_thaw (GTK_TEXT (text)); } /* Create a scrolled text area that displays a "message" */ GtkWidget *create_text( void ) { GtkWidget *table; GtkWidget *text; GtkWidget *hscrollbar; GtkWidget *vscrollbar; /* Create a table to hold the text widget and scrollbars */ table = gtk_table_new (2, 2, FALSE); /* Put a text widget in the upper left hand corner. Note the use of * GTK_SHRINK in the y direction */ text = gtk_text_new (NULL, NULL); gtk_table_attach (GTK_TABLE (table), text, 0, 1, 0, 1, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 0); gtk_widget_show (text); /* Put a HScrollbar in the lower left hand corner */ hscrollbar = gtk_hscrollbar_new (GTK_TEXT (text)->hadj); gtk_table_attach (GTK_TABLE (table), hscrollbar, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (hscrollbar); /* And a VScrollbar in the upper right */ vscrollbar = gtk_vscrollbar_new (GTK_TEXT (text)->vadj); gtk_table_attach (GTK_TABLE (table), vscrollbar, 1, 2, 0, 1, GTK_FILL, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0); gtk_widget_show (vscrollbar); /* Add a handler to put a message in the text widget when it is realized */ gtk_signal_connect (GTK_OBJECT (text), "realize", GTK_SIGNAL_FUNC (realize_text), NULL); return table; } int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *vpaned; GtkWidget *list; GtkWidget *text; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Paned Windows"); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_main_quit), NULL); gtk_container_set_border_width (GTK_CONTAINER (window), 10); gtk_widget_set_usize (GTK_WIDGET(window), 450, 400); /* create a vpaned widget and add it to our toplevel window */ vpaned = gtk_vpaned_new (); gtk_container_add (GTK_CONTAINER(window), vpaned); gtk_paned_set_handle_size (GTK_PANED(vpaned), 10); gtk_paned_set_gutter_size (GTK_PANED(vpaned), 15); gtk_widget_show (vpaned); /* Now create the contents of the two halves of the window */ list = create_list (); gtk_paned_add1 (GTK_PANED(vpaned), list); gtk_widget_show (list); text = create_text (); gtk_paned_add2 (GTK_PANED(vpaned), text); gtk_widget_show (text); gtk_widget_show (window); gtk_main (); return 0; } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Viewports <label id="sec_Viewports"> <p> It is unlikely that you will ever need to use the Viewport widget directly. You are much more likely to use the <ref id="sec_ScrolledWindow" name="Scrolled Window"> widget which itself uses the Viewport. A viewport widget allows you to place a larger widget within it such that you can view a part of it at a time. It uses <ref id="sec_Adjustment" name="Adjustments"> to define the area that is currently in view. A Viewport is created with the function <tscreen><verb> GtkWidget *gtk_viewport_new( GtkAdjustment *hadjustment, GtkAdjustment *vadjustment ); </verb></tscreen> As you can see you can specify the horizontal and vertical Adjustments that the widget is to use when you create the widget. It will create its own if you pass NULL as the value of the arguments. You can get and set the adjustments after the widget has been created using the following four functions: <tscreen><verb> GtkAdjustment *gtk_viewport_get_hadjustment (GtkViewport *viewport ); GtkAdjustment *gtk_viewport_get_vadjustment (GtkViewport *viewport ); void gtk_viewport_set_hadjustment( GtkViewport *viewport, GtkAdjustment *adjustment ); void gtk_viewport_set_vadjustment( GtkViewport *viewport, GtkAdjustment *adjustment ); </verb></tscreen> The only other viewport function is used to alter its appearance: <tscreen><verb> void gtk_viewport_set_shadow_type( GtkViewport *viewport, GtkShadowType type ); </verb></tscreen> Possible values for the <tt/type/ parameter are: <tscreen><verb> GTK_SHADOW_NONE, GTK_SHADOW_IN, GTK_SHADOW_OUT, GTK_SHADOW_ETCHED_IN, GTK_SHADOW_ETCHED_OUT </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Scrolled Windows <label id="sec_ScrolledWindow"> <p> Scrolled windows are used to create a scrollable area with another widget inside it. You may insert any type of widget into a scrolled window, and it will be accessible regardless of the size by using the scrollbars. The following function is used to create a new scrolled window. <tscreen><verb> GtkWidget *gtk_scrolled_window_new( GtkAdjustment *hadjustment, GtkAdjustment *vadjustment ); </verb></tscreen> Where the first argument is the adjustment for the horizontal direction, and the second, the adjustment for the vertical direction. These are almost always set to NULL. <tscreen><verb> void gtk_scrolled_window_set_policy( GtkScrolledWindow *scrolled_window, GtkPolicyType hscrollbar_policy, GtkPolicyType vscrollbar_policy ); </verb></tscreen> This sets the policy to be used with respect to the scrollbars. The first argument is the scrolled window you wish to change. The second sets the policy for the horizontal scrollbar, and the third the policy for the vertical scrollbar. The policy may be one of <tt/GTK_POLICY_AUTOMATIC/ or <tt/GTK_POLICY_ALWAYS/. <tt/GTK_POLICY_AUTOMATIC/ will automatically decide whether you need scrollbars, whereas <tt/GTK_POLICY_ALWAYS/ will always leave the scrollbars there. You can then place your object into the scrolled window using the following function. <tscreen><verb> void gtk_scrolled_window_add_with_viewport( GtkScrolledWindow *scrolled_window, GtkWidget *child); </verb></tscreen> Here is a simple example that packs a table eith 100 toggle buttons into a scrolled window. I've only commented on the parts that may be new to you. <tscreen><verb> /* example-start scrolledwin scrolledwin.c */ #include <stdio.h> #include <gtk/gtk.h> void destroy( GtkWidget *widget, gpointer data ) { gtk_main_quit(); } int main( int argc, char *argv[] ) { static GtkWidget *window; GtkWidget *scrolled_window; GtkWidget *table; GtkWidget *button; char buffer[32]; int i, j; gtk_init (&argc, &argv); /* Create a new dialog window for the scrolled window to be * packed into. */ window = gtk_dialog_new (); gtk_signal_connect (GTK_OBJECT (window), "destroy", (GtkSignalFunc) destroy, NULL); gtk_window_set_title (GTK_WINDOW (window), "GtkScrolledWindow example"); gtk_container_set_border_width (GTK_CONTAINER (window), 0); gtk_widget_set_usize(window, 300, 300); /* create a new scrolled window. */ scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 10); /* the policy is one of GTK_POLICY AUTOMATIC, or GTK_POLICY_ALWAYS. * GTK_POLICY_AUTOMATIC will automatically decide whether you need * scrollbars, whereas GTK_POLICY_ALWAYS will always leave the scrollbars * there. The first one is the horizontal scrollbar, the second, * the vertical. */ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); /* The dialog window is created with a vbox packed into it. */ gtk_box_pack_start (GTK_BOX (GTK_DIALOG(window)->vbox), scrolled_window, TRUE, TRUE, 0); gtk_widget_show (scrolled_window); /* create a table of 10 by 10 squares. */ table = gtk_table_new (10, 10, FALSE); /* set the spacing to 10 on x and 10 on y */ gtk_table_set_row_spacings (GTK_TABLE (table), 10); gtk_table_set_col_spacings (GTK_TABLE (table), 10); /* pack the table into the scrolled window */ gtk_scrolled_window_add_with_viewport ( GTK_SCROLLED_WINDOW (scrolled_window), table); gtk_widget_show (table); /* this simply creates a grid of toggle buttons on the table * to demonstrate the scrolled window. */ for (i = 0; i < 10; i++) for (j = 0; j < 10; j++) { sprintf (buffer, "button (%d,%d)\n", i, j); button = gtk_toggle_button_new_with_label (buffer); gtk_table_attach_defaults (GTK_TABLE (table), button, i, i+1, j, j+1); gtk_widget_show (button); } /* Add a "close" button to the bottom of the dialog */ button = gtk_button_new_with_label ("close"); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", (GtkSignalFunc) gtk_widget_destroy, GTK_OBJECT (window)); /* this makes it so the button is the default. */ GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area), button, TRUE, TRUE, 0); /* This grabs this button to be the default button. Simply hitting * the "Enter" key will cause this button to activate. */ gtk_widget_grab_default (button); gtk_widget_show (button); gtk_widget_show (window); gtk_main(); return(0); } /* example-end */ </verb></tscreen> Try playing with resizing the window. You'll notice how the scrollbars react. You may also wish to use the gtk_widget_set_usize() call to set the default size of the window or other widgets. <!-- ----------------------------------------------------------------- --> <sect1>Button Boxes <p> Button Boxes are a convenient way to quickly layout a group of buttons. They come in both horizontal and vertical flavours. You create a new Button Box with one of the following calls, which create a horizontal or vertical box, respectively: <tscreen><verb> GtkWidget *gtk_hbutton_box_new( void ); GtkWidget *gtk_vbutton_box_new( void ); </verb></tscreen> The only attributes pertaining to button boxes effect how the buttons are laid out. You can change the spacing between the buttons with: <tscreen><verb> void gtk_hbutton_box_set_spacing_default( gint spacing ); void gtk_vbutton_box_set_spacing_default( gint spacing ); </verb></tscreen> Similarly, the current spacing values can be queried using: <tscreen><verb> gint gtk_hbutton_box_get_spacing_default( void ); gint gtk_vbutton_box_get_spacing_default( void ); </verb></tscreen> The second attribute that we can access effects the layout of the buttons within the box. It is set using one of: <tscreen><verb> void gtk_hbutton_box_set_layout_default( GtkButtonBoxStyle layout ); void gtk_vbutton_box_set_layout_default( GtkButtonBoxStyle layout ); </verb></tscreen> The <tt/layout/ argument can take one of the following values: <tscreen><verb> GTK_BUTTONBOX_DEFAULT_STYLE GTK_BUTTONBOX_SPREAD GTK_BUTTONBOX_EDGE GTK_BUTTONBOX_START GTK_BUTTONBOX_END </verb></tscreen> The current layout setting can be retrieved using: <tscreen><verb> GtkButtonBoxStyle gtk_hbutton_box_get_layout_default( void ); GtkButtonBoxStyle gtk_vbutton_box_get_layout_default( void ); </verb></tscreen> Buttons are added to a Button Box using the usual function: <tscreen><verb> gtk_container_add( GTK_CONTAINER(button_box), child_widget ); </verb></tscreen> Here's an example that illustrates all the different layout settings for Button Boxes. <tscreen><verb> /* example-start buttonbox buttonbox.c */ #include <gtk/gtk.h> /* Create a Button Box with the specified parameters */ GtkWidget *create_bbox( gint horizontal, char *title, gint spacing, gint child_w, gint child_h, gint layout ) { GtkWidget *frame; GtkWidget *bbox; GtkWidget *button; frame = gtk_frame_new (title); if (horizontal) bbox = gtk_hbutton_box_new (); else bbox = gtk_vbutton_box_new (); gtk_container_set_border_width (GTK_CONTAINER (bbox), 5); gtk_container_add (GTK_CONTAINER (frame), bbox); /* Set the appearance of the Button Box */ gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), layout); gtk_button_box_set_spacing (GTK_BUTTON_BOX (bbox), spacing); gtk_button_box_set_child_size (GTK_BUTTON_BOX (bbox), child_w, child_h); button = gtk_button_new_with_label ("OK"); gtk_container_add (GTK_CONTAINER (bbox), button); button = gtk_button_new_with_label ("Cancel"); gtk_container_add (GTK_CONTAINER (bbox), button); button = gtk_button_new_with_label ("Help"); gtk_container_add (GTK_CONTAINER (bbox), button); return(frame); } int main( int argc, char *argv[] ) { static GtkWidget* window = NULL; GtkWidget *main_vbox; GtkWidget *vbox; GtkWidget *hbox; GtkWidget *frame_horz; GtkWidget *frame_vert; /* Initialize GTK */ gtk_init( &argc, &argv ); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Button Boxes"); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC(gtk_main_quit), NULL); gtk_container_set_border_width (GTK_CONTAINER (window), 10); main_vbox = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window), main_vbox); frame_horz = gtk_frame_new ("Horizontal Button Boxes"); gtk_box_pack_start (GTK_BOX (main_vbox), frame_horz, TRUE, TRUE, 10); vbox = gtk_vbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 10); gtk_container_add (GTK_CONTAINER (frame_horz), vbox); gtk_box_pack_start (GTK_BOX (vbox), create_bbox (TRUE, "Spread (spacing 40)", 40, 85, 20, GTK_BUTTONBOX_SPREAD), TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox), create_bbox (TRUE, "Edge (spacing 30)", 30, 85, 20, GTK_BUTTONBOX_EDGE), TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (vbox), create_bbox (TRUE, "Start (spacing 20)", 20, 85, 20, GTK_BUTTONBOX_START), TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (vbox), create_bbox (TRUE, "End (spacing 10)", 10, 85, 20, GTK_BUTTONBOX_END), TRUE, TRUE, 5); frame_vert = gtk_frame_new ("Vertical Button Boxes"); gtk_box_pack_start (GTK_BOX (main_vbox), frame_vert, TRUE, TRUE, 10); hbox = gtk_hbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); gtk_container_add (GTK_CONTAINER (frame_vert), hbox); gtk_box_pack_start (GTK_BOX (hbox), create_bbox (FALSE, "Spread (spacing 5)", 5, 85, 20, GTK_BUTTONBOX_SPREAD), TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox), create_bbox (FALSE, "Edge (spacing 30)", 30, 85, 20, GTK_BUTTONBOX_EDGE), TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (hbox), create_bbox (FALSE, "Start (spacing 20)", 20, 85, 20, GTK_BUTTONBOX_START), TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (hbox), create_bbox (FALSE, "End (spacing 20)", 20, 85, 20, GTK_BUTTONBOX_END), TRUE, TRUE, 5); gtk_widget_show_all (window); /* Enter the event loop */ gtk_main (); return(0); } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Toolbar <p> Toolbars are usually used to group some number of widgets in order to simplify customization of their look and layout. Typically a toolbar consists of buttons with icons, labels and tooltips, but any other widget can also be put inside a toolbar. Finally, items can be arranged horizontally or vertically and buttons can be displayed with icons, labels, or both. Creating a toolbar is (as one may already suspect) done with the following function: <tscreen><verb> GtkWidget *gtk_toolbar_new( GtkOrientation orientation, GtkToolbarStyle style ); </verb></tscreen> where orientation may be one of: <tscreen><verb> GTK_ORIENTATION_HORIZONTAL GTK_ORIENTATION_VERTICAL </verb></tscreen> and style one of: <tscreen><verb> GTK_TOOLBAR_TEXT GTK_TOOLBAR_ICONS GTK_TOOLBAR_BOTH </verb></tscreen> The style applies to all the buttons created with the `item' functions (not to buttons inserted into toolbar as separate widgets). After creating a toolbar one can append, prepend and insert items (that means simple text strings) or elements (that means any widget types) into the toolbar. To describe an item we need a label text, a tooltip text, a private tooltip text, an icon for the button and a callback function for it. For example, to append or prepend an item you may use the following functions: <tscreen><verb> GtkWidget *gtk_toolbar_append_item( GtkToolbar *toolbar, const char *text, const char *tooltip_text, const char *tooltip_private_text, GtkWidget *icon, GtkSignalFunc callback, gpointer user_data ); GtkWidget *gtk_toolbar_prepend_item( GtkToolbar *toolbar, const char *text, const char *tooltip_text, const char *tooltip_private_text, GtkWidget *icon, GtkSignalFunc callback, gpointer user_data ); </verb></tscreen> If you want to use gtk_toolbar_insert_item, the only additional parameter which must be specified is the position in which the item should be inserted, thus: <tscreen><verb> GtkWidget *gtk_toolbar_insert_item( GtkToolbar *toolbar, const char *text, const char *tooltip_text, const char *tooltip_private_text, GtkWidget *icon, GtkSignalFunc callback, gpointer user_data, gint position ); </verb></tscreen> To simplify adding spaces between toolbar items, you may use the following functions: <tscreen><verb> void gtk_toolbar_append_space( GtkToolbar *toolbar ); void gtk_toolbar_prepend_space( GtkToolbar *toolbar ); void gtk_toolbar_insert_space( GtkToolbar *toolbar, gint position ); </verb></tscreen> While the size of the added space can be set globally for a whole toolbar with the function: <tscreen><verb> void gtk_toolbar_set_space_size( GtkToolbar *toolbar, gint space_size) ; </verb></tscreen> If it's required, the orientation of a toolbar and its style can be changed "on the fly" using the following functions: <tscreen><verb> void gtk_toolbar_set_orientation( GtkToolbar *toolbar, GtkOrientation orientation ); void gtk_toolbar_set_style( GtkToolbar *toolbar, GtkToolbarStyle style ); void gtk_toolbar_set_tooltips( GtkToolbar *toolbar, gint enable ); </verb></tscreen> Where <tt/orientation/ is one of <tt/GTK_ORIENTATION_HORIZONTAL/ or <tt/GTK_ORIENTATION_VERTICAL/. The <tt/style/ is used to set appearance of the toolbar items by using one of <tt/GTK_TOOLBAR_ICONS/, <tt/GTK_TOOLBAR_TEXT/, or <tt/GTK_TOOLBAR_BOTH/. To show some other things that can be done with a toolbar, let's take the following program (we'll interrupt the listing with some additional explanations): <tscreen><verb> #include <gtk/gtk.h> #include "gtk.xpm" /* This function is connected to the Close button or * closing the window from the WM */ gint delete_event (GtkWidget *widget, GdkEvent *event, gpointer data) { gtk_main_quit (); return(FALSE); } </verb></tscreen> The above beginning seems for sure familiar to you if it's not your first GTK program. There is one additional thing though, we include a nice XPM picture to serve as an icon for all of the buttons. <tscreen><verb> GtkWidget* close_button; /* This button will emit signal to close * application */ GtkWidget* tooltips_button; /* to enable/disable tooltips */ GtkWidget* text_button, * icon_button, * both_button; /* radio buttons for toolbar style */ GtkWidget* entry; /* a text entry to show packing any widget into * toolbar */ </verb></tscreen> In fact not all of the above widgets are needed here, but to make things clearer I put them all together. <tscreen><verb> /* that's easy... when one of the buttons is toggled, we just * check which one is active and set the style of the toolbar * accordingly * ATTENTION: our toolbar is passed as data to callback ! */ void radio_event (GtkWidget *widget, gpointer data) { if (GTK_TOGGLE_BUTTON (text_button)->active) gtk_toolbar_set_style(GTK_TOOLBAR ( data ), GTK_TOOLBAR_TEXT); else if (GTK_TOGGLE_BUTTON (icon_button)->active) gtk_toolbar_set_style(GTK_TOOLBAR ( data ), GTK_TOOLBAR_ICONS); else if (GTK_TOGGLE_BUTTON (both_button)->active) gtk_toolbar_set_style(GTK_TOOLBAR ( data ), GTK_TOOLBAR_BOTH); } /* even easier, just check given toggle button and enable/disable * tooltips */ void toggle_event (GtkWidget *widget, gpointer data) { gtk_toolbar_set_tooltips (GTK_TOOLBAR ( data ), GTK_TOGGLE_BUTTON (widget)->active ); } </verb></tscreen> The above are just two callback functions that will be called when one of the buttons on a toolbar is pressed. You should already be familiar with things like this if you've already used toggle buttons (and radio buttons). <tscreen><verb> int main (int argc, char *argv[]) { /* Here is our main window (a dialog) and a handle for the handlebox */ GtkWidget* dialog; GtkWidget* handlebox; /* Ok, we need a toolbar, an icon with a mask (one for all of the buttons) and an icon widget to put this icon in (but we'll create a separate widget for each button) */ GtkWidget * toolbar; GdkPixmap * icon; GdkBitmap * mask; GtkWidget * iconw; /* this is called in all GTK application. */ gtk_init (&argc, &argv); /* create a new window with a given title, and nice size */ dialog = gtk_dialog_new (); gtk_window_set_title ( GTK_WINDOW ( dialog ) , "GTKToolbar Tutorial"); gtk_widget_set_usize( GTK_WIDGET ( dialog ) , 600 , 300 ); GTK_WINDOW ( dialog ) ->allow_shrink = TRUE; /* typically we quit if someone tries to close us */ gtk_signal_connect ( GTK_OBJECT ( dialog ), "delete_event", GTK_SIGNAL_FUNC ( delete_event ), NULL); /* we need to realize the window because we use pixmaps for * items on the toolbar in the context of it */ gtk_widget_realize ( dialog ); /* to make it nice we'll put the toolbar into the handle box, * so that it can be detached from the main window */ handlebox = gtk_handle_box_new (); gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG(dialog)->vbox ), handlebox, FALSE, FALSE, 5 ); </verb></tscreen> The above should be similar to any other GTK application. Just initialization of GTK, creating the window, etc. There is only one thing that probably needs some explanation: a handle box. A handle box is just another box that can be used to pack widgets in to. The difference between it and typical boxes is that it can be detached from a parent window (or, in fact, the handle box remains in the parent, but it is reduced to a very small rectangle, while all of its contents are reparented to a new freely floating window). It is usually nice to have a detachable toolbar, so these two widgets occur together quite often. <tscreen><verb> /* toolbar will be horizontal, with both icons and text, and * with 5pxl spaces between items and finally, * we'll also put it into our handlebox */ toolbar = gtk_toolbar_new ( GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH ); gtk_container_set_border_width ( GTK_CONTAINER ( toolbar ) , 5 ); gtk_toolbar_set_space_size ( GTK_TOOLBAR ( toolbar ), 5 ); gtk_container_add ( GTK_CONTAINER ( handlebox ) , toolbar ); /* now we create icon with mask: we'll reuse it to create * icon widgets for toolbar items */ icon = gdk_pixmap_create_from_xpm_d ( dialog->window, &mask, &dialog->style->white, gtk_xpm ); </verb></tscreen> Well, what we do above is just a straightforward initialization of the toolbar widget and creation of a GDK pixmap with its mask. If you want to know something more about using pixmaps, refer to GDK documentation or to the <ref id="sec_Pixmaps" name="Pixmaps"> section earlier in this tutorial. <tscreen><verb> /* our first item is <close> button */ iconw = gtk_pixmap_new ( icon, mask ); /* icon widget */ close_button = gtk_toolbar_append_item ( GTK_TOOLBAR (toolbar), /* our toolbar */ "Close", /* button label */ "Closes this app", /* this button's tooltip */ "Private", /* tooltip private info */ iconw, /* icon widget */ GTK_SIGNAL_FUNC (delete_event), /* a signal */ NULL ); gtk_toolbar_append_space ( GTK_TOOLBAR ( toolbar ) ); /* space after item */ </verb></tscreen> In the above code you see the simplest case: adding a button to toolbar. Just before appending a new item, we have to construct a pixmap widget to serve as an icon for this item; this step will have to be repeated for each new item. Just after the item we also add a space, so the following items will not touch each other. As you see gtk_toolbar_append_item returns a pointer to our newly created button widget, so that we can work with it in the normal way. <tscreen><verb> /* now, let's make our radio buttons group... */ iconw = gtk_pixmap_new ( icon, mask ); icon_button = gtk_toolbar_append_element( GTK_TOOLBAR(toolbar), GTK_TOOLBAR_CHILD_RADIOBUTTON, /* a type of element */ NULL, /* pointer to widget */ "Icon", /* label */ "Only icons in toolbar", /* tooltip */ "Private", /* tooltip private string */ iconw, /* icon */ GTK_SIGNAL_FUNC (radio_event), /* signal */ toolbar); /* data for signal */ gtk_toolbar_append_space ( GTK_TOOLBAR ( toolbar ) ); </verb></tscreen> Here we begin creating a radio buttons group. To do this we use gtk_toolbar_append_element. In fact, using this function one can also +add simple items or even spaces (type = <tt/GTK_TOOLBAR_CHILD_SPACE/ or +<tt/GTK_TOOLBAR_CHILD_BUTTON/). In the above case we start creating a radio group. In creating other radio buttons for this group a pointer to the previous button in the group is required, so that a list of buttons can be easily constructed (see the section on <ref id="sec_Radio_Buttons" name="Radio Buttons"> earlier in this tutorial). <tscreen><verb> /* following radio buttons refer to previous ones */ iconw = gtk_pixmap_new ( icon, mask ); text_button = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_CHILD_RADIOBUTTON, icon_button, "Text", "Only texts in toolbar", "Private", iconw, GTK_SIGNAL_FUNC (radio_event), toolbar); gtk_toolbar_append_space ( GTK_TOOLBAR ( toolbar ) ); iconw = gtk_pixmap_new ( icon, mask ); both_button = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_CHILD_RADIOBUTTON, text_button, "Both", "Icons and text in toolbar", "Private", iconw, GTK_SIGNAL_FUNC (radio_event), toolbar); gtk_toolbar_append_space ( GTK_TOOLBAR ( toolbar ) ); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(both_button),TRUE); </verb></tscreen> In the end we have to set the state of one of the buttons manually (otherwise they all stay in active state, preventing us from switching between them). <tscreen><verb> /* here we have just a simple toggle button */ iconw = gtk_pixmap_new ( icon, mask ); tooltips_button = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, "Tooltips", "Toolbar with or without tips", "Private", iconw, GTK_SIGNAL_FUNC (toggle_event), toolbar); gtk_toolbar_append_space ( GTK_TOOLBAR ( toolbar ) ); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tooltips_button),TRUE); </verb></tscreen> A toggle button can be created in the obvious way (if one knows how to create radio buttons already). <tscreen><verb> /* to pack a widget into toolbar, we only have to * create it and append it with an appropriate tooltip */ entry = gtk_entry_new (); gtk_toolbar_append_widget( GTK_TOOLBAR (toolbar), entry, "This is just an entry", "Private" ); /* well, it isn't created within thetoolbar, so we must still show it */ gtk_widget_show ( entry ); </verb></tscreen> As you see, adding any kind of widget to a toolbar is simple. The one thing you have to remember is that this widget must be shown manually (contrary to other items which will be shown together with the toolbar). <tscreen><verb> /* that's it ! let's show everything. */ gtk_widget_show ( toolbar ); gtk_widget_show (handlebox); gtk_widget_show ( dialog ); /* rest in gtk_main and wait for the fun to begin! */ gtk_main (); return 0; } </verb></tscreen> So, here we are at the end of toolbar tutorial. Of course, to appreciate it in full you need also this nice XPM icon, so here it is: <tscreen><verb> /* XPM */ static char * gtk_xpm[] = { "32 39 5 1", ". c none", "+ c black", "@ c #3070E0", "# c #F05050", "$ c #35E035", "................+...............", "..............+++++.............", "............+++++@@++...........", "..........+++++@@@@@@++.........", "........++++@@@@@@@@@@++........", "......++++@@++++++++@@@++.......", ".....+++@@@+++++++++++@@@++.....", "...+++@@@@+++@@@@@@++++@@@@+....", "..+++@@@@+++@@@@@@@@+++@@@@@++..", ".++@@@@@@+++@@@@@@@@@@@@@@@@@@++", ".+#+@@@@@@++@@@@+++@@@@@@@@@@@@+", ".+##++@@@@+++@@@+++++@@@@@@@@$@.", ".+###++@@@@+++@@@+++@@@@@++$$$@.", ".+####+++@@@+++++++@@@@@+@$$$$@.", ".+#####+++@@@@+++@@@@++@$$$$$$+.", ".+######++++@@@@@@@++@$$$$$$$$+.", ".+#######+##+@@@@+++$$$$$$@@$$+.", ".+###+++##+##+@@++@$$$$$$++$$$+.", ".+###++++##+##+@@$$$$$$$@+@$$@+.", ".+###++++++#+++@$$@+@$$@++$$$@+.", ".+####+++++++#++$$@+@$$++$$$$+..", ".++####++++++#++$$@+@$++@$$$$+..", ".+#####+++++##++$$++@+++$$$$$+..", ".++####+++##+#++$$+++++@$$$$$+..", ".++####+++####++$$++++++@$$$@+..", ".+#####++#####++$$+++@++++@$@+..", ".+#####++#####++$$++@$$@+++$@@..", ".++####++#####++$$++$$$$$+@$@++.", ".++####++#####++$$++$$$$$$$$+++.", ".+++####+#####++$$++$$$$$$$@+++.", "..+++#########+@$$+@$$$$$$+++...", "...+++########+@$$$$$$$$@+++....", ".....+++######+@$$$$$$$+++......", "......+++#####+@$$$$$@++........", ".......+++####+@$$$$+++.........", ".........++###+$$$@++...........", "..........++##+$@+++............", "...........+++++++..............", ".............++++..............."}; </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1> Notebooks <p> The NoteBook Widget is a collection of "pages" that overlap each other, each page contains different information with only one page visible at a time. This widget has become more common lately in GUI programming, and it is a good way to show blocks of similar information that warrant separation in their display. The first function call you will need to know, as you can probably guess by now, is used to create a new notebook widget. <tscreen><verb> GtkWidget *gtk_notebook_new( void ); </verb></tscreen> Once the notebook has been created, there are a number of functions that operate on the notebook widget. Let's look at them individually. The first one we will look at is how to position the page indicators. These page indicators or "tabs" as they are referred to, can be positioned in four ways: top, bottom, left, or right. <tscreen><verb> void gtk_notebook_set_tab_pos( GtkNotebook *notebook, GtkPositionType pos ); </verb></tscreen> GtkPositionType will be one of the following, which are pretty self explanatory: <tscreen><verb> GTK_POS_LEFT GTK_POS_RIGHT GTK_POS_TOP GTK_POS_BOTTOM </verb></tscreen> <tt/GTK_POS_TOP/ is the default. Next we will look at how to add pages to the notebook. There are three ways to add pages to the NoteBook. Let's look at the first two together as they are quite similar. <tscreen><verb> void gtk_notebook_append_page( GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label ); void gtk_notebook_prepend_page( GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label ); </verb></tscreen> These functions add pages to the notebook by inserting them from the back of the notebook (append), or the front of the notebook (prepend). <tt/child/ is the widget that is placed within the notebook page, and <tt/tab_label/ is the label for the page being added. The <tt/child/ widget must be created separately, and is typically a set of options setup witin one of the other container widgets, such as a table. The final function for adding a page to the notebook contains all of the properties of the previous two, but it allows you to specify what position you want the page to be in the notebook. <tscreen><verb> void gtk_notebook_insert_page( GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label, gint position ); </verb></tscreen> The parameters are the same as _append_ and _prepend_ except it contains an extra parameter, <tt/position/. This parameter is used to specify what place this page will be inserted into the first page having position zero. Now that we know how to add a page, lets see how we can remove a page from the notebook. <tscreen><verb> void gtk_notebook_remove_page( GtkNotebook *notebook, gint page_num ); </verb></tscreen> This function takes the page specified by <tt/page_num/ and removes it from the widget pointed to by <tt/notebook/. To find out what the current page is in a notebook use the function: <tscreen><verb> gint gtk_notebook_get_current_page( GtkNotebook *notebook ); </verb></tscreen> These next two functions are simple calls to move the notebook page forward or backward. Simply provide the respective function call with the notebook widget you wish to operate on. Note: When the NoteBook is currently on the last page, and gtk_notebook_next_page is called, the notebook will wrap back to the first page. Likewise, if the NoteBook is on the first page, and gtk_notebook_prev_page is called, the notebook will wrap to the last page. <tscreen><verb> void gtk_notebook_next_page( GtkNoteBook *notebook ); void gtk_notebook_prev_page( GtkNoteBook *notebook ); </verb></tscreen> This next function sets the "active" page. If you wish the notebook to be opened to page 5 for example, you would use this function. Without using this function, the notebook defaults to the first page. <tscreen><verb> void gtk_notebook_set_page( GtkNotebook *notebook, gint page_num ); </verb></tscreen> The next two functions add or remove the notebook page tabs and the notebook border respectively. <tscreen><verb> void gtk_notebook_set_show_tabs( GtkNotebook *notebook, gboolean show_tabs); void gtk_notebook_set_show_border( GtkNotebook *notebook, gboolean show_border ); </verb></tscreen> The next function is useful when the you have a large number of pages, and the tabs don't fit on the page. It allows the tabs to be scrolled through using two arrow buttons. <tscreen><verb> void gtk_notebook_set_scrollable( GtkNotebook *notebook, gboolean scrollable ); </verb></tscreen> <tt/show_tabs/, <tt/show_border/ and <tt/scrollable/ can be either TRUE or FALSE. Now let's look at an example, it is expanded from the testgtk.c code that comes with the GTK distribution. This small program creates a window with a notebook and six buttons. The notebook contains 11 pages, added in three different ways, appended, inserted, and prepended. The buttons allow you rotate the tab positions, add/remove the tabs and border, remove a page, change pages in both a forward and backward manner, and exit the program. <tscreen><verb> /* example-start notebook notebook.c */ #include <stdio.h> #include <gtk/gtk.h> /* This function rotates the position of the tabs */ void rotate_book( GtkButton *button, GtkNotebook *notebook ) { gtk_notebook_set_tab_pos (notebook, (notebook->tab_pos +1) %4); } /* Add/Remove the page tabs and the borders */ void tabsborder_book( GtkButton *button, GtkNotebook *notebook ) { gint tval = FALSE; gint bval = FALSE; if (notebook->show_tabs == 0) tval = TRUE; if (notebook->show_border == 0) bval = TRUE; gtk_notebook_set_show_tabs (notebook, tval); gtk_notebook_set_show_border (notebook, bval); } /* Remove a page from the notebook */ void remove_book( GtkButton *button, GtkNotebook *notebook ) { gint page; page = gtk_notebook_get_current_page(notebook); gtk_notebook_remove_page (notebook, page); /* Need to refresh the widget -- This forces the widget to redraw itself. */ gtk_widget_draw(GTK_WIDGET(notebook), NULL); } gint delete( GtkWidget *widget, GtkWidget *event, gpointer data ) { gtk_main_quit(); return(FALSE); } int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *button; GtkWidget *table; GtkWidget *notebook; GtkWidget *frame; GtkWidget *label; GtkWidget *checkbutton; int i; char bufferf[32]; char bufferl[32]; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (delete), NULL); gtk_container_set_border_width (GTK_CONTAINER (window), 10); table = gtk_table_new(3,6,FALSE); gtk_container_add (GTK_CONTAINER (window), table); /* Create a new notebook, place the position of the tabs */ notebook = gtk_notebook_new (); gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook), GTK_POS_TOP); gtk_table_attach_defaults(GTK_TABLE(table), notebook, 0,6,0,1); gtk_widget_show(notebook); /* Let's append a bunch of pages to the notebook */ for (i=0; i < 5; i++) { sprintf(bufferf, "Append Frame %d", i+1); sprintf(bufferl, "Page %d", i+1); frame = gtk_frame_new (bufferf); gtk_container_set_border_width (GTK_CONTAINER (frame), 10); gtk_widget_set_usize (frame, 100, 75); gtk_widget_show (frame); label = gtk_label_new (bufferf); gtk_container_add (GTK_CONTAINER (frame), label); gtk_widget_show (label); label = gtk_label_new (bufferl); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame, label); } /* Now let's add a page to a specific spot */ checkbutton = gtk_check_button_new_with_label ("Check me please!"); gtk_widget_set_usize(checkbutton, 100, 75); gtk_widget_show (checkbutton); label = gtk_label_new ("Add page"); gtk_notebook_insert_page (GTK_NOTEBOOK (notebook), checkbutton, label, 2); /* Now finally let's prepend pages to the notebook */ for (i=0; i < 5; i++) { sprintf(bufferf, "Prepend Frame %d", i+1); sprintf(bufferl, "PPage %d", i+1); frame = gtk_frame_new (bufferf); gtk_container_set_border_width (GTK_CONTAINER (frame), 10); gtk_widget_set_usize (frame, 100, 75); gtk_widget_show (frame); label = gtk_label_new (bufferf); gtk_container_add (GTK_CONTAINER (frame), label); gtk_widget_show (label); label = gtk_label_new (bufferl); gtk_notebook_prepend_page (GTK_NOTEBOOK(notebook), frame, label); } /* Set what page to start at (page 4) */ gtk_notebook_set_page (GTK_NOTEBOOK(notebook), 3); /* Create a bunch of buttons */ button = gtk_button_new_with_label ("close"); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (delete), NULL); gtk_table_attach_defaults(GTK_TABLE(table), button, 0,1,1,2); gtk_widget_show(button); button = gtk_button_new_with_label ("next page"); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", (GtkSignalFunc) gtk_notebook_next_page, GTK_OBJECT (notebook)); gtk_table_attach_defaults(GTK_TABLE(table), button, 1,2,1,2); gtk_widget_show(button); button = gtk_button_new_with_label ("prev page"); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", (GtkSignalFunc) gtk_notebook_prev_page, GTK_OBJECT (notebook)); gtk_table_attach_defaults(GTK_TABLE(table), button, 2,3,1,2); gtk_widget_show(button); button = gtk_button_new_with_label ("tab position"); gtk_signal_connect (GTK_OBJECT (button), "clicked", (GtkSignalFunc) rotate_book, GTK_OBJECT(notebook)); gtk_table_attach_defaults(GTK_TABLE(table), button, 3,4,1,2); gtk_widget_show(button); button = gtk_button_new_with_label ("tabs/border on/off"); gtk_signal_connect (GTK_OBJECT (button), "clicked", (GtkSignalFunc) tabsborder_book, GTK_OBJECT (notebook)); gtk_table_attach_defaults(GTK_TABLE(table), button, 4,5,1,2); gtk_widget_show(button); button = gtk_button_new_with_label ("remove page"); gtk_signal_connect (GTK_OBJECT (button), "clicked", (GtkSignalFunc) remove_book, GTK_OBJECT(notebook)); gtk_table_attach_defaults(GTK_TABLE(table), button, 5,6,1,2); gtk_widget_show(button); gtk_widget_show(table); gtk_widget_show(window); gtk_main (); return(0); } /* example-end */ </verb></tscreen> I hope this helps you on your way with creating notebooks for your GTK applications. <!-- ***************************************************************** --> <sect>CList Widget <!-- ***************************************************************** --> <!-- ----------------------------------------------------------------- --> <p> The CList widget has replaced the List widget (which is still available). The CList widget is a multi-column list widget that is capable of handling literally thousands of rows of information. Each column can optionally have a title, which itself is optionally active, allowing us to bind a function to its selection. <!-- ----------------------------------------------------------------- --> <sect1>Creating a CList widget <p> Creating a CList is quite straightforward, once you have learned about widgets in general. It provides the almost standard two ways, that is the hard way, and the easy way. But before we create it, there is one thing we should figure out beforehand: how many columns should it have? Not all columns have to be visible and can be used to store data that is related to a certain cell in the list. <tscreen><verb> GtkWidget *gtk_clist_new ( gint columns ); GtkWidget *gtk_clist_new_with_titles( gint columns, gchar *titles[] ); </verb></tscreen> The first form is very straightforward, the second might require some explanation. Each column can have a title associated with it, and this title can be a label or a button that reacts when we click on it. If we use the second form, we must provide pointers to the title texts, and the number of pointers should equal the number of columns specified. Of course we can always use the first form, and manually add titles later. Note: The CList widget does not have its own scrollbars and should be placed within a ScrolledWindow widget if your require this functionality. This is a change from the GTK 1.0 implementation. <!-- ----------------------------------------------------------------- --> <sect1>Modes of operation <p> There are several attributes that can be used to alter the behaviour of a CList. First there is <tscreen><verb> void gtk_clist_set_selection_mode( GtkCList *clist, GtkSelectionMode mode ); </verb></tscreen> which, as the name implies, sets the selection mode of the CList. The first argument is the CList widget, and the second specifies the cell selection mode (they are defined in gtkenums.h). At the time of this writing, the following modes are available to us: <itemize> <item> <tt/GTK_SELECTION_SINGLE/ - The selection is either NULL or contains a GList pointer for a single selected item. <item> <tt/GTK_SELECTION_BROWSE/ - The selection is NULL if the list contains no widgets or insensitive ones only, otherwise it contains a GList pointer for one GList structure, and therefore exactly one list item. <item> <tt/GTK_SELECTION_MULTIPLE/ - The selection is NULL if no list items are selected or a GList pointer for the first selected item. That in turn points to a GList structure for the second selected item and so on. This is currently the <bf>default</bf> for the CList widget. <item> <tt/GTK_SELECTION_EXTENDED/ - The selection is always NULL. </itemize> Others might be added in later revisions of GTK. We can also define what the border of the CList widget should look like. It is done through <tscreen><verb> void gtk_clist_set_shadow_type( GtkCList *clist, GtkShadowType border ); </verb></tscreen> The possible values for the second argument are <tscreen><verb> GTK_SHADOW_NONE GTK_SHADOW_IN GTK_SHADOW_OUT GTK_SHADOW_ETCHED_IN GTK_SHADOW_ETCHED_OUT </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Working with titles <p> When you create a CList widget, you will also get a set of title buttons automatically. They live in the top of the CList window, and can act either as normal buttons that respond to being pressed, or they can be passive, in which case they are nothing more than a title. There are four different calls that aid us in setting the status of the title buttons. <tscreen><verb> void gtk_clist_column_title_active( GtkCList *clist, gint column ); void gtk_clist_column_title_passive( GtkCList *clist, gint column ); void gtk_clist_column_titles_active( GtkCList *clist ); void gtk_clist_column_titles_passive( GtkCList *clist ); </verb></tscreen> An active title is one which acts as a normal button, a passive one is just a label. The first two calls above will activate/deactivate the title button above the specific column, while the last two calls activate/deactivate all title buttons in the supplied clist widget. But of course there are those cases when we don't want them at all, and so they can be hidden and shown at will using the following two calls. <tscreen><verb> void gtk_clist_column_titles_show( GtkCList *clist ); void gtk_clist_column_titles_hide( GtkCList *clist ); </verb></tscreen> For titles to be really useful we need a mechanism to set and change them, and this is done using <tscreen><verb> void gtk_clist_set_column_title( GtkCList *clist, gint column, gchar *title ); </verb></tscreen> Note that only the title of one column can be set at a time, so if all the titles are known from the beginning, then I really suggest using gtk_clist_new_with_titles (as described above) to set them. It saves you coding time, and makes your program smaller. There are some cases where getting the job done the manual way is better, and that's when not all titles will be text. CList provides us with title buttons that can in fact incorporate whole widgets, for example a pixmap. It's all done through <tscreen><verb> void gtk_clist_set_column_widget( GtkCList *clist, gint column, GtkWidget *widget ); </verb></tscreen> which should require no special explanation. <!-- ----------------------------------------------------------------- --> <sect1>Manipulating the list itself <p> It is possible to change the justification for a column, and it is done through <tscreen><verb> void gtk_clist_set_column_justification( GtkCList *clist, gint column, GtkJustification justification ); </verb></tscreen> The GtkJustification type can take the following values: <itemize> <item><tt/GTK_JUSTIFY_LEFT/ - The text in the column will begin from the left edge. <item><tt/GTK_JUSTIFY_RIGHT/ - The text in the column will begin from the right edge. <item><tt/GTK_JUSTIFY_CENTER/ - The text is placed in the center of the column. <item><tt/GTK_JUSTIFY_FILL/ - The text will use up all available space in the column. It is normally done by inserting extra blank spaces between words (or between individual letters if it's a single word). Much in the same way as any ordinary WYSIWYG text editor. </itemize> The next function is a very important one, and should be standard in the setup of all CList widgets. When the list is created, the width of the various columns are chosen to match their titles, and since this is seldom the right width we have to set it using <tscreen><verb> void gtk_clist_set_column_width( GtkCList *clist, gint column, gint width ); </verb></tscreen> Note that the width is given in pixels and not letters. The same goes for the height of the cells in the columns, but as the default value is the height of the current font this isn't as critical to the application. Still, it is done through <tscreen><verb> void gtk_clist_set_row_height( GtkCList *clist, gint height ); </verb></tscreen> Again, note that the height is given in pixels. We can also move the list around without user interaction, however, it does require that we know what we are looking for. Or in other words, we need the row and column of the item we want to scroll to. <tscreen><verb> void gtk_clist_moveto( GtkCList *clist, gint row, gint column, gfloat row_align, gfloat col_align ); </verb></tscreen> The gfloat row_align is pretty important to understand. It's a value between 0.0 and 1.0, where 0.0 means that we should scroll the list so the row appears at the top, while if the value of row_align is 1.0, the row will appear at the bottom instead. All other values between 0.0 and 1.0 are also valid and will place the row between the top and the bottom. The last argument, gfloat col_align works in the same way, though 0.0 marks left and 1.0 marks right instead. Depending on the application's needs, we don't have to scroll to an item that is already visible to us. So how do we know if it is visible? As usual, there is a function to find that out as well. <tscreen><verb> GtkVisibility gtk_clist_row_is_visible( GtkCList *clist, gint row ); </verb></tscreen> The return value is is one of the following: <tscreen><verb> GTK_VISIBILITY_NONE GTK_VISIBILITY_PARTIAL GTK_VISIBILITY_FULL </verb></tscreen> Note that it will only tell us if a row is visible. Currently there is no way to determine this for a column. We can get partial information though, because if the return is <tt/GTK_VISIBILITY_PARTIAL/, then some of it is hidden, but we don't know if it is the row that is being cut by the lower edge of the listbox, or if the row has columns that are outside. We can also change both the foreground and background colors of a particular row. This is useful for marking the row selected by the user, and the two functions that is used to do it are <tscreen><verb> void gtk_clist_set_foreground( GtkCList *clist, gint row, GdkColor *color ); void gtk_clist_set_background( GtkCList *clist, gint row, GdkColor *color ); </verb></tscreen> Please note that the colors must have been previously allocated. <!-- ----------------------------------------------------------------- --> <sect1>Adding rows to the list <p> We can add rows in three ways. They can be prepended or appended to the list using <tscreen><verb> gint gtk_clist_prepend( GtkCList *clist, gchar *text[] ); gint gtk_clist_append( GtkCList *clist, gchar *text[] ); </verb></tscreen> The return value of these two functions indicate the index of the row that was just added. We can insert a row at a given place using <tscreen><verb> void gtk_clist_insert( GtkCList *clist, gint row, gchar *text[] ); </verb></tscreen> In these calls we have to provide a collection of pointers that are the texts we want to put in the columns. The number of pointers should equal the number of columns in the list. If the text[] argument is NULL, then there will be no text in the columns of the row. This is useful, for example, if we want to add pixmaps instead (something that has to be done manually). Also, please note that the numbering of both rows and columns start at 0. To remove an individual row we use <tscreen><verb> void gtk_clist_remove( GtkCList *clist, gint row ); </verb></tscreen> There is also a call that removes all rows in the list. This is a lot faster than calling gtk_clist_remove once for each row, which is the only alternative. <tscreen><verb> void gtk_clist_clear( GtkCList *clist ); </verb></tscreen> There are also two convenience functions that should be used when a lot of changes have to be made to the list. This is to prevent the list flickering while being repeatedly updated, which may be highly annoying to the user. So instead it is a good idea to freeze the list, do the updates to it, and finally thaw it which causes the list to be updated on the screen. <tscreen><verb> void gtk_clist_freeze( GtkCList * clist ); void gtk_clist_thaw( GtkCList * clist ); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Setting text and pixmaps in the cells <p> A cell can contain a pixmap, text or both. To set them the following functions are used. <tscreen><verb> void gtk_clist_set_text( GtkCList *clist, gint row, gint column, const gchar *text ); void gtk_clist_set_pixmap( GtkCList *clist, gint row, gint column, GdkPixmap *pixmap, GdkBitmap *mask ); void gtk_clist_set_pixtext( GtkCList *clist, gint row, gint column, gchar *text, guint8 spacing, GdkPixmap *pixmap, GdkBitmap *mask ); </verb></tscreen> It's quite straightforward. All the calls have the CList as the first argument, followed by the row and column of the cell, followed by the data to be set. The <tt/spacing/ argument in gtk_clist_set_pixtext is the number of pixels between the pixmap and the beginning of the text. In all cases the data is copied into the widget. To read back the data, we instead use <tscreen><verb> gint gtk_clist_get_text( GtkCList *clist, gint row, gint column, gchar **text ); gint gtk_clist_get_pixmap( GtkCList *clist, gint row, gint column, GdkPixmap **pixmap, GdkBitmap **mask ); gint gtk_clist_get_pixtext( GtkCList *clist, gint row, gint column, gchar **text, guint8 *spacing, GdkPixmap **pixmap, GdkBitmap **mask ); </verb></tscreen> The returned pointers are all pointers to the data stored within the widget, so the referenced data should not be modified or released. It isn't necessary to read it all back in case you aren't interested. Any of the pointers that are meant for return values (all except the clist) can be NULL. So if we want to read back only the text from a cell that is of type pixtext, then we would do the following, assuming that clist, row and column already exist: <tscreen><verb> gchar *mytext; gtk_clist_get_pixtext(clist, row, column, &mytext, NULL, NULL, NULL); </verb></tscreen> There is one more call that is related to what's inside a cell in the clist, and that's <tscreen><verb> GtkCellType gtk_clist_get_cell_type( GtkCList *clist, gint row, gint column ); </verb></tscreen> which returns the type of data in a cell. The return value is one of <tscreen><verb> GTK_CELL_EMPTY GTK_CELL_TEXT GTK_CELL_PIXMAP GTK_CELL_PIXTEXT GTK_CELL_WIDGET </verb></tscreen> There is also a function that will let us set the indentation, both vertical and horizontal, of a cell. The indentation value is of type gint, given in pixels, and can be both positive and negative. <tscreen><verb> void gtk_clist_set_shift( GtkCList *clist, gint row, gint column, gint vertical, gint horizontal ); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Storing data pointers <p> With a CList it is possible to set a data pointer for a row. This pointer will not be visible for the user, but is merely a convenience for the programmer to associate a row with a pointer to some additional data. The functions should be fairly self-explanatory by now. <tscreen><verb> void gtk_clist_set_row_data( GtkCList *clist, gint row, gpointer data ); void gtk_clist_set_row_data_full( GtkCList *clist, gint row, gpointer data, GtkDestroyNotify destroy ); gpointer gtk_clist_get_row_data( GtkCList *clist, gint row ); gint gtk_clist_find_row_from_data( GtkCList *clist, gpointer data ); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Working with selections <p> There are also functions available that let us force the (un)selection of a row. These are <tscreen><verb> void gtk_clist_select_row( GtkCList *clist, gint row, gint column ); void gtk_clist_unselect_row( GtkCList *clist, gint row, gint column ); </verb></tscreen> And also a function that will take x and y coordinates (for example, read from the mousepointer), and map that onto the list, returning the corresponding row and column. <tscreen><verb> gint gtk_clist_get_selection_info( GtkCList *clist, gint x, gint y, gint *row, gint *column ); </verb></tscreen> When we detect something of interest (it might be movement of the pointer, a click somewhere in the list) we can read the pointer coordinates and find out where in the list the pointer is. Cumbersome? Luckily, there is a simpler way... <!-- ----------------------------------------------------------------- --> <sect1>The signals that bring it together <p> As with all other widgets, there are a few signals that can be used. The CList widget is derived from the Container widget, and so has all the same signals, but also adds the following: <itemize> <item>select_row - This signal will send the following information, in order: GtkCList *clist, gint row, gint column, GtkEventButton *event <item>unselect_row - When the user unselects a row, this signal is activated. It sends the same information as select_row <item>click_column - Send GtkCList *clist, gint column </itemize> So if we want to connect a callback to select_row, the callback function would be declared like this <tscreen><verb> void select_row_callback(GtkWidget *widget, gint row, gint column, GdkEventButton *event, gpointer data); </verb></tscreen> The callback is connected as usual with <tscreen><verb> gtk_signal_connect(GTK_OBJECT( clist), "select_row" GTK_SIGNAL_FUNC(select_row_callback), NULL); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>A CList example <p> <tscreen><verb> /* example-start clist clist.c */ #include <gtk/gtk.h> /* User clicked the "Add List" button. */ void button_add_clicked( gpointer data ) { int indx; /* Something silly to add to the list. 4 rows of 2 columns each */ gchar *drink[4][2] = { { "Milk", "3 Oz" }, { "Water", "6 l" }, { "Carrots", "2" }, { "Snakes", "55" } }; /* Here we do the actual adding of the text. It's done once for * each row. */ for ( indx=0 ; indx < 4 ; indx++ ) gtk_clist_append( (GtkCList *) data, drink[indx]); return; } /* User clicked the "Clear List" button. */ void button_clear_clicked( gpointer data ) { /* Clear the list using gtk_clist_clear. This is much faster than * calling gtk_clist_remove once for each row. */ gtk_clist_clear( (GtkCList *) data); return; } /* The user clicked the "Hide/Show titles" button. */ void button_hide_show_clicked( gpointer data ) { /* Just a flag to remember the status. 0 = currently visible */ static short int flag = 0; if (flag == 0) { /* Hide the titles and set the flag to 1 */ gtk_clist_column_titles_hide((GtkCList *) data); flag++; } else { /* Show the titles and reset flag to 0 */ gtk_clist_column_titles_show((GtkCList *) data); flag--; } return; } /* If we come here, then the user has selected a row in the list. */ void selection_made( GtkWidget *clist, gint row, gint column, GdkEventButton *event, gpointer data ) { gchar *text; /* Get the text that is stored in the selected row and column * which was clicked in. We will receive it as a pointer in the * argument text. */ gtk_clist_get_text(GTK_CLIST(clist), row, column, &text); /* Just prints some information about the selected row */ g_print("You selected row %d. More specifically you clicked in " "column %d, and the text in this cell is %s\n\n", row, column, text); return; } int main( int argc, gchar *argv[] ) { GtkWidget *window; GtkWidget *vbox, *hbox; GtkWidget *scrolled_window, *clist; GtkWidget *button_add, *button_clear, *button_hide_show; gchar *titles[2] = { "Ingredients", "Amount" }; gtk_init(&argc, &argv); window=gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_set_usize(GTK_WIDGET(window), 300, 150); gtk_window_set_title(GTK_WINDOW(window), "GtkCList Example"); gtk_signal_connect(GTK_OBJECT(window), "destroy", GTK_SIGNAL_FUNC(gtk_main_quit), NULL); vbox=gtk_vbox_new(FALSE, 5); gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); gtk_container_add(GTK_CONTAINER(window), vbox); gtk_widget_show(vbox); /* Create a scrolled window to pack the CList widget into */ scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0); gtk_widget_show (scrolled_window); /* Create the CList. For this example we use 2 columns */ clist = gtk_clist_new_with_titles( 2, titles); /* When a selection is made, we want to know about it. The callback * used is selection_made, and its code can be found further down */ gtk_signal_connect(GTK_OBJECT(clist), "select_row", GTK_SIGNAL_FUNC(selection_made), NULL); /* It isn't necessary to shadow the border, but it looks nice :) */ gtk_clist_set_shadow_type (GTK_CLIST(clist), GTK_SHADOW_OUT); /* What however is important, is that we set the column widths as * they will never be right otherwise. Note that the columns are * numbered from 0 and up (to 1 in this case). */ gtk_clist_set_column_width (GTK_CLIST(clist), 0, 150); /* Add the CList widget to the vertical box and show it. */ gtk_container_add(GTK_CONTAINER(scrolled_window), clist); gtk_widget_show(clist); /* Create the buttons and add them to the window. See the button * tutorial for more examples and comments on this. */ hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0); gtk_widget_show(hbox); button_add = gtk_button_new_with_label("Add List"); button_clear = gtk_button_new_with_label("Clear List"); button_hide_show = gtk_button_new_with_label("Hide/Show titles"); gtk_box_pack_start(GTK_BOX(hbox), button_add, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), button_clear, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), button_hide_show, TRUE, TRUE, 0); /* Connect our callbacks to the three buttons */ gtk_signal_connect_object(GTK_OBJECT(button_add), "clicked", GTK_SIGNAL_FUNC(button_add_clicked), (gpointer) clist); gtk_signal_connect_object(GTK_OBJECT(button_clear), "clicked", GTK_SIGNAL_FUNC(button_clear_clicked), (gpointer) clist); gtk_signal_connect_object(GTK_OBJECT(button_hide_show), "clicked", GTK_SIGNAL_FUNC(button_hide_show_clicked), (gpointer) clist); gtk_widget_show(button_add); gtk_widget_show(button_clear); gtk_widget_show(button_hide_show); /* The interface is completely set up so we show the window and * enter the gtk_main loop. */ gtk_widget_show(window); gtk_main(); return(0); } /* example-end */ </verb></tscreen> <!-- ***************************************************************** --> <sect> Tree Widget <label id="sec_Tree_Widgets"> <!-- ***************************************************************** --> <p> The purpose of tree widgets is to display hierarchically-organized data. The Tree widget itself is a vertical container for widgets of type TreeItem. Tree itself is not terribly different from CList - both are derived directly from Container, and the Container methods work in the same way on Tree widgets as on CList widgets. The difference is that Tree widgets can be nested within other Tree widgets. We'll see how to do this shortly. The Tree widget has its own window, and defaults to a white background, as does CList. Also, most of the Tree methods work in the same way as the corresponding CList ones. However, Tree is not derived from CList, so you cannot use them interchangeably. <sect1> Creating a Tree <p> A Tree is created in the usual way, using: <tscreen><verb> GtkWidget *gtk_tree_new( void ); </verb></tscreen> Like the CList widget, a Tree will simply keep growing as more items are added to it, as well as when subtrees are expanded. For this reason, they are almost always packed into a ScrolledWindow. You might want to use gtk_widget_set_usize() on the scrolled window to ensure that it is big enough to see the tree's items, as the default size for ScrolledWindow is quite small. Now that you have a tree, you'll probably want to add some items to it. <ref id="sec_Tree_Item_Widget" name="The Tree Item Widget"> below explains the gory details of TreeItem. For now, it'll suffice to create one, using: <tscreen><verb> GtkWidget *gtk_tree_item_new_with_label( gchar *label ); </verb></tscreen> You can then add it to the tree using one of the following (see <ref id="sec_Tree_Functions" name="Functions and Macros"> below for more options): <tscreen><verb> void gtk_tree_append( GtkTree *tree, GtkWidget *tree_item ); void gtk_tree_prepend( GtkTree *tree, GtkWidget *tree_item ); </verb></tscreen> Note that you must add items to a Tree one at a time - there is no equivalent to gtk_list_*_items(). <!-- ----------------------------------------------------------------- --> <sect1> Adding a Subtree <p> A subtree is created like any other Tree widget. A subtree is added to another tree beneath a tree item, using: <tscreen><verb> void gtk_tree_item_set_subtree( GtkTreeItem *tree_item, GtkWidget *subtree ); </verb></tscreen> You do not need to call gtk_widget_show() on a subtree before or after adding it to a TreeItem. However, you <em>must</em> have added the TreeItem in question to a parent tree before calling gtk_tree_item_set_subtree(). This is because, technically, the parent of the subtree is <em>not</em> the GtkTreeItem which "owns" it, but rather the GtkTree which holds that GtkTreeItem. When you add a subtree to a TreeItem, a plus or minus sign appears beside it, which the user can click on to "expand" or "collapse" it, meaning, to show or hide its subtree. TreeItems are collapsed by default. Note that when you collapse a TreeItem, any selected items in its subtree remain selected, which may not be what the user expects. <!-- ----------------------------------------------------------------- --> <sect1> Handling the Selection List <p> As with CList, the Tree type has a <tt>selection</tt> field, and it is possible to control the behaviour of the tree (somewhat) by setting the selection type using: <tscreen><verb> void gtk_tree_set_selection_mode( GtkTree *tree, GtkSelectionMode mode ); </verb></tscreen> The semantics associated with the various selection modes are described in the section on the CList widget. As with the CList widget, the "select_child", "unselect_child" (not really - see <ref id="sec_Tree_Signals" name="Signals"> below for an explanation), and "selection_changed" signals are emitted when list items are selected or unselected. However, in order to take advantage of these signals, you need to know <em>which</em> Tree widget they will be emitted by, and where to find the list of selected items. This is a source of potential confusion. The best way to explain this is that though all Tree widgets are created equal, some are more equal than others. All Tree widgets have their own X window, and can therefore receive events such as mouse clicks (if their TreeItems or their children don't catch them first!). However, to make <tt/GTK_SELECTION_SINGLE/ and <tt/GTK_SELECTION_BROWSE/ selection types behave in a sane manner, the list of selected items is specific to the topmost Tree widget in a hierarchy, known as the "root tree". Thus, accessing the <tt>selection</tt> field directly in an arbitrary Tree widget is not a good idea unless you <em>know</em> it's the root tree. Instead, use the <tt/GTK_TREE_SELECTION (Tree)/ macro, which gives the root tree's selection list as a GList pointer. Of course, this list can include items that are not in the subtree in question if the selection type is <tt/GTK_SELECTION_MULTIPLE/. Finally, the "select_child" (and "unselect_child", in theory) signals are emitted by all trees, but the "selection_changed" signal is only emitted by the root tree. Consequently, if you want to handle the "select_child" signal for a tree and all its subtrees, you will have to call gtk_signal_connect() for every subtree. <sect1> Tree Widget Internals <p> The Tree's struct definition looks like this: <tscreen><verb> struct _GtkTree { GtkContainer container; GList *children; GtkTree* root_tree; /* owner of selection list */ GtkWidget* tree_owner; GList *selection; guint level; guint indent_value; guint current_indent; guint selection_mode : 2; guint view_mode : 1; guint view_line : 1; }; </verb></tscreen> The perils associated with accessing the <tt>selection</tt> field directly have already been mentioned. The other important fields of the struct can also be accessed with handy macros or class functions. <tt/GTK_IS_ROOT_TREE (Tree)/ returns a boolean value which indicates whether a tree is the root tree in a Tree hierarchy, while <tt/GTK_TREE_ROOT_TREE (Tree)/ returns the root tree, an object of type GtkTree (so, remember to cast it using <tt/GTK_WIDGET (Tree)/ if you want to use one of the gtk_widget_*() functions on it). Instead of directly accessing the children field of a Tree widget, it's probably best to cast it using >tt/GTK_CONTAINER (Tree)/, and pass it to the gtk_container_children() function. This creates a duplicate of the original list, so it's advisable to free it up using g_list_free() after you're done with it, or to iterate on it destructively, like this: <tscreen><verb> children = gtk_container_children (GTK_CONTAINER (tree)); while (children) { do_something_nice (GTK_TREE_ITEM (children->data)); children = g_list_remove_link (children, children); } </verb></tscreen> The <tt>tree_owner</tt> field is defined only in subtrees, where it points to the TreeItem widget which holds the tree in question. The <tt>level</tt> field indicates how deeply nested a particular tree is; root trees have level 0, and each successive level of subtrees has a level one greater than the parent level. This field is set only after a Tree widget is actually mapped (i.e. drawn on the screen). <sect2> Signals<label id="sec_Tree_Signals"> <p> <tscreen><verb> void selection_changed( GtkTree *tree ); </verb></tscreen> This signal will be emitted whenever the <tt>selection</tt> field of a Tree has changed. This happens when a child of the Tree is selected or deselected. <tscreen><verb> void select_child( GtkTree *tree, GtkWidget *child ); </verb></tscreen> This signal is emitted when a child of the Tree is about to get selected. This happens on calls to gtk_tree_select_item(), gtk_tree_select_child(), on <em>all</em> button presses and calls to gtk_tree_item_toggle() and gtk_item_toggle(). It may sometimes be indirectly triggered on other occasions where children get added to or removed from the Tree. <tscreen><verb> void unselect_child (GtkTree *tree, GtkWidget *child); </verb></tscreen> This signal is emitted when a child of the Tree is about to get deselected. As of GTK 1.0.4, this seems to only occur on calls to gtk_tree_unselect_item() or gtk_tree_unselect_child(), and perhaps on other occasions, but <em>not</em> when a button press deselects a child, nor on emission of the "toggle" signal by gtk_item_toggle(). <sect2> Functions and Macros<label id="sec_Tree_Functions"> <p> <tscreen><verb> guint gtk_tree_get_type( void ); </verb></tscreen> Returns the "GtkTree" type identifier. <tscreen><verb> GtkWidget* gtk_tree_new( void ); </verb></tscreen> Create a new Tree object. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure. <tscreen><verb> void gtk_tree_append( GtkTree *tree, GtkWidget *tree_item ); </verb></tscreen> Append a tree item to a Tree. <tscreen><verb> void gtk_tree_prepend( GtkTree *tree, GtkWidget *tree_item ); </verb></tscreen> Prepend a tree item to a Tree. <tscreen><verb> void gtk_tree_insert( GtkTree *tree, GtkWidget *tree_item, gint position ); </verb></tscreen> Insert a tree item into a Tree at the position in the list specified by <tt>position.</tt> <tscreen><verb> void gtk_tree_remove_items( GtkTree *tree, GList *items ); </verb></tscreen> Remove a list of items (in the form of a GList *) from a Tree. Note that removing an item from a tree dereferences (and thus usually) destroys it <em>and</em> its subtree, if it has one, <em>and</em> all subtrees in that subtree. If you want to remove only one item, you can use gtk_container_remove(). <tscreen><verb> void gtk_tree_clear_items( GtkTree *tree, gint start, gint end ); </verb></tscreen> Remove the items from position <tt>start</tt> to position <tt>end</tt> from a Tree. The same warning about dereferencing applies here, as gtk_tree_clear_items() simply constructs a list and passes it to gtk_tree_remove_items(). <tscreen><verb> void gtk_tree_select_item( GtkTree *tree, gint item ); </verb></tscreen> Emits the "select_item" signal for the child at position <tt>item</tt>, thus selecting the child (unless you unselect it in a signal handler). <tscreen><verb> void gtk_tree_unselect_item( GtkTree *tree, gint item ); </verb></tscreen> Emits the "unselect_item" signal for the child at position <tt>item</tt>, thus unselecting the child. <tscreen><verb> void gtk_tree_select_child( GtkTree *tree, GtkWidget *tree_item ); </verb></tscreen> Emits the "select_item" signal for the child <tt>tree_item</tt>, thus selecting it. <tscreen><verb> void gtk_tree_unselect_child( GtkTree *tree, GtkWidget *tree_item ); </verb></tscreen> Emits the "unselect_item" signal for the child <tt>tree_item</tt>, thus unselecting it. <tscreen><verb> gint gtk_tree_child_position( GtkTree *tree, GtkWidget *child ); </verb></tscreen> Returns the position in the tree of <tt>child</tt>, unless <tt>child</tt> is not in the tree, in which case it returns -1. <tscreen><verb> void gtk_tree_set_selection_mode( GtkTree *tree, GtkSelectionMode mode ); </verb></tscreen> Sets the selection mode, which can be one of <tt/GTK_SELECTION_SINGLE/ (the default), <tt/GTK_SELECTION_BROWSE/, <tt/GTK_SELECTION_MULTIPLE/, or <tt/GTK_SELECTION_EXTENDED/. This is only defined for root trees, which makes sense, since the root tree "owns" the selection. Setting it for subtrees has no effect at all; the value is simply ignored. <tscreen><verb> void gtk_tree_set_view_mode( GtkTree *tree, GtkTreeViewMode mode ); </verb></tscreen> Sets the "view mode", which can be either <tt/GTK_TREE_VIEW_LINE/ (the default) or <tt/GTK_TREE_VIEW_ITEM/. The view mode propagates from a tree to its subtrees, and can't be set exclusively to a subtree (this is not exactly true - see the example code comments). The term "view mode" is rather ambiguous - basically, it controls the way the highlight is drawn when one of a tree's children is selected. If it's <tt/GTK_TREE_VIEW_LINE/, the entire TreeItem widget is highlighted, while for <tt/GTK_TREE_VIEW_ITEM/, only the child widget (i.e., usually the label) is highlighted. <tscreen><verb> void gtk_tree_set_view_lines( GtkTree *tree, guint flag ); </verb></tscreen> Controls whether connecting lines between tree items are drawn. <tt>flag</tt> is either TRUE, in which case they are, or FALSE, in which case they aren't. <tscreen><verb> GtkTree *GTK_TREE (gpointer obj); </verb></tscreen> Cast a generic pointer to "GtkTree *". <tscreen><verb> GtkTreeClass *GTK_TREE_CLASS (gpointer class); </verb></tscreen> Cast a generic pointer to "GtkTreeClass *". <tscreen><verb> gint GTK_IS_TREE (gpointer obj); </verb></tscreen> Determine if a generic pointer refers to a "GtkTree" object. <tscreen><verb> gint GTK_IS_ROOT_TREE (gpointer obj) </verb></tscreen> Determine if a generic pointer refers to a "GtkTree" object <em>and</em> is a root tree. Though this will accept any pointer, the results of passing it a pointer that does not refer to a Tree are undefined and possibly harmful. <tscreen><verb> GtkTree *GTK_TREE_ROOT_TREE (gpointer obj) </verb></tscreen> Return the root tree of a pointer to a "GtkTree" object. The above warning applies. <tscreen><verb> GList *GTK_TREE_SELECTION( gpointer obj) </verb></tscreen> Return the selection list of the root tree of a "GtkTree" object. The above warning applies here, too. <sect1> Tree Item Widget<label id="sec_Tree_Item_Widget"> <p> The TreeItem widget, like CListItem, is derived from Item, which in turn is derived from Bin. Therefore, the item itself is a generic container holding exactly one child widget, which can be of any type. The TreeItem widget has a number of extra fields, but the only one we need be concerned with is the <tt>subtree</tt> field. The definition for the TreeItem struct looks like this: <tscreen><verb> struct _GtkTreeItem { GtkItem item; GtkWidget *subtree; GtkWidget *pixmaps_box; GtkWidget *plus_pix_widget, *minus_pix_widget; GList *pixmaps; /* pixmap node for this items color depth */ guint expanded : 1; }; </verb></tscreen> The <tt>pixmaps_box</tt> field is an EventBox which catches clicks on the plus/minus symbol which controls expansion and collapsing. The <tt>pixmaps</tt> field points to an internal data structure. Since you can always obtain the subtree of a TreeItem in a (relatively) type-safe manner with the <tt/GTK_TREE_ITEM_SUBTREE (Item)/ macro, it's probably advisable never to touch the insides of a TreeItem unless you <em>really</em> know what you're doing. Since it is directly derived from an Item it can be treated as such by using the <tt/GTK_ITEM (TreeItem)/ macro. A TreeItem usually holds a label, so the convenience function gtk_list_item_new_with_label() is provided. The same effect can be achieved using code like the following, which is actually copied verbatim from gtk_tree_item_new_with_label(): <tscreen><verb> tree_item = gtk_tree_item_new (); label_widget = gtk_label_new (label); gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 0.5); gtk_container_add (GTK_CONTAINER (tree_item), label_widget); gtk_widget_show (label_widget); </verb></tscreen> As one is not forced to add a Label to a TreeItem, you could also add an HBox or an Arrow, or even a Notebook (though your app will likely be quite unpopular in this case) to the TreeItem. If you remove all the items from a subtree, it will be destroyed and unparented, unless you reference it beforehand, and the TreeItem which owns it will be collapsed. So, if you want it to stick around, do something like the following: <tscreen><verb> gtk_widget_ref (tree); owner = GTK_TREE(tree)->tree_owner; gtk_container_remove (GTK_CONTAINER(tree), item); if (tree->parent == NULL){ gtk_tree_item_expand (GTK_TREE_ITEM(owner)); gtk_tree_item_set_subtree (GTK_TREE_ITEM(owner), tree); } else gtk_widget_unref (tree); </verb></tscreen> Finally, drag-n-drop <em>does</em> work with TreeItems. You just have to make sure that the TreeItem you want to make into a drag item or a drop site has not only been added to a Tree, but that each successive parent widget has a parent itself, all the way back to a toplevel or dialog window, when you call gtk_widget_dnd_drag_set() or gtk_widget_dnd_drop_set(). Otherwise, strange things will happen. <sect2> Signals <p> TreeItem inherits the "select", "deselect", and "toggle" signals from Item. In addition, it adds two signals of its own, "expand" and "collapse". <tscreen><verb> void select( GtkItem *tree_item ); </verb></tscreen> This signal is emitted when an item is about to be selected, either after it has been clicked on by the user, or when the program calls gtk_tree_item_select(), gtk_item_select(), or gtk_tree_select_child(). <tscreen><verb> void deselect( GtkItem *tree_item ); </verb></tscreen> This signal is emitted when an item is about to be unselected, either after it has been clicked on by the user, or when the program calls gtk_tree_item_deselect() or gtk_item_deselect(). In the case of TreeItems, it is also emitted by gtk_tree_unselect_child(), and sometimes gtk_tree_select_child(). <tscreen><verb> void toggle( GtkItem *tree_item ); </verb></tscreen> This signal is emitted when the program calls gtk_item_toggle(). The effect it has when emitted on a TreeItem is to call gtk_tree_select_child() (and never gtk_tree_unselect_child()) on the item's parent tree, if the item has a parent tree. If it doesn't, then the highlight is reversed on the item. <tscreen><verb> void expand( GtkTreeItem *tree_item ); </verb></tscreen> This signal is emitted when the tree item's subtree is about to be expanded, that is, when the user clicks on the plus sign next to the item, or when the program calls gtk_tree_item_expand(). <tscreen><verb> void collapse( GtkTreeItem *tree_item ); </verb></tscreen> This signal is emitted when the tree item's subtree is about to be collapsed, that is, when the user clicks on the minus sign next to the item, or when the program calls gtk_tree_item_collapse(). <sect2> Functions and Macros <p> <tscreen><verb> guint gtk_tree_item_get_type( void ); </verb></tscreen> Returns the "GtkTreeItem" type identifier. <tscreen><verb> GtkWidget* gtk_tree_item_new( void ); </verb></tscreen> Create a new TreeItem object. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure. <tscreen><verb> GtkWidget* gtk_tree_item_new_with_label (gchar *label); </verb></tscreen> Create a new TreeItem object, having a single GtkLabel as the sole child. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure. <tscreen><verb> void gtk_tree_item_select( GtkTreeItem *tree_item ); </verb></tscreen> This function is basically a wrapper around a call to <tt>gtk_item_select (GTK_ITEM (tree_item))</tt> which will emit the select signal. <tscreen><verb> void gtk_tree_item_deselect( GtkTreeItem *tree_item ); </verb></tscreen> This function is basically a wrapper around a call to gtk_item_deselect (GTK_ITEM (tree_item)) which will emit the deselect signal. <tscreen><verb> void gtk_tree_item_set_subtree( GtkTreeItem *tree_item, GtkWidget *subtree ); </verb></tscreen> This function adds a subtree to tree_item, showing it if tree_item is expanded, or hiding it if tree_item is collapsed. Again, remember that the tree_item must have already been added to a tree for this to work. <tscreen><verb> void gtk_tree_item_remove_subtree( GtkTreeItem *tree_item ); </verb></tscreen> This removes all of tree_item's subtree's children (thus unreferencing and destroying it, any of its children's subtrees, and so on...), then removes the subtree itself, and hides the plus/minus sign. <tscreen><verb> void gtk_tree_item_expand( GtkTreeItem *tree_item ); </verb></tscreen> This emits the "expand" signal on tree_item, which expands it. <tscreen><verb> void gtk_tree_item_collapse( GtkTreeItem *tree_item ); </verb></tscreen> This emits the "collapse" signal on tree_item, which collapses it. <tscreen><verb> GtkTreeItem *GTK_TREE_ITEM (gpointer obj) </verb></tscreen> Cast a generic pointer to "GtkTreeItem *". <tscreen><verb> GtkTreeItemClass *GTK_TREE_ITEM_CLASS (gpointer obj) </verb></tscreen> Cast a generic pointer to "GtkTreeItemClass". <tscreen><verb> gint GTK_IS_TREE_ITEM (gpointer obj) </verb></tscreen> Determine if a generic pointer refers to a "GtkTreeItem" object. <tscreen><verb> GtkWidget GTK_TREE_ITEM_SUBTREE (gpointer obj) </verb></tscreen> Returns a tree item's subtree (<tt/obj/ should point to a "GtkTreeItem" object). <sect1> Tree Example <p> This is somewhat like the tree example in testgtk.c, but a lot less complete (although much better commented). It puts up a window with a tree, and connects all the signals for the relevant objects, so you can see when they are emitted. <tscreen><verb> /* example-start tree tree.c */ #include <gtk/gtk.h> /* for all the GtkItem:: and GtkTreeItem:: signals */ static void cb_itemsignal( GtkWidget *item, gchar *signame ) { gchar *name; GtkLabel *label; /* It's a Bin, so it has one child, which we know to be a label, so get that */ label = GTK_LABEL (GTK_BIN (item)->child); /* Get the text of the label */ gtk_label_get (label, &name); /* Get the level of the tree which the item is in */ g_print ("%s called for item %s->%p, level %d\n", signame, name, item, GTK_TREE (item->parent)->level); } /* Note that this is never called */ static void cb_unselect_child( GtkWidget *root_tree, GtkWidget *child, GtkWidget *subtree ) { g_print ("unselect_child called for root tree %p, subtree %p, child %p\n", root_tree, subtree, child); } /* Note that this is called every time the user clicks on an item, whether it is already selected or not. */ static void cb_select_child (GtkWidget *root_tree, GtkWidget *child, GtkWidget *subtree) { g_print ("select_child called for root tree %p, subtree %p, child %p\n", root_tree, subtree, child); } static void cb_selection_changed( GtkWidget *tree ) { GList *i; g_print ("selection_change called for tree %p\n", tree); g_print ("selected objects are:\n"); i = GTK_TREE_SELECTION(tree); while (i){ gchar *name; GtkLabel *label; GtkWidget *item; /* Get a GtkWidget pointer from the list node */ item = GTK_WIDGET (i->data); label = GTK_LABEL (GTK_BIN (item)->child); gtk_label_get (label, &name); g_print ("\t%s on level %d\n", name, GTK_TREE (item->parent)->level); i = i->next; } } int main( int argc, char *argv[] ) { GtkWidget *window, *scrolled_win, *tree; static gchar *itemnames[] = {"Foo", "Bar", "Baz", "Quux", "Maurice"}; gint i; gtk_init (&argc, &argv); /* a generic toplevel window */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_signal_connect (GTK_OBJECT(window), "delete_event", GTK_SIGNAL_FUNC (gtk_main_quit), NULL); gtk_container_set_border_width (GTK_CONTAINER(window), 5); /* A generic scrolled window */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_widget_set_usize (scrolled_win, 150, 200); gtk_container_add (GTK_CONTAINER(window), scrolled_win); gtk_widget_show (scrolled_win); /* Create the root tree */ tree = gtk_tree_new(); g_print ("root tree is %p\n", tree); /* connect all GtkTree:: signals */ gtk_signal_connect (GTK_OBJECT(tree), "select_child", GTK_SIGNAL_FUNC(cb_select_child), tree); gtk_signal_connect (GTK_OBJECT(tree), "unselect_child", GTK_SIGNAL_FUNC(cb_unselect_child), tree); gtk_signal_connect (GTK_OBJECT(tree), "selection_changed", GTK_SIGNAL_FUNC(cb_selection_changed), tree); /* Add it to the scrolled window */ gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW(scrolled_win), tree); /* Set the selection mode */ gtk_tree_set_selection_mode (GTK_TREE(tree), GTK_SELECTION_MULTIPLE); /* Show it */ gtk_widget_show (tree); for (i = 0; i < 5; i++){ GtkWidget *subtree, *item; gint j; /* Create a tree item */ item = gtk_tree_item_new_with_label (itemnames[i]); /* Connect all GtkItem:: and GtkTreeItem:: signals */ gtk_signal_connect (GTK_OBJECT(item), "select", GTK_SIGNAL_FUNC(cb_itemsignal), "select"); gtk_signal_connect (GTK_OBJECT(item), "deselect", GTK_SIGNAL_FUNC(cb_itemsignal), "deselect"); gtk_signal_connect (GTK_OBJECT(item), "toggle", GTK_SIGNAL_FUNC(cb_itemsignal), "toggle"); gtk_signal_connect (GTK_OBJECT(item), "expand", GTK_SIGNAL_FUNC(cb_itemsignal), "expand"); gtk_signal_connect (GTK_OBJECT(item), "collapse", GTK_SIGNAL_FUNC(cb_itemsignal), "collapse"); /* Add it to the parent tree */ gtk_tree_append (GTK_TREE(tree), item); /* Show it - this can be done at any time */ gtk_widget_show (item); /* Create this item's subtree */ subtree = gtk_tree_new(); g_print ("-> item %s->%p, subtree %p\n", itemnames[i], item, subtree); /* This is still necessary if you want these signals to be called for the subtree's children. Note that selection_change will be signalled for the root tree regardless. */ gtk_signal_connect (GTK_OBJECT(subtree), "select_child", GTK_SIGNAL_FUNC(cb_select_child), subtree); gtk_signal_connect (GTK_OBJECT(subtree), "unselect_child", GTK_SIGNAL_FUNC(cb_unselect_child), subtree); /* This has absolutely no effect, because it is completely ignored in subtrees */ gtk_tree_set_selection_mode (GTK_TREE(subtree), GTK_SELECTION_SINGLE); /* Neither does this, but for a rather different reason - the view_mode and view_line values of a tree are propagated to subtrees when they are mapped. So, setting it later on would actually have a (somewhat unpredictable) effect */ gtk_tree_set_view_mode (GTK_TREE(subtree), GTK_TREE_VIEW_ITEM); /* Set this item's subtree - note that you cannot do this until AFTER the item has been added to its parent tree! */ gtk_tree_item_set_subtree (GTK_TREE_ITEM(item), subtree); for (j = 0; j < 5; j++){ GtkWidget *subitem; /* Create a subtree item, in much the same way */ subitem = gtk_tree_item_new_with_label (itemnames[j]); /* Connect all GtkItem:: and GtkTreeItem:: signals */ gtk_signal_connect (GTK_OBJECT(subitem), "select", GTK_SIGNAL_FUNC(cb_itemsignal), "select"); gtk_signal_connect (GTK_OBJECT(subitem), "deselect", GTK_SIGNAL_FUNC(cb_itemsignal), "deselect"); gtk_signal_connect (GTK_OBJECT(subitem), "toggle", GTK_SIGNAL_FUNC(cb_itemsignal), "toggle"); gtk_signal_connect (GTK_OBJECT(subitem), "expand", GTK_SIGNAL_FUNC(cb_itemsignal), "expand"); gtk_signal_connect (GTK_OBJECT(subitem), "collapse", GTK_SIGNAL_FUNC(cb_itemsignal), "collapse"); g_print ("-> -> item %s->%p\n", itemnames[j], subitem); /* Add it to its parent tree */ gtk_tree_append (GTK_TREE(subtree), subitem); /* Show it */ gtk_widget_show (subitem); } } /* Show the window and loop endlessly */ gtk_widget_show (window); gtk_main(); return 0; } /* example-end */ </verb></tscreen> <!-- ***************************************************************** --> <sect>Menu Widget <!-- ***************************************************************** --> <p> There are two ways to create menus: there's the easy way, and there's the hard way. Both have their uses, but you can usually use the Itemfactory (the easy way). The "hard" way is to create all the menus using the calls directly. The easy way is to use the gtk_item_factory calls. This is much simpler, but there are advantages and disadvantages to each approach. The Itemfactory is much easier to use, and to add new menus to, although writing a few wrapper functions to create menus using the manual method could go a long way towards usability. With the Itemfactory, it is not possible to add images or the character '/' to the menus. <!-- ----------------------------------------------------------------- --> <sect1>Manual Menu Creation <p> In the true tradition of teaching, we'll show you the hard way first. <tt>:)</> There are three widgets that go into making a menubar and submenus: <itemize> <item>a menu item, which is what the user wants to select, e.g., "Save" <item>a menu, which acts as a container for the menu items, and <item>a menubar, which is a container for each of the individual menus. </itemize> This is slightly complicated by the fact that menu item widgets are used for two different things. They are both the widgets that are packed into the menu, and the widget that is packed into the menubar, which, when selected, activates the menu. Let's look at the functions that are used to create menus and menubars. This first function is used to create a new menubar. <tscreen> <verb> GtkWidget *gtk_menu_bar_new( void ); </verb> </tscreen> This rather self explanatory function creates a new menubar. You use gtk_container_add to pack this into a window, or the box_pack functions to pack it into a box - the same as buttons. <tscreen><verb> GtkWidget *gtk_menu_new( void ); </verb></tscreen> This function returns a pointer to a new menu; it is never actually shown (with gtk_widget_show), it is just a container for the menu items. I hope this will become more clear when you look at the example below. The next two calls are used to create menu items that are packed into the menu (and menubar). <tscreen><verb> GtkWidget *gtk_menu_item_new( void ); </verb></tscreen> and <tscreen><verb> GtkWidget *gtk_menu_item_new_with_label( const char *label ); </verb></tscreen> These calls are used to create the menu items that are to be displayed. Remember to differentiate between a "menu" as created with gtk_menu_new and a "menu item" as created by the gtk_menu_item_new functions. The menu item will be an actual button with an associated action, whereas a menu will be a container holding menu items. The gtk_menu_new_with_label and gtk_menu_new functions are just as you'd expect after reading about the buttons. One creates a new menu item with a label already packed into it, and the other just creates a blank menu item. Once you've created a menu item you have to put it into a menu. This is done using the function gtk_menu_append. In order to capture when the item is selected by the user, we need to connect to the <tt/activate/ signal in the usual way. So, if we wanted to create a standard <tt/File/ menu, with the options <tt/Open/, <tt/Save/, and <tt/Quit/, the code would look something like: <tscreen><verb> file_menu = gtk_menu_new (); /* Don't need to show menus */ /* Create the menu items */ open_item = gtk_menu_item_new_with_label ("Open"); save_item = gtk_menu_item_new_with_label ("Save"); quit_item = gtk_menu_item_new_with_label ("Quit"); /* Add them to the menu */ gtk_menu_append (GTK_MENU (file_menu), open_item); gtk_menu_append (GTK_MENU (file_menu), save_item); gtk_menu_append (GTK_MENU (file_menu), quit_item); /* Attach the callback functions to the activate signal */ gtk_signal_connect_object (GTK_OBJECT (open_items), "activate", GTK_SIGNAL_FUNC (menuitem_response), (gpointer) "file.open"); gtk_signal_connect_object (GTK_OBJECT (save_items), "activate", GTK_SIGNAL_FUNC (menuitem_response), (gpointer) "file.save"); /* We can attach the Quit menu item to our exit function */ gtk_signal_connect_object (GTK_OBJECT (quit_items), "activate", GTK_SIGNAL_FUNC (destroy), (gpointer) "file.quit"); /* We do need to show menu items */ gtk_widget_show (open_item); gtk_widget_show (save_item); gtk_widget_show (quit_item); </verb></tscreen> At this point we have our menu. Now we need to create a menubar and a menu item for the <tt/File/ entry, to which we add our menu. The code looks like this: <tscreen><verb> menu_bar = gtk_menu_bar_new (); gtk_container_add (GTK_CONTAINER (window), menu_bar); gtk_widget_show (menu_bar); file_item = gtk_menu_item_new_with_label ("File"); gtk_widget_show (file_item); </verb></tscreen> Now we need to associate the menu with <tt/file_item/. This is done with the function <tscreen> void gtk_menu_item_set_submenu( GtkMenuItem *menu_item, GtkWidget *submenu ); </tscreen> So, our example would continue with <tscreen><verb> gtk_menu_item_set_submenu (GTK_MENU_ITEM (file_item), file_menu); </verb></tscreen> All that is left to do is to add the menu to the menubar, which is accomplished using the function <tscreen> void gtk_menu_bar_append( GtkMenuBar *menu_bar, GtkWidget *menu_item ); </tscreen> which in our case looks like this: <tscreen><verb> gtk_menu_bar_append (GTK_MENU_BAR (menu_bar), file_item); </verb></tscreen> If we wanted the menu right justified on the menubar, such as help menus often are, we can use the following function (again on <tt/file_item/ in the current example) before attaching it to the menubar. <tscreen><verb> void gtk_menu_item_right_justify( GtkMenuItem *menu_item ); </verb></tscreen> Here is a summary of the steps needed to create a menu bar with menus attached: <itemize> <item> Create a new menu using gtk_menu_new() <item> Use multiple calls to gtk_menu_item_new() for each item you wish to have on your menu. And use gtk_menu_append() to put each of these new items on to the menu. <item> Create a menu item using gtk_menu_item_new(). This will be the root of the menu, the text appearing here will be on the menubar itself. <item>Use gtk_menu_item_set_submenu() to attach the menu to the root menu item (the one created in the above step). <item> Create a new menubar using gtk_menu_bar_new. This step only needs to be done once when creating a series of menus on one menu bar. <item> Use gtk_menu_bar_append() to put the root menu onto the menubar. </itemize> Creating a popup menu is nearly the same. The difference is that the menu is not posted "automatically" by a menubar, but explicitly by calling the function gtk_menu_popup() from a button-press event, for example. Take these steps: <itemize> <item>Create an event handling function. It needs to have the prototype <tscreen> static gint handler (GtkWidget *widget, GdkEvent *event); </tscreen> and it will use the event to find out where to pop up the menu. <item>In the event handler, if the event is a mouse button press, treat <tt>event</tt> as a button event (which it is) and use it as shown in the sample code to pass information to gtk_menu_popup(). <item>Bind that event handler to a widget with <tscreen> gtk_signal_connect_object (GTK_OBJECT (widget), "event", GTK_SIGNAL_FUNC (handler), GTK_OBJECT (menu)); </tscreen> where <tt>widget</tt> is the widget you are binding to, <tt>handler</tt> is the handling function, and <tt>menu</tt> is a menu created with gtk_menu_new(). This can be a menu which is also posted by a menu bar, as shown in the sample code. </itemize> <!-- ----------------------------------------------------------------- --> <sect1>Manual Menu Example <p> That should about do it. Let's take a look at an example to help clarify. <tscreen><verb> /* example-start menu menu.c */ #include <stdio.h> #include <gtk/gtk.h> static gint button_press (GtkWidget *, GdkEvent *); static void menuitem_response (gchar *); int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *menu; GtkWidget *menu_bar; GtkWidget *root_menu; GtkWidget *menu_items; GtkWidget *vbox; GtkWidget *button; char buf[128]; int i; gtk_init (&argc, &argv); /* create a new window */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_set_usize (GTK_WIDGET (window), 200, 100); gtk_window_set_title (GTK_WINDOW (window), "GTK Menu Test"); gtk_signal_connect (GTK_OBJECT (window), "delete_event", (GtkSignalFunc) gtk_main_quit, NULL); /* Init the menu-widget, and remember -- never * gtk_show_widget() the menu widget!! * This is the menu that holds the menu items, the one that * will pop up when you click on the "Root Menu" in the app */ menu = gtk_menu_new (); /* Next we make a little loop that makes three menu-entries for "test-menu". * Notice the call to gtk_menu_append. Here we are adding a list of * menu items to our menu. Normally, we'd also catch the "clicked" * signal on each of the menu items and setup a callback for it, * but it's omitted here to save space. */ for (i = 0; i < 3; i++) { /* Copy the names to the buf. */ sprintf (buf, "Test-undermenu - %d", i); /* Create a new menu-item with a name... */ menu_items = gtk_menu_item_new_with_label (buf); /* ...and add it to the menu. */ gtk_menu_append (GTK_MENU (menu), menu_items); /* Do something interesting when the menuitem is selected */ gtk_signal_connect_object (GTK_OBJECT (menu_items), "activate", GTK_SIGNAL_FUNC (menuitem_response), (gpointer) g_strdup (buf)); /* Show the widget */ gtk_widget_show (menu_items); } /* This is the root menu, and will be the label * displayed on the menu bar. There won't be a signal handler attached, * as it only pops up the rest of the menu when pressed. */ root_menu = gtk_menu_item_new_with_label ("Root Menu"); gtk_widget_show (root_menu); /* Now we specify that we want our newly created "menu" to be the menu * for the "root menu" */ gtk_menu_item_set_submenu (GTK_MENU_ITEM (root_menu), menu); /* A vbox to put a menu and a button in: */ vbox = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window), vbox); gtk_widget_show (vbox); /* Create a menu-bar to hold the menus and add it to our main window */ menu_bar = gtk_menu_bar_new (); gtk_box_pack_start (GTK_BOX (vbox), menu_bar, FALSE, FALSE, 2); gtk_widget_show (menu_bar); /* Create a button to which to attach menu as a popup */ button = gtk_button_new_with_label ("press me"); gtk_signal_connect_object (GTK_OBJECT (button), "event", GTK_SIGNAL_FUNC (button_press), GTK_OBJECT (menu)); gtk_box_pack_end (GTK_BOX (vbox), button, TRUE, TRUE, 2); gtk_widget_show (button); /* And finally we append the menu-item to the menu-bar -- this is the * "root" menu-item I have been raving about =) */ gtk_menu_bar_append (GTK_MENU_BAR (menu_bar), root_menu); /* always display the window as the last step so it all splashes on * the screen at once. */ gtk_widget_show (window); gtk_main (); return(0); } /* Respond to a button-press by posting a menu passed in as widget. * * Note that the "widget" argument is the menu being posted, NOT * the button that was pressed. */ static gint button_press( GtkWidget *widget, GdkEvent *event ) { if (event->type == GDK_BUTTON_PRESS) { GdkEventButton *bevent = (GdkEventButton *) event; gtk_menu_popup (GTK_MENU (widget), NULL, NULL, NULL, NULL, bevent->button, bevent->time); /* Tell calling code that we have handled this event; the buck * stops here. */ return TRUE; } /* Tell calling code that we have not handled this event; pass it on. */ return FALSE; } /* Print a string when a menu item is selected */ static void menuitem_response( gchar *string ) { printf ("%s\n", string); } /* example-end */ </verb></tscreen> You may also set a menu item to be insensitive and, using an accelerator table, bind keys to menu functions. <!-- ----------------------------------------------------------------- --> <sect1>Using ItemFactory <p> Now that we've shown you the hard way, here's how you do it using the gtk_item_factory calls. <!-- ----------------------------------------------------------------- --> <sect1>Item Factory Example <p> Here is an example using the GTK item factory. <tscreen><verb> /* example-start menu itemfactory.c */ #include <gtk/gtk.h> #include <strings.h> /* Obligatory basic callback */ static void print_hello( GtkWidget *w, gpointer data ) { g_message ("Hello, World!\n"); } /* This is the GtkItemFactoryEntry structure used to generate new menus. Item 1: The menu path. The letter after the underscore indicates an accelerator key once the menu is open. Item 2: The accelerator key for the entry Item 3: The callback function. Item 4: The callback action. This changes the parameters with which the function is called. The default is 0. Item 5: The item type, used to define what kind of an item it is. Here are the possible values: NULL -> "<Item>" "" -> "<Item>" "<Title>" -> create a title item "<Item>" -> create a simple item "<CheckItem>" -> create a check item "<ToggleItem>" -> create a toggle item "<RadioItem>" -> create a radio item <path> -> path of a radio item to link against "<Separator>" -> create a separator "<Branch>" -> create an item to hold sub items (optional) "<LastBranch>" -> create a right justified branch */ static GtkItemFactoryEntry menu_items[] = { { "/_File", NULL, NULL, 0, "<Branch>" }, { "/File/_New", "<control>N", print_hello, 0, NULL }, { "/File/_Open", "<control>O", print_hello, 0, NULL }, { "/File/_Save", "<control>S", print_hello, 0, NULL }, { "/File/Save _As", NULL, NULL, 0, NULL }, { "/File/sep1", NULL, NULL, 0, "<Separator>" }, { "/File/Quit", "<control>Q", gtk_main_quit, 0, NULL }, { "/_Options", NULL, NULL, 0, "<Branch>" }, { "/Options/Test", NULL, NULL, 0, NULL }, { "/_Help", NULL, NULL, 0, "<LastBranch>" }, { "/_Help/About", NULL, NULL, 0, NULL }, }; void get_main_menu( GtkWidget *window, GtkWidget **menubar ) { GtkItemFactory *item_factory; GtkAccelGroup *accel_group; gint nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]); accel_group = gtk_accel_group_new (); /* This function initializes the item factory. Param 1: The type of menu - can be GTK_TYPE_MENU_BAR, GTK_TYPE_MENU, or GTK_TYPE_OPTION_MENU. Param 2: The path of the menu. Param 3: A pointer to a gtk_accel_group. The item factory sets up the accelerator table while generating menus. */ item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>", accel_group); /* This function generates the menu items. Pass the item factory, the number of items in the array, the array itself, and any callback data for the the menu items. */ gtk_item_factory_create_items (item_factory, nmenu_items, menu_items, NULL); /* Attach the new accelerator group to the window. */ gtk_window_add_accel_group (GTK_WINDOW (window), accel_group); if (menubar) /* Finally, return the actual menu bar created by the item factory. */ *menubar = gtk_item_factory_get_widget (item_factory, "<main>"); } int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *main_vbox; GtkWidget *menubar; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_main_quit), "WM destroy"); gtk_window_set_title (GTK_WINDOW(window), "Item Factory"); gtk_widget_set_usize (GTK_WIDGET(window), 300, 200); main_vbox = gtk_vbox_new (FALSE, 1); gtk_container_border_width (GTK_CONTAINER (main_vbox), 1); gtk_container_add (GTK_CONTAINER (window), main_vbox); gtk_widget_show (main_vbox); get_main_menu (window, &menubar); gtk_box_pack_start (GTK_BOX (main_vbox), menubar, FALSE, TRUE, 0); gtk_widget_show (menubar); gtk_widget_show (window); gtk_main (); return(0); } /* example-end */ </verb></tscreen> For now, there's only this example. An explanation and lots 'o' comments will follow later. <!-- ***************************************************************** --> <sect> Text Widget <!-- ***************************************************************** --> <p> The Text widget allows multiple lines of text to be displayed and edited. It supports both multi-colored and multi-font text, allowing them to be mixed in any way we wish. It also has a wide set of key based text editing commands, which are compatible with Emacs. The text widget supports full cut-and-paste facilities, including the use of double- and triple-click to select a word and a whole line, respectively. <!-- ----------------------------------------------------------------- --> <sect1>Creating and Configuring a Text box <p> There is only one function for creating a new Text widget. <tscreen><verb> GtkWidget *gtk_text_new( GtkAdjustment *hadj, GtkAdjustment *vadj ); </verb></tscreen> The arguments allow us to give the Text widget pointers to Adjustments that can be used to track the viewing position of the widget. Passing NULL values to either or both of these arguments will cause the gtk_text_new function to create its own. <tscreen><verb> void gtk_text_set_adjustments( GtkText *text, GtkAdjustment *hadj, GtkAdjustment *vadj ); </verb></tscreen> The above function allows the horizontal and vertical adjustments of a text widget to be changed at any time. The text widget will not automatically create its own scrollbars when the amount of text to be displayed is too long for the display window. We therefore have to create and add them to the display layout ourselves. <tscreen><verb> vscrollbar = gtk_vscrollbar_new (GTK_TEXT(text)->vadj); gtk_box_pack_start(GTK_BOX(hbox), vscrollbar, FALSE, FALSE, 0); gtk_widget_show (vscrollbar); </verb></tscreen> The above code snippet creates a new vertical scrollbar, and attaches it to the vertical adjustment of the text widget, <tt/text/. It then packs it into a box in the normal way. Note, currently the Text widget does not support horizontal scrollbars. There are two main ways in which a Text widget can be used: to allow the user to edit a body of text, or to allow us to display multiple lines of text to the user. In order for us to switch between these modes of operation, the text widget has the following function: <tscreen><verb> void gtk_text_set_editable( GtkText *text, gint editable ); </verb></tscreen> The <tt/editable/ argument is a TRUE or FALSE value that specifies whether the user is permitted to edit the contents of the Text widget. When the text widget is editable, it will display a cursor at the current insertion point. You are not, however, restricted to just using the text widget in these two modes. You can toggle the editable state of the text widget at any time, and can insert text at any time. The text widget wraps lines of text that are too long to fit onto a single line of the display window. Its default behaviour is to break words across line breaks. This can be changed using the next function: <tscreen><verb> void gtk_text_set_word_wrap( GtkText *text, gint word_wrap ); </verb></tscreen> Using this function allows us to specify that the text widget should wrap long lines on word boundaries. The <tt/word_wrap/ argument is a TRUE or FALSE value. <!-- ----------------------------------------------------------------- --> <sect1>Text Manipulation <P> The current insertion point of a Text widget can be set using <tscreen><verb> void gtk_text_set_point( GtkText *text, guint index ); </verb></tscreen> where <tt/index/ is the position to set the insertion point. Analogous to this is the function for getting the current insertion point: <tscreen><verb> guint gtk_text_get_point( GtkText *text ); </verb></tscreen> A function that is useful in combination with the above two functions is <tscreen><verb> guint gtk_text_get_length( GtkText *text ); </verb></tscreen> which returns the current length of the Text widget. The length is the number of characters that are within the text block of the widget, including characters such as newline, which marks the end of lines. In order to insert text at the current insertion point of a Text widget, the function gtk_text_insert is used, which also allows us to specify background and foreground colors and a font for the text. <tscreen><verb> void gtk_text_insert( GtkText *text, GdkFont *font, GdkColor *fore, GdkColor *back, const char *chars, gint length ); </verb></tscreen> Passing a value of <tt/NULL/ in as the value for the foreground color, background color or font will result in the values set within the widget style to be used. Using a value of <tt/-1/ for the length parameter will result in the whole of the text string given being inserted. The text widget is one of the few within GTK that redraws itself dynamically, outside of the gtk_main function. This means that all changes to the contents of the text widget take effect immediately. This may be undesirable when performing multiple changes to the text widget. In order to allow us to perform multiple updates to the text widget without it continuously redrawing, we can freeze the widget, which temporarily stops it from automatically redrawing itself every time it is changed. We can then thaw the widget after our updates are complete. The following two functions perform this freeze and thaw action: <tscreen><verb> void gtk_text_freeze( GtkText *text ); void gtk_text_thaw( GtkText *text ); </verb></tscreen> Text is deleted from the text widget relative to the current insertion point by the following two functions. The return value is a TRUE or FALSE indicator of whether the operation was successful. <tscreen><verb> gint gtk_text_backward_delete( GtkText *text, guint nchars ); gint gtk_text_forward_delete ( GtkText *text, guint nchars ); </verb></tscreen> If you want to retrieve the contents of the text widget, then the macro <tt/GTK_TEXT_INDEX(t, index)/ allows you to retrieve the character at position <tt/index/ within the text widget <tt/t/. To retrieve larger blocks of text, we can use the function <tscreen><verb> gchar *gtk_editable_get_chars( GtkEditable *editable, gint start_pos, gint end_pos ); </verb></tscreen> This is a function of the parent class of the text widget. A value of -1 as <tt/end_pos/ signifies the end of the text. The index of the text starts at 0. The function allocates a new chunk of memory for the text block, so don't forget to free it with a call to g_free when you have finished with it. <!-- ----------------------------------------------------------------- --> <sect1>Keyboard Shortcuts <p> The text widget has a number of pre-installed keyboard shortcuts for common editing, motion and selection functions. These are accessed using Control and Alt key combinations. In addition to these, holding down the Control key whilst using cursor key movement will move the cursor by words rather than characters. Holding down Shift whilst using cursor movement will extend the selection. <sect2>Motion Shortcuts <p> <itemize> <item> Ctrl-A Beginning of line <item> Ctrl-E End of line <item> Ctrl-N Next Line <item> Ctrl-P Previous Line <item> Ctrl-B Backward one character <item> Ctrl-F Forward one character <item> Alt-B Backward one word <item> Alt-F Forward one word </itemize> <sect2>Editing Shortcuts <p> <itemize> <item> Ctrl-H Delete Backward Character (Backspace) <item> Ctrl-D Delete Forward Character (Delete) <item> Ctrl-W Delete Backward Word <item> Alt-D Delete Forward Word <item> Ctrl-K Delete to end of line <item> Ctrl-U Delete line </itemize> <sect2>Selection Shortcuts <p> <itemize> <item> Ctrl-X Cut to clipboard <item> Ctrl-C Copy to clipboard <item> Ctrl-V Paste from clipboard </itemize> <!-- ----------------------------------------------------------------- --> <sect1>A GtkText Example <p> <tscreen><verb> /* example-start text text.c */ /* text.c */ #include <stdio.h> #include <gtk/gtk.h> void text_toggle_editable (GtkWidget *checkbutton, GtkWidget *text) { gtk_text_set_editable(GTK_TEXT(text), GTK_TOGGLE_BUTTON(checkbutton)->active); } void text_toggle_word_wrap (GtkWidget *checkbutton, GtkWidget *text) { gtk_text_set_word_wrap(GTK_TEXT(text), GTK_TOGGLE_BUTTON(checkbutton)->active); } void close_application( GtkWidget *widget, gpointer data ) { gtk_main_quit(); } int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *box1; GtkWidget *box2; GtkWidget *hbox; GtkWidget *button; GtkWidget *check; GtkWidget *separator; GtkWidget *table; GtkWidget *vscrollbar; GtkWidget *text; GdkColormap *cmap; GdkColor color; GdkFont *fixed_font; FILE *infile; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_set_usize (window, 600, 500); gtk_window_set_policy (GTK_WINDOW(window), TRUE, TRUE, FALSE); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC(close_application), NULL); gtk_window_set_title (GTK_WINDOW (window), "Text Widget Example"); gtk_container_set_border_width (GTK_CONTAINER (window), 0); box1 = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window), box1); gtk_widget_show (box1); box2 = gtk_vbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); gtk_widget_show (box2); table = gtk_table_new (2, 2, FALSE); gtk_table_set_row_spacing (GTK_TABLE (table), 0, 2); gtk_table_set_col_spacing (GTK_TABLE (table), 0, 2); gtk_box_pack_start (GTK_BOX (box2), table, TRUE, TRUE, 0); gtk_widget_show (table); /* Create the GtkText widget */ text = gtk_text_new (NULL, NULL); gtk_text_set_editable (GTK_TEXT (text), TRUE); gtk_table_attach (GTK_TABLE (table), text, 0, 1, 0, 1, GTK_EXPAND | GTK_SHRINK | GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (text); /* Add a vertical scrollbar to the GtkText widget */ vscrollbar = gtk_vscrollbar_new (GTK_TEXT (text)->vadj); gtk_table_attach (GTK_TABLE (table), vscrollbar, 1, 2, 0, 1, GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (vscrollbar); /* Get the system color map and allocate the color red */ cmap = gdk_colormap_get_system(); color.red = 0xffff; color.green = 0; color.blue = 0; if (!gdk_color_alloc(cmap, &color)) { g_error("couldn't allocate color"); } /* Load a fixed font */ fixed_font = gdk_font_load ("-misc-fixed-medium-r-*-*-*-140-*-*-*-*-*-*"); /* Realizing a widget creates a window for it, * ready for us to insert some text */ gtk_widget_realize (text); /* Freeze the text widget, ready for multiple updates */ gtk_text_freeze (GTK_TEXT (text)); /* Insert some colored text */ gtk_text_insert (GTK_TEXT (text), NULL, &text->style->black, NULL, "Supports ", -1); gtk_text_insert (GTK_TEXT (text), NULL, &color, NULL, "colored ", -1); gtk_text_insert (GTK_TEXT (text), NULL, &text->style->black, NULL, "text and different ", -1); gtk_text_insert (GTK_TEXT (text), fixed_font, &text->style->black, NULL, "fonts\n\n", -1); /* Load the file text.c into the text window */ infile = fopen("text.c", "r"); if (infile) { char buffer[1024]; int nchars; while (1) { nchars = fread(buffer, 1, 1024, infile); gtk_text_insert (GTK_TEXT (text), fixed_font, NULL, NULL, buffer, nchars); if (nchars < 1024) break; } fclose (infile); } /* Thaw the text widget, allowing the updates to become visible */ gtk_text_thaw (GTK_TEXT (text)); hbox = gtk_hbutton_box_new (); gtk_box_pack_start (GTK_BOX (box2), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); check = gtk_check_button_new_with_label("Editable"); gtk_box_pack_start (GTK_BOX (hbox), check, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT(check), "toggled", GTK_SIGNAL_FUNC(text_toggle_editable), text); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), TRUE); gtk_widget_show (check); check = gtk_check_button_new_with_label("Wrap Words"); gtk_box_pack_start (GTK_BOX (hbox), check, FALSE, TRUE, 0); gtk_signal_connect (GTK_OBJECT(check), "toggled", GTK_SIGNAL_FUNC(text_toggle_word_wrap), text); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), FALSE); gtk_widget_show (check); separator = gtk_hseparator_new (); gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0); gtk_widget_show (separator); box2 = gtk_vbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0); gtk_widget_show (box2); button = gtk_button_new_with_label ("close"); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC(close_application), NULL); gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_grab_default (button); gtk_widget_show (button); gtk_widget_show (window); gtk_main (); return(0); } /* example-end */ </verb></tscreen> <!-- ***************************************************************** --> <sect> Undocumented Widgets <!-- ***************************************************************** --> <p> These all require authors! :) Please consider contributing to our tutorial. If you must use one of these widgets that are undocumented, I strongly suggest you take a look at their respective header files in the GTK distribution. GTK's function names are very descriptive. Once you have an understanding of how things work, it's not difficult to figure out how to use a widget simply by looking at its function declarations. This, along with a few examples from others' code, and it should be no problem. When you do come to understand all the functions of a new undocumented widget, please consider writing a tutorial on it so others may benefit from your time. <!-- ----------------------------------------------------------------- --> <sect1> CTree <p> <!-- ----------------------------------------------------------------- --> <sect1> Curves <p> <!-- ----------------------------------------------------------------- --> <sect1> Drawing Area <p> <!-- ----------------------------------------------------------------- --> <sect1> Font Selection Dialog <p> <!-- ----------------------------------------------------------------- --> <sect1> Gamma Curve <p> <!-- ----------------------------------------------------------------- --> <sect1> Image <p> <!-- ----------------------------------------------------------------- --> <sect1> Packer <p> <!-- ----------------------------------------------------------------- --> <sect1> Plugs and Sockets <p> <!-- ----------------------------------------------------------------- --> <sect1> Preview <p> <!-- (This may need to be rewritten to follow the style of the rest of the tutorial) <tscreen><verb> Previews serve a number of purposes in GIMP/GTK. The most important one is this. High quality images may take up to tens of megabytes of memory - easily! Any operation on an image that big is bound to take a long time. If it takes you 5-10 trial-and-errors (i.e., 10-20 steps, since you have to revert after you make an error) to choose the desired modification, it make take you literally hours to make the right one - if you don't run out of memory first. People who have spent hours in color darkrooms know the feeling. Previews to the rescue! But the annoyance of the delay is not the only issue. Oftentimes it is helpful to compare the Before and After versions side-by-side or at least back-to-back. If you're working with big images and 10 second delays, obtaining the Before and After impressions is, to say the least, difficult. For 30M images (4"x6", 600dpi, 24 bit) the side-by-side comparison is right out for most people, while back-to-back is more like back-to-1001, 1002, ..., 1010-back! Previews to the rescue! But there's more. Previews allow for side-by-side pre-previews. In other words, you write a plug-in (e.g., the filterpack simulation) which would have a number of here's-what-it-would-look-like-if-you-were-to-do-this previews. An approach like this acts as a sort of a preview palette and is very effective for subtle changes. Let's go previews! There's more. For certain plug-ins real-time image-specific human intervention maybe necessary. In the SuperNova plug-in, for example, the user is asked to enter the coordinates of the center of the future supernova. The easiest way to do this, really, is to present the user with a preview and ask him to interactively select the spot. Let's go previews! Finally, a couple of misc uses. One can use previews even when not working with big images. For example, they are useful when rendering complicated patterns. (Just check out the venerable Diffraction plug-in + many other ones!) As another example, take a look at the colormap rotation plug-in (work in progress). You can also use previews for little logos inside you plug-ins and even for an image of yourself, The Author. Let's go previews! When Not to Use Previews Don't use previews for graphs, drawing, etc. GDK is much faster for that. Use previews only for rendered images! Let's go previews! You can stick a preview into just about anything. In a vbox, an hbox, a table, a button, etc. But they look their best in tight frames around them. Previews by themselves do not have borders and look flat without them. (Of course, if the flat look is what you want...) Tight frames provide the necessary borders. [Image][Image] Previews in many ways are like any other widgets in GTK (whatever that means) except they possess an additional feature: they need to be filled with some sort of an image! First, we will deal exclusively with the GTK aspect of previews and then we'll discuss how to fill them. GtkWidget *preview! Without any ado: /* Create a preview widget, set its size, an show it */ GtkWidget *preview; preview=gtk_preview_new(GTK_PREVIEW_COLOR) /*Other option: GTK_PREVIEW_GRAYSCALE);*/ gtk_preview_size (GTK_PREVIEW (preview), WIDTH, HEIGHT); gtk_widget_show(preview); my_preview_rendering_function(preview); Oh yeah, like I said, previews look good inside frames, so how about: GtkWidget *create_a_preview(int Width, int Height, int Colorfulness) { GtkWidget *preview; GtkWidget *frame; frame = gtk_frame_new(NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_set_border_width (GTK_CONTAINER(frame),0); gtk_widget_show(frame); preview=gtk_preview_new (Colorfulness?GTK_PREVIEW_COLOR :GTK_PREVIEW_GRAYSCALE); gtk_preview_size (GTK_PREVIEW (preview), Width, Height); gtk_container_add(GTK_CONTAINER(frame),preview); gtk_widget_show(preview); my_preview_rendering_function(preview); return frame; } That's my basic preview. This routine returns the "parent" frame so you can place it somewhere else in your interface. Of course, you can pass the parent frame to this routine as a parameter. In many situations, however, the contents of the preview are changed continually by your application. In this case you may want to pass a pointer to the preview to a "create_a_preview()" and thus have control of it later. One more important note that may one day save you a lot of time. Sometimes it is desirable to label you preview. For example, you may label the preview containing the original image as "Original" and the one containing the modified image as "Less Original". It might occur to you to pack the preview along with the appropriate label into a vbox. The unexpected caveat is that if the label is wider than the preview (which may happen for a variety of reasons unforseeable to you, from the dynamic decision on the size of the preview to the size of the font) the frame expands and no longer fits tightly over the preview. The same problem can probably arise in other situations as well. [Image] The solution is to place the preview and the label into a 2x1 table and by attaching them with the following parameters (this is one possible variations of course. The key is no GTK_FILL in the second attachment): gtk_table_attach(GTK_TABLE(table),label,0,1,0,1, 0, GTK_EXPAND|GTK_FILL, 0,0); gtk_table_attach(GTK_TABLE(table),frame,0,1,1,2, GTK_EXPAND, GTK_EXPAND, 0,0); And here's the result: [Image] Misc Making a preview clickable is achieved most easily by placing it in a button. It also adds a nice border around the preview and you may not even need to place it in a frame. See the Filter Pack Simulation plug-in for an example. This is pretty much it as far as GTK is concerned. Filling In a Preview In order to familiarize ourselves with the basics of filling in previews, let's create the following pattern (contrived by trial and error): [Image] void my_preview_rendering_function(GtkWidget *preview) { #define SIZE 100 #define HALF (SIZE/2) guchar *row=(guchar *) malloc(3*SIZE); /* 3 bits per dot */ gint i, j; /* Coordinates */ double r, alpha, x, y; if (preview==NULL) return; /* I usually add this when I want */ /* to avoid silly crashes. You */ /* should probably make sure that */ /* everything has been nicely */ /* initialized! */ for (j=0; j < ABS(cos(2*alpha)) ) { /* Are we inside the shape? */ /* glib.h contains ABS(x). */ row[i*3+0] = sqrt(1-r)*255; /* Define Red */ row[i*3+1] = 128; /* Define Green */ row[i*3+2] = 224; /* Define Blue */ } /* "+0" is for alignment! */ else { row[i*3+0] = r*255; row[i*3+1] = ABS(sin((float)i/SIZE*2*PI))*255; row[i*3+2] = ABS(sin((float)j/SIZE*2*PI))*255; } } gtk_preview_draw_row( GTK_PREVIEW(preview),row,0,j,SIZE); /* Insert "row" into "preview" starting at the point with */ /* coordinates (0,j) first column, j_th row extending SIZE */ /* pixels to the right */ } free(row); /* save some space */ gtk_widget_draw(preview,NULL); /* what does this do? */ gdk_flush(); /* or this? */ } Non-GIMP users can have probably seen enough to do a lot of things already. For the GIMP users I have a few pointers to add. Image Preview It is probably wise to keep a reduced version of the image around with just enough pixels to fill the preview. This is done by selecting every n'th pixel where n is the ratio of the size of the image to the size of the preview. All further operations (including filling in the previews) are then performed on the reduced number of pixels only. The following is my implementation of reducing the image. (Keep in mind that I've had only basic C!) (UNTESTED CODE ALERT!!!) typedef struct { gint width; gint height; gint bbp; guchar *rgb; guchar *mask; } ReducedImage; enum { SELECTION_ONLY, SELECTION_IN_CONTEXT, ENTIRE_IMAGE }; ReducedImage *Reduce_The_Image(GDrawable *drawable, GDrawable *mask, gint LongerSize, gint Selection) { /* This function reduced the image down to the the selected preview size */ /* The preview size is determine by LongerSize, i.e., the greater of the */ /* two dimensions. Works for RGB images only! */ gint RH, RW; /* Reduced height and reduced width */ gint width, height; /* Width and Height of the area being reduced */ gint bytes=drawable->bpp; ReducedImage *temp=(ReducedImage *)malloc(sizeof(ReducedImage)); guchar *tempRGB, *src_row, *tempmask, *src_mask_row,R,G,B; gint i, j, whichcol, whichrow, x1, x2, y1, y2; GPixelRgn srcPR, srcMask; gint NoSelectionMade=TRUE; /* Assume that we're dealing with the entire */ /* image. */ gimp_drawable_mask_bounds (drawable->id, &x1, &y1, &x2, &y2); width = x2-x1; height = y2-y1; /* If there's a SELECTION, we got its bounds!) if (width != drawable->width && height != drawable->height) NoSelectionMade=FALSE; /* Become aware of whether the user has made an active selection */ /* This will become important later, when creating a reduced mask. */ /* If we want to preview the entire image, overrule the above! */ /* Of course, if no selection has been made, this does nothing! */ if (Selection==ENTIRE_IMAGE) { x1=0; x2=drawable->width; y1=0; y2=drawable->height; } /* If we want to preview a selection with some surrounding area we */ /* have to expand it a little bit. Consider it a bit of a riddle. */ if (Selection==SELECTION_IN_CONTEXT) { x1=MAX(0, x1-width/2.0); x2=MIN(drawable->width, x2+width/2.0); y1=MAX(0, y1-height/2.0); y2=MIN(drawable->height, y2+height/2.0); } /* How we can determine the width and the height of the area being */ /* reduced. */ width = x2-x1; height = y2-y1; /* The lines below determine which dimension is to be the longer */ /* side. The idea borrowed from the supernova plug-in. I suspect I */ /* could've thought of it myself, but the truth must be told. */ /* Plagiarism stinks! */ if (width>height) { RW=LongerSize; RH=(float) height * (float) LongerSize/ (float) width; } else { RH=LongerSize; RW=(float)width * (float) LongerSize/ (float) height; } /* The entire image is stretched into a string! */ tempRGB = (guchar *) malloc(RW*RH*bytes); tempmask = (guchar *) malloc(RW*RH); gimp_pixel_rgn_init (&srcPR, drawable, x1, y1, width, height, FALSE, FALSE); gimp_pixel_rgn_init (&srcMask, mask, x1, y1, width, height, FALSE, FALSE); /* Grab enough to save a row of image and a row of mask. */ src_row = (guchar *) malloc (width*bytes); src_mask_row = (guchar *) malloc (width); for (i=0; i < RH; i++) { whichrow=(float)i*(float)height/(float)RH; gimp_pixel_rgn_get_row (&srcPR, src_row, x1, y1+whichrow, width); gimp_pixel_rgn_get_row (&srcMask, src_mask_row, x1, y1+whichrow, width); for (j=0; j < RW; j++) { whichcol=(float)j*(float)width/(float)RW; /* No selection made = each point is completely selected! */ if (NoSelectionMade) tempmask[i*RW+j]=255; else tempmask[i*RW+j]=src_mask_row[whichcol]; /* Add the row to the one long string which now contains the image! */ tempRGB[i*RW*bytes+j*bytes+0]=src_row[whichcol*bytes+0]; tempRGB[i*RW*bytes+j*bytes+1]=src_row[whichcol*bytes+1]; tempRGB[i*RW*bytes+j*bytes+2]=src_row[whichcol*bytes+2]; /* Hold on to the alpha as well */ if (bytes==4) tempRGB[i*RW*bytes+j*bytes+3]=src_row[whichcol*bytes+3]; } } temp->bpp=bytes; temp->width=RW; temp->height=RH; temp->rgb=tempRGB; temp->mask=tempmask; return temp; } The following is a preview function which used the same ReducedImage type! Note that it uses fakes transparency (if one is present by means of fake_transparency which is defined as follows: gint fake_transparency(gint i, gint j) { if ( ((i%20)- 10) * ((j%20)- 10)>0 ) return 64; else return 196; } Now here's the preview function: void my_preview_render_function(GtkWidget *preview, gint changewhat, gint changewhich) { gint Inten, bytes=drawable->bpp; gint i, j, k; float partial; gint RW=reduced->width; gint RH=reduced->height; guchar *row=malloc(bytes*RW);; for (i=0; i < RH; i++) { for (j=0; j < RW; j++) { row[j*3+0] = reduced->rgb[i*RW*bytes + j*bytes + 0]; row[j*3+1] = reduced->rgb[i*RW*bytes + j*bytes + 1]; row[j*3+2] = reduced->rgb[i*RW*bytes + j*bytes + 2]; if (bytes==4) for (k=0; k<3; k++) { float transp=reduced->rgb[i*RW*bytes+j*bytes+3]/255.0; row[3*j+k]=transp*a[3*j+k]+(1-transp)*fake_transparency(i,j); } } gtk_preview_draw_row( GTK_PREVIEW(preview),row,0,i,RW); } free(a); gtk_widget_draw(preview,NULL); gdk_flush(); } Applicable Routines guint gtk_preview_get_type (void); /* No idea */ void gtk_preview_uninit (void); /* No idea */ GtkWidget* gtk_preview_new (GtkPreviewType type); /* Described above */ void gtk_preview_size (GtkPreview *preview, gint width, gint height); /* Allows you to resize an existing preview. */ /* Apparently there's a bug in GTK which makes */ /* this process messy. A way to clean up a mess */ /* is to manually resize the window containing */ /* the preview after resizing the preview. */ void gtk_preview_put (GtkPreview *preview, GdkWindow *window, GdkGC *gc, gint srcx, gint srcy, gint destx, gint desty, gint width, gint height); /* No idea */ void gtk_preview_put_row (GtkPreview *preview, guchar *src, guchar *dest, gint x, gint y, gint w); /* No idea */ void gtk_preview_draw_row (GtkPreview *preview, guchar *data, gint x, gint y, gint w); /* Described in the text */ void gtk_preview_set_expand (GtkPreview *preview, gint expand); /* No idea */ /* No clue for any of the below but */ /* should be standard for most widgets */ void gtk_preview_set_gamma (double gamma); void gtk_preview_set_color_cube (guint nred_shades, guint ngreen_shades, guint nblue_shades, guint ngray_shades); void gtk_preview_set_install_cmap (gint install_cmap); void gtk_preview_set_reserved (gint nreserved); GdkVisual* gtk_preview_get_visual (void); GdkColormap* gtk_preview_get_cmap (void); GtkPreviewInfo* gtk_preview_get_info (void); That's all, folks! </verb></tscreen> --> <!-- ***************************************************************** --> <sect>Setting Widget Attributes<label id="sec_setting_widget_attributes"> <!-- ***************************************************************** --> <p> This describes the functions used to operate on widgets. These can be used to set style, padding, size, etc. (Maybe I should make a whole section on accelerators.) <tscreen><verb> void gtk_widget_install_accelerator( GtkWidget *widget, GtkAcceleratorTable *table, gchar *signal_name, gchar key, guint8 modifiers ); void gtk_widget_remove_accelerator ( GtkWidget *widget, GtkAcceleratorTable *table, gchar *signal_name); void gtk_widget_activate( GtkWidget *widget ); void gtk_widget_set_name( GtkWidget *widget, gchar *name ); gchar *gtk_widget_get_name( GtkWidget *widget ); void gtk_widget_set_sensitive( GtkWidget *widget, gint sensitive ); void gtk_widget_set_style( GtkWidget *widget, GtkStyle *style ); GtkStyle *gtk_widget_get_style( GtkWidget *widget ); GtkStyle *gtk_widget_get_default_style( void ); void gtk_widget_set_uposition( GtkWidget *widget, gint x, gint y ); void gtk_widget_set_usize( GtkWidget *widget, gint width, gint height ); void gtk_widget_grab_focus( GtkWidget *widget ); void gtk_widget_show( GtkWidget *widget ); void gtk_widget_hide( GtkWidget *widget ); </verb></tscreen> <!-- ***************************************************************** --> <sect>Timeouts, IO and Idle Functions<label id="sec_timeouts"> <!-- ***************************************************************** --> <!-- ----------------------------------------------------------------- --> <sect1>Timeouts <p> You may be wondering how you make GTK do useful work when in gtk_main. Well, you have several options. Using the following function you can create a timeout function that will be called every "interval" milliseconds. <tscreen><verb> gint gtk_timeout_add( guint32 interval, GtkFunction function, gpointer data ); </verb></tscreen> The first argument is the number of milliseconds between calls to your function. The second argument is the function you wish to have called, and the third, the data passed to this callback function. The return value is an integer "tag" which may be used to stop the timeout by calling: <tscreen><verb> void gtk_timeout_remove( gint tag ); </verb></tscreen> You may also stop the timeout function by returning zero or FALSE from your callback function. Obviously this means if you want your function to continue to be called, it should return a non-zero value, i.e., TRUE. The declaration of your callback should look something like this: <tscreen><verb> gint timeout_callback( gpointer data ); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Monitoring IO <p> A nifty feature of GDK (the library that underlies GTK), is the ability to have it check for data on a file descriptor for you (as returned by open(2) or socket(2)). This is especially useful for networking applications. The function: <tscreen><verb> gint gdk_input_add( gint source, GdkInputCondition condition, GdkInputFunction function, gpointer data ); </verb></tscreen> Where the first argument is the file descriptor you wish to have watched, and the second specifies what you want GDK to look for. This may be one of: <itemize> <item><tt/GDK_INPUT_READ/ - Call your function when there is data ready for reading on your file descriptor. <item>><tt/GDK_INPUT_WRITE/ - Call your function when the file descriptor is ready for writing. </itemize> As I'm sure you've figured out already, the third argument is the function you wish to have called when the above conditions are satisfied, and the fourth is the data to pass to this function. The return value is a tag that may be used to stop GDK from monitoring this file descriptor using the following function. <tscreen><verb> void gdk_input_remove( gint tag ); </verb></tscreen> The callback function should be declared as: <tscreen><verb> void input_callback( gpointer data, gint source, GdkInputCondition condition ); </verb></tscreen> Where <tt/source/ and <tt/condition/ are as specified above. <!-- ----------------------------------------------------------------- --> <sect1>Idle Functions <p> <!-- TODO: Need to check on idle priorities - TRG --> What if you have a function which you want to be called when nothing else is happening ? <tscreen><verb> gint gtk_idle_add( GtkFunction function, gpointer data ); </verb></tscreen> This causes GTK to call the specified function whenever nothing else is happening. <tscreen><verb> void gtk_idle_remove( gint tag ); </verb></tscreen> I won't explain the meaning of the arguments as they follow very much like the ones above. The function pointed to by the first argument to gtk_idle_add will be called whenever the opportunity arises. As with the others, returning FALSE will stop the idle function from being called. <!-- ***************************************************************** --> <sect>Advanced Event and Signal Handling<label id="sec_Adv_Events_and_Signals"> <!-- ***************************************************************** --> <!-- ----------------------------------------------------------------- --> <sect1>Signal Functions <!-- ----------------------------------------------------------------- --> <sect2>Connecting and Disconnecting Signal Handlers <p> <tscreen><verb> guint gtk_signal_connect( GtkObject *object, const gchar *name, GtkSignalFunc func, gpointer func_data ); guint gtk_signal_connect_after( GtkObject *object, const gchar *name, GtkSignalFunc func, gpointer func_data ); guint gtk_signal_connect_object( GtkObject *object, const gchar *name, GtkSignalFunc func, GtkObject *slot_object ); guint gtk_signal_connect_object_after( GtkObject *object, const gchar *name, GtkSignalFunc func, GtkObject *slot_object ); guint gtk_signal_connect_full( GtkObject *object, const gchar *name, GtkSignalFunc func, GtkCallbackMarshal marshal, gpointer data, GtkDestroyNotify destroy_func, gint object_signal, gint after ); guint gtk_signal_connect_interp( GtkObject *object, const gchar *name, GtkCallbackMarshal func, gpointer data, GtkDestroyNotify destroy_func, gint after ); void gtk_signal_connect_object_while_alive( GtkObject *object, const gchar *signal, GtkSignalFunc func, GtkObject *alive_object ); void gtk_signal_connect_while_alive( GtkObject *object, const gchar *signal, GtkSignalFunc func, gpointer func_data, GtkObject *alive_object ); void gtk_signal_disconnect( GtkObject *object, guint handler_id ); void gtk_signal_disconnect_by_func( GtkObject *object, GtkSignalFunc func, gpointer data ); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect2>Blocking and Unblocking Signal Handlers <p> <tscreen><verb> void gtk_signal_handler_block( GtkObject *object, guint handler_id); void gtk_signal_handler_block_by_func( GtkObject *object, GtkSignalFunc func, gpointer data ); void gtk_signal_handler_block_by_data( GtkObject *object, gpointer data ); void gtk_signal_handler_unblock( GtkObject *object, guint handler_id ); void gtk_signal_handler_unblock_by_func( GtkObject *object, GtkSignalFunc func, gpointer data ); void gtk_signal_handler_unblock_by_data( GtkObject *object, gpointer data ); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect2>Emitting and Stopping Signals <p> <tscreen><verb> void gtk_signal_emit( GtkObject *object, guint signal_id, ... ); void gtk_signal_emit_by_name( GtkObject *object, const gchar *name, ... ); void gtk_signal_emitv( GtkObject *object, guint signal_id, GtkArg *params ); void gtk_signal_emitv_by_name( GtkObject *object, const gchar *name, GtkArg *params ); guint gtk_signal_n_emissions( GtkObject *object, guint signal_id ); guint gtk_signal_n_emissions_by_name( GtkObject *object, const gchar *name ); void gtk_signal_emit_stop( GtkObject *object, guint signal_id ); void gtk_signal_emit_stop_by_name( GtkObject *object, const gchar *name ); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Signal Emission and Propagation <p> Signal emission is the process whereby GTK runs all handlers for a specific object and signal. First, note that the return value from a signal emission is the return value of the <em>last</em> handler executed. Since event signals are all of type <tt/GTK_RUN_LAST/, this will be the default (GTK supplied) handler, unless you connect with gtk_signal_connect_after(). The way an event (say "button_press_event") is handled, is: <itemize> <item>Start with the widget where the event occured. <item>Emit the generic "event" signal. If that signal handler returns a value of TRUE, stop all processing. <item>Otherwise, emit a specific, "button_press_event" signal. If that returns TRUE, stop all processing. <item>Otherwise, go to the widget's parent, and repeat the above two steps. <item>Continue until some signal handler returns TRUE, or until the top-level widget is reached. </itemize> Some consequences of the above are: <itemize> <item>Your handler's return value will have no effect if there is a default handler, unless you connect with gtk_signal_connect_after(). <item>To prevent the default handler from being run, you need to connect with gtk_signal_connect() and use gtk_signal_emit_stop_by_name() - the return value only affects whether the signal is propagated, not the current emission. </itemize> <!-- ***************************************************************** --> <sect>Managing Selections <!-- ***************************************************************** --> <!-- ----------------------------------------------------------------- --> <sect1> Overview <p> One type of interprocess communication supported by X and GTK is <em>selections</em>. A selection identifies a chunk of data, for instance, a portion of text, selected by the user in some fashion, for instance, by dragging with the mouse. Only one application on a display (the <em>owner</em>) can own a particular selection at one time, so when a selection is claimed by one application, the previous owner must indicate to the user that selection has been relinquished. Other applications can request the contents of a selection in different forms, called <em>targets</em>. There can be any number of selections, but most X applications only handle one, the <em>primary selection</em>. In most cases, it isn't necessary for a GTK application to deal with selections itself. The standard widgets, such as the Entry widget, already have the capability to claim the selection when appropriate (e.g., when the user drags over text), and to retrieve the contents of the selection owned by another widget or another application (e.g., when the user clicks the second mouse button). However, there may be cases in which you want to give other widgets the ability to supply the selection, or you wish to retrieve targets not supported by default. A fundamental concept needed to understand selection handling is that of the <em>atom</em>. An atom is an integer that uniquely identifies a string (on a certain display). Certain atoms are predefined by the X server, and in some cases there are constants in <tt>gtk.h</tt> corresponding to these atoms. For instance the constant <tt>GDK_PRIMARY_SELECTION</tt> corresponds to the string "PRIMARY". In other cases, you should use the functions <tt>gdk_atom_intern()</tt>, to get the atom corresponding to a string, and <tt>gdk_atom_name()</tt>, to get the name of an atom. Both selections and targets are identified by atoms. <!-- ----------------------------------------------------------------- --> <sect1> Retrieving the selection <p> Retrieving the selection is an asynchronous process. To start the process, you call: <tscreen><verb> gint gtk_selection_convert( GtkWidget *widget, GdkAtom selection, GdkAtom target, guint32 time ); </verb</tscreen> This <em>converts</em> the selection into the form specified by <tt/target/. If at all possible, the time field should be the time from the event that triggered the selection. This helps make sure that events occur in the order that the user requested them. However, if it is not available (for instance, if the conversion was triggered by a "clicked" signal), then you can use the constant <tt>GDK_CURRENT_TIME</tt>. When the selection owner responds to the request, a "selection_received" signal is sent to your application. The handler for this signal receives a pointer to a <tt>GtkSelectionData</tt> structure, which is defined as: <tscreen><verb> struct _GtkSelectionData { GdkAtom selection; GdkAtom target; GdkAtom type; gint format; guchar *data; gint length; }; </verb></tscreen> <tt>selection</tt> and <tt>target</tt> are the values you gave in your <tt>gtk_selection_convert()</tt> call. <tt>type</tt> is an atom that identifies the type of data returned by the selection owner. Some possible values are "STRING", a string of latin-1 characters, "ATOM", a series of atoms, "INTEGER", an integer, etc. Most targets can only return one type. <tt/format/ gives the length of the units (for instance characters) in bits. Usually, you don't care about this when receiving data. <tt>data</tt> is a pointer to the returned data, and <tt>length</tt> gives the length of the returned data, in bytes. If <tt>length</tt> is negative, then an error occurred and the selection could not be retrieved. This might happen if no application owned the selection, or if you requested a target that the application didn't support. The buffer is actually guaranteed to be one byte longer than <tt>length</tt>; the extra byte will always be zero, so it isn't necessary to make a copy of strings just to null terminate them. In the following example, we retrieve the special target "TARGETS", which is a list of all targets into which the selection can be converted. <tscreen><verb> /* example-start selection gettargets.c */ #include <gtk/gtk.h> void selection_received( GtkWidget *widget, GtkSelectionData *selection_data, gpointer data ); /* Signal handler invoked when user clicks on the "Get Targets" button */ void get_targets( GtkWidget *widget, gpointer data ) { static GdkAtom targets_atom = GDK_NONE; /* Get the atom corresponding to the string "TARGETS" */ if (targets_atom == GDK_NONE) targets_atom = gdk_atom_intern ("TARGETS", FALSE); /* And request the "TARGETS" target for the primary selection */ gtk_selection_convert (widget, GDK_SELECTION_PRIMARY, targets_atom, GDK_CURRENT_TIME); } /* Signal handler called when the selections owner returns the data */ void selection_received( GtkWidget *widget, GtkSelectionData *selection_data, gpointer data ) { GdkAtom *atoms; GList *item_list; int i; /* **** IMPORTANT **** Check to see if retrieval succeeded */ if (selection_data->length < 0) { g_print ("Selection retrieval failed\n"); return; } /* Make sure we got the data in the expected form */ if (selection_data->type != GDK_SELECTION_TYPE_ATOM) { g_print ("Selection \"TARGETS\" was not returned as atoms!\n"); return; } /* Print out the atoms we received */ atoms = (GdkAtom *)selection_data->data; item_list = NULL; for (i=0; i<selection_data->length/sizeof(GdkAtom); i++) { char *name; name = gdk_atom_name (atoms[i]); if (name != NULL) g_print ("%s\n",name); else g_print ("(bad atom)\n"); } return; } int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *button; gtk_init (&argc, &argv); /* Create the toplevel window */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Event Box"); gtk_container_set_border_width (GTK_CONTAINER (window), 10); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_exit), NULL); /* Create a button the user can click to get targets */ button = gtk_button_new_with_label ("Get Targets"); gtk_container_add (GTK_CONTAINER (window), button); gtk_signal_connect (GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC (get_targets), NULL); gtk_signal_connect (GTK_OBJECT(button), "selection_received", GTK_SIGNAL_FUNC (selection_received), NULL); gtk_widget_show (button); gtk_widget_show (window); gtk_main (); return 0; } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1> Supplying the selection <p> Supplying the selection is a bit more complicated. You must register handlers that will be called when your selection is requested. For each selection/target pair you will handle, you make a call to: <tscreen><verb> void gtk_selection_add_target (GtkWidget *widget, GdkAtom selection, GdkAtom target, guint info); </verb></tscreen> <tt/widget/, <tt/selection/, and <tt/target/ identify the requests this handler will manage. When a request for a selection is received, the "selection_get" signal will be called. <tt/info/ can be used as an enumerator to identify the specific target within the callback function. The callback function has the signature: <tscreen><verb> void "selection_get" (GtkWidget *widget, GtkSelectionData *selection_data, guint info, guint time); </verb></tscreen> The GtkSelectionData is the same as above, but this time, we're responsible for filling in the fields <tt/type/, <tt/format/, <tt/data/, and <tt/length/. (The <tt/format/ field is actually important here - the X server uses it to figure out whether the data needs to be byte-swapped or not. Usually it will be 8 - <em/i.e./ a character - or 32 - <em/i.e./ a. integer.) This is done by calling the function: <tscreen><verb> void gtk_selection_data_set( GtkSelectionData *selection_data, GdkAtom type, gint format, guchar *data, gint length ); </verb></tscreen> This function takes care of properly making a copy of the data so that you don't have to worry about keeping it around. (You should not fill in the fields of the GtkSelectionData structure by hand.) When prompted by the user, you claim ownership of the selection by calling: <tscreen><verb> gint gtk_selection_owner_set( GtkWidget *widget, GdkAtom selection, guint32 time ); </verb></tscreen> If another application claims ownership of the selection, you will receive a "selection_clear_event". As an example of supplying the selection, the following program adds selection functionality to a toggle button. When the toggle button is depressed, the program claims the primary selection. The only target supported (aside from certain targets like "TARGETS" supplied by GTK itself), is the "STRING" target. When this target is requested, a string representation of the time is returned. <tscreen><verb> /* example-start selection setselection.c */ #include <gtk/gtk.h> #include <time.h> /* Callback when the user toggles the selection */ void selection_toggled( GtkWidget *widget, gint *have_selection ) { if (GTK_TOGGLE_BUTTON(widget)->active) { *have_selection = gtk_selection_owner_set (widget, GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME); /* if claiming the selection failed, we return the button to the out state */ if (!*have_selection) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widget), FALSE); } else { if (*have_selection) { /* Before clearing the selection by setting the owner to NULL, we check if we are the actual owner */ if (gdk_selection_owner_get (GDK_SELECTION_PRIMARY) == widget->window) gtk_selection_owner_set (NULL, GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME); *have_selection = FALSE; } } } /* Called when another application claims the selection */ gint selection_clear( GtkWidget *widget, GdkEventSelection *event, gint *have_selection ) { *have_selection = FALSE; gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widget), FALSE); return TRUE; } /* Supplies the current time as the selection. */ void selection_handle( GtkWidget *widget, GtkSelectionData *selection_data, guint info, guint time_stamp, gpointer data ) { gchar *timestr; time_t current_time; current_time = time(NULL); timestr = asctime (localtime(&current_time)); /* When we return a single string, it should not be null terminated. That will be done for us */ gtk_selection_data_set (selection_data, GDK_SELECTION_TYPE_STRING, 8, timestr, strlen(timestr)); } int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *selection_button; static int have_selection = FALSE; gtk_init (&argc, &argv); /* Create the toplevel window */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Event Box"); gtk_container_set_border_width (GTK_CONTAINER (window), 10); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_exit), NULL); /* Create a toggle button to act as the selection */ selection_button = gtk_toggle_button_new_with_label ("Claim Selection"); gtk_container_add (GTK_CONTAINER (window), selection_button); gtk_widget_show (selection_button); gtk_signal_connect (GTK_OBJECT(selection_button), "toggled", GTK_SIGNAL_FUNC (selection_toggled), &have_selection); gtk_signal_connect (GTK_OBJECT(selection_button), "selection_clear_event", GTK_SIGNAL_FUNC (selection_clear), &have_selection); gtk_selection_add_target (selection_button, GDK_SELECTION_PRIMARY, GDK_SELECTION_TYPE_STRING, 1); gtk_signal_connect (GTK_OBJECT(selection_button), "selection_get", GTK_SIGNAL_FUNC (selection_handle), &have_selection); gtk_widget_show (selection_button); gtk_widget_show (window); gtk_main (); return 0; } /* example-end */ </verb></tscreen> <!-- ***************************************************************** --> <sect>GLib<label id="sec_glib"> <!-- ***************************************************************** --> <p> GLib is a lower-level library that provides many useful definitions and functions available for use when creating GDK and GTK applications. These include definitions for basic types and their limits, standard macros, type conversions, byte order, memory allocation, warnings and assertions, message logging, timers, string utilities, hook functions, a lexical scanner, dynamic loading of modules, and automatic string completion. A number of data structures (and their related operations) are also defined, including memory chunks, doubly-linked lists, singly-linked lists, hash tables, strings (which can grow dynamically), string chunks (groups of strings), arrays (which can grow in size as elements are added), balanced binary trees, N-ary trees, quarks (a two-way association of a string and a unique integer identifier), keyed data lists (lists of data elements accessible by a string or integer id), relations and tuples (tables of data which can be indexed on any number of fields), and caches. A summary of some of GLib's capabilities follows; not every function, data structure, or operation is covered here. For more complete information about the GLib routines, see the GLib documentation. One source of GLib documentation is <htmlurl url="http://www.gtk.org/" name="http://www.gtk.org/">. If you are using a language other than C, you should consult your language's binding documentation. In some cases your language may have equivalent functionality built-in, while in other cases it may not. <!-- ----------------------------------------------------------------- --> <sect1>Definitions <p> Definitions for the extremes of many of the standard types are: <tscreen><verb> G_MINFLOAT G_MAXFLOAT G_MINDOUBLE G_MAXDOUBLE G_MINSHORT G_MAXSHORT G_MININT G_MAXINT G_MINLONG G_MAXLONG </verb></tscreen> Also, the following typedefs. The ones left unspecified are dynamically set depending on the architecture. Remember to avoid counting on the size of a pointer if you want to be portable! E.g., a pointer on an Alpha is 8 bytes, but 4 on Intel 80x86 family CPUs. <tscreen><verb> char gchar; short gshort; long glong; int gint; char gboolean; unsigned char guchar; unsigned short gushort; unsigned long gulong; unsigned int guint; float gfloat; double gdouble; long double gldouble; void* gpointer; gint8 guint8 gint16 guint16 gint32 guint32 </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Doubly Linked Lists <p> The following functions are used to create, manage, and destroy standard doubly linked lists. Each element in the list contains a piece of data, together with pointers which link to the previous and next elements in the list. This enables easy movement in either direction through the list. The data item is of type "gpointer", which means the data can be a pointer to your real data or (through casting) a numeric value (but do not assume that int and gpointer have the same size!). These routines internally allocate list elements in blocks, which is more efficient than allocating elements individually. There is no function to specifically create a list. Instead, simply create a variable of type GList* and set its value to NULL; NULL is considered to be the empty list. To add elements to a list, use the g_list_append(), g_list_prepend(), g_list_insert(), or g_list_insert_sorted() routines. In all cases they accept a pointer to the beginning of the list, and return the (possibly changed) pointer to the beginning of the list. Thus, for all of the operations that add or remove elements, be sure to save the returned value! <tscreen><verb> GList *g_list_append( GList *list, gpointer data ); </verb></tscreen> This adds a new element (with value <tt/data/) onto the end of the list. <tscreen><verb> GList *g_list_prepend( GList *list, gpointer data ); </verb></tscreen> This adds a new element (with value <tt/data/) to the beginning of the list. <tscreen><verb> GList *g_list_insert( GList *list, gpointer data, gint position ); </verb></tscreen> This inserts a new element (with value data) into the list at the given position. If position is 0, this is just like g_list_prepend(); if position is less than 0, this is just like g_list_append(). <tscreen><verb> GList *g_list_remove( GList *list, gpointer data ); </verb></tscreen> This removes the element in the list with the value <tt/data/; if the element isn't there, the list is unchanged. <tscreen><verb> void g_list_free( GList *list ); </verb></tscreen> This frees all of the memory used by a GList. If the list elements refer to dynamically-allocated memory, then they should be freed first. There are many other GLib functions that support doubly linked lists; see the glib documentation for more information. Here are a few of the more useful functions' signatures: <tscreen><verb> GList *g_list_remove_link( GList *list, GList *link ); GList *g_list_reverse( GList *list ); GList *g_list_nth( GList *list, gint n ); GList *g_list_find( GList *list, gpointer data ); GList *g_list_last( GList *list ); GList *g_list_first( GList *list ); gint g_list_length( GList *list ); void g_list_foreach( GList *list, GFunc func, gpointer user_data ); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Singly Linked Lists <p> Many of the above functions for singly linked lists are identical to the above. Here is a list of some of their operations: <tscreen><verb> GSList *g_slist_append( GSList *list, gpointer data ); GSList *g_slist_prepend( GSList *list, gpointer data ); GSList *g_slist_insert( GSList *list, gpointer data, gint position ); GSList *g_slist_remove( GSList *list, gpointer data ); GSList *g_slist_remove_link( GSList *list, GSList *link ); GSList *g_slist_reverse( GSList *list ); GSList *g_slist_nth( GSList *list, gint n ); GSList *g_slist_find( GSList *list, gpointer data ); GSList *g_slist_last( GSList *list ); gint g_slist_length( GSList *list ); void g_slist_foreach( GSList *list, GFunc func, gpointer user_data ); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Memory Management <p> <tscreen><verb> gpointer g_malloc( gulong size ); </verb></tscreen> This is a replacement for malloc(). You do not need to check the return value as it is done for you in this function. If the memory allocation fails for whatever reasons, your applications will be terminated. <tscreen><verb> gpointer g_malloc0( gulong size ); </verb></tscreen> Same as above, but zeroes the memory before returning a pointer to it. <tscreen><verb> gpointer g_realloc( gpointer mem, gulong size ); </verb></tscreen> Relocates "size" bytes of memory starting at "mem". Obviously, the memory should have been previously allocated. <tscreen><verb> void g_free( gpointer mem ); </verb></tscreen> Frees memory. Easy one. If <tt/mem/ is NULL it simply returns. <tscreen><verb> void g_mem_profile( void ); </verb></tscreen> Dumps a profile of used memory, but requires that you add <tt>#define MEM_PROFILE</tt> to the top of glib/gmem.c and re-make and make install. <tscreen><verb> void g_mem_check( gpointer mem ); </verb></tscreen> Checks that a memory location is valid. Requires you add <tt>#define MEM_CHECK</tt> to the top of gmem.c and re-make and make install. <!-- ----------------------------------------------------------------- --> <sect1>Timers <p> Timer functions can be used to time operations (e.g., to see how much time has elapsed). First, you create a new timer with g_timer_new(). You can then use g_timer_start() to start timing an operation, g_timer_stop() to stop timing an operation, and g_timer_elapsed() to determine the elapsed time. <tscreen><verb> GTimer *g_timer_new( void ); void g_timer_destroy( GTimer *timer ); void g_timer_start( GTimer *timer ); void g_timer_stop( GTimer *timer ); void g_timer_reset( GTimer *timer ); gdouble g_timer_elapsed( GTimer *timer, gulong *microseconds ); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>String Handling <p> GLib defines a new type called a GString, which is similar to a standard C string but one that grows automatically. Its string data is null-terminated. What this gives you is protection from buffer overflow programming errors within your program. This is a very important feature, and hence I recommend that you make use of GStrings. GString itself has a simple public definition: <tscreen><verb> struct GString { gchar *str; /* Points to the string's current \0-terminated value. */ gint len; /* Current length */ }; </verb></tscreen> As you might expect, there are a number of operations you can do with a GString. <tscreen><verb> GString *g_string_new( gchar *init ); </verb></tscreen> This constructs a GString, copying the string value of <tt/init/ into the GString and returning a pointer to it. NULL may be given as the argument for an initially empty GString. <tscreen><verb> void g_string_free( GString *string, gint free_segment ); </verb></tscreen> This frees the memory for the given GString. If <tt/free_segment/ is TRUE, then this also frees its character data. <tscreen><verb> GString *g_string_assign( GString *lval, const gchar *rval ); </verb></tscreen> This copies the characters from rval into lval, destroying the previous contents of lval. Note that lval will be lengthened as necessary to hold the string's contents, unlike the standard strcpy() function. The rest of these functions should be relatively obvious (the _c versions accept a character instead of a string): <tscreen><verb> GString *g_string_truncate( GString *string, gint len ); GString *g_string_append( GString *string, gchar *val ); GString *g_string_append_c( GString *string, gchar c ); GString *g_string_prepend( GString *string, gchar *val ); GString *g_string_prepend_c( GString *string, gchar c ); void g_string_sprintf( GString *string, gchar *fmt, ...); void g_string_sprintfa ( GString *string, gchar *fmt, ... ); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>Utility and Error Functions <p> <tscreen><verb> gchar *g_strdup( const gchar *str ); </verb></tscreen> Replacement strdup function. Copies the original strings contents to newly allocated memory, and returns a pointer to it. <tscreen><verb> gchar *g_strerror( gint errnum ); </verb></tscreen> I recommend using this for all error messages. It's much nicer, and more portable than perror() or others. The output is usually of the form: <tscreen><verb> program name:function that failed:file or further description:strerror </verb></tscreen> Here's an example of one such call used in our hello_world program: <tscreen><verb> g_print("hello_world:open:%s:%s\n", filename, g_strerror(errno)); </verb></tscreen> <tscreen><verb> void g_error( gchar *format, ... ); </verb></tscreen> Prints an error message. The format is just like printf, but it prepends "** ERROR **: " to your message, and exits the program. Use only for fatal errors. <tscreen><verb> void g_warning( gchar *format, ... ); </verb></tscreen> Same as above, but prepends "** WARNING **: ", and does not exit the program. <tscreen><verb> void g_message( gchar *format, ... ); </verb></tscreen> Prints "message: " prepended to the string you pass in. <tscreen><verb> void g_print( gchar *format, ... ); </verb></tscreen> Replacement for printf(). And our last function: <tscreen><verb> gchar *g_strsignal( gint signum ); </verb></tscreen> Prints out the name of the Unix system signal given the signal number. Useful in generic signal handling functions. All of the above are more or less just stolen from glib.h. If anyone cares to document any function, just send me an email! <!-- ***************************************************************** --> <sect>GTK's rc Files <label id="sec_gtkrc_files"> <!-- ***************************************************************** --> <p> GTK has its own way of dealing with application defaults, by using rc files. These can be used to set the colors of just about any widget, and can also be used to tile pixmaps onto the background of some widgets. <!-- ----------------------------------------------------------------- --> <sect1>Functions For rc Files <p> When your application starts, you should include a call to: <tscreen><verb> void gtk_rc_parse( char *filename ); </verb></tscreen> Passing in the filename of your rc file. This will cause GTK to parse this file, and use the style settings for the widget types defined there. If you wish to have a special set of widgets that can take on a different style from others, or any other logical division of widgets, use a call to: <tscreen><verb> void gtk_widget_set_name( GtkWidget *widget, gchar *name ); </verb></tscreen> Passing your newly created widget as the first argument, and the name you wish to give it as the second. This will allow you to change the attributes of this widget by name through the rc file. If we use a call something like this: <tscreen><verb> button = gtk_button_new_with_label ("Special Button"); gtk_widget_set_name (button, "special button"); </verb></tscreen> Then this button is given the name "special button" and may be addressed by name in the rc file as "special button.GtkButton". [<--- Verify ME!] The example rc file below, sets the properties of the main window, and lets all children of that main window inherit the style described by the "main button" style. The code used in the application is: <tscreen><verb> window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_set_name (window, "main window"); </verb></tscreen> And then the style is defined in the rc file using: <tscreen><verb> widget "main window.*GtkButton*" style "main_button" </verb></tscreen> Which sets all the Button widgets in the "main window" to the "main_buttons" style as defined in the rc file. As you can see, this is a fairly powerful and flexible system. Use your imagination as to how best to take advantage of this. <!-- ----------------------------------------------------------------- --> <sect1>GTK's rc File Format <p> The format of the GTK file is illustrated in the example below. This is the testgtkrc file from the GTK distribution, but I've added a few comments and things. You may wish to include this explanation in your application to allow the user to fine tune his application. There are several directives to change the attributes of a widget. <itemize> <item>fg - Sets the foreground color of a widget. <item>bg - Sets the background color of a widget. <item>bg_pixmap - Sets the background of a widget to a tiled pixmap. <item>font - Sets the font to be used with the given widget. </itemize> In addition to this, there are several states a widget can be in, and you can set different colors, pixmaps and fonts for each state. These states are: <itemize> <item>NORMAL - The normal state of a widget, without the mouse over top of it, and not being pressed, etc. <item>PRELIGHT - When the mouse is over top of the widget, colors defined using this state will be in effect. <item>ACTIVE - When the widget is pressed or clicked it will be active, and the attributes assigned by this tag will be in effect. <item>INSENSITIVE - When a widget is set insensitive, and cannot be activated, it will take these attributes. <item>SELECTED - When an object is selected, it takes these attributes. </itemize> When using the "fg" and "bg" keywords to set the colors of widgets, the format is: <tscreen><verb> fg[<STATE>] = { Red, Green, Blue } </verb></tscreen> Where STATE is one of the above states (PRELIGHT, ACTIVE, etc), and the Red, Green and Blue are values in the range of 0 - 1.0, { 1.0, 1.0, 1.0 } being white. They must be in float form, or they will register as 0, so a straight "1" will not work, it must be "1.0". A straight "0" is fine because it doesn't matter if it's not recognized. Unrecognized values are set to 0. bg_pixmap is very similar to the above, except the colors are replaced by a filename. pixmap_path is a list of paths separated by ":"'s. These paths will be searched for any pixmap you specify. The font directive is simply: <tscreen><verb> font = "<font name>" </verb></tscreen> The only hard part is figuring out the font string. Using xfontsel or a similar utility should help. The "widget_class" sets the style of a class of widgets. These classes are listed in the widget overview on the class hierarchy. The "widget" directive sets a specifically named set of widgets to a given style, overriding any style set for the given widget class. These widgets are registered inside the application using the gtk_widget_set_name() call. This allows you to specify the attributes of a widget on a per widget basis, rather than setting the attributes of an entire widget class. I urge you to document any of these special widgets so users may customize them. When the keyword <tt>parent</> is used as an attribute, the widget will take on the attributes of its parent in the application. When defining a style, you may assign the attributes of a previously defined style to this new one. <tscreen><verb> style "main_button" = "button" { font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*" bg[PRELIGHT] = { 0.75, 0, 0 } } </verb></tscreen> This example takes the "button" style, and creates a new "main_button" style simply by changing the font and prelight background color of the "button" style. Of course, many of these attributes don't apply to all widgets. It's a simple matter of common sense really. Anything that could apply, should. <!-- ----------------------------------------------------------------- --> <sect1>Example rc file <p> <tscreen><verb> # pixmap_path "<dir 1>:<dir 2>:<dir 3>:..." # pixmap_path "/usr/include/X11R6/pixmaps:/home/imain/pixmaps" # # style <name> [= <name>] # { # <option> # } # # widget <widget_set> style <style_name> # widget_class <widget_class_set> style <style_name> # Here is a list of all the possible states. Note that some do not apply to # certain widgets. # # NORMAL - The normal state of a widget, without the mouse over top of # it, and not being pressed, etc. # # PRELIGHT - When the mouse is over top of the widget, colors defined # using this state will be in effect. # # ACTIVE - When the widget is pressed or clicked it will be active, and # the attributes assigned by this tag will be in effect. # # INSENSITIVE - When a widget is set insensitive, and cannot be # activated, it will take these attributes. # # SELECTED - When an object is selected, it takes these attributes. # # Given these states, we can set the attributes of the widgets in each of # these states using the following directives. # # fg - Sets the foreground color of a widget. # fg - Sets the background color of a widget. # bg_pixmap - Sets the background of a widget to a tiled pixmap. # font - Sets the font to be used with the given widget. # # This sets a style called "button". The name is not really important, as # it is assigned to the actual widgets at the bottom of the file. style "window" { #This sets the padding around the window to the pixmap specified. #bg_pixmap[<STATE>] = "<pixmap filename>" bg_pixmap[NORMAL] = "warning.xpm" } style "scale" { #Sets the foreground color (font color) to red when in the "NORMAL" #state. fg[NORMAL] = { 1.0, 0, 0 } #Sets the background pixmap of this widget to that of its parent. bg_pixmap[NORMAL] = "<parent>" } style "button" { # This shows all the possible states for a button. The only one that # doesn't apply is the SELECTED state. fg[PRELIGHT] = { 0, 1.0, 1.0 } bg[PRELIGHT] = { 0, 0, 1.0 } bg[ACTIVE] = { 1.0, 0, 0 } fg[ACTIVE] = { 0, 1.0, 0 } bg[NORMAL] = { 1.0, 1.0, 0 } fg[NORMAL] = { .99, 0, .99 } bg[INSENSITIVE] = { 1.0, 1.0, 1.0 } fg[INSENSITIVE] = { 1.0, 0, 1.0 } } # In this example, we inherit the attributes of the "button" style and then # override the font and background color when prelit to create a new # "main_button" style. style "main_button" = "button" { font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*" bg[PRELIGHT] = { 0.75, 0, 0 } } style "toggle_button" = "button" { fg[NORMAL] = { 1.0, 0, 0 } fg[ACTIVE] = { 1.0, 0, 0 } # This sets the background pixmap of the toggle_button to that of its # parent widget (as defined in the application). bg_pixmap[NORMAL] = "<parent>" } style "text" { bg_pixmap[NORMAL] = "marble.xpm" fg[NORMAL] = { 1.0, 1.0, 1.0 } } style "ruler" { font = "-adobe-helvetica-medium-r-normal--*-80-*-*-*-*-*-*" } # pixmap_path "~/.pixmaps" # These set the widget types to use the styles defined above. # The widget types are listed in the class hierarchy, but could probably be # just listed in this document for the users reference. widget_class "GtkWindow" style "window" widget_class "GtkDialog" style "window" widget_class "GtkFileSelection" style "window" widget_class "*Gtk*Scale" style "scale" widget_class "*GtkCheckButton*" style "toggle_button" widget_class "*GtkRadioButton*" style "toggle_button" widget_class "*GtkButton*" style "button" widget_class "*Ruler" style "ruler" widget_class "*GtkText" style "text" # This sets all the buttons that are children of the "main window" to # the main_button style. These must be documented to be taken advantage of. widget "main window.*GtkButton*" style "main_button" </verb></tscreen> <!-- ***************************************************************** --> <sect>Writing Your Own Widgets <!-- ***************************************************************** --> <!-- ----------------------------------------------------------------- --> <sect1> Overview <p> Although the GTK distribution comes with many types of widgets that should cover most basic needs, there may come a time when you need to create your own new widget type. Since GTK uses widget inheritance extensively, and there is already a widget that is close to what you want, it is often possible to make a useful new widget type in just a few lines of code. But before starting work on a new widget, check around first to make sure that someone has not already written it. This will prevent duplication of effort and keep the number of GTK widgets out there to a minimum, which will help keep both the code and the interface of different applications consistent. As a flip side to this, once you finish your widget, announce it to the world so other people can benefit. The best place to do this is probably the <tt>gtk-list</tt>. Complete sources for the example widgets are available at the place you got this tutorial, or from: <htmlurl url="http://www.gtk.org/~otaylor/gtk/tutorial/" name="http://www.gtk.org/~otaylor/gtk/tutorial/"> <!-- ----------------------------------------------------------------- --> <sect1> The Anatomy Of A Widget <p> In order to create a new widget, it is important to have an understanding of how GTK objects work. This section is just meant as a brief overview. See the reference documentation for the details. GTK widgets are implemented in an object oriented fashion. However, they are implemented in standard C. This greatly improves portability and stability over using current generation C++ compilers; however, it does mean that the widget writer has to pay attention to some of the implementation details. The information common to all instances of one class of widgets (e.g., to all Button widgets) is stored in the <em>class structure</em>. There is only one copy of this in which is stored information about the class's signals (which act like virtual functions in C). To support inheritance, the first field in the class structure must be a copy of the parent's class structure. The declaration of the class structure of GtkButtton looks like: <tscreen><verb> struct _GtkButtonClass { GtkContainerClass parent_class; void (* pressed) (GtkButton *button); void (* released) (GtkButton *button); void (* clicked) (GtkButton *button); void (* enter) (GtkButton *button); void (* leave) (GtkButton *button); }; </verb></tscreen> When a button is treated as a container (for instance, when it is resized), its class structure can be cast to GtkContainerClass, and the relevant fields used to handle the signals. There is also a structure for each widget that is created on a per-instance basis. This structure has fields to store information that is different for each instance of the widget. We'll call this structure the <em>object structure</em>. For the Button class, it looks like: <tscreen><verb> struct _GtkButton { GtkContainer container; GtkWidget *child; guint in_button : 1; guint button_down : 1; }; </verb></tscreen> Note that, similar to the class structure, the first field is the object structure of the parent class, so that this structure can be cast to the parent class' object structure as needed. <!-- ----------------------------------------------------------------- --> <sect1> Creating a Composite widget <!-- ----------------------------------------------------------------- --> <sect2> Introduction <p> One type of widget that you may be interested in creating is a widget that is merely an aggregate of other GTK widgets. This type of widget does nothing that couldn't be done without creating new widgets, but provides a convenient way of packaging user interface elements for reuse. The FileSelection and ColorSelection widgets in the standard distribution are examples of this type of widget. The example widget that we'll create in this section is the Tictactoe widget, a 3x3 array of toggle buttons which triggers a signal when all three buttons in a row, column, or on one of the diagonals are depressed. <!-- ----------------------------------------------------------------- --> <sect2> Choosing a parent class <p> The parent class for a composite widget is typically the container class that holds all of the elements of the composite widget. For example, the parent class of the FileSelection widget is the Dialog class. Since our buttons will be arranged in a table, it might seem natural to make our parent class the Table class. Unfortunately, this turns out not to work. The creation of a widget is divided among two functions - a <tt/WIDGETNAME_new()/ function that the user calls, and a <tt/WIDGETNAME_init()/ function which does the basic work of initializing the widget which is independent of the arguments passed to the <tt/_new()/ function. Descendant widgets only call the <tt/_init/ function of their parent widget. But this division of labor doesn't work well for tables, which when created need to know the number of rows and columns in the table. Unless we want to duplicate most of the functionality of <tt/gtk_table_new()/ in our Tictactoe widget, we had best avoid deriving it from Table. For that reason, we derive it from VBox instead, and stick our table inside the VBox. <!-- ----------------------------------------------------------------- --> <sect2> The header file <p> Each widget class has a header file which declares the object and class structures for that widget, along with public functions. A couple of features are worth pointing out. To prevent duplicate definitions, we wrap the entire header file in: <tscreen><verb> #ifndef __TICTACTOE_H__ #define __TICTACTOE_H__ . . . #endif /* __TICTACTOE_H__ */ </verb></tscreen> And to keep C++ programs that include the header file happy, in: <tscreen><verb> #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ . . . #ifdef __cplusplus } #endif /* __cplusplus */ </verb></tscreen> Along with the functions and structures, we declare three standard macros in our header file, <tt/TICTACTOE(obj)/, <tt/TICTACTOE_CLASS(klass)/, and <tt/IS_TICTACTOE(obj)/, which cast a pointer into a pointer to the object or class structure, and check if an object is a Tictactoe widget respectively. Here is the complete header file: <tscreen><verb> /* tictactoe.h */ #ifndef __TICTACTOE_H__ #define __TICTACTOE_H__ #include <gdk/gdk.h> #include <gtk/gtkvbox.h> #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define TICTACTOE(obj) GTK_CHECK_CAST (obj, tictactoe_get_type (), Tictactoe) #define TICTACTOE_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, tictactoe_get_type (), TictactoeClass) #define IS_TICTACTOE(obj) GTK_CHECK_TYPE (obj, tictactoe_get_type ()) typedef struct _Tictactoe Tictactoe; typedef struct _TictactoeClass TictactoeClass; struct _Tictactoe { GtkVBox vbox; GtkWidget *buttons[3][3]; }; struct _TictactoeClass { GtkVBoxClass parent_class; void (* tictactoe) (Tictactoe *ttt); }; guint tictactoe_get_type (void); GtkWidget* tictactoe_new (void); void tictactoe_clear (Tictactoe *ttt); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __TICTACTOE_H__ */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect2> The <tt/_get_type()/ function. <p> We now continue on to the implementation of our widget. A core function for every widget is the function <tt/WIDGETNAME_get_type()/. This function, when first called, tells GTK about the widget class, and gets an ID that uniquely identifies the widget class. Upon subsequent calls, it just returns the ID. <tscreen><verb> guint tictactoe_get_type () { static guint ttt_type = 0; if (!ttt_type) { GtkTypeInfo ttt_info = { "Tictactoe", sizeof (Tictactoe), sizeof (TictactoeClass), (GtkClassInitFunc) tictactoe_class_init, (GtkObjectInitFunc) tictactoe_init, (GtkArgSetFunc) NULL, (GtkArgGetFunc) NULL }; ttt_type = gtk_type_unique (gtk_vbox_get_type (), &ttt_info); } return ttt_type; } </verb></tscreen> The GtkTypeInfo structure has the following definition: <tscreen><verb> struct _GtkTypeInfo { gchar *type_name; guint object_size; guint class_size; GtkClassInitFunc class_init_func; GtkObjectInitFunc object_init_func; GtkArgSetFunc arg_set_func; GtkArgGetFunc arg_get_func; }; </verb></tscreen> The fields of this structure are pretty self-explanatory. We'll ignore the <tt/arg_set_func/ and <tt/arg_get_func/ fields here: they have an important, but as yet largely unimplemented, role in allowing widget options to be conveniently set from interpreted languages. Once GTK has a correctly filled in copy of this structure, it knows how to create objects of a particular widget type. <!-- ----------------------------------------------------------------- --> <sect2> The <tt/_class_init()/ function <p> The <tt/WIDGETNAME_class_init()/ function initializes the fields of the widget's class structure, and sets up any signals for the class. For our Tictactoe widget it looks like: <tscreen><verb> enum { TICTACTOE_SIGNAL, LAST_SIGNAL }; static gint tictactoe_signals[LAST_SIGNAL] = { 0 }; static void tictactoe_class_init (TictactoeClass *class) { GtkObjectClass *object_class; object_class = (GtkObjectClass*) class; tictactoe_signals[TICTACTOE_SIGNAL] = gtk_signal_new ("tictactoe", GTK_RUN_FIRST, object_class->type, GTK_SIGNAL_OFFSET (TictactoeClass, tictactoe), gtk_signal_default_marshaller, GTK_TYPE_NONE, 0); gtk_object_class_add_signals (object_class, tictactoe_signals, LAST_SIGNAL); class->tictactoe = NULL; } </verb></tscreen> Our widget has just one signal, the <tt/tictactoe/ signal that is invoked when a row, column, or diagonal is completely filled in. Not every composite widget needs signals, so if you are reading this for the first time, you may want to skip to the next section now, as things are going to get a bit complicated. The function: <tscreen><verb> gint gtk_signal_new( const gchar *name, GtkSignalRunType run_type, GtkType object_type, gint function_offset, GtkSignalMarshaller marshaller, GtkType return_val, guint nparams, ...); </verb></tscreen> Creates a new signal. The parameters are: <itemize> <item> <tt/name/: The name of the signal. <item> <tt/run_type/: Whether the default handler runs before or after user handlers. Usually this will be <tt/GTK_RUN_FIRST/, or <tt/GTK_RUN_LAST/, although there are other possibilities. <item> <tt/object_type/: The ID of the object that this signal applies to. (It will also apply to that objects descendants.) <item> <tt/function_offset/: The offset within the class structure of a pointer to the default handler. <item> <tt/marshaller/: A function that is used to invoke the signal handler. For signal handlers that have no arguments other than the object that emitted the signal and user data, we can use the pre-supplied marshaller function <tt/gtk_signal_default_marshaller/. <item> <tt/return_val/: The type of the return val. <item> <tt/nparams/: The number of parameters of the signal handler (other than the two default ones mentioned above) <item> <tt/.../: The types of the parameters. </itemize> When specifying types, the <tt/GtkType/ enumeration is used: <tscreen><verb> typedef enum { GTK_TYPE_INVALID, GTK_TYPE_NONE, GTK_TYPE_CHAR, GTK_TYPE_BOOL, GTK_TYPE_INT, GTK_TYPE_UINT, GTK_TYPE_LONG, GTK_TYPE_ULONG, GTK_TYPE_FLOAT, GTK_TYPE_DOUBLE, GTK_TYPE_STRING, GTK_TYPE_ENUM, GTK_TYPE_FLAGS, GTK_TYPE_BOXED, GTK_TYPE_FOREIGN, GTK_TYPE_CALLBACK, GTK_TYPE_ARGS, GTK_TYPE_POINTER, /* it'd be great if the next two could be removed eventually */ GTK_TYPE_SIGNAL, GTK_TYPE_C_CALLBACK, GTK_TYPE_OBJECT } GtkFundamentalType; </verb></tscreen> <tt/gtk_signal_new()/ returns a unique integer identifier for the signal, that we store in the <tt/tictactoe_signals/ array, which we index using an enumeration. (Conventionally, the enumeration elements are the signal name, uppercased, but here there would be a conflict with the <tt/TICTACTOE()/ macro, so we called it <tt/TICTACTOE_SIGNAL/ instead. After creating our signals, we need to tell GTK to associate our signals with the Tictactoe class. We do that by calling <tt/gtk_object_class_add_signals()/. We then set the pointer which points to the default handler for the "tictactoe" signal to NULL, indicating that there is no default action. <!-- ----------------------------------------------------------------- --> <sect2> The <tt/_init()/ function. <p> Each widget class also needs a function to initialize the object structure. Usually, this function has the fairly limited role of setting the fields of the structure to default values. For composite widgets, however, this function also creates the component widgets. <tscreen><verb> static void tictactoe_init (Tictactoe *ttt) { GtkWidget *table; gint i,j; table = gtk_table_new (3, 3, TRUE); gtk_container_add (GTK_CONTAINER(ttt), table); gtk_widget_show (table); for (i=0;i<3; i++) for (j=0;j<3; j++) { ttt->buttons[i][j] = gtk_toggle_button_new (); gtk_table_attach_defaults (GTK_TABLE(table), ttt->buttons[i][j], i, i+1, j, j+1); gtk_signal_connect (GTK_OBJECT (ttt->buttons[i][j]), "toggled", GTK_SIGNAL_FUNC (tictactoe_toggle), ttt); gtk_widget_set_usize (ttt->buttons[i][j], 20, 20); gtk_widget_show (ttt->buttons[i][j]); } } </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect2> And the rest... <p> There is one more function that every widget (except for base widget types like Bin that cannot be instantiated) needs to have - the function that the user calls to create an object of that type. This is conventionally called <tt/WIDGETNAME_new()/. In some widgets, though not for the Tictactoe widgets, this function takes arguments, and does some setup based on the arguments. The other two functions are specific to the Tictactoe widget. <tt/tictactoe_clear()/ is a public function that resets all the buttons in the widget to the up position. Note the use of <tt/gtk_signal_handler_block_by_data()/ to keep our signal handler for button toggles from being triggered unnecessarily. <tt/tictactoe_toggle()/ is the signal handler that is invoked when the user clicks on a button. It checks to see if there are any winning combinations that involve the toggled button, and if so, emits the "tictactoe" signal. <tscreen><verb> GtkWidget* tictactoe_new () { return GTK_WIDGET ( gtk_type_new (tictactoe_get_type ())); } void tictactoe_clear (Tictactoe *ttt) { int i,j; for (i=0;i<3;i++) for (j=0;j<3;j++) { gtk_signal_handler_block_by_data (GTK_OBJECT(ttt->buttons[i][j]), ttt); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ttt->buttons[i][j]), FALSE); gtk_signal_handler_unblock_by_data (GTK_OBJECT(ttt->buttons[i][j]), ttt); } } static void tictactoe_toggle (GtkWidget *widget, Tictactoe *ttt) { int i,k; static int rwins[8][3] = { { 0, 0, 0 }, { 1, 1, 1 }, { 2, 2, 2 }, { 0, 1, 2 }, { 0, 1, 2 }, { 0, 1, 2 }, { 0, 1, 2 }, { 0, 1, 2 } }; static int cwins[8][3] = { { 0, 1, 2 }, { 0, 1, 2 }, { 0, 1, 2 }, { 0, 0, 0 }, { 1, 1, 1 }, { 2, 2, 2 }, { 0, 1, 2 }, { 2, 1, 0 } }; int success, found; for (k=0; k<8; k++) { success = TRUE; found = FALSE; for (i=0;i<3;i++) { success = success && GTK_TOGGLE_BUTTON(ttt->buttons[rwins[k][i]][cwins[k][i]])->active; found = found || ttt->buttons[rwins[k][i]][cwins[k][i]] == widget; } if (success && found) { gtk_signal_emit (GTK_OBJECT (ttt), tictactoe_signals[TICTACTOE_SIGNAL]); break; } } } </verb></tscreen> And finally, an example program using our Tictactoe widget: <tscreen><verb> #include <gtk/gtk.h> #include "tictactoe.h" /* Invoked when a row, column or diagonal is completed */ void win (GtkWidget *widget, gpointer data) { g_print ("Yay!\n"); tictactoe_clear (TICTACTOE (widget)); } int main (int argc, char *argv[]) { GtkWidget *window; GtkWidget *ttt; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Aspect Frame"); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_exit), NULL); gtk_container_set_border_width (GTK_CONTAINER (window), 10); /* Create a new Tictactoe widget */ ttt = tictactoe_new (); gtk_container_add (GTK_CONTAINER (window), ttt); gtk_widget_show (ttt); /* And attach to its "tictactoe" signal */ gtk_signal_connect (GTK_OBJECT (ttt), "tictactoe", GTK_SIGNAL_FUNC (win), NULL); gtk_widget_show (window); gtk_main (); return 0; } </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1> Creating a widget from scratch. <!-- ----------------------------------------------------------------- --> <sect2> Introduction <p> In this section, we'll learn more about how widgets display themselves on the screen and interact with events. As an example of this, we'll create an analog dial widget with a pointer that the user can drag to set the value. <!-- ----------------------------------------------------------------- --> <sect2> Displaying a widget on the screen <p> There are several steps that are involved in displaying on the screen. After the widget is created with a call to <tt/WIDGETNAME_new()/, several more functions are needed: <itemize> <item> <tt/WIDGETNAME_realize()/ is responsible for creating an X window for the widget if it has one. <item> <tt/WIDGETNAME_map()/ is invoked after the user calls <tt/gtk_widget_show()/. It is responsible for making sure the widget is actually drawn on the screen (<em/mapped/). For a container class, it must also make calls to <tt/map()/> functions of any child widgets. <item> <tt/WIDGETNAME_draw()/ is invoked when <tt/gtk_widget_draw()/ is called for the widget or one of its ancestors. It makes the actual calls to the drawing functions to draw the widget on the screen. For container widgets, this function must make calls to <tt/gtk_widget_draw()/ for its child widgets. <item> <tt/WIDGETNAME_expose()/ is a handler for expose events for the widget. It makes the necessary calls to the drawing functions to draw the exposed portion on the screen. For container widgets, this function must generate expose events for its child widgets which don't have their own windows. (If they have their own windows, then X will generate the necessary expose events.) </itemize> You might notice that the last two functions are quite similar - each is responsible for drawing the widget on the screen. In fact many types of widgets don't really care about the difference between the two. The default <tt/draw()/ function in the widget class simply generates a synthetic expose event for the redrawn area. However, some types of widgets can save work by distinguishing between the two functions. For instance, if a widget has multiple X windows, then since expose events identify the exposed window, it can redraw only the affected window, which is not possible for calls to <tt/draw()/. Container widgets, even if they don't care about the difference for themselves, can't simply use the default <tt/draw()/ function because their child widgets might care about the difference. However, it would be wasteful to duplicate the drawing code between the two functions. The convention is that such widgets have a function called <tt/WIDGETNAME_paint()/ that does the actual work of drawing the widget, that is then called by the <tt/draw()/ and <tt/expose()/ functions. In our example approach, since the dial widget is not a container widget, and only has a single window, we can take the simplest approach and use the default <tt/draw()/ function and only implement an <tt/expose()/ function. <!-- ----------------------------------------------------------------- --> <sect2> The origins of the Dial Widget <p> Just as all land animals are just variants on the first amphibian that crawled up out of the mud, GTK widgets tend to start off as variants of some other, previously written widget. Thus, although this section is entitled "Creating a Widget from Scratch", the Dial widget really began with the source code for the Range widget. This was picked as a starting point because it would be nice if our Dial had the same interface as the Scale widgets which are just specialized descendants of the Range widget. So, though the source code is presented below in finished form, it should not be implied that it was written, <em>ab initio</em> in this fashion. Also, if you aren't yet familiar with how scale widgets work from the application writer's point of view, it would be a good idea to look them over before continuing. <!-- ----------------------------------------------------------------- --> <sect2> The Basics <p> Quite a bit of our widget should look pretty familiar from the Tictactoe widget. First, we have a header file: <tscreen><verb> /* GTK - The GIMP Toolkit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __GTK_DIAL_H__ #define __GTK_DIAL_H__ #include <gdk/gdk.h> #include <gtk/gtkadjustment.h> #include <gtk/gtkwidget.h> #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define GTK_DIAL(obj) GTK_CHECK_CAST (obj, gtk_dial_get_type (), GtkDial) #define GTK_DIAL_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_dial_get_type (), GtkDialClass) #define GTK_IS_DIAL(obj) GTK_CHECK_TYPE (obj, gtk_dial_get_type ()) typedef struct _GtkDial GtkDial; typedef struct _GtkDialClass GtkDialClass; struct _GtkDial { GtkWidget widget; /* update policy (GTK_UPDATE_[CONTINUOUS/DELAYED/DISCONTINUOUS]) */ guint policy : 2; /* Button currently pressed or 0 if none */ guint8 button; /* Dimensions of dial components */ gint radius; gint pointer_width; /* ID of update timer, or 0 if none */ guint32 timer; /* Current angle */ gfloat angle; /* Old values from adjustment stored so we know when something changes */ gfloat old_value; gfloat old_lower; gfloat old_upper; /* The adjustment object that stores the data for this dial */ GtkAdjustment *adjustment; }; struct _GtkDialClass { GtkWidgetClass parent_class; }; GtkWidget* gtk_dial_new (GtkAdjustment *adjustment); guint gtk_dial_get_type (void); GtkAdjustment* gtk_dial_get_adjustment (GtkDial *dial); void gtk_dial_set_update_policy (GtkDial *dial, GtkUpdateType policy); void gtk_dial_set_adjustment (GtkDial *dial, GtkAdjustment *adjustment); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __GTK_DIAL_H__ */ </verb></tscreen> Since there is quite a bit more going on in this widget than the last one, we have more fields in the data structure, but otherwise things are pretty similar. Next, after including header files and declaring a few constants, we have some functions to provide information about the widget and initialize it: <tscreen><verb> #include <math.h> #include <stdio.h> #include <gtk/gtkmain.h> #include <gtk/gtksignal.h> #include "gtkdial.h" #define SCROLL_DELAY_LENGTH 300 #define DIAL_DEFAULT_SIZE 100 /* Forward declarations */ [ omitted to save space ] /* Local data */ static GtkWidgetClass *parent_class = NULL; guint gtk_dial_get_type () { static guint dial_type = 0; if (!dial_type) { GtkTypeInfo dial_info = { "GtkDial", sizeof (GtkDial), sizeof (GtkDialClass), (GtkClassInitFunc) gtk_dial_class_init, (GtkObjectInitFunc) gtk_dial_init, (GtkArgSetFunc) NULL, (GtkArgGetFunc) NULL, }; dial_type = gtk_type_unique (gtk_widget_get_type (), &dial_info); } return dial_type; } static void gtk_dial_class_init (GtkDialClass *class) { GtkObjectClass *object_class; GtkWidgetClass *widget_class; object_class = (GtkObjectClass*) class; widget_class = (GtkWidgetClass*) class; parent_class = gtk_type_class (gtk_widget_get_type ()); object_class->destroy = gtk_dial_destroy; widget_class->realize = gtk_dial_realize; widget_class->expose_event = gtk_dial_expose; widget_class->size_request = gtk_dial_size_request; widget_class->size_allocate = gtk_dial_size_allocate; widget_class->button_press_event = gtk_dial_button_press; widget_class->button_release_event = gtk_dial_button_release; widget_class->motion_notify_event = gtk_dial_motion_notify; } static void gtk_dial_init (GtkDial *dial) { dial->button = 0; dial->policy = GTK_UPDATE_CONTINUOUS; dial->timer = 0; dial->radius = 0; dial->pointer_width = 0; dial->angle = 0.0; dial->old_value = 0.0; dial->old_lower = 0.0; dial->old_upper = 0.0; dial->adjustment = NULL; } GtkWidget* gtk_dial_new (GtkAdjustment *adjustment) { GtkDial *dial; dial = gtk_type_new (gtk_dial_get_type ()); if (!adjustment) adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); gtk_dial_set_adjustment (dial, adjustment); return GTK_WIDGET (dial); } static void gtk_dial_destroy (GtkObject *object) { GtkDial *dial; g_return_if_fail (object != NULL); g_return_if_fail (GTK_IS_DIAL (object)); dial = GTK_DIAL (object); if (dial->adjustment) gtk_object_unref (GTK_OBJECT (dial->adjustment)); if (GTK_OBJECT_CLASS (parent_class)->destroy) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } </verb></tscreen> Note that this <tt/init()/ function does less than for the Tictactoe widget, since this is not a composite widget, and the <tt/new()/ function does more, since it now has an argument. Also, note that when we store a pointer to the Adjustment object, we increment its reference count, (and correspondingly decrement it when we no longer use it) so that GTK can keep track of when it can be safely destroyed. <p> Also, there are a few function to manipulate the widget's options: <tscreen><verb> GtkAdjustment* gtk_dial_get_adjustment (GtkDial *dial) { g_return_val_if_fail (dial != NULL, NULL); g_return_val_if_fail (GTK_IS_DIAL (dial), NULL); return dial->adjustment; } void gtk_dial_set_update_policy (GtkDial *dial, GtkUpdateType policy) { g_return_if_fail (dial != NULL); g_return_if_fail (GTK_IS_DIAL (dial)); dial->policy = policy; } void gtk_dial_set_adjustment (GtkDial *dial, GtkAdjustment *adjustment) { g_return_if_fail (dial != NULL); g_return_if_fail (GTK_IS_DIAL (dial)); if (dial->adjustment) { gtk_signal_disconnect_by_data (GTK_OBJECT (dial->adjustment), (gpointer) dial); gtk_object_unref (GTK_OBJECT (dial->adjustment)); } dial->adjustment = adjustment; gtk_object_ref (GTK_OBJECT (dial->adjustment)); gtk_signal_connect (GTK_OBJECT (adjustment), "changed", (GtkSignalFunc) gtk_dial_adjustment_changed, (gpointer) dial); gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed", (GtkSignalFunc) gtk_dial_adjustment_value_changed, (gpointer) dial); dial->old_value = adjustment->value; dial->old_lower = adjustment->lower; dial->old_upper = adjustment->upper; gtk_dial_update (dial); } </verb></tscreen> <sect2> <tt/gtk_dial_realize()/ <p> Now we come to some new types of functions. First, we have a function that does the work of creating the X window. Notice that a mask is passed to the function <tt/gdk_window_new()/ which specifies which fields of the GdkWindowAttr structure actually have data in them (the remaining fields will be given default values). Also worth noting is the way the event mask of the widget is created. We call <tt/gtk_widget_get_events()/ to retrieve the event mask that the user has specified for this widget (with <tt/gtk_widget_set_events()/), and add the events that we are interested in ourselves. <p> After creating the window, we set its style and background, and put a pointer to the widget in the user data field of the GdkWindow. This last step allows GTK to dispatch events for this window to the correct widget. <tscreen><verb> static void gtk_dial_realize (GtkWidget *widget) { GtkDial *dial; GdkWindowAttr attributes; gint attributes_mask; g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_DIAL (widget)); GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); dial = GTK_DIAL (widget); attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; attributes.width = widget->allocation.width; attributes.height = widget->allocation.height; attributes.wclass = GDK_INPUT_OUTPUT; attributes.window_type = GDK_WINDOW_CHILD; attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK; attributes.visual = gtk_widget_get_visual (widget); attributes.colormap = gtk_widget_get_colormap (widget); attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; widget->window = gdk_window_new (widget->parent->window, &attributes, attributes_mask); widget->style = gtk_style_attach (widget->style, widget->window); gdk_window_set_user_data (widget->window, widget); gtk_style_set_background (widget->style, widget->window, GTK_STATE_ACTIVE); } </verb></tscreen> <sect2> Size negotiation <p> Before the first time that the window containing a widget is displayed, and whenever the layout of the window changes, GTK asks each child widget for its desired size. This request is handled by the function <tt/gtk_dial_size_request()/. Since our widget isn't a container widget, and has no real constraints on its size, we just return a reasonable default value. <tscreen><verb> static void gtk_dial_size_request (GtkWidget *widget, GtkRequisition *requisition) { requisition->width = DIAL_DEFAULT_SIZE; requisition->height = DIAL_DEFAULT_SIZE; } </verb></tscreen> <p> After all the widgets have requested an ideal size, the layout of the window is computed and each child widget is notified of its actual size. Usually, this will be at least as large as the requested size, but if for instance the user has resized the window, it may occasionally be smaller than the requested size. The size notification is handled by the function <tt/gtk_dial_size_allocate()/. Notice that as well as computing the sizes of some component pieces for future use, this routine also does the grunt work of moving the widget's X window into the new position and size. <tscreen><verb> static void gtk_dial_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GtkDial *dial; g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_DIAL (widget)); g_return_if_fail (allocation != NULL); widget->allocation = *allocation; if (GTK_WIDGET_REALIZED (widget)) { dial = GTK_DIAL (widget); gdk_window_move_resize (widget->window, allocation->x, allocation->y, allocation->width, allocation->height); dial->radius = MAX(allocation->width,allocation->height) * 0.45; dial->pointer_width = dial->radius / 5; } } </verb></tscreen>. <!-- ----------------------------------------------------------------- --> <sect2> <tt/gtk_dial_expose()/ <p> As mentioned above, all the drawing of this widget is done in the handler for expose events. There's not much to remark on here except the use of the function <tt/gtk_draw_polygon/ to draw the pointer with three dimensional shading according to the colors stored in the widget's style. <tscreen><verb> static gint gtk_dial_expose (GtkWidget *widget, GdkEventExpose *event) { GtkDial *dial; GdkPoint points[3]; gdouble s,c; gdouble theta; gint xc, yc; gint tick_length; gint i; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GTK_IS_DIAL (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); if (event->count > 0) return FALSE; dial = GTK_DIAL (widget); gdk_window_clear_area (widget->window, 0, 0, widget->allocation.width, widget->allocation.height); xc = widget->allocation.width/2; yc = widget->allocation.height/2; /* Draw ticks */ for (i=0; i<25; i++) { theta = (i*M_PI/18. - M_PI/6.); s = sin(theta); c = cos(theta); tick_length = (i%6 == 0) ? dial->pointer_width : dial->pointer_width/2; gdk_draw_line (widget->window, widget->style->fg_gc[widget->state], xc + c*(dial->radius - tick_length), yc - s*(dial->radius - tick_length), xc + c*dial->radius, yc - s*dial->radius); } /* Draw pointer */ s = sin(dial->angle); c = cos(dial->angle); points[0].x = xc + s*dial->pointer_width/2; points[0].y = yc + c*dial->pointer_width/2; points[1].x = xc + c*dial->radius; points[1].y = yc - s*dial->radius; points[2].x = xc - s*dial->pointer_width/2; points[2].y = yc - c*dial->pointer_width/2; gtk_draw_polygon (widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, points, 3, TRUE); return FALSE; } </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect2> Event handling <p> The rest of the widget's code handles various types of events, and isn't too different from what would be found in many GTK applications. Two types of events can occur - either the user can click on the widget with the mouse and drag to move the pointer, or the value of the Adjustment object can change due to some external circumstance. When the user clicks on the widget, we check to see if the click was appropriately near the pointer, and if so, store the button that the user clicked with in the <tt/button/ field of the widget structure, and grab all mouse events with a call to <tt/gtk_grab_add()/. Subsequent motion of the mouse causes the value of the control to be recomputed (by the function <tt/gtk_dial_update_mouse/). Depending on the policy that has been set, "value_changed" events are either generated instantly (<tt/GTK_UPDATE_CONTINUOUS/), after a delay in a timer added with <tt/gtk_timeout_add()/ (<tt/GTK_UPDATE_DELAYED/), or only when the button is released (<tt/GTK_UPDATE_DISCONTINUOUS/). <tscreen><verb> static gint gtk_dial_button_press (GtkWidget *widget, GdkEventButton *event) { GtkDial *dial; gint dx, dy; double s, c; double d_parallel; double d_perpendicular; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GTK_IS_DIAL (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); dial = GTK_DIAL (widget); /* Determine if button press was within pointer region - we do this by computing the parallel and perpendicular distance of the point where the mouse was pressed from the line passing through the pointer */ dx = event->x - widget->allocation.width / 2; dy = widget->allocation.height / 2 - event->y; s = sin(dial->angle); c = cos(dial->angle); d_parallel = s*dy + c*dx; d_perpendicular = fabs(s*dx - c*dy); if (!dial->button && (d_perpendicular < dial->pointer_width/2) && (d_parallel > - dial->pointer_width)) { gtk_grab_add (widget); dial->button = event->button; gtk_dial_update_mouse (dial, event->x, event->y); } return FALSE; } static gint gtk_dial_button_release (GtkWidget *widget, GdkEventButton *event) { GtkDial *dial; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GTK_IS_DIAL (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); dial = GTK_DIAL (widget); if (dial->button == event->button) { gtk_grab_remove (widget); dial->button = 0; if (dial->policy == GTK_UPDATE_DELAYED) gtk_timeout_remove (dial->timer); if ((dial->policy != GTK_UPDATE_CONTINUOUS) && (dial->old_value != dial->adjustment->value)) gtk_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed"); } return FALSE; } static gint gtk_dial_motion_notify (GtkWidget *widget, GdkEventMotion *event) { GtkDial *dial; GdkModifierType mods; gint x, y, mask; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GTK_IS_DIAL (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); dial = GTK_DIAL (widget); if (dial->button != 0) { x = event->x; y = event->y; if (event->is_hint || (event->window != widget->window)) gdk_window_get_pointer (widget->window, &x, &y, &mods); switch (dial->button) { case 1: mask = GDK_BUTTON1_MASK; break; case 2: mask = GDK_BUTTON2_MASK; break; case 3: mask = GDK_BUTTON3_MASK; break; default: mask = 0; break; } if (mods & mask) gtk_dial_update_mouse (dial, x,y); } return FALSE; } static gint gtk_dial_timer (GtkDial *dial) { g_return_val_if_fail (dial != NULL, FALSE); g_return_val_if_fail (GTK_IS_DIAL (dial), FALSE); if (dial->policy == GTK_UPDATE_DELAYED) gtk_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed"); return FALSE; } static void gtk_dial_update_mouse (GtkDial *dial, gint x, gint y) { gint xc, yc; gfloat old_value; g_return_if_fail (dial != NULL); g_return_if_fail (GTK_IS_DIAL (dial)); xc = GTK_WIDGET(dial)->allocation.width / 2; yc = GTK_WIDGET(dial)->allocation.height / 2; old_value = dial->adjustment->value; dial->angle = atan2(yc-y, x-xc); if (dial->angle < -M_PI/2.) dial->angle += 2*M_PI; if (dial->angle < -M_PI/6) dial->angle = -M_PI/6; if (dial->angle > 7.*M_PI/6.) dial->angle = 7.*M_PI/6.; dial->adjustment->value = dial->adjustment->lower + (7.*M_PI/6 - dial->angle) * (dial->adjustment->upper - dial->adjustment->lower) / (4.*M_PI/3.); if (dial->adjustment->value != old_value) { if (dial->policy == GTK_UPDATE_CONTINUOUS) { gtk_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed"); } else { gtk_widget_draw (GTK_WIDGET(dial), NULL); if (dial->policy == GTK_UPDATE_DELAYED) { if (dial->timer) gtk_timeout_remove (dial->timer); dial->timer = gtk_timeout_add (SCROLL_DELAY_LENGTH, (GtkFunction) gtk_dial_timer, (gpointer) dial); } } } } </verb></tscreen> Changes to the Adjustment by external means are communicated to our widget by the "changed" and "value_changed" signals. The handlers for these functions call <tt/gtk_dial_update()/ to validate the arguments, compute the new pointer angle, and redraw the widget (by calling <tt/gtk_widget_draw()/). <tscreen><verb> static void gtk_dial_update (GtkDial *dial) { gfloat new_value; g_return_if_fail (dial != NULL); g_return_if_fail (GTK_IS_DIAL (dial)); new_value = dial->adjustment->value; if (new_value < dial->adjustment->lower) new_value = dial->adjustment->lower; if (new_value > dial->adjustment->upper) new_value = dial->adjustment->upper; if (new_value != dial->adjustment->value) { dial->adjustment->value = new_value; gtk_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed"); } dial->angle = 7.*M_PI/6. - (new_value - dial->adjustment->lower) * 4.*M_PI/3. / (dial->adjustment->upper - dial->adjustment->lower); gtk_widget_draw (GTK_WIDGET(dial), NULL); } static void gtk_dial_adjustment_changed (GtkAdjustment *adjustment, gpointer data) { GtkDial *dial; g_return_if_fail (adjustment != NULL); g_return_if_fail (data != NULL); dial = GTK_DIAL (data); if ((dial->old_value != adjustment->value) || (dial->old_lower != adjustment->lower) || (dial->old_upper != adjustment->upper)) { gtk_dial_update (dial); dial->old_value = adjustment->value; dial->old_lower = adjustment->lower; dial->old_upper = adjustment->upper; } } static void gtk_dial_adjustment_value_changed (GtkAdjustment *adjustment, gpointer data) { GtkDial *dial; g_return_if_fail (adjustment != NULL); g_return_if_fail (data != NULL); dial = GTK_DIAL (data); if (dial->old_value != adjustment->value) { gtk_dial_update (dial); dial->old_value = adjustment->value; } } </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect2> Possible Enhancements <p> The Dial widget as we've described it so far runs about 670 lines of code. Although that might sound like a fair bit, we've really accomplished quite a bit with that much code, especially since much of that length is headers and boilerplate. However, there are quite a few more enhancements that could be made to this widget: <itemize> <item> If you try this widget out, you'll find that there is some flashing as the pointer is dragged around. This is because the entire widget is erased every time the pointer is moved before being redrawn. Often, the best way to handle this problem is to draw to an offscreen pixmap, then copy the final results onto the screen in one step. (The ProgressBar widget draws itself in this fashion.) <item> The user should be able to use the up and down arrow keys to increase and decrease the value. <item> It would be nice if the widget had buttons to increase and decrease the value in small or large steps. Although it would be possible to use embedded Button widgets for this, we would also like the buttons to auto-repeat when held down, as the arrows on a scrollbar do. Most of the code to implement this type of behavior can be found in the Range widget. <item> The Dial widget could be made into a container widget with a single child widget positioned at the bottom between the buttons mentioned above. The user could then add their choice of a label or entry widget to display the current value of the dial. </itemize> <!-- ----------------------------------------------------------------- --> <sect1> Learning More <p> Only a small part of the many details involved in creating widgets could be described above. If you want to write your own widgets, the best source of examples is the GTK source itself. Ask yourself some questions about the widget you want to write: IS it a Container widget? Does it have its own window? Is it a modification of an existing widget? Then find a similar widget, and start making changes. Good luck! <!-- ***************************************************************** --> <sect>Scribble, A Simple Example Drawing Program <!-- ***************************************************************** --> <!-- ----------------------------------------------------------------- --> <sect1> Overview <p> In this section, we will build a simple drawing program. In the process, we will examine how to handle mouse events, how to draw in a window, and how to do drawing better by using a backing pixmap. After creating the simple drawing program, we will extend it by adding support for XInput devices, such as drawing tablets. GTK provides support routines which makes getting extended information, such as pressure and tilt, from such devices quite easy. <!-- ----------------------------------------------------------------- --> <sect1> Event Handling <p> The GTK signals we have already discussed are for high-level actions, such as a menu item being selected. However, sometimes it is useful to learn about lower-level occurrences, such as the mouse being moved, or a key being pressed. There are also GTK signals corresponding to these low-level <em>events</em>. The handlers for these signals have an extra parameter which is a pointer to a structure containing information about the event. For instance, motion event handlers are passed a pointer to a GdkEventMotion structure which looks (in part) like: <tscreen><verb> struct _GdkEventMotion { GdkEventType type; GdkWindow *window; guint32 time; gdouble x; gdouble y; ... guint state; ... }; </verb></tscreen> <tt/type/ will be set to the event type, in this case <tt/GDK_MOTION_NOTIFY/, window is the window in which the event occurred. <tt/x/ and <tt/y/ give the coordinates of the event. <tt/state/ specifies the modifier state when the event occurred (that is, it specifies which modifier keys and mouse buttons were pressed). It is the bitwise OR of some of the following: <tscreen><verb> GDK_SHIFT_MASK GDK_LOCK_MASK GDK_CONTROL_MASK GDK_MOD1_MASK GDK_MOD2_MASK GDK_MOD3_MASK GDK_MOD4_MASK GDK_MOD5_MASK GDK_BUTTON1_MASK GDK_BUTTON2_MASK GDK_BUTTON3_MASK GDK_BUTTON4_MASK GDK_BUTTON5_MASK </verb></tscreen> As for other signals, to determine what happens when an event occurs we call <tt>gtk_signal_connect()</tt>. But we also need let GTK know which events we want to be notified about. To do this, we call the function: <tscreen><verb> void gtk_widget_set_events (GtkWidget *widget, gint events); </verb></tscreen> The second field specifies the events we are interested in. It is the bitwise OR of constants that specify different types of events. For future reference the event types are: <tscreen><verb> GDK_EXPOSURE_MASK GDK_POINTER_MOTION_MASK GDK_POINTER_MOTION_HINT_MASK GDK_BUTTON_MOTION_MASK GDK_BUTTON1_MOTION_MASK GDK_BUTTON2_MOTION_MASK GDK_BUTTON3_MOTION_MASK GDK_BUTTON_PRESS_MASK GDK_BUTTON_RELEASE_MASK GDK_KEY_PRESS_MASK GDK_KEY_RELEASE_MASK GDK_ENTER_NOTIFY_MASK GDK_LEAVE_NOTIFY_MASK GDK_FOCUS_CHANGE_MASK GDK_STRUCTURE_MASK GDK_PROPERTY_CHANGE_MASK GDK_PROXIMITY_IN_MASK GDK_PROXIMITY_OUT_MASK </verb></tscreen> There are a few subtle points that have to be observed when calling <tt/gtk_widget_set_events()/. First, it must be called before the X window for a GTK widget is created. In practical terms, this means you should call it immediately after creating the widget. Second, the widget must have an associated X window. For efficiency, many widget types do not have their own window, but draw in their parent's window. These widgets are: <tscreen><verb> GtkAlignment GtkArrow GtkBin GtkBox GtkImage GtkItem GtkLabel GtkPixmap GtkScrolledWindow GtkSeparator GtkTable GtkAspectFrame GtkFrame GtkVBox GtkHBox GtkVSeparator GtkHSeparator </verb></tscreen> To capture events for these widgets, you need to use an EventBox widget. See the section on the <ref id="sec_EventBox" name="EventBox"> widget for details. For our drawing program, we want to know when the mouse button is pressed and when the mouse is moved, so we specify <tt/GDK_POINTER_MOTION_MASK/ and <tt/GDK_BUTTON_PRESS_MASK/. We also want to know when we need to redraw our window, so we specify <tt/GDK_EXPOSURE_MASK/. Although we want to be notified via a Configure event when our window size changes, we don't have to specify the corresponding <tt/GDK_STRUCTURE_MASK/ flag, because it is automatically specified for all windows. It turns out, however, that there is a problem with just specifying <tt/GDK_POINTER_MOTION_MASK/. This will cause the server to add a new motion event to the event queue every time the user moves the mouse. Imagine that it takes us 0.1 seconds to handle a motion event, but the X server queues a new motion event every 0.05 seconds. We will soon get way behind the users drawing. If the user draws for 5 seconds, it will take us another 5 seconds to catch up after they release the mouse button! What we would like is to only get one motion event for each event we process. The way to do this is to specify <tt/GDK_POINTER_MOTION_HINT_MASK/. When we specify <tt/GDK_POINTER_MOTION_HINT_MASK/, the server sends us a motion event the first time the pointer moves after entering our window, or after a button press or release event. Subsequent motion events will be suppressed until we explicitly ask for the position of the pointer using the function: <tscreen><verb> GdkWindow* gdk_window_get_pointer (GdkWindow *window, gint *x, gint *y, GdkModifierType *mask); </verb></tscreen> (There is another function, <tt>gtk_widget_get_pointer()</tt> which has a simpler interface, but turns out not to be very useful, since it only retrieves the position of the mouse, not whether the buttons are pressed.) The code to set the events for our window then looks like: <tscreen><verb> gtk_signal_connect (GTK_OBJECT (drawing_area), "expose_event", (GtkSignalFunc) expose_event, NULL); gtk_signal_connect (GTK_OBJECT(drawing_area),"configure_event", (GtkSignalFunc) configure_event, NULL); gtk_signal_connect (GTK_OBJECT (drawing_area), "motion_notify_event", (GtkSignalFunc) motion_notify_event, NULL); gtk_signal_connect (GTK_OBJECT (drawing_area), "button_press_event", (GtkSignalFunc) button_press_event, NULL); gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK); </verb></tscreen> We'll save the "expose_event" and "configure_event" handlers for later. The "motion_notify_event" and "button_press_event" handlers are pretty simple: <tscreen><verb> static gint button_press_event (GtkWidget *widget, GdkEventButton *event) { if (event->button == 1 && pixmap != NULL) draw_brush (widget, event->x, event->y); return TRUE; } static gint motion_notify_event (GtkWidget *widget, GdkEventMotion *event) { int x, y; GdkModifierType state; if (event->is_hint) gdk_window_get_pointer (event->window, &x, &y, &state); else { x = event->x; y = event->y; state = event->state; } if (state & GDK_BUTTON1_MASK && pixmap != NULL) draw_brush (widget, x, y); return TRUE; } </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1> The DrawingArea Widget, And Drawing <p> We now turn to the process of drawing on the screen. The widget we use for this is the DrawingArea widget. A drawing area widget is essentially an X window and nothing more. It is a blank canvas in which we can draw whatever we like. A drawing area is created using the call: <tscreen><verb> GtkWidget* gtk_drawing_area_new (void); </verb></tscreen> A default size for the widget can be specified by calling: <tscreen><verb> void gtk_drawing_area_size (GtkDrawingArea *darea, gint width, gint height); </verb></tscreen> This default size can be overridden, as is true for all widgets, by calling <tt>gtk_widget_set_usize()</tt>, and that, in turn, can be overridden if the user manually resizes the the window containing the drawing area. It should be noted that when we create a DrawingArea widget, we are <em>completely</em> responsible for drawing the contents. If our window is obscured then uncovered, we get an exposure event and must redraw what was previously hidden. Having to remember everything that was drawn on the screen so we can properly redraw it can, to say the least, be a nuisance. In addition, it can be visually distracting if portions of the window are cleared, then redrawn step by step. The solution to this problem is to use an offscreen <em>backing pixmap</em>. Instead of drawing directly to the screen, we draw to an image stored in server memory but not displayed, then when the image changes or new portions of the image are displayed, we copy the relevant portions onto the screen. To create an offscreen pixmap, we call the function: <tscreen><verb> GdkPixmap* gdk_pixmap_new (GdkWindow *window, gint width, gint height, gint depth); </verb></tscreen> The <tt>window</tt> parameter specifies a GDK window that this pixmap takes some of its properties from. <tt>width</tt> and <tt>height</tt> specify the size of the pixmap. <tt>depth</tt> specifies the <em>color depth</em>, that is the number of bits per pixel, for the new window. If the depth is specified as <tt>-1</tt>, it will match the depth of <tt>window</tt>. We create the pixmap in our "configure_event" handler. This event is generated whenever the window changes size, including when it is originally created. <tscreen><verb> /* Backing pixmap for drawing area */ static GdkPixmap *pixmap = NULL; /* Create a new backing pixmap of the appropriate size */ static gint configure_event (GtkWidget *widget, GdkEventConfigure *event) { if (pixmap) gdk_pixmap_unref(pixmap); pixmap = gdk_pixmap_new(widget->window, widget->allocation.width, widget->allocation.height, -1); gdk_draw_rectangle (pixmap, widget->style->white_gc, TRUE, 0, 0, widget->allocation.width, widget->allocation.height); return TRUE; } </verb></tscreen> The call to <tt>gdk_draw_rectangle()</tt> clears the pixmap initially to white. We'll say more about that in a moment. Our exposure event handler then simply copies the relevant portion of the pixmap onto the screen (we determine the area we need to redraw by using the event->area field of the exposure event): <tscreen><verb> /* Redraw the screen from the backing pixmap */ static gint expose_event (GtkWidget *widget, GdkEventExpose *event) { gdk_draw_pixmap(widget->window, widget->style->fg_gc[GTK_WIDGET_STATE (widget)], pixmap, event->area.x, event->area.y, event->area.x, event->area.y, event->area.width, event->area.height); return FALSE; } </verb></tscreen> We've now seen how to keep the screen up to date with our pixmap, but how do we actually draw interesting stuff on our pixmap? There are a large number of calls in GTK's GDK library for drawing on <em>drawables</em>. A drawable is simply something that can be drawn upon. It can be a window, a pixmap, or a bitmap (a black and white image). We've already seen two such calls above, <tt>gdk_draw_rectangle()</tt> and <tt>gdk_draw_pixmap()</tt>. The complete list is: <tscreen><verb> gdk_draw_line () gdk_draw_rectangle () gdk_draw_arc () gdk_draw_polygon () gdk_draw_string () gdk_draw_text () gdk_draw_pixmap () gdk_draw_bitmap () gdk_draw_image () gdk_draw_points () gdk_draw_segments () </verb></tscreen> See the reference documentation or the header file <tt><gdk/gdk.h></tt> for further details on these functions. These functions all share the same first two arguments. The first argument is the drawable to draw upon, the second argument is a <em>graphics context</em> (GC). A graphics context encapsulates information about things such as foreground and background color and line width. GDK has a full set of functions for creating and modifying graphics contexts, but to keep things simple we'll just use predefined graphics contexts. Each widget has an associated style. (Which can be modified in a gtkrc file, see the section GTK's rc file.) This, among other things, stores a number of graphics contexts. Some examples of accessing these graphics contexts are: <tscreen><verb> widget->style->white_gc widget->style->black_gc widget->style->fg_gc[GTK_STATE_NORMAL] widget->style->bg_gc[GTK_WIDGET_STATE(widget)] </verb></tscreen> The fields <tt>fg_gc</tt>, <tt>bg_gc</tt>, <tt>dark_gc</tt>, and <tt>light_gc</tt> are indexed by a parameter of type <tt>GtkStateType</tt> which can take on the values: <tscreen><verb> GTK_STATE_NORMAL, GTK_STATE_ACTIVE, GTK_STATE_PRELIGHT, GTK_STATE_SELECTED, GTK_STATE_INSENSITIVE </verb></tscreen> For instance, for <tt/GTK_STATE_SELECTED/ the default foreground color is white and the default background color, dark blue. Our function <tt>draw_brush()</tt>, which does the actual drawing on the screen, is then: <tscreen><verb> /* Draw a rectangle on the screen */ static void draw_brush (GtkWidget *widget, gdouble x, gdouble y) { GdkRectangle update_rect; update_rect.x = x - 5; update_rect.y = y - 5; update_rect.width = 10; update_rect.height = 10; gdk_draw_rectangle (pixmap, widget->style->black_gc, TRUE, update_rect.x, update_rect.y, update_rect.width, update_rect.height); gtk_widget_draw (widget, &update_rect); } </verb></tscreen> After we draw the rectangle representing the brush onto the pixmap, we call the function: <tscreen><verb> void gtk_widget_draw (GtkWidget *widget, GdkRectangle *area); </verb></tscreen> which notifies X that the area given by the <tt>area</tt> parameter needs to be updated. X will eventually generate an expose event (possibly combining the areas passed in several calls to <tt>gtk_widget_draw()</tt>) which will cause our expose event handler to copy the relevant portions to the screen. We have now covered the entire drawing program except for a few mundane details like creating the main window. <!-- ----------------------------------------------------------------- --> <sect1> Adding XInput support <p> It is now possible to buy quite inexpensive input devices such as drawing tablets, which allow drawing with a much greater ease of artistic expression than does a mouse. The simplest way to use such devices is simply as a replacement for the mouse, but that misses out many of the advantages of these devices, such as: <itemize> <item> Pressure sensitivity <item> Tilt reporting <item> Sub-pixel positioning <item> Multiple inputs (for example, a stylus with a point and eraser) </itemize> For information about the XInput extension, see the <htmlurl url="http://www.msc.cornell.edu/~otaylor/xinput/XInput-HOWTO.html" name="XInput-HOWTO">. If we examine the full definition of, for example, the GdkEventMotion structure, we see that it has fields to support extended device information. <tscreen><verb> struct _GdkEventMotion { GdkEventType type; GdkWindow *window; guint32 time; gdouble x; gdouble y; gdouble pressure; gdouble xtilt; gdouble ytilt; guint state; gint16 is_hint; GdkInputSource source; guint32 deviceid; }; </verb></tscreen> <tt/pressure/ gives the pressure as a floating point number between 0 and 1. <tt/xtilt/ and <tt/ytilt/ can take on values between -1 and 1, corresponding to the degree of tilt in each direction. <tt/source/ and <tt/deviceid/ specify the device for which the event occurred in two different ways. <tt/source/ gives some simple information about the type of device. It can take the enumeration values: <tscreen><verb> GDK_SOURCE_MOUSE GDK_SOURCE_PEN GDK_SOURCE_ERASER GDK_SOURCE_CURSOR </verb></tscreen> <tt/deviceid/ specifies a unique numeric ID for the device. This can be used to find out further information about the device using the <tt/gdk_input_list_devices()/ call (see below). The special value <tt/GDK_CORE_POINTER/ is used for the core pointer device. (Usually the mouse.) <sect2> Enabling extended device information <p> To let GTK know about our interest in the extended device information, we merely have to add a single line to our program: <tscreen><verb> gtk_widget_set_extension_events (drawing_area, GDK_EXTENSION_EVENTS_CURSOR); </verb></tscreen> By giving the value <tt/GDK_EXTENSION_EVENTS_CURSOR/ we say that we are interested in extension events, but only if we don't have to draw our own cursor. See the section <ref id="sec_Further_Sophistications" name="Further Sophistications"> below for more information about drawing the cursor. We could also give the values <tt/GDK_EXTENSION_EVENTS_ALL/ if we were willing to draw our own cursor, or <tt/GDK_EXTENSION_EVENTS_NONE/ to revert back to the default condition. This is not completely the end of the story however. By default, no extension devices are enabled. We need a mechanism to allow users to enable and configure their extension devices. GTK provides the InputDialog widget to automate this process. The following procedure manages an InputDialog widget. It creates the dialog if it isn't present, and raises it to the top otherwise. <tscreen><verb> void input_dialog_destroy (GtkWidget *w, gpointer data) { *((GtkWidget **)data) = NULL; } void create_input_dialog () { static GtkWidget *inputd = NULL; if (!inputd) { inputd = gtk_input_dialog_new(); gtk_signal_connect (GTK_OBJECT(inputd), "destroy", (GtkSignalFunc)input_dialog_destroy, &inputd); gtk_signal_connect_object (GTK_OBJECT(GTK_INPUT_DIALOG(inputd)->close_button), "clicked", (GtkSignalFunc)gtk_widget_hide, GTK_OBJECT(inputd)); gtk_widget_hide ( GTK_INPUT_DIALOG(inputd)->save_button); gtk_widget_show (inputd); } else { if (!GTK_WIDGET_MAPPED(inputd)) gtk_widget_show(inputd); else gdk_window_raise(inputd->window); } } </verb></tscreen> (You might want to take note of the way we handle this dialog. By connecting to the "destroy" signal, we make sure that we don't keep a pointer to dialog around after it is destroyed - that could lead to a segfault.) The InputDialog has two buttons "Close" and "Save", which by default have no actions assigned to them. In the above function we make "Close" hide the dialog, hide the "Save" button, since we don't implement saving of XInput options in this program. <sect2> Using extended device information <p> Once we've enabled the device, we can just use the extended device information in the extra fields of the event structures. In fact, it is always safe to use this information since these fields will have reasonable default values even when extended events are not enabled. Once change we do have to make is to call <tt/gdk_input_window_get_pointer()/ instead of <tt/gdk_window_get_pointer/. This is necessary because <tt/gdk_window_get_pointer/ doesn't return the extended device information. <tscreen><verb> void gdk_input_window_get_pointer( GdkWindow *window, guint32 deviceid, gdouble *x, gdouble *y, gdouble *pressure, gdouble *xtilt, gdouble *ytilt, GdkModifierType *mask); </verb></tscreen> When calling this function, we need to specify the device ID as well as the window. Usually, we'll get the device ID from the <tt/deviceid/ field of an event structure. Again, this function will return reasonable values when extension events are not enabled. (In this case, <tt/event->deviceid/ will have the value <tt/GDK_CORE_POINTER/). So the basic structure of our button-press and motion event handlers doesn't change much - we just need to add code to deal with the extended information. <tscreen><verb> static gint button_press_event (GtkWidget *widget, GdkEventButton *event) { print_button_press (event->deviceid); if (event->button == 1 && pixmap != NULL) draw_brush (widget, event->source, event->x, event->y, event->pressure); return TRUE; } static gint motion_notify_event (GtkWidget *widget, GdkEventMotion *event) { gdouble x, y; gdouble pressure; GdkModifierType state; if (event->is_hint) gdk_input_window_get_pointer (event->window, event->deviceid, &x, &y, &pressure, NULL, NULL, &state); else { x = event->x; y = event->y; pressure = event->pressure; state = event->state; } if (state & GDK_BUTTON1_MASK && pixmap != NULL) draw_brush (widget, event->source, x, y, pressure); return TRUE; } </verb></tscreen> We also need to do something with the new information. Our new <tt/draw_brush()/ function draws with a different color for each <tt/event->source/ and changes the brush size depending on the pressure. <tscreen><verb> /* Draw a rectangle on the screen, size depending on pressure, and color on the type of device */ static void draw_brush (GtkWidget *widget, GdkInputSource source, gdouble x, gdouble y, gdouble pressure) { GdkGC *gc; GdkRectangle update_rect; switch (source) { case GDK_SOURCE_MOUSE: gc = widget->style->dark_gc[GTK_WIDGET_STATE (widget)]; break; case GDK_SOURCE_PEN: gc = widget->style->black_gc; break; case GDK_SOURCE_ERASER: gc = widget->style->white_gc; break; default: gc = widget->style->light_gc[GTK_WIDGET_STATE (widget)]; } update_rect.x = x - 10 * pressure; update_rect.y = y - 10 * pressure; update_rect.width = 20 * pressure; update_rect.height = 20 * pressure; gdk_draw_rectangle (pixmap, gc, TRUE, update_rect.x, update_rect.y, update_rect.width, update_rect.height); gtk_widget_draw (widget, &update_rect); } </verb></tscreen> <sect2> Finding out more about a device <p> As an example of how to find out more about a device, our program will print the name of the device that generates each button press. To find out the name of a device, we call the function: <tscreen><verb> GList *gdk_input_list_devices (void); </verb></tscreen> which returns a GList (a linked list type from the GLib library) of GdkDeviceInfo structures. The GdkDeviceInfo structure is defined as: <tscreen><verb> struct _GdkDeviceInfo { guint32 deviceid; gchar *name; GdkInputSource source; GdkInputMode mode; gint has_cursor; gint num_axes; GdkAxisUse *axes; gint num_keys; GdkDeviceKey *keys; }; </verb></tscreen> Most of these fields are configuration information that you can ignore unless you are implementing XInput configuration saving. The fieldwe are interested in here is <tt/name/ which is simply the name that X assigns to the device. The other field that isn't configuration information is <tt/has_cursor/. If <tt/has_cursor/ is false, then we we need to draw our own cursor. But since we've specified <tt/GDK_EXTENSION_EVENTS_CURSOR/, we don't have to worry about this. Our <tt/print_button_press()/ function simply iterates through the returned list until it finds a match, then prints out the name of the device. <tscreen><verb> static void print_button_press (guint32 deviceid) { GList *tmp_list; /* gdk_input_list_devices returns an internal list, so we shouldn't free it afterwards */ tmp_list = gdk_input_list_devices(); while (tmp_list) { GdkDeviceInfo *info = (GdkDeviceInfo *)tmp_list->data; if (info->deviceid == deviceid) { printf("Button press on device '%s'\n", info->name); return; } tmp_list = tmp_list->next; } } </verb></tscreen> That completes the changes to "XInputize" our program. <sect2> Further sophistications <label id="sec_Further_Sophistications"> <p> Although our program now supports XInput quite well, it lacks some features we would want in a full-featured application. First, the user probably doesn't want to have to configure their device each time they run the program, so we should allow them to save the device configuration. This is done by iterating through the return of <tt/gdk_input_list_devices()/ and writing out the configuration to a file. To restore the state next time the program is run, GDK provides functions to change device configuration: <tscreen><verb> gdk_input_set_extension_events() gdk_input_set_source() gdk_input_set_mode() gdk_input_set_axes() gdk_input_set_key() </verb></tscreen> (The list returned from <tt/gdk_input_list_devices()/ should not be modified directly.) An example of doing this can be found in the drawing program gsumi. (Available from <htmlurl url="http://www.msc.cornell.edu/~otaylor/gsumi/" name="http://www.msc.cornell.edu/~otaylor/gsumi/">) Eventually, it would be nice to have a standard way of doing this for all applications. This probably belongs at a slightly higher level than GTK, perhaps in the GNOME library. Another major omission that we have mentioned above is the lack of cursor drawing. Platforms other than XFree86 currently do not allow simultaneously using a device as both the core pointer and directly by an application. See the <url url="http://www.msc.cornell.edu/~otaylor/xinput/XInput-HOWTO.html" name="XInput-HOWTO"> for more information about this. This means that applications that want to support the widest audience need to draw their own cursor. An application that draws its own cursor needs to do two things: determine if the current device needs a cursor drawn or not, and determine if the current device is in proximity. (If the current device is a drawing tablet, it's a nice touch to make the cursor disappear when the stylus is lifted from the tablet. When the device is touching the stylus, that is called "in proximity.") The first is done by searching the device list, as we did to find out the device name. The second is achieved by selecting "proximity_out" events. An example of drawing one's own cursor is found in the "testinput" program found in the GTK distribution. <!-- ***************************************************************** --> <sect>Tips For Writing GTK Applications <!-- ***************************************************************** --> <p> This section is simply a gathering of wisdom, general style guidelines and hints to creating good GTK applications. Currently this section is very short, but I hope it will get longer in future editions of this tutorial. Use GNU autoconf and automake! They are your friends :) Automake examines C files, determines how they depend on each other, and generates a Makefile so the files can be compiled in the correct order. Autoconf permits automatic configuration of software installation, handling a large number of system quirks to increase portability. I am planning to make a quick intro on them here. When writing C code, use only C comments (beginning with "/*" and ending with "*/"), and don't use C++-style comments ("//"). Although many C compilers understand C++ comments, others don't, and the ANSI C standard does not require that C++-style comments be processed as comments. <!-- ***************************************************************** --> <sect>Contributing <label id="sec_Contributing"> <!-- ***************************************************************** --> <p> This document, like so much other great software out there, was created for free by volunteers. If you are at all knowledgeable about any aspect of GTK that does not already have documentation, please consider contributing to this document. If you do decide to contribute, please mail your text to Tony Gale, <tt><htmlurl url="mailto:gale@gtk.org" name="gale@gtk.org"></tt>. Also, be aware that the entirety of this document is free, and any addition by you provide must also be free. That is, people may use any portion of your examples in their programs, and copies of this document may be distributed at will, etc. Thank you. <!-- ***************************************************************** --> <sect>Credits <!-- ***************************************************************** --> <p> We would like to thank the following for their contributions to this text. <itemize> <item>Bawer Dagdeviren, <tt><htmlurl url="mailto:chamele0n@geocities.com" name="chamele0n@geocities.com"></tt> for the menus tutorial. <item>Raph Levien, <tt><htmlurl url="mailto:raph@acm.org" name="raph@acm.org"></tt> for hello world ala GTK, widget packing, and general all around wisdom. He's also generously donated a home for this tutorial. <item>Peter Mattis, <tt><htmlurl url="mailto:petm@xcf.berkeley.edu" name="petm@xcf.berkeley.edu"></tt> for the simplest GTK program.. and the ability to make it :) <item>Werner Koch <tt><htmlurl url="mailto:werner.koch@guug.de" name="werner.koch@guug.de"></tt> for converting the original plain text to SGML, and the widget class hierarchy. <item>Mark Crichton <tt><htmlurl url="mailto:crichton@expert.cc.purdue.edu" name="crichton@expert.cc.purdue.edu"></tt> for the menu factory code, and the table packing tutorial. <item>Owen Taylor <tt><htmlurl url="mailto:owt1@cornell.edu" name="owt1@cornell.edu"></tt> for the EventBox widget section (and the patch to the distro). He's also responsible for the selections code and tutorial, as well as the sections on writing your own GTK widgets, and the example application. Thanks a lot Owen for all you help! <item>Mark VanderBoom <tt><htmlurl url="mailto:mvboom42@calvin.edu" name="mvboom42@calvin.edu"></tt> for his wonderful work on the Notebook, Progress Bar, Dialogs, and File selection widgets. Thanks a lot Mark! You've been a great help. <item>Tim Janik <tt><htmlurl url="mailto:timj@gtk.org" name="timj@gtk.org"></tt> for his great job on the Lists Widget. His excellent work on automatically extracting the widget tree and signal information from GTK. Thanks Tim :) <item>Rajat Datta <tt><htmlurl url="mailto:rajat@ix.netcom.com" name="rajat@ix.netcom.com"</tt> for the excellent job on the Pixmap tutorial. <item>Michael K. Johnson <tt><htmlurl url="mailto:johnsonm@redhat.com" name="johnsonm@redhat.com"></tt> for info and code for popup menus. <item>David Huggins-Daines <tt><htmlurl url="mailto:bn711@freenet.carleton.ca" name="bn711@freenet.carleton.ca"></tt> for the Range Widgets and Tree Widget sections. <item>Stefan Mars <tt><htmlurl url="mailto:mars@lysator.liu.se" name="mars@lysator.liu.se"></tt> for the CList section. <item>David A. Wheeler <tt><htmlurl url="mailto:dwheeler@ida.org" name="dwheeler@ida.org"></tt> for portions of the text on GLib and various tutorial fixups and improvements. The GLib text was in turn based on material developed by Damon Chaplin <tt><htmlurl url="mailto:DAChaplin@msn.com" name="DAChaplin@msn.com"></tt> <item>David King for style checking the entire document. </itemize> And to all of you who commented on and helped refine this document. Thanks. <!-- ***************************************************************** --> <sect> Tutorial Copyright and Permissions Notice <!-- ***************************************************************** --> <p> The GTK Tutorial is Copyright (C) 1997 Ian Main. Copyright (C) 1998-1999 Tony Gale. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this document under the conditions for verbatim copying, provided that this copyright notice is included exactly as in the original, and that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. <P>Permission is granted to copy and distribute translations of this document into another language, under the above conditions for modified versions. If you are intending to incorporate this document into a published work, please contact the maintainer, and we will make an effort to ensure that you have the most up to date information available. There is no guarantee that this document lives up to its intended purpose. This is simply provided as a free resource. As such, the authors and maintainers of the information provided within can not make any guarantee that the information is even accurate. <!-- ***************************************************************** --> <appendix> <!-- ***************************************************************** --> <!-- ***************************************************************** --> <sect> GTK Signals <label id="sec_GTK_Signals"> <!-- ***************************************************************** --> <p> As GTK is an object oriented widget set, it has a hierarchy of inheritance. This inheritance mechanism applies for signals. Therefore, you should refer to the widget hierarchy tree when using the signals listed in this section. <!-- ----------------------------------------------------------------- --> <sect1>GtkObject <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkObject::destroy (GtkObject *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkWidget <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkWidget::show (GtkWidget *, gpointer); void GtkWidget::hide (GtkWidget *, gpointer); void GtkWidget::map (GtkWidget *, gpointer); void GtkWidget::unmap (GtkWidget *, gpointer); void GtkWidget::realize (GtkWidget *, gpointer); void GtkWidget::unrealize (GtkWidget *, gpointer); void GtkWidget::draw (GtkWidget *, ggpointer, gpointer); void GtkWidget::draw-focus (GtkWidget *, gpointer); void GtkWidget::draw-default (GtkWidget *, gpointer); void GtkWidget::size-request (GtkWidget *, ggpointer, gpointer); void GtkWidget::size-allocate (GtkWidget *, ggpointer, gpointer); void GtkWidget::state-changed (GtkWidget *, GtkStateType, gpointer); void GtkWidget::parent-set (GtkWidget *, GtkObject *, gpointer); void GtkWidget::style-set (GtkWidget *, GtkStyle *, gpointer); void GtkWidget::add-accelerator (GtkWidget *, gguint, GtkAccelGroup *, gguint, GdkModifierType, GtkAccelFlags, gpointer); void GtkWidget::remove-accelerator (GtkWidget *, GtkAccelGroup *, gguint, GdkModifierType, gpointer); gboolean GtkWidget::event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::button-press-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::button-release-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::motion-notify-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::delete-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::destroy-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::expose-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::key-press-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::key-release-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::enter-notify-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::leave-notify-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::configure-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::focus-in-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::focus-out-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::map-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::unmap-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::property-notify-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::selection-clear-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::selection-request-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::selection-notify-event (GtkWidget *, GdkEvent *, gpointer); void GtkWidget::selection-get (GtkWidget *, GtkSelectionData *, gguint, gpointer); void GtkWidget::selection-received (GtkWidget *, GtkSelectionData *, gguint, gpointer); gboolean GtkWidget::proximity-in-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::proximity-out-event (GtkWidget *, GdkEvent *, gpointer); void GtkWidget::drag-begin (GtkWidget *, GdkDragContext *, gpointer); void GtkWidget::drag-end (GtkWidget *, GdkDragContext *, gpointer); void GtkWidget::drag-data-delete (GtkWidget *, GdkDragContext *, gpointer); void GtkWidget::drag-leave (GtkWidget *, GdkDragContext *, gguint, gpointer); gboolean GtkWidget::drag-motion (GtkWidget *, GdkDragContext *, ggint, ggint, gguint, gpointer); gboolean GtkWidget::drag-drop (GtkWidget *, GdkDragContext *, ggint, ggint, gguint, gpointer); void GtkWidget::drag-data-get (GtkWidget *, GdkDragContext *, GtkSelectionData *, gguint, gguint, gpointer); void GtkWidget::drag-data-received (GtkWidget *, GdkDragContext *, ggint, ggint, GtkSelectionData *, gguint, gguint, gpointer); gboolean GtkWidget::client-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::no-expose-event (GtkWidget *, GdkEvent *, gpointer); gboolean GtkWidget::visibility-notify-event (GtkWidget *, GdkEvent *, gpointer); void GtkWidget::debug-msg (GtkWidget *, GtkString *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkData <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkData::disconnect (GtkData *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkContainer <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkContainer::add (GtkContainer *, GtkWidget *, gpointer); void GtkContainer::remove (GtkContainer *, GtkWidget *, gpointer); void GtkContainer::check-resize (GtkContainer *, gpointer); GtkDirectionType GtkContainer::focus (GtkContainer *, GtkDirectionType, gpointer); void GtkContainer::set-focus-child (GtkContainer *, GtkWidget *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkCalendar <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkCalendar::month-changed (GtkCalendar *, gpointer); void GtkCalendar::day-selected (GtkCalendar *, gpointer); void GtkCalendar::day-selected-double-click (GtkCalendar *, gpointer); void GtkCalendar::prev-month (GtkCalendar *, gpointer); void GtkCalendar::next-month (GtkCalendar *, gpointer); void GtkCalendar::prev-year (GtkCalendar *, gpointer); void GtkCalendar::next-year (GtkCalendar *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkEditable <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkEditable::changed (GtkEditable *, gpointer); void GtkEditable::insert-text (GtkEditable *, GtkString *, ggint, ggpointer, gpointer); void GtkEditable::delete-text (GtkEditable *, ggint, ggint, gpointer); void GtkEditable::activate (GtkEditable *, gpointer); void GtkEditable::set-editable (GtkEditable *, gboolean, gpointer); void GtkEditable::move-cursor (GtkEditable *, ggint, ggint, gpointer); void GtkEditable::move-word (GtkEditable *, ggint, gpointer); void GtkEditable::move-page (GtkEditable *, ggint, ggint, gpointer); void GtkEditable::move-to-row (GtkEditable *, ggint, gpointer); void GtkEditable::move-to-column (GtkEditable *, ggint, gpointer); void GtkEditable::kill-char (GtkEditable *, ggint, gpointer); void GtkEditable::kill-word (GtkEditable *, ggint, gpointer); void GtkEditable::kill-line (GtkEditable *, ggint, gpointer); void GtkEditable::cut-clipboard (GtkEditable *, gpointer); void GtkEditable::copy-clipboard (GtkEditable *, gpointer); void GtkEditable::paste-clipboard (GtkEditable *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkTipsQuery <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkTipsQuery::start-query (GtkTipsQuery *, gpointer); void GtkTipsQuery::stop-query (GtkTipsQuery *, gpointer); void GtkTipsQuery::widget-entered (GtkTipsQuery *, GtkWidget *, GtkString *, GtkString *, gpointer); gboolean GtkTipsQuery::widget-selected (GtkTipsQuery *, GtkWidget *, GtkString *, GtkString *, GdkEvent *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkCList <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkCList::select-row (GtkCList *, ggint, ggint, GdkEvent *, gpointer); void GtkCList::unselect-row (GtkCList *, ggint, ggint, GdkEvent *, gpointer); void GtkCList::row-move (GtkCList *, ggint, ggint, gpointer); void GtkCList::click-column (GtkCList *, ggint, gpointer); void GtkCList::resize-column (GtkCList *, ggint, ggint, gpointer); void GtkCList::toggle-focus-row (GtkCList *, gpointer); void GtkCList::select-all (GtkCList *, gpointer); void GtkCList::unselect-all (GtkCList *, gpointer); void GtkCList::undo-selection (GtkCList *, gpointer); void GtkCList::start-selection (GtkCList *, gpointer); void GtkCList::end-selection (GtkCList *, gpointer); void GtkCList::toggle-add-mode (GtkCList *, gpointer); void GtkCList::extend-selection (GtkCList *, GtkScrollType, ggfloat, gboolean, gpointer); void GtkCList::scroll-vertical (GtkCList *, GtkScrollType, ggfloat, gpointer); void GtkCList::scroll-horizontal (GtkCList *, GtkScrollType, ggfloat, gpointer); void GtkCList::abort-column-resize (GtkCList *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkNotebook <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkNotebook::switch-page (GtkNotebook *, ggpointer, gguint, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkList <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkList::selection-changed (GtkList *, gpointer); void GtkList::select-child (GtkList *, GtkWidget *, gpointer); void GtkList::unselect-child (GtkList *, GtkWidget *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkMenuShell <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkMenuShell::deactivate (GtkMenuShell *, gpointer); void GtkMenuShell::selection-done (GtkMenuShell *, gpointer); void GtkMenuShell::move-current (GtkMenuShell *, GtkMenuDirectionType, gpointer); void GtkMenuShell::activate-current (GtkMenuShell *, gboolean, gpointer); void GtkMenuShell::cancel (GtkMenuShell *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkToolbar <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkToolbar::orientation-changed (GtkToolbar *, ggint, gpointer); void GtkToolbar::style-changed (GtkToolbar *, ggint, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkTree <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkTree::selection-changed (GtkTree *, gpointer); void GtkTree::select-child (GtkTree *, GtkWidget *, gpointer); void GtkTree::unselect-child (GtkTree *, GtkWidget *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkButton <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkButton::pressed (GtkButton *, gpointer); void GtkButton::released (GtkButton *, gpointer); void GtkButton::clicked (GtkButton *, gpointer); void GtkButton::enter (GtkButton *, gpointer); void GtkButton::leave (GtkButton *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkItem <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkItem::select (GtkItem *, gpointer); void GtkItem::deselect (GtkItem *, gpointer); void GtkItem::toggle (GtkItem *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkWindow <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkWindow::set-focus (GtkWindow *, ggpointer, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkHandleBox <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkHandleBox::child-attached (GtkHandleBox *, GtkWidget *, gpointer); void GtkHandleBox::child-detached (GtkHandleBox *, GtkWidget *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkToggleButton <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkToggleButton::toggled (GtkToggleButton *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkMenuItem <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkMenuItem::activate (GtkMenuItem *, gpointer); void GtkMenuItem::activate-item (GtkMenuItem *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkListItem <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkListItem::toggle-focus-row (GtkListItem *, gpointer); void GtkListItem::select-all (GtkListItem *, gpointer); void GtkListItem::unselect-all (GtkListItem *, gpointer); void GtkListItem::undo-selection (GtkListItem *, gpointer); void GtkListItem::start-selection (GtkListItem *, gpointer); void GtkListItem::end-selection (GtkListItem *, gpointer); void GtkListItem::toggle-add-mode (GtkListItem *, gpointer); void GtkListItem::extend-selection (GtkListItem *, GtkEnum, ggfloat, gboolean, gpointer); void GtkListItem::scroll-vertical (GtkListItem *, GtkEnum, ggfloat, gpointer); void GtkListItem::scroll-horizontal (GtkListItem *, GtkEnum, ggfloat, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkTreeItem <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkTreeItem::collapse (GtkTreeItem *, gpointer); void GtkTreeItem::expand (GtkTreeItem *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkCheckMenuItem <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkCheckMenuItem::toggled (GtkCheckMenuItem *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkInputDialog <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkInputDialog::enable-device (GtkInputDialog *, ggint, gpointer); void GtkInputDialog::disable-device (GtkInputDialog *, ggint, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkColorSelection <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkColorSelection::color-changed (GtkColorSelection *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkStatusBar <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkStatusbar::text-pushed (GtkStatusbar *, gguint, GtkString *, gpointer); void GtkStatusbar::text-popped (GtkStatusbar *, gguint, GtkString *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkCTree <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkCTree::tree-select-row (GtkCTree *, GtkCTreeNode *, ggint, gpointer); void GtkCTree::tree-unselect-row (GtkCTree *, GtkCTreeNode *, ggint, gpointer); void GtkCTree::tree-expand (GtkCTree *, GtkCTreeNode *, gpointer); void GtkCTree::tree-collapse (GtkCTree *, ggpointer, gpointer); void GtkCTree::tree-move (GtkCTree *, GtkCTreeNode *, GtkCTreeNode *, GtkCTreeNode *, gpointer); void GtkCTree::change-focus-row-expansion (GtkCTree *, GtkCTreeExpansionType, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkCurve <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkCurve::curve-type-changed (GtkCurve *, gpointer); </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1>GtkAdjustment <!-- ----------------------------------------------------------------- --> <p> <tscreen><verb> void GtkAdjustment::changed (GtkAdjustment *, gpointer); void GtkAdjustment::value-changed (GtkAdjustment *, gpointer); </verb></tscreen> <!-- ***************************************************************** --> <sect> GDK Event Types<label id="sec_GDK_Event_Types"> <!-- ***************************************************************** --> <p> The following data types are passed into event handlers by GTK+. For each data type listed, the signals that use this data type are listed. <itemize> <item> GdkEvent <itemize> <item>drag_end_event </itemize> <item> GdkEventType <item> GdkEventAny <itemize> <item>delete_event <item>destroy_event <item>map_event <item>unmap_event <item>no_expose_event </itemize> <item> GdkEventExpose <itemize> <item>expose_event </itemize> <item> GdkEventNoExpose <item> GdkEventVisibility <item> GdkEventMotion <itemize> <item>motion_notify_event </itemize> <item> GdkEventButton <itemize> <item>button_press_event <item>button_release_event </itemize> <item> GdkEventKey <itemize> <item>key_press_event <item>key_release_event </itemize> <item> GdkEventCrossing <itemize> <item>enter_notify_event <item>leave_notify_event </itemize> <item> GdkEventFocus <itemize> <item>focus_in_event <item>focus_out_event </itemize> <item> GdkEventConfigure <itemize> <item>configure_event </itemize> <item> GdkEventProperty <itemize> <item>property_notify_event </itemize> <item> GdkEventSelection <itemize> <item>selection_clear_event <item>selection_request_event <item>selection_notify_event </itemize> <item> GdkEventProximity <itemize> <item>proximity_in_event <item>proximity_out_event </itemize> <item> GdkEventDragBegin <itemize> <item>drag_begin_event </itemize> <item> GdkEventDragRequest <itemize> <item>drag_request_event </itemize> <item> GdkEventDropEnter <itemize> <item>drop_enter_event </itemize> <item> GdkEventDropLeave <itemize> <item>drop_leave_event </itemize> <item> GdkEventDropDataAvailable <itemize> <item>drop_data_available_event </itemize> <item> GdkEventClient <itemize> <item>client_event </itemize> <item> GdkEventOther <itemize> <item>other_event </itemize> </itemize> The data type <tt/GdkEventType/ is a special data type that is used by all the other data types as an indicator of the data type being passed to the signal handler. As you will see below, each of the event data structures has a member of this type. It is defined as an enumeration type as follows: <tscreen><verb> typedef enum { GDK_NOTHING = -1, GDK_DELETE = 0, GDK_DESTROY = 1, GDK_EXPOSE = 2, GDK_MOTION_NOTIFY = 3, GDK_BUTTON_PRESS = 4, GDK_2BUTTON_PRESS = 5, GDK_3BUTTON_PRESS = 6, GDK_BUTTON_RELEASE = 7, GDK_KEY_PRESS = 8, GDK_KEY_RELEASE = 9, GDK_ENTER_NOTIFY = 10, GDK_LEAVE_NOTIFY = 11, GDK_FOCUS_CHANGE = 12, GDK_CONFIGURE = 13, GDK_MAP = 14, GDK_UNMAP = 15, GDK_PROPERTY_NOTIFY = 16, GDK_SELECTION_CLEAR = 17, GDK_SELECTION_REQUEST = 18, GDK_SELECTION_NOTIFY = 19, GDK_PROXIMITY_IN = 20, GDK_PROXIMITY_OUT = 21, GDK_DRAG_BEGIN = 22, GDK_DRAG_REQUEST = 23, GDK_DROP_ENTER = 24, GDK_DROP_LEAVE = 25, GDK_DROP_DATA_AVAIL = 26, GDK_CLIENT_EVENT = 27, GDK_VISIBILITY_NOTIFY = 28, GDK_NO_EXPOSE = 29, GDK_OTHER_EVENT = 9999 /* Deprecated, use filters instead */ } GdkEventType; </verb></tscreen> The other event type that is different from the others is <tt/GdkEvent/ itself. This is a union of all the other data types, which allows it to be cast to a specific event data type within a signal handler. <!-- Just a big list for now, needs expanding upon - TRG --> So, the event data types are defined as follows: <tscreen><verb> struct _GdkEventAny { GdkEventType type; GdkWindow *window; gint8 send_event; }; struct _GdkEventExpose { GdkEventType type; GdkWindow *window; gint8 send_event; GdkRectangle area; gint count; /* If non-zero, how many more events follow. */ }; struct _GdkEventNoExpose { GdkEventType type; GdkWindow *window; gint8 send_event; /* XXX: does anyone need the X major_code or minor_code fields? */ }; struct _GdkEventVisibility { GdkEventType type; GdkWindow *window; gint8 send_event; GdkVisibilityState state; }; struct _GdkEventMotion { GdkEventType type; GdkWindow *window; gint8 send_event; guint32 time; gdouble x; gdouble y; gdouble pressure; gdouble xtilt; gdouble ytilt; guint state; gint16 is_hint; GdkInputSource source; guint32 deviceid; gdouble x_root, y_root; }; struct _GdkEventButton { GdkEventType type; GdkWindow *window; gint8 send_event; guint32 time; gdouble x; gdouble y; gdouble pressure; gdouble xtilt; gdouble ytilt; guint state; guint button; GdkInputSource source; guint32 deviceid; gdouble x_root, y_root; }; struct _GdkEventKey { GdkEventType type; GdkWindow *window; gint8 send_event; guint32 time; guint state; guint keyval; gint length; gchar *string; }; struct _GdkEventCrossing { GdkEventType type; GdkWindow *window; gint8 send_event; GdkWindow *subwindow; GdkNotifyType detail; }; struct _GdkEventFocus { GdkEventType type; GdkWindow *window; gint8 send_event; gint16 in; }; struct _GdkEventConfigure { GdkEventType type; GdkWindow *window; gint8 send_event; gint16 x, y; gint16 width; gint16 height; }; struct _GdkEventProperty { GdkEventType type; GdkWindow *window; gint8 send_event; GdkAtom atom; guint32 time; guint state; }; struct _GdkEventSelection { GdkEventType type; GdkWindow *window; gint8 send_event; GdkAtom selection; GdkAtom target; GdkAtom property; guint32 requestor; guint32 time; }; /* This event type will be used pretty rarely. It only is important for XInput aware programs that are drawing their own cursor */ struct _GdkEventProximity { GdkEventType type; GdkWindow *window; gint8 send_event; guint32 time; GdkInputSource source; guint32 deviceid; }; struct _GdkEventDragRequest { GdkEventType type; GdkWindow *window; gint8 send_event; guint32 requestor; union { struct { guint protocol_version:4; guint sendreply:1; guint willaccept:1; guint delete_data:1; /* Do *not* delete if link is sent, only if data is sent */ guint senddata:1; guint reserved:22; } flags; glong allflags; } u; guint8 isdrop; /* This gdk event can be generated by a couple of X events - this lets the app know whether the drop really occurred or we just set the data */ GdkPoint drop_coords; gchar *data_type; guint32 timestamp; }; struct _GdkEventDragBegin { GdkEventType type; GdkWindow *window; gint8 send_event; union { struct { guint protocol_version:4; guint reserved:28; } flags; glong allflags; } u; }; struct _GdkEventDropEnter { GdkEventType type; GdkWindow *window; gint8 send_event; guint32 requestor; union { struct { guint protocol_version:4; guint sendreply:1; guint extended_typelist:1; guint reserved:26; } flags; glong allflags; } u; }; struct _GdkEventDropLeave { GdkEventType type; GdkWindow *window; gint8 send_event; guint32 requestor; union { struct { guint protocol_version:4; guint reserved:28; } flags; glong allflags; } u; }; struct _GdkEventDropDataAvailable { GdkEventType type; GdkWindow *window; gint8 send_event; guint32 requestor; union { struct { guint protocol_version:4; guint isdrop:1; guint reserved:25; } flags; glong allflags; } u; gchar *data_type; /* MIME type */ gulong data_numbytes; gpointer data; guint32 timestamp; GdkPoint coords; }; struct _GdkEventClient { GdkEventType type; GdkWindow *window; gint8 send_event; GdkAtom message_type; gushort data_format; union { char b[20]; short s[10]; long l[5]; } data; }; struct _GdkEventOther { GdkEventType type; GdkWindow *window; gint8 send_event; GdkXEvent *xevent; }; </verb></tscreen> <!-- ***************************************************************** --> <sect> Code Examples <!-- ***************************************************************** --> <p> Below are the code examples that are used in the above text which are not included in complete form elsewhere. <!-- ----------------------------------------------------------------- --> <sect1>Tictactoe <!-- ----------------------------------------------------------------- --> <sect2>tictactoe.h <p> <tscreen><verb> /* example-start tictactoe tictactoe.h */ /* GTK - The GIMP Toolkit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __TICTACTOE_H__ #define __TICTACTOE_H__ #include <gdk/gdk.h> #include <gtk/gtkvbox.h> #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define TICTACTOE(obj) GTK_CHECK_CAST (obj, tictactoe_get_type (), Tictactoe) #define TICTACTOE_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, tictactoe_get_type (), TictactoeClass) #define IS_TICTACTOE(obj) GTK_CHECK_TYPE (obj, tictactoe_get_type ()) typedef struct _Tictactoe Tictactoe; typedef struct _TictactoeClass TictactoeClass; struct _Tictactoe { GtkVBox vbox; GtkWidget *buttons[3][3]; }; struct _TictactoeClass { GtkVBoxClass parent_class; void (* tictactoe) (Tictactoe *ttt); }; guint tictactoe_get_type (void); GtkWidget* tictactoe_new (void); void tictactoe_clear (Tictactoe *ttt); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __TICTACTOE_H__ */ /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect2>tictactoe.c <p> <tscreen><verb> /* example-start tictactoe tictactoe.c */ /* GTK - The GIMP Toolkit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include "gtk/gtksignal.h" #include "gtk/gtktable.h" #include "gtk/gtktogglebutton.h" #include "tictactoe.h" enum { TICTACTOE_SIGNAL, LAST_SIGNAL }; static void tictactoe_class_init (TictactoeClass *klass); static void tictactoe_init (Tictactoe *ttt); static void tictactoe_toggle (GtkWidget *widget, Tictactoe *ttt); static gint tictactoe_signals[LAST_SIGNAL] = { 0 }; guint tictactoe_get_type () { static guint ttt_type = 0; if (!ttt_type) { GtkTypeInfo ttt_info = { "Tictactoe", sizeof (Tictactoe), sizeof (TictactoeClass), (GtkClassInitFunc) tictactoe_class_init, (GtkObjectInitFunc) tictactoe_init, (GtkArgSetFunc) NULL, (GtkArgGetFunc) NULL }; ttt_type = gtk_type_unique (gtk_vbox_get_type (), &ttt_info); } return ttt_type; } static void tictactoe_class_init (TictactoeClass *class) { GtkObjectClass *object_class; object_class = (GtkObjectClass*) class; tictactoe_signals[TICTACTOE_SIGNAL] = gtk_signal_new ("tictactoe", GTK_RUN_FIRST, object_class->type, GTK_SIGNAL_OFFSET (TictactoeClass, tictactoe), gtk_signal_default_marshaller, GTK_TYPE_NONE, 0); gtk_object_class_add_signals (object_class, tictactoe_signals, LAST_SIGNAL); class->tictactoe = NULL; } static void tictactoe_init (Tictactoe *ttt) { GtkWidget *table; gint i,j; table = gtk_table_new (3, 3, TRUE); gtk_container_add (GTK_CONTAINER(ttt), table); gtk_widget_show (table); for (i=0;i<3; i++) for (j=0;j<3; j++) { ttt->buttons[i][j] = gtk_toggle_button_new (); gtk_table_attach_defaults (GTK_TABLE(table), ttt->buttons[i][j], i, i+1, j, j+1); gtk_signal_connect (GTK_OBJECT (ttt->buttons[i][j]), "toggled", GTK_SIGNAL_FUNC (tictactoe_toggle), ttt); gtk_widget_set_usize (ttt->buttons[i][j], 20, 20); gtk_widget_show (ttt->buttons[i][j]); } } GtkWidget* tictactoe_new () { return GTK_WIDGET ( gtk_type_new (tictactoe_get_type ())); } void tictactoe_clear (Tictactoe *ttt) { int i,j; for (i=0;i<3;i++) for (j=0;j<3;j++) { gtk_signal_handler_block_by_data (GTK_OBJECT(ttt->buttons[i][j]), ttt); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ttt->buttons[i][j]), FALSE); gtk_signal_handler_unblock_by_data (GTK_OBJECT(ttt->buttons[i][j]), ttt); } } static void tictactoe_toggle (GtkWidget *widget, Tictactoe *ttt) { int i,k; static int rwins[8][3] = { { 0, 0, 0 }, { 1, 1, 1 }, { 2, 2, 2 }, { 0, 1, 2 }, { 0, 1, 2 }, { 0, 1, 2 }, { 0, 1, 2 }, { 0, 1, 2 } }; static int cwins[8][3] = { { 0, 1, 2 }, { 0, 1, 2 }, { 0, 1, 2 }, { 0, 0, 0 }, { 1, 1, 1 }, { 2, 2, 2 }, { 0, 1, 2 }, { 2, 1, 0 } }; int success, found; for (k=0; k<8; k++) { success = TRUE; found = FALSE; for (i=0;i<3;i++) { success = success && GTK_TOGGLE_BUTTON(ttt->buttons[rwins[k][i]][cwins[k][i]])->active; found = found || ttt->buttons[rwins[k][i]][cwins[k][i]] == widget; } if (success && found) { gtk_signal_emit (GTK_OBJECT (ttt), tictactoe_signals[TICTACTOE_SIGNAL]); break; } } } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect2>ttt_test.c <p> <tscreen><verb> /* example-start tictactoe ttt_test.c */ #include <gtk/gtk.h> #include "tictactoe.h" void win( GtkWidget *widget, gpointer data ) { g_print ("Yay!\n"); tictactoe_clear (TICTACTOE (widget)); } int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *ttt; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Aspect Frame"); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_exit), NULL); gtk_container_set_border_width (GTK_CONTAINER (window), 10); ttt = tictactoe_new (); gtk_container_add (GTK_CONTAINER (window), ttt); gtk_widget_show (ttt); gtk_signal_connect (GTK_OBJECT (ttt), "tictactoe", GTK_SIGNAL_FUNC (win), NULL); gtk_widget_show (window); gtk_main (); return 0; } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1> GtkDial <!-- ----------------------------------------------------------------- --> <sect2> gtkdial.h <p> <tscreen><verb> /* example-start gtkdial gtkdial.h */ /* GTK - The GIMP Toolkit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __GTK_DIAL_H__ #define __GTK_DIAL_H__ #include <gdk/gdk.h> #include <gtk/gtkadjustment.h> #include <gtk/gtkwidget.h> #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define GTK_DIAL(obj) GTK_CHECK_CAST (obj, gtk_dial_get_type (), GtkDial) #define GTK_DIAL_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_dial_get_type (), GtkDialClass) #define GTK_IS_DIAL(obj) GTK_CHECK_TYPE (obj, gtk_dial_get_type ()) typedef struct _GtkDial GtkDial; typedef struct _GtkDialClass GtkDialClass; struct _GtkDial { GtkWidget widget; /* update policy (GTK_UPDATE_[CONTINUOUS/DELAYED/DISCONTINUOUS]) */ guint policy : 2; /* Button currently pressed or 0 if none */ guint8 button; /* Dimensions of dial components */ gint radius; gint pointer_width; /* ID of update timer, or 0 if none */ guint32 timer; /* Current angle */ gfloat angle; gfloat last_angle; /* Old values from adjustment stored so we know when something changes */ gfloat old_value; gfloat old_lower; gfloat old_upper; /* The adjustment object that stores the data for this dial */ GtkAdjustment *adjustment; }; struct _GtkDialClass { GtkWidgetClass parent_class; }; GtkWidget* gtk_dial_new (GtkAdjustment *adjustment); guint gtk_dial_get_type (void); GtkAdjustment* gtk_dial_get_adjustment (GtkDial *dial); void gtk_dial_set_update_policy (GtkDial *dial, GtkUpdateType policy); void gtk_dial_set_adjustment (GtkDial *dial, GtkAdjustment *adjustment); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __GTK_DIAL_H__ */ /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect2> gtkdial.c <p> <tscreen><verb> /* example-start gtkdial gtkdial.c */ /* GTK - The GIMP Toolkit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include <math.h> #include <stdio.h> #include <gtk/gtkmain.h> #include <gtk/gtksignal.h> #include "gtkdial.h" #define SCROLL_DELAY_LENGTH 300 #define DIAL_DEFAULT_SIZE 100 /* Forward declarations */ static void gtk_dial_class_init (GtkDialClass *klass); static void gtk_dial_init (GtkDial *dial); static void gtk_dial_destroy (GtkObject *object); static void gtk_dial_realize (GtkWidget *widget); static void gtk_dial_size_request (GtkWidget *widget, GtkRequisition *requisition); static void gtk_dial_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static gint gtk_dial_expose (GtkWidget *widget, GdkEventExpose *event); static gint gtk_dial_button_press (GtkWidget *widget, GdkEventButton *event); static gint gtk_dial_button_release (GtkWidget *widget, GdkEventButton *event); static gint gtk_dial_motion_notify (GtkWidget *widget, GdkEventMotion *event); static gint gtk_dial_timer (GtkDial *dial); static void gtk_dial_update_mouse (GtkDial *dial, gint x, gint y); static void gtk_dial_update (GtkDial *dial); static void gtk_dial_adjustment_changed (GtkAdjustment *adjustment, gpointer data); static void gtk_dial_adjustment_value_changed (GtkAdjustment *adjustment, gpointer data); /* Local data */ static GtkWidgetClass *parent_class = NULL; guint gtk_dial_get_type () { static guint dial_type = 0; if (!dial_type) { GtkTypeInfo dial_info = { "GtkDial", sizeof (GtkDial), sizeof (GtkDialClass), (GtkClassInitFunc) gtk_dial_class_init, (GtkObjectInitFunc) gtk_dial_init, (GtkArgSetFunc) NULL, (GtkArgGetFunc) NULL, }; dial_type = gtk_type_unique (gtk_widget_get_type (), &dial_info); } return dial_type; } static void gtk_dial_class_init (GtkDialClass *class) { GtkObjectClass *object_class; GtkWidgetClass *widget_class; object_class = (GtkObjectClass*) class; widget_class = (GtkWidgetClass*) class; parent_class = gtk_type_class (gtk_widget_get_type ()); object_class->destroy = gtk_dial_destroy; widget_class->realize = gtk_dial_realize; widget_class->expose_event = gtk_dial_expose; widget_class->size_request = gtk_dial_size_request; widget_class->size_allocate = gtk_dial_size_allocate; widget_class->button_press_event = gtk_dial_button_press; widget_class->button_release_event = gtk_dial_button_release; widget_class->motion_notify_event = gtk_dial_motion_notify; } static void gtk_dial_init (GtkDial *dial) { dial->button = 0; dial->policy = GTK_UPDATE_CONTINUOUS; dial->timer = 0; dial->radius = 0; dial->pointer_width = 0; dial->angle = 0.0; dial->old_value = 0.0; dial->old_lower = 0.0; dial->old_upper = 0.0; dial->adjustment = NULL; } GtkWidget* gtk_dial_new (GtkAdjustment *adjustment) { GtkDial *dial; dial = gtk_type_new (gtk_dial_get_type ()); if (!adjustment) adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); gtk_dial_set_adjustment (dial, adjustment); return GTK_WIDGET (dial); } static void gtk_dial_destroy (GtkObject *object) { GtkDial *dial; g_return_if_fail (object != NULL); g_return_if_fail (GTK_IS_DIAL (object)); dial = GTK_DIAL (object); if (dial->adjustment) gtk_object_unref (GTK_OBJECT (dial->adjustment)); if (GTK_OBJECT_CLASS (parent_class)->destroy) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } GtkAdjustment* gtk_dial_get_adjustment (GtkDial *dial) { g_return_val_if_fail (dial != NULL, NULL); g_return_val_if_fail (GTK_IS_DIAL (dial), NULL); return dial->adjustment; } void gtk_dial_set_update_policy (GtkDial *dial, GtkUpdateType policy) { g_return_if_fail (dial != NULL); g_return_if_fail (GTK_IS_DIAL (dial)); dial->policy = policy; } void gtk_dial_set_adjustment (GtkDial *dial, GtkAdjustment *adjustment) { g_return_if_fail (dial != NULL); g_return_if_fail (GTK_IS_DIAL (dial)); if (dial->adjustment) { gtk_signal_disconnect_by_data (GTK_OBJECT (dial->adjustment), (gpointer) dial); gtk_object_unref (GTK_OBJECT (dial->adjustment)); } dial->adjustment = adjustment; gtk_object_ref (GTK_OBJECT (dial->adjustment)); gtk_signal_connect (GTK_OBJECT (adjustment), "changed", (GtkSignalFunc) gtk_dial_adjustment_changed, (gpointer) dial); gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed", (GtkSignalFunc) gtk_dial_adjustment_value_changed, (gpointer) dial); dial->old_value = adjustment->value; dial->old_lower = adjustment->lower; dial->old_upper = adjustment->upper; gtk_dial_update (dial); } static void gtk_dial_realize (GtkWidget *widget) { GtkDial *dial; GdkWindowAttr attributes; gint attributes_mask; g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_DIAL (widget)); GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); dial = GTK_DIAL (widget); attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; attributes.width = widget->allocation.width; attributes.height = widget->allocation.height; attributes.wclass = GDK_INPUT_OUTPUT; attributes.window_type = GDK_WINDOW_CHILD; attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK; attributes.visual = gtk_widget_get_visual (widget); attributes.colormap = gtk_widget_get_colormap (widget); attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; widget->window = gdk_window_new (widget->parent->window, &attributes, attributes_mask); widget->style = gtk_style_attach (widget->style, widget->window); gdk_window_set_user_data (widget->window, widget); gtk_style_set_background (widget->style, widget->window, GTK_STATE_ACTIVE); } static void gtk_dial_size_request (GtkWidget *widget, GtkRequisition *requisition) { requisition->width = DIAL_DEFAULT_SIZE; requisition->height = DIAL_DEFAULT_SIZE; } static void gtk_dial_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GtkDial *dial; g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_DIAL (widget)); g_return_if_fail (allocation != NULL); widget->allocation = *allocation; dial = GTK_DIAL (widget); if (GTK_WIDGET_REALIZED (widget)) { gdk_window_move_resize (widget->window, allocation->x, allocation->y, allocation->width, allocation->height); } dial->radius = MIN(allocation->width,allocation->height) * 0.45; dial->pointer_width = dial->radius / 5; } static gint gtk_dial_expose (GtkWidget *widget, GdkEventExpose *event) { GtkDial *dial; GdkPoint points[6]; gdouble s,c; gdouble theta, last, increment; GtkStyle *blankstyle; gint xc, yc; gint upper, lower; gint tick_length; gint i, inc; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GTK_IS_DIAL (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); if (event->count > 0) return FALSE; dial = GTK_DIAL (widget); /* gdk_window_clear_area (widget->window, 0, 0, widget->allocation.width, widget->allocation.height); */ xc = widget->allocation.width/2; yc = widget->allocation.height/2; upper = dial->adjustment->upper; lower = dial->adjustment->lower; /* Erase old pointer */ s = sin(dial->last_angle); c = cos(dial->last_angle); dial->last_angle = dial->angle; points[0].x = xc + s*dial->pointer_width/2; points[0].y = yc + c*dial->pointer_width/2; points[1].x = xc + c*dial->radius; points[1].y = yc - s*dial->radius; points[2].x = xc - s*dial->pointer_width/2; points[2].y = yc - c*dial->pointer_width/2; points[3].x = xc - c*dial->radius/10; points[3].y = yc + s*dial->radius/10; points[4].x = points[0].x; points[4].y = points[0].y; blankstyle = gtk_style_new (); blankstyle->bg_gc[GTK_STATE_NORMAL] = widget->style->bg_gc[GTK_STATE_NORMAL]; blankstyle->dark_gc[GTK_STATE_NORMAL] = widget->style->bg_gc[GTK_STATE_NORMAL]; blankstyle->light_gc[GTK_STATE_NORMAL] = widget->style->bg_gc[GTK_STATE_NORMAL]; blankstyle->black_gc = widget->style->bg_gc[GTK_STATE_NORMAL]; gtk_draw_polygon (blankstyle, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, points, 5, FALSE); gtk_style_unref(blankstyle); /* Draw ticks */ if ((upper - lower) == 0) return; increment = (100*M_PI)/(dial->radius*dial->radius); inc = (upper - lower); while (inc < 100) inc *=10; while (inc >= 1000) inc /=10; last = -1; for (i=0; i<=inc; i++) { theta = ((gfloat)i*M_PI/(18*inc/24.) - M_PI/6.); if ((theta - last) < (increment)) continue; last = theta; s = sin(theta); c = cos(theta); tick_length = (i%(inc/10) == 0) ? dial->pointer_width : dial->pointer_width/2; gdk_draw_line (widget->window, widget->style->fg_gc[widget->state], xc + c*(dial->radius - tick_length), yc - s*(dial->radius - tick_length), xc + c*dial->radius, yc - s*dial->radius); } /* Draw pointer */ s = sin(dial->angle); c = cos(dial->angle); dial->last_angle = dial->angle; points[0].x = xc + s*dial->pointer_width/2; points[0].y = yc + c*dial->pointer_width/2; points[1].x = xc + c*dial->radius; points[1].y = yc - s*dial->radius; points[2].x = xc - s*dial->pointer_width/2; points[2].y = yc - c*dial->pointer_width/2; points[3].x = xc - c*dial->radius/10; points[3].y = yc + s*dial->radius/10; points[4].x = points[0].x; points[4].y = points[0].y; gtk_draw_polygon (widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, points, 5, TRUE); return FALSE; } static gint gtk_dial_button_press (GtkWidget *widget, GdkEventButton *event) { GtkDial *dial; gint dx, dy; double s, c; double d_parallel; double d_perpendicular; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GTK_IS_DIAL (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); dial = GTK_DIAL (widget); /* Determine if button press was within pointer region - we do this by computing the parallel and perpendicular distance of the point where the mouse was pressed from the line passing through the pointer */ dx = event->x - widget->allocation.width / 2; dy = widget->allocation.height / 2 - event->y; s = sin(dial->angle); c = cos(dial->angle); d_parallel = s*dy + c*dx; d_perpendicular = fabs(s*dx - c*dy); if (!dial->button && (d_perpendicular < dial->pointer_width/2) && (d_parallel > - dial->pointer_width)) { gtk_grab_add (widget); dial->button = event->button; gtk_dial_update_mouse (dial, event->x, event->y); } return FALSE; } static gint gtk_dial_button_release (GtkWidget *widget, GdkEventButton *event) { GtkDial *dial; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GTK_IS_DIAL (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); dial = GTK_DIAL (widget); if (dial->button == event->button) { gtk_grab_remove (widget); dial->button = 0; if (dial->policy == GTK_UPDATE_DELAYED) gtk_timeout_remove (dial->timer); if ((dial->policy != GTK_UPDATE_CONTINUOUS) && (dial->old_value != dial->adjustment->value)) gtk_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed"); } return FALSE; } static gint gtk_dial_motion_notify (GtkWidget *widget, GdkEventMotion *event) { GtkDial *dial; GdkModifierType mods; gint x, y, mask; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GTK_IS_DIAL (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); dial = GTK_DIAL (widget); if (dial->button != 0) { x = event->x; y = event->y; if (event->is_hint || (event->window != widget->window)) gdk_window_get_pointer (widget->window, &x, &y, &mods); switch (dial->button) { case 1: mask = GDK_BUTTON1_MASK; break; case 2: mask = GDK_BUTTON2_MASK; break; case 3: mask = GDK_BUTTON3_MASK; break; default: mask = 0; break; } if (mods & mask) gtk_dial_update_mouse (dial, x,y); } return FALSE; } static gint gtk_dial_timer (GtkDial *dial) { g_return_val_if_fail (dial != NULL, FALSE); g_return_val_if_fail (GTK_IS_DIAL (dial), FALSE); if (dial->policy == GTK_UPDATE_DELAYED) gtk_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed"); return FALSE; } static void gtk_dial_update_mouse (GtkDial *dial, gint x, gint y) { gint xc, yc; gfloat old_value; g_return_if_fail (dial != NULL); g_return_if_fail (GTK_IS_DIAL (dial)); xc = GTK_WIDGET(dial)->allocation.width / 2; yc = GTK_WIDGET(dial)->allocation.height / 2; old_value = dial->adjustment->value; dial->angle = atan2(yc-y, x-xc); if (dial->angle < -M_PI/2.) dial->angle += 2*M_PI; if (dial->angle < -M_PI/6) dial->angle = -M_PI/6; if (dial->angle > 7.*M_PI/6.) dial->angle = 7.*M_PI/6.; dial->adjustment->value = dial->adjustment->lower + (7.*M_PI/6 - dial->angle) * (dial->adjustment->upper - dial->adjustment->lower) / (4.*M_PI/3.); if (dial->adjustment->value != old_value) { if (dial->policy == GTK_UPDATE_CONTINUOUS) { gtk_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed"); } else { gtk_widget_draw (GTK_WIDGET(dial), NULL); if (dial->policy == GTK_UPDATE_DELAYED) { if (dial->timer) gtk_timeout_remove (dial->timer); dial->timer = gtk_timeout_add (SCROLL_DELAY_LENGTH, (GtkFunction) gtk_dial_timer, (gpointer) dial); } } } } static void gtk_dial_update (GtkDial *dial) { gfloat new_value; g_return_if_fail (dial != NULL); g_return_if_fail (GTK_IS_DIAL (dial)); new_value = dial->adjustment->value; if (new_value < dial->adjustment->lower) new_value = dial->adjustment->lower; if (new_value > dial->adjustment->upper) new_value = dial->adjustment->upper; if (new_value != dial->adjustment->value) { dial->adjustment->value = new_value; gtk_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed"); } dial->angle = 7.*M_PI/6. - (new_value - dial->adjustment->lower) * 4.*M_PI/3. / (dial->adjustment->upper - dial->adjustment->lower); gtk_widget_draw (GTK_WIDGET(dial), NULL); } static void gtk_dial_adjustment_changed (GtkAdjustment *adjustment, gpointer data) { GtkDial *dial; g_return_if_fail (adjustment != NULL); g_return_if_fail (data != NULL); dial = GTK_DIAL (data); if ((dial->old_value != adjustment->value) || (dial->old_lower != adjustment->lower) || (dial->old_upper != adjustment->upper)) { gtk_dial_update (dial); dial->old_value = adjustment->value; dial->old_lower = adjustment->lower; dial->old_upper = adjustment->upper; } } static void gtk_dial_adjustment_value_changed (GtkAdjustment *adjustment, gpointer data) { GtkDial *dial; g_return_if_fail (adjustment != NULL); g_return_if_fail (data != NULL); dial = GTK_DIAL (data); if (dial->old_value != adjustment->value) { gtk_dial_update (dial); dial->old_value = adjustment->value; } } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect2> dial_test.c <p> <tscreen><verb> #include <stdio.h> #include <gtk/gtk.h> #include "gtkdial.h" void value_changed( GtkAdjustment *adjustment, GtkWidget *label ) { char buffer[16]; sprintf(buffer,"%4.2f",adjustment->value); gtk_label_set (GTK_LABEL (label), buffer); } int main( int argc, char *argv[]) { GtkWidget *window; GtkAdjustment *adjustment; GtkWidget *dial; GtkWidget *frame; GtkWidget *vbox; GtkWidget *label; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Dial"); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_exit), NULL); gtk_container_border_width (GTK_CONTAINER (window), 10); vbox = gtk_vbox_new (FALSE, 5); gtk_container_add (GTK_CONTAINER (window), vbox); gtk_widget_show(vbox); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (vbox), frame); gtk_widget_show (frame); adjustment = GTK_ADJUSTMENT(gtk_adjustment_new (0, 0, 100, 0.01, 0.1, 0)); dial = gtk_dial_new(adjustment); gtk_dial_set_update_policy (GTK_DIAL(dial), GTK_UPDATE_DELAYED); /* gtk_widget_set_usize (dial, 100, 100); */ gtk_container_add (GTK_CONTAINER (frame), dial); gtk_widget_show (dial); label = gtk_label_new("0.00"); gtk_box_pack_end (GTK_BOX(vbox), label, 0, 0, 0); gtk_widget_show (label); gtk_signal_connect (GTK_OBJECT(adjustment), "value_changed", GTK_SIGNAL_FUNC (value_changed), label); gtk_widget_show (window); gtk_main (); return 0; } </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1> Scribble <p> <!-- ----------------------------------------------------------------- --> <sect2> scribble-simple.c <p> <tscreen><verb> /* example-start scribble-simple scribble-simple.c */ /* GTK - The GIMP Toolkit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include <gtk/gtk.h> /* Backing pixmap for drawing area */ static GdkPixmap *pixmap = NULL; /* Create a new backing pixmap of the appropriate size */ static gint configure_event( GtkWidget *widget, GdkEventConfigure *event ) { if (pixmap) gdk_pixmap_unref(pixmap); pixmap = gdk_pixmap_new(widget->window, widget->allocation.width, widget->allocation.height, -1); gdk_draw_rectangle (pixmap, widget->style->white_gc, TRUE, 0, 0, widget->allocation.width, widget->allocation.height); return TRUE; } /* Redraw the screen from the backing pixmap */ static gint expose_event( GtkWidget *widget, GdkEventExpose *event ) { gdk_draw_pixmap(widget->window, widget->style->fg_gc[GTK_WIDGET_STATE (widget)], pixmap, event->area.x, event->area.y, event->area.x, event->area.y, event->area.width, event->area.height); return FALSE; } /* Draw a rectangle on the screen */ static void draw_brush( GtkWidget *widget, gdouble x, gdouble y) { GdkRectangle update_rect; update_rect.x = x - 5; update_rect.y = y - 5; update_rect.width = 10; update_rect.height = 10; gdk_draw_rectangle (pixmap, widget->style->black_gc, TRUE, update_rect.x, update_rect.y, update_rect.width, update_rect.height); gtk_widget_draw (widget, &update_rect); } static gint button_press_event( GtkWidget *widget, GdkEventButton *event ) { if (event->button == 1 && pixmap != NULL) draw_brush (widget, event->x, event->y); return TRUE; } static gint motion_notify_event( GtkWidget *widget, GdkEventMotion *event ) { int x, y; GdkModifierType state; if (event->is_hint) gdk_window_get_pointer (event->window, &x, &y, &state); else { x = event->x; y = event->y; state = event->state; } if (state & GDK_BUTTON1_MASK && pixmap != NULL) draw_brush (widget, x, y); return TRUE; } void quit () { gtk_exit (0); } int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *drawing_area; GtkWidget *vbox; GtkWidget *button; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_set_name (window, "Test Input"); vbox = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window), vbox); gtk_widget_show (vbox); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (quit), NULL); /* Create the drawing area */ drawing_area = gtk_drawing_area_new (); gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 200, 200); gtk_box_pack_start (GTK_BOX (vbox), drawing_area, TRUE, TRUE, 0); gtk_widget_show (drawing_area); /* Signals used to handle backing pixmap */ gtk_signal_connect (GTK_OBJECT (drawing_area), "expose_event", (GtkSignalFunc) expose_event, NULL); gtk_signal_connect (GTK_OBJECT(drawing_area),"configure_event", (GtkSignalFunc) configure_event, NULL); /* Event signals */ gtk_signal_connect (GTK_OBJECT (drawing_area), "motion_notify_event", (GtkSignalFunc) motion_notify_event, NULL); gtk_signal_connect (GTK_OBJECT (drawing_area), "button_press_event", (GtkSignalFunc) button_press_event, NULL); gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK); /* .. And a quit button */ button = gtk_button_new_with_label ("Quit"); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); gtk_widget_show (button); gtk_widget_show (window); gtk_main (); return 0; } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect2> scribble-xinput.c <p> <tscreen><verb> /* example-start scribble-xinput scribble-xinput.c */ /* GTK - The GIMP Toolkit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include <gtk/gtk.h> /* Backing pixmap for drawing area */ static GdkPixmap *pixmap = NULL; /* Create a new backing pixmap of the appropriate size */ static gint configure_event (GtkWidget *widget, GdkEventConfigure *event) { if (pixmap) gdk_pixmap_unref(pixmap); pixmap = gdk_pixmap_new(widget->window, widget->allocation.width, widget->allocation.height, -1); gdk_draw_rectangle (pixmap, widget->style->white_gc, TRUE, 0, 0, widget->allocation.width, widget->allocation.height); return TRUE; } /* Redraw the screen from the backing pixmap */ static gint expose_event (GtkWidget *widget, GdkEventExpose *event) { gdk_draw_pixmap(widget->window, widget->style->fg_gc[GTK_WIDGET_STATE (widget)], pixmap, event->area.x, event->area.y, event->area.x, event->area.y, event->area.width, event->area.height); return FALSE; } /* Draw a rectangle on the screen, size depending on pressure, and color on the type of device */ static void draw_brush (GtkWidget *widget, GdkInputSource source, gdouble x, gdouble y, gdouble pressure) { GdkGC *gc; GdkRectangle update_rect; switch (source) { case GDK_SOURCE_MOUSE: gc = widget->style->dark_gc[GTK_WIDGET_STATE (widget)]; break; case GDK_SOURCE_PEN: gc = widget->style->black_gc; break; case GDK_SOURCE_ERASER: gc = widget->style->white_gc; break; default: gc = widget->style->light_gc[GTK_WIDGET_STATE (widget)]; } update_rect.x = x - 10 * pressure; update_rect.y = y - 10 * pressure; update_rect.width = 20 * pressure; update_rect.height = 20 * pressure; gdk_draw_rectangle (pixmap, gc, TRUE, update_rect.x, update_rect.y, update_rect.width, update_rect.height); gtk_widget_draw (widget, &update_rect); } static void print_button_press (guint32 deviceid) { GList *tmp_list; /* gdk_input_list_devices returns an internal list, so we shouldn't free it afterwards */ tmp_list = gdk_input_list_devices(); while (tmp_list) { GdkDeviceInfo *info = (GdkDeviceInfo *)tmp_list->data; if (info->deviceid == deviceid) { g_print("Button press on device '%s'\n", info->name); return; } tmp_list = tmp_list->next; } } static gint button_press_event (GtkWidget *widget, GdkEventButton *event) { print_button_press (event->deviceid); if (event->button == 1 && pixmap != NULL) draw_brush (widget, event->source, event->x, event->y, event->pressure); return TRUE; } static gint motion_notify_event (GtkWidget *widget, GdkEventMotion *event) { gdouble x, y; gdouble pressure; GdkModifierType state; if (event->is_hint) gdk_input_window_get_pointer (event->window, event->deviceid, &x, &y, &pressure, NULL, NULL, &state); else { x = event->x; y = event->y; pressure = event->pressure; state = event->state; } if (state & GDK_BUTTON1_MASK && pixmap != NULL) draw_brush (widget, event->source, x, y, pressure); return TRUE; } void input_dialog_destroy (GtkWidget *w, gpointer data) { *((GtkWidget **)data) = NULL; } void create_input_dialog () { static GtkWidget *inputd = NULL; if (!inputd) { inputd = gtk_input_dialog_new(); gtk_signal_connect (GTK_OBJECT(inputd), "destroy", (GtkSignalFunc)input_dialog_destroy, &inputd); gtk_signal_connect_object (GTK_OBJECT(GTK_INPUT_DIALOG(inputd)->close_button), "clicked", (GtkSignalFunc)gtk_widget_hide, GTK_OBJECT(inputd)); gtk_widget_hide ( GTK_INPUT_DIALOG(inputd)->save_button); gtk_widget_show (inputd); } else { if (!GTK_WIDGET_MAPPED(inputd)) gtk_widget_show(inputd); else gdk_window_raise(inputd->window); } } void quit () { gtk_exit (0); } int main (int argc, char *argv[]) { GtkWidget *window; GtkWidget *drawing_area; GtkWidget *vbox; GtkWidget *button; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_set_name (window, "Test Input"); vbox = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window), vbox); gtk_widget_show (vbox); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (quit), NULL); /* Create the drawing area */ drawing_area = gtk_drawing_area_new (); gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 200, 200); gtk_box_pack_start (GTK_BOX (vbox), drawing_area, TRUE, TRUE, 0); gtk_widget_show (drawing_area); /* Signals used to handle backing pixmap */ gtk_signal_connect (GTK_OBJECT (drawing_area), "expose_event", (GtkSignalFunc) expose_event, NULL); gtk_signal_connect (GTK_OBJECT(drawing_area),"configure_event", (GtkSignalFunc) configure_event, NULL); /* Event signals */ gtk_signal_connect (GTK_OBJECT (drawing_area), "motion_notify_event", (GtkSignalFunc) motion_notify_event, NULL); gtk_signal_connect (GTK_OBJECT (drawing_area), "button_press_event", (GtkSignalFunc) button_press_event, NULL); gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK); /* The following call enables tracking and processing of extension events for the drawing area */ gtk_widget_set_extension_events (drawing_area, GDK_EXTENSION_EVENTS_CURSOR); /* .. And some buttons */ button = gtk_button_new_with_label ("Input Dialog"); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (create_input_dialog), NULL); gtk_widget_show (button); button = gtk_button_new_with_label ("Quit"); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); gtk_widget_show (button); gtk_widget_show (window); gtk_main (); return 0; } /* example-end */ </verb></tscreen> <!-- ***************************************************************** --> <sect> List Widget <!-- ***************************************************************** --> <p> NOTE: The List widget has been superseded by the CList widget. It is detailed here just for completeness. The List widget is designed to act as a vertical container for widgets that should be of the type ListItem. A List widget has its own window to receive events and its own background color which is usually white. As it is directly derived from a Container it can be treated as such by using the GTK_CONTAINER(List) macro, see the Container widget for more on this. One should already be familiar with the usage of a GList and its related functions g_list_*() to be able to use the List widget to it full extent. There is one field inside the structure definition of the List widget that will be of greater interest to us, this is: <tscreen><verb> struct _GtkList { ... GList *selection; guint selection_mode; ... }; </verb></tscreen> The selection field of a List points to a linked list of all items that are currently selected, or NULL if the selection is empty. So to learn about the current selection we read the GTK_LIST()->selection field, but do not modify it since the internal fields are maintained by the gtk_list_*() functions. The selection_mode of the List determines the selection facilities of a List and therefore the contents of the GTK_LIST()->selection field. The selection_mode may be one of the following: <itemize> <item> <tt/GTK_SELECTION_SINGLE/ - The selection is either NULL or contains a GList pointer for a single selected item. <item> <tt/GTK_SELECTION_BROWSE/ - The selection is NULL if the list contains no widgets or insensitive ones only, otherwise it contains a GList pointer for one GList structure, and therefore exactly one list item. <item> <tt/GTK_SELECTION_MULTIPLE/ - The selection is NULL if no list items are selected or a GList pointer for the first selected item. That in turn points to a GList structure for the second selected item and so on. <item> <tt/GTK_SELECTION_EXTENDED/ - The selection is always NULL. </itemize> The default is <tt/GTK_SELECTION_MULTIPLE/. <!-- ----------------------------------------------------------------- --> <sect1> Signals <p> <tscreen><verb> void selection_changed( GtkList *list ); </verb></tscreen> This signal will be invoked whenever the selection field of a List has changed. This happens when a child of thekList got selected or deselected. <tscreen><verb> void select_child( GtkList *list, GtkWidget *child); </verb></tscreen> This signal is invoked when a child of the List is about to get selected. This happens mainly on calls to gtk_list_select_item(), gtk_list_select_child(), button presses and sometimes indirectly triggered on some else occasions where children get added to or removed from the List. <tscreen><verb> void unselect_child( GtkList *list, GtkWidget *child ); </verb></tscreen> This signal is invoked when a child of the List is about to get deselected. This happens mainly on calls to gtk_list_unselect_item(), gtk_list_unselect_child(), button presses and sometimes indirectly triggered on some else occasions where children get added to or removed from the List. <!-- ----------------------------------------------------------------- --> <sect1> Functions <p> <tscreen><verb> guint gtk_list_get_type( void ); </verb></tscreen> Returns the "GtkList" type identifier. <tscreen><verb> GtkWidget *gtk_list_new( void ); </verb></tscreen> Create a new List object. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure. <tscreen><verb> void gtk_list_insert_items( GtkList *list, GList *items, gint position ); </verb></tscreen> Insert list items into the list, starting at <tt/position/. <tt/items/ is a doubly linked list where each nodes data pointer is expected to point to a newly created ListItem. The GList nodes of <tt/items/ are taken over by the list. <tscreen><verb> void gtk_list_append_items( GtkList *list, GList *items); </verb></tscreen> Insert list items just like gtk_list_insert_items() at the end of the list. The GList nodes of <tt/items/ are taken over by the list. <tscreen><verb> void gtk_list_prepend_items( GtkList *list, GList *items); </verb></tscreen> Insert list items just like gtk_list_insert_items() at the very beginning of the list. The GList nodes of <tt/items/ are taken over by the list. <tscreen><verb> void gtk_list_remove_items( GtkList *list, GList *items); </verb></tscreen> Remove list items from the list. <tt/items/ is a doubly linked list where each nodes data pointer is expected to point to a direct child of list. It is the callers responsibility to make a call to g_list_free(items) afterwards. Also the caller has to destroy the list items himself. <tscreen><verb> void gtk_list_clear_items( GtkList *list, gint start, gint end ); </verb></tscreen> Remove and destroy list items from the list. A widget is affected if its current position within the list is in the range specified by <tt/start/ and <tt/end/. <tscreen><verb> void gtk_list_select_item( GtkList *list, gint item ); </verb></tscreen> Invoke the select_child signal for a list item specified through its current position within the list. <tscreen><verb> void gtk_list_unselect_item( GtkList *list, gint item); </verb></tscreen> Invoke the unselect_child signal for a list item specified through its current position within the list. <tscreen><verb> void gtk_list_select_child( GtkList *list, GtkWidget *child); </verb></tscreen> Invoke the select_child signal for the specified child. <tscreen><verb> void gtk_list_unselect_child( GtkList *list, GtkWidget *child); </verb></tscreen> Invoke the unselect_child signal for the specified child. <tscreen><verb> gint gtk_list_child_position( GtkList *list, GtkWidget *child); </verb></tscreen> Return the position of <tt/child/ within the list. "-1" is returned on failure. <tscreen><verb> void gtk_list_set_selection_mode( GtkList *list, GtkSelectionMode mode ); </verb></tscreen> Set the selection mode MODE which can be of GTK_SELECTION_SINGLE, GTK_SELECTION_BROWSE, GTK_SELECTION_MULTIPLE or GTK_SELECTION_EXTENDED. <tscreen><verb> GtkList *GTK_LIST( gpointer obj ); </verb></tscreen> Cast a generic pointer to "GtkList *". <tscreen><verb> GtkListClass *GTK_LIST_CLASS( gpointer class); </verb></tscreen> Cast a generic pointer to "GtkListClass *". <tscreen><verb> gint GTK_IS_LIST( gpointer obj); </verb></tscreen> Determine if a generic pointer refers to a "GtkList" object. <!-- ----------------------------------------------------------------- --> <sect1> Example <p> Following is an example program that will print out the changes of the selection of a List, and lets you "arrest" list items into a prison by selecting them with the rightmost mouse button. <tscreen><verb> /* example-start list list.c */ /* Include the GTK header files * Include stdio.h, we need that for the printf() function */ #include <gtk/gtk.h> #include <stdio.h> /* This is our data identification string to store * data in list items */ const gchar *list_item_data_key="list_item_data"; /* prototypes for signal handler that we are going to connect * to the List widget */ static void sigh_print_selection( GtkWidget *gtklist, gpointer func_data); static void sigh_button_event( GtkWidget *gtklist, GdkEventButton *event, GtkWidget *frame ); /* Main function to set up the user interface */ gint main( int argc, gchar *argv[] ) { GtkWidget *separator; GtkWidget *window; GtkWidget *vbox; GtkWidget *scrolled_window; GtkWidget *frame; GtkWidget *gtklist; GtkWidget *button; GtkWidget *list_item; GList *dlist; guint i; gchar buffer[64]; /* Initialize GTK (and subsequently GDK) */ gtk_init(&argc, &argv); /* Create a window to put all the widgets in * connect gtk_main_quit() to the "destroy" event of * the window to handle window manager close-window-events */ window=gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window), "GtkList Example"); gtk_signal_connect(GTK_OBJECT(window), "destroy", GTK_SIGNAL_FUNC(gtk_main_quit), NULL); /* Inside the window we need a box to arrange the widgets * vertically */ vbox=gtk_vbox_new(FALSE, 5); gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); gtk_container_add(GTK_CONTAINER(window), vbox); gtk_widget_show(vbox); /* This is the scrolled window to put the List widget inside */ scrolled_window=gtk_scrolled_window_new(NULL, NULL); gtk_widget_set_usize(scrolled_window, 250, 150); gtk_container_add(GTK_CONTAINER(vbox), scrolled_window); gtk_widget_show(scrolled_window); /* Create thekList widget. * Connect the sigh_print_selection() signal handler * function to the "selection_changed" signal of the List * to print out the selected items each time the selection * has changed */ gtklist=gtk_list_new(); gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW(scrolled_window), gtklist); gtk_widget_show(gtklist); gtk_signal_connect(GTK_OBJECT(gtklist), "selection_changed", GTK_SIGNAL_FUNC(sigh_print_selection), NULL); /* We create a "Prison" to put a list item in ;) */ frame=gtk_frame_new("Prison"); gtk_widget_set_usize(frame, 200, 50); gtk_container_set_border_width(GTK_CONTAINER(frame), 5); gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT); gtk_container_add(GTK_CONTAINER(vbox), frame); gtk_widget_show(frame); /* Connect the sigh_button_event() signal handler to the List * which will handle the "arresting" of list items */ gtk_signal_connect(GTK_OBJECT(gtklist), "button_release_event", GTK_SIGNAL_FUNC(sigh_button_event), frame); /* Create a separator */ separator=gtk_hseparator_new(); gtk_container_add(GTK_CONTAINER(vbox), separator); gtk_widget_show(separator); /* Finally create a button and connect its "clicked" signal * to the destruction of the window */ button=gtk_button_new_with_label("Close"); gtk_container_add(GTK_CONTAINER(vbox), button); gtk_widget_show(button); gtk_signal_connect_object(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(window)); /* Now we create 5 list items, each having its own * label and add them to the List using gtk_container_add() * Also we query the text string from the label and * associate it with the list_item_data_key for each list item */ for (i=0; i<5; i++) { GtkWidget *label; gchar *string; sprintf(buffer, "ListItemContainer with Label #%d", i); label=gtk_label_new(buffer); list_item=gtk_list_item_new(); gtk_container_add(GTK_CONTAINER(list_item), label); gtk_widget_show(label); gtk_container_add(GTK_CONTAINER(gtklist), list_item); gtk_widget_show(list_item); gtk_label_get(GTK_LABEL(label), &string); gtk_object_set_data(GTK_OBJECT(list_item), list_item_data_key, string); } /* Here, we are creating another 5 labels, this time * we use gtk_list_item_new_with_label() for the creation * we can't query the text string from the label because * we don't have the labels pointer and therefore * we just associate the list_item_data_key of each * list item with the same text string. * For adding of the list items we put them all into a doubly * linked list (GList), and then add them by a single call to * gtk_list_append_items(). * Because we use g_list_prepend() to put the items into the * doubly linked list, their order will be descending (instead * of ascending when using g_list_append()) */ dlist=NULL; for (; i<10; i++) { sprintf(buffer, "List Item with Label %d", i); list_item=gtk_list_item_new_with_label(buffer); dlist=g_list_prepend(dlist, list_item); gtk_widget_show(list_item); gtk_object_set_data(GTK_OBJECT(list_item), list_item_data_key, "ListItem with integrated Label"); } gtk_list_append_items(GTK_LIST(gtklist), dlist); /* Finally we want to see the window, don't we? ;) */ gtk_widget_show(window); /* Fire up the main event loop of gtk */ gtk_main(); /* We get here after gtk_main_quit() has been called which * happens if the main window gets destroyed */ return(0); } /* This is the signal handler that got connected to button * press/release events of the List */ void sigh_button_event( GtkWidget *gtklist, GdkEventButton *event, GtkWidget *frame ) { /* We only do something if the third (rightmost mouse button * was released */ if (event->type==GDK_BUTTON_RELEASE && event->button==3) { GList *dlist, *free_list; GtkWidget *new_prisoner; /* Fetch the currently selected list item which * will be our next prisoner ;) */ dlist=GTK_LIST(gtklist)->selection; if (dlist) new_prisoner=GTK_WIDGET(dlist->data); else new_prisoner=NULL; /* Look for already imprisoned list items, we * will put them back into the list. * Remember to free the doubly linked list that * gtk_container_children() returns */ dlist=gtk_container_children(GTK_CONTAINER(frame)); free_list=dlist; while (dlist) { GtkWidget *list_item; list_item=dlist->data; gtk_widget_reparent(list_item, gtklist); dlist=dlist->next; } g_list_free(free_list); /* If we have a new prisoner, remove him from the * List and put him into the frame "Prison". * We need to unselect the item first. */ if (new_prisoner) { GList static_dlist; static_dlist.data=new_prisoner; static_dlist.next=NULL; static_dlist.prev=NULL; gtk_list_unselect_child(GTK_LIST(gtklist), new_prisoner); gtk_widget_reparent(new_prisoner, frame); } } } /* This is the signal handler that gets called if List * emits the "selection_changed" signal */ void sigh_print_selection( GtkWidget *gtklist, gpointer func_data ) { GList *dlist; /* Fetch the doubly linked list of selected items * of the List, remember to treat this as read-only! */ dlist=GTK_LIST(gtklist)->selection; /* If there are no selected items there is nothing more * to do than just telling the user so */ if (!dlist) { g_print("Selection cleared\n"); return; } /* Ok, we got a selection and so we print it */ g_print("The selection is a "); /* Get the list item from the doubly linked list * and then query the data associated with list_item_data_key. * We then just print it */ while (dlist) { GtkObject *list_item; gchar *item_data_string; list_item=GTK_OBJECT(dlist->data); item_data_string=gtk_object_get_data(list_item, list_item_data_key); g_print("%s ", item_data_string); dlist=dlist->next; } g_print("\n"); } /* example-end */ </verb></tscreen> <!-- ----------------------------------------------------------------- --> <sect1> List Item Widget <p> The ListItem widget is designed to act as a container holding up to one child, providing functions for selection/deselection just like the List widget requires them for its children. A ListItem has its own window to receive events and has its own background color which is usually white. As it is directly derived from an Item it can be treated as such by using the GTK_ITEM(ListItem) macro, see the Item widget for more on this. Usually a ListItem just holds a label to identify, e.g., a filename within a List -- therefore the convenience function gtk_list_item_new_with_label() is provided. The same effect can be achieved by creating a Label on its own, setting its alignment to xalign=0 and yalign=0.5 with a subsequent container addition to the ListItem. As one is not forced to add a GtkLabel to a GtkListItem, you could also add a GtkVBox or a GtkArrow etc. to the GtkListItem. <!-- ----------------------------------------------------------------- --> <sect1> Signals <p> AkListItem does not create new signals on its own, but inherits the signals of a Item. <!-- ----------------------------------------------------------------- --> <sect1> Functions <p> <tscreen><verb> guint gtk_list_item_get_type( void ); </verb></tscreen> Returns the "GtkListItem" type identifier. <tscreen><verb> GtkWidget *gtk_list_item_new( void ); </verb></tscreen> Create a new ListItem object. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure. <tscreen><verb> GtkWidget *gtk_list_item_new_with_label( gchar *label ); </verb></tscreen> Create a new ListItem object, having a single GtkLabel as the sole child. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure. <tscreen><verb> void gtk_list_item_select( GtkListItem *list_item ); </verb></tscreen> This function is basically a wrapper around a call to gtk_item_select (GTK_ITEM (list_item)) which will emit the select signal. *Note GtkItem::, for more info. <tscreen><verb> void gtk_list_item_deselect( GtkListItem *list_item ); </verb></tscreen> This function is basically a wrapper around a call to gtk_item_deselect (GTK_ITEM (list_item)) which will emit the deselect signal. *Note GtkItem::, for more info. <tscreen><verb> GtkListItem *GTK_LIST_ITEM( gpointer obj ); </verb></tscreen> Cast a generic pointer to "GtkListItem *". <tscreen><verb> GtkListItemClass *GTK_LIST_ITEM_CLASS( gpointer class ); </verb></tscreen> Cast a generic pointer to GtkListItemClass*. *Note Standard Macros::, for more info. <tscreen><verb> gint GTK_IS_LIST_ITEM( gpointer obj ); </verb></tscreen> Determine if a generic pointer refers to a `GtkListItem' object. *Note Standard Macros::, for more info. <!-- ----------------------------------------------------------------- --> <sect1> Example <p> Please see the List example on this, which covers the usage of a ListItem as well. </article> 0707010001bb02000081a40000000a0000000a000000013d12d39d000453ae0000008800000003000000000000000000000023ff350892reloc/doc/gtk/docs/gtk_tut_fr.sgml����<!doctype linuxdoc system> <article> <title>Didacticiel <author>Ian Main, <tt><htmlurl url="mailto:slow@intergate.bc.ca" name="slow@intergate.bc.ca"></tt> <date>January 24, 1998. <sect>Introduction <p> GTK (GIMP Toolkit) a été d'abord développé pour être une boîte à outils pour GIMP (General Image Manipulation Program). GTK est construit sur GDK (GIMP Drawing Kit) qui est, avant tout, une encapsulation des fonctions Xlib. On l'appelle « GIMP toolkit » car il fut créé pour développer GIMP, mais il est désormais utilisé dans plusieurs projets de logiciels libres. Les auteurs sont : <itemize> <item> Peter Mattis <tt><htmlurl url="mailto:petm@xcf.berkeley.edu" name="petm@xcf.berkeley.edu"></tt> <item> Spencer Kimball <tt><htmlurl url="mailto:spencer@xcf.berkeley.edu" name="spencer@xcf.berkeley.edu"></tt> <item> Josh MacDonald <tt><htmlurl url="mailto:jmacd@xcf.berkeley.edu" name="jmacd@xcf.berkeley.edu"></tt> </itemize> <p> GTK est essentiellement une interface de programmation (API) orientée objet. Bien qu'il soit entièrement écrit en C, il est implanté en utilisant la notion de classes et de fonctions de rappel (pointeurs de fonctions). <p> Un troisième composant, appelé glib, remplace certains appels standard et comporte quelques fonctions supplémentaires pour gérer les listes chaînées, etc. Les fonctions de remplacement sont utilisées pour accroître la portabilité de GTK car certaines de ces fonctions, comme g_strerror(), ne sont pas disponibles ou ne sont pas standard sur d'autres Unix. D'autres comportent des améliorations par rapport aux versions de la libc : g_malloc(), par exemple, facilite le débuggage.<p> Ce didacticiel tente de décrire du mieux possible GTK, mais il n'est pas exhaustif. Il suppose une bonne connaissance du langage C, et de la façon de créer des programmes C. Il serait très précieux au lecteur d'avoir déjà une expérience de la programmation X, mais cela n'est pas nécessaire. Si l'apprentissage de GTK marque vos débuts dans l'approche des widgets, n'hésitez pas à faire des commentaires sur ce didacticiel et sur les problèmes qu'il vous a posé. Il y a aussi une API C++ pour GTK (GTK--), si vous préférez utiliser ce langage, consultez plutôt la documentation qui la concerne. Une encapsulation en Objective C et des liaisons Guile sont également disponibles, mais ne seront pas abordées ici. <p> J'apprécierais beaucoup avoir un écho des problèmes que vous avez rencontré pour apprendre GTK à partir de ce document. De plus, toute suggestion sur son amélioration est la bienvenue. <sect>Bien débuter <p> La première chose à faire est, bien sûr, de récupérer les sources de GTK et de les installer. Vous pouvez en obtenir la dernière version sur <tt/ftp.gimp.org/ dans le répertoire <tt>/pub/gtk</tt>. D'autres sources d'informations se trouvent sur <tt>http://www.gimp.org/gtk</tt>. GTK utilise <em/autoconf/ de GNU pour se configurer. Lorsque vous l'aurez détarré, tapez <em>./configure --help</em> pour consulter la liste des options. <p> Pour commencer notre introduction à GTK, nous débuterons avec le programme le plus simple qui soit. Celui-ci créera une fenêtre de 200x200 pixels et ne pourra se terminer qu'en le tuant à partir du shell. <tscreen><verb> #include <gtk/gtk.h> int main (int argc, char *argv[]) { GtkWidget *window; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_show (window); gtk_main (); return 0; } </verb></tscreen> Tous les programmes inclueront évidemment le fichier <tt>gtk/gtk.h</tt> qui déclare les variables, fonctions, structures, etc. qui seront utilisées par votre application GTK. <p> La ligne  : <tscreen><verb> gtk_init (&argc, &argv); </verb></tscreen> appelle la fonction <em/gtk_init(gint *argc, gchar ***argv)/ qui sera appelée dans toutes les applications GTK. Cette fonction configure certaines choses pour nous, comme l'aspect visuel et les couleurs par défaut, puis appelle <em/gdk_init(gint *argc, gchar ***argv)/. Cette dernière initialise la bibliothèque pour qu'elle puisse être utilisée, configure les gestionnaires de signaux par défaut et vérifie les paramètres passés à notre application via la ligne de commande en recherchant l'un des suivants : <itemize> <item> <tt/--display/ <item> <tt/--debug-level/ <item> <tt/--no-xshm/ <item> <tt/--sync/ <item> <tt/--show-events/ <item> <tt/--no-show-events/ </itemize> <p> Elle les supprime alors de la liste des paramètres, en laissant tout ce qu'elle ne reconnaît pas pour que notre application l'analyse ou l'ignore. Ceci crée un ensemble de paramètres standards acceptés par toutes les applications GTK. <p> Les deux lignes de code suivantes créent et affichent une fenêtre. <tscreen><verb> window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_show (window); </verb></tscreen> Le paramètre <tt/GTK_WINDOW_TOPLEVEL/ précise que l'on veut que la fenêtre créée suive l'aspect et le placement définis par le gestionnaire de fenêtres. Plutôt que de créer une fenêtre de 0x0, une fenêtre sans fenêtre fille est de 200x200 par défaut : on peut ainsi la manipuler facilement. <p> La fonction <em/gtk_widget_show()/ informe GTK que l'on a configuré le widget et qu'il peut l'afficher. <p> La ligne suivante lance la boucle principale de traitement de GTK. <tscreen><verb> gtk_main (); </verb></tscreen> <em/gtk_main()/ est un autre appel que vous verrez dans toute application GTK. Lorsque le contrôle atteind ce point, GTK se met en attente d'événements X (click sur un bouton, ou appui d'une touche, par exemple), de timeouts ou d'entrées-sorties fichier. Dans notre exemple simple, cependant, les événements sont ignorés. <sect1>« Bonjour tout le monde » en GTK <p> OK, écrivons un programme avec un widget (bouton). C'est le classique « Bonjour tout le monde » à la sauce GTK. <tscreen><verb> #include <gtk/gtk.h> /* fonction de rappel. Dans cet exemple, les paramètres sont ignorés... * Les fonctions de rappel sont détaillées plus loin. */ void hello (GtkWidget *widget, gpointer data) { g_print ("Bonjour tout le monde.\n"); } gint delete_event(GtkWidget *widget, GdkEvent *event, gpointer data) { g_print ("le signal delete_event est survenu.\n"); /* Si l'on renvoit TRUE dans le gestionnaire du signal "delete_event", * GTK émettra le signal "destroy". Retourner FALSE signifie que l'on * ne veut pas que la fenêtre soit détruite. * Utilisé pour faire apparaître des boîtes de dialogue du type * « Êtes-vous sûr de vouloir quitter ? » */ /* Remplacez FALSE par TRUE et la fenêtre principale sera détruite par * un signal « delete_event ». */ return (FALSE); } /* Autre fonction de rappel */ void destroy (GtkWidget *widget, gpointer data) { gtk_main_quit (); } int main (int argc, char *argv[]) { /* GtkWidget est le type pour déclarer les widgets. */ GtkWidget *window; GtkWidget *button; /* Cette fonction est appelée dans toutes les applications GTK. * Les paramètres passés en ligne de commande sont analysés et * retournés à l'application. */ gtk_init (&argc, &argv); /* Création d'une nouvelle fenêtre. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); /* Lorsque la fenêtre reçoit le signal "delete_event" * (envoyé par le gestionnaire de fenêtres en utilisant l'option * « close » ou la barre de titre), on lui demande d'appeler la * fonction delete_event() définie plus haut. La donnée passée en * paramètre à la fonction de rappel est NULL et est ignoré dans le * rappel. */ gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (delete_event), NULL); /* Ici, on connecte l'évenement "destroy" à un gestionnaire de signal. * Cet événement arrive lorsqu'on appelle gtk_widget_destroy() sur la * fenêtre, ou si l'on retourne TRUE dans le rappel "delete_event". */ gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (destroy), NULL); /* Configuration de la largeur du contour de la fenêtre. */ gtk_container_border_width (GTK_CONTAINER (window), 10); /* Création d'un nouveau bouton portant le label * "Bonjour tout le monde". */ button = gtk_button_new_with_label ("Bonjour tout le monde"); /* Quand le bouton recevra le signal "clicked", il appellera la * fonction hello() définie plus haut en lui passant NULL en paramètre. */ gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (hello), NULL); /* Ceci provoquera la destruction de la fenêtre par appel de la * fonction gtk_widget_destroy(window) lors du signal "clicked". * Le signal de destruction pourrait venir de là, ou du * gestionnaire de fenêtres. */ gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); /* Insertion du bouton dans la fenêtre (container gtk). */ gtk_container_add (GTK_CONTAINER (window), button); /* L'étape finale consiste à afficher ce nouveau widget... */ gtk_widget_show (button); /* ... et la fenêtre. */ gtk_widget_show (window); /* Toutes les applications GTK doivent avoir un gtk_main(). * Le déroulement du programme se termine là et attend qu'un * événement survienne (touche pressée ou événement souris). */ gtk_main (); return 0; } </verb></tscreen> <sect1>Compilation de « Bonjour tout le monde » <p> Supposons que vous avez sauvegardé le code précédent dans un fichier nommé <em/bonjour.c/, pour le compiler tapez la commande suivante : <tscreen><verb> gcc -Wall -g bonjour.c -o bonjour_monde -L/usr/X11R6/lib \ -lgtk -lgdk -lglib -lXext -lX11 -lm </verb></tscreen> <p> Les bibliothèques invoquées ci-dessus doivent toutes être dans vos chemins de recherche par défaut, sinon, ajoutez <tt/-L<library directory>/ pour que <em/gcc/ recherche dans ces répertoires les bibliothèques nécessaires. Sur mon système Debian GNU/Linux, par exemple, je dois ajouter <tt>-L/usr/X11R6/lib</> pour qu'il trouve les bibliothèques X11 (NdT : et c'est pareil sur mon système Red Hat Linux...). <p> L'ordre des bibliothèques est important. L'éditeur de liens doit connaître les fonctions d'une bibliothèque dont il a besoin avant de les traiter. <p> Si vous compilez en utilisant des bibliothèques statiques, l'ordre dans lequel vous listez les bibliothèques devient très important. L'exemple donné ci-dessus devrait fonctionner dans tous les cas. <p> Les bibliothèques que l'on utilise sont : <itemize> <item>La bibliothèque glib (<tt/-lglib/), qui contient diverses fonctions. Seule <em/g_print()/ est utilisée dans cet exemple. GTK est construit au dessus de <em/glib/ et vous aurez donc toujours besoin de celle-ci. Voir la section concernant <ref id="sec_glib" name="glib"> pour plus de détails. <item>La bibliothèque GDK (<tt/-lgdk/), l'enveloppe de Xlib. <item>La bibliothèque GTK (<tt/-lgtk/), la bibliothèque des widgets, construite au dessus de GDK. <item>La bibliothèque Xlib (<tt/-lX11/ utilisée par GDK. <item>La bibliothèque Xext (<tt/-lXext/). Cette dernière contient le code pour les pixmaps en mémoire partagée et les autres extensions X. <item>La bibliothèque mathématique (<tt/-lm/). Elle est utilisée pour différentes raisons par GTK. </itemize> <sect1>Théorie des signaux et des rappels <p> Avant de voir en détail le programme « Bonjour tout le monde », nous parlerons d'abord des événements et des fonctions de rappel. GTK est dirigé par les événements, ce qui signifie qu'il restera inactif dans <em/gtk_main/ jusqu'à ce qu'un événement survienne et que le contrôle soit passé à la fonction appropriée. <p> Ce passage du contrôle est réalisé en utilisant le concept de « signal ». Lorsqu'un événement survient, comme l'appui sur un bouton, le signal approprié sera « émis » par le widget qui a été pressé. C'est de cette façon que GTK réalise la plupart de son travail. Pour qu'un bouton réalise une action, on configure un gestionnaire de signal pour capturer ces signaux et appeler la fonction adéquate. Ceci est fait en utilisant une fonction comme : <tscreen><verb> gint gtk_signal_connect (GtkObject *object, gchar *name, GtkSignalFunc func, gpointer func_data); </verb></tscreen> <p> Où le premier paramètre est le widget qui émettra le signal, et le deuxième est le nom du signal que l'on souhaite intercepter. Le troisième paramètre est la fonction que l'on veut appeler quand le signal est capturé, et le quatrième sont les données que l'on souhaite passer à cette fonction. <p> La fonction spécifiée par le troisième paramètre s'appelle une « fonction de rappel » et doit être de la forme : <tscreen><verb> void callback_func(GtkWidget *widget, gpointer *callback_data); </verb></tscreen> <p> Où le premier paramètre sera un pointeur vers le widget qui a émis le signal, et le second un pointeur vers les données passées par le dernier paramètre de la fonction <em/gtk_signal_connect()/ décrite plus haut. <p> Un autre appel utilisé dans l'exemple « Bonjour tout le monde » est : <tscreen><verb> gint gtk_signal_connect_object (GtkObject *object, gchar *name, GtkSignalFunc func, GtkObject *slot_object); </verb></tscreen> <p> <em/gtk_signal_connect_object()/ est la même chose que <em/gtk_signal_connect()/ sauf que la fonction de rappel utilise un seul paramètre : un pointeur vers un objet GTK. Lorsqu'on utilise cette fonction pour connecter des signaux, le rappel doit être de cette forme : <tscreen><verb> void callback_func (GtkObject *object); </verb></tscreen> <p> Où l'objet est d'ordinaire un widget. En général, on ne configure pas de rappels pour <em/gtk_signal_connect_object/. D'habitude, ceux-ci sont utilisés pour appeler une fonction GTK acceptant un simple widget ou objet comme paramètre, comme dans notre exemple. La raison pour laquelle il y a deux fonctions pour connecter les signaux est simplement de permettre aux fonctions de rappel d'avoir un nombre différent de paramètres. De nombreuses fonctions de la bibliothèque GTK n'acceptent qu'un simple pointeur vers un <em/GtkWidget/ comme paramètre et vous pouvez donc utiliser <em/gtk_signal_connect_object()/ pour celles-ci, tandis que pour vos fonctions vous pouvez avoir besoin d'avoir de fournir plus de données aux fonctions de rappel. <sect1>« Bonjour tout le monde » pas à pas <p> Maintenant que nous connaissons la théorie, clarifions un peu en progressant à travers le programme « Bonjour tout le monde ». <p> Voici la fonction de rappel appelée lorsque le bouton est « clicked ». Dans notre exemple, on ignore le widget et les données mais il n'est pas difficile de faire quelque chose avec. Le prochain exemple utilisera le paramètre des données pour nous dire quel bouton a été pressé. <tscreen><verb> void hello (GtkWidget *widget, gpointer *data) { g_print ("Bonjour tout le monde\n"); } </verb></tscreen> <p> Cette fonction de rappel est un peu spéciale. L'événement "delete_event" survient lorsque le gestionnaire de fenêtres l'envoie à l'application. On doit choisir ce qu'il faut faire de ces événements. On peut les ignorer, leur donner une réponse, ou simplement quitter l'application. La valeur que l'on retourne dans cette fonction de rappel permet à GTK de savoir ce qu'il a à faire. En retournant FALSE, on l'informe que l'on ne veut pas que le signal "destroy" soit émis, afin de laisser notre application tourner. En retournant TRUE, on lui demande d'émettre "destroy" qui appellera à son tour notre gestionnaire du signal "destroy". <tscreen><verb> gint delete_event(GtkWidget *widget, GdkEvent *event, gpointer data) { g_print ("le signal delete_event est survenu.\n"); return (FALSE); } </verb></tscreen> <p> Voici une autre fonction de rappel qui ne fait que quitter l'application en appelant <em/gtk_main_quit()/. Il n'y a pas grand chose de plus à dire car elle est plutôt triviale : <tscreen><verb> void destroy (GtkWidget *widget, gpointer *data) { gtk_main_quit (); } </verb></tscreen> <p> Je suppose que vous connaissez la fonction <em/main()/... oui, comme les autres programmes C, toutes les applications GTK en ont une. <tscreen><verb> int main (int argc, char *argv[]) { </verb></tscreen> <p> La partie qui suit déclare deux pointeurs sur des structures de type <em/GtkWidget/. Ceux-ci sont utilisés plus loin pour créer une fenêtre et un bouton. <tscreen><verb> GtkWidget *window; GtkWidget *button; </verb></tscreen> <p> Et revoici notre <em/gtk_init/. Comme précédemment, il initialise le toolkit et analyse les paramètres de la ligne de commande. Il supprime chaque paramètre reconnu de la liste et modifie <em/argc/ et <em/argv/ pour faire comme si ces paramètres n'avaient jamais existé, laissant notre application analyser les paramètres restants. <tscreen><verb> gtk_init (&argc, &argv); </verb></tscreen> <p> Création d'une nouvelle fenêtre. C'est plutôt classique. La mémoire est allouée pour une structure <em/GtkWidget/ et <em/window/ pointe donc sur celle-ci. Cela configure une nouvelle fenêtre, mais celle-ci ne sera pas affichée tant que l'on n'a pas appelé <em/gtk_widget_show(window)/ vers la fin de notre programme. <tscreen><verb> window = gtk_window_new (GTK_WINDOW_TOPLEVEL); </verb></tscreen> <p> Voici maintenant un exemple de connexion d'un gestionnaire de signal à un objet : la fenêtre. Le signal "destroy" est capturé. Il est émis lorsqu'on utilise le gestionnaire de fenêtres pour tuer la fenêtre (et que l'on retourne TRUE dans le gestionnaire "delete_event"), ou lorsqu'on utilise l'appel <em/gtk_widget_destroy()/ en lui passant le widget <em/window/ comme objet à détruire. Ici, on appelle juste la fonction <em/destroy()/ définie ci-dessus avec le paramètre NULL, ce qui quitte GTK pour nous. <p> <tt/GTK_OBJECT/ et <tt/GTK_SIGNAL_FUNC/ sont des macros qui réalisent les conversions et les vérifications de types pour nous. Elles rendent aussi le code plus lisible. <tscreen><verb> gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (destroy), NULL); </verb></tscreen> <p> La fonction suivante sert à configurer un attribut d'un objet container. Elle configure simplement la fenêtre pour qu'elle ait une zone vide autour d'elle de 10 pixels de large où aucun widget ne pourra se trouver. Il existe d'autres fonctions similaires que nous verrons dans la section sur la <ref id="sec_setting_widget_attributes" name="Configuration des attributs des widgets"> <p> À nouveau, <tt/GTK_CONTAINER/ est une macro réalisant la conversion de type. <tscreen><verb> gtk_container_border_width (GTK_CONTAINER (window), 10); </verb></tscreen> <p> Cet appel crée un nouveau bouton. Il alloue l'espace mémoire pour une nouvelle structure GtkWidget, l'initialise et fait pointer <em/button/ vers elle. Ce bouton portera le label « Bonjour tout le monde » lorsqu'il sera affiché. <tscreen><verb> button = gtk_button_new_with_label ("Bonjour tout le monde"); </verb></tscreen> <p> Maintenant, prenons ce bouton et faisons lui faire quelque chose d'utile. On lui attache un gestionnaire de signal pour que, lorsqu'il émettra le signal "clicked", notre fonction <em/hello()/ soit appelée. On ignore les paramètres et on ne passe donc que la valeur NULL à la fonction de rappel <em/hello()/. Évidemment, le signal "clicked" est émis lorsqu'on clique sur le bouton avec la souris. <tscreen><verb> gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (hello), NULL); </verb></tscreen> <p> On utilisera aussi ce bouton pour quitter notre programme, ce qui permettra d'illustrer la façon dont le signal "destroy" peut venir soit du gestionnaire de fenêtres, soit de notre programme. Quand le bouton est "clicked" comme cela est décrit plus haut, il appelle d'abord la fonction de rappel <em/hello()/ puis celle-ci dans l'ordre dans lequel elles sont configurées. On peut avoir autant de fonctions de rappel que l'on désire, elles seront exécutées selon leur ordre de connexion. Puisque la fonction <em/gtk_widget_destroy()/ n'accepte que <em/GtkWidget *widget/ comme paramètre, on utilise ici la fonction <em/gtk_signal_connect_object()/ à la place de <em/gtk_signal_connect()/. <tscreen><verb> gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); </verb></tscreen> <p> Voici un appel de placement, qui sera expliqué en détail plus tard, mais qui est plutôt facile à comprendre. Il indique simplement à GTK que le bouton doit être placé dans la fenêtre où il s'affichera. <tscreen><verb> gtk_container_add (GTK_CONTAINER (window), button); </verb></tscreen> <p> Maintenant, nous avons tout configuré comme on le souhaitait : les gestionnaires de signaux sont en place et le bouton est mis dans la fenêtre où il doit se trouver. On demande alors à GTK de « montrer » les widgets à l'écran. Le widget <em/window/ est affiché en dernier afin que la fenêtre entière surgisse d'un coup plutôt que voir d'abord la fenêtre s'afficher puis ensuite le bouton apparaître à l'intérieur. Il faut dire qu'avec des exemples simples comme celui-ci, vous ne ferez pas la différence. <tscreen><verb> gtk_widget_show(button); gtk_widget_show (window); </verb></tscreen> <p> Bien sûr, on appelle <em/gtk_main()/ qui attendra les événements venant du serveur X et demandera aux widgets d'émettre les signaux lorsque ces événements surviendront. <tscreen><verb> gtk_main (); </verb></tscreen> Enfin, le <em/return/ final. Il est exécuté lorsque <em/gtk_quit()/ est appelé. <tscreen><verb> return 0; </verb></tscreen> <p> Lorsque l'on clique sur un bouton GTK, le widget émet un signal "clicked". Afin de pouvoir utiliser cette information, notre programme configure un gestionnaire pour capturer ce signal. Ce gestionnaire appelle la fonction de notre choix. Dans notre exemple, lorsque le bouton que l'on a créé est "clicked", la fonction <em/hello()/ est appelée avec le paramètre NULL, puis le gestionnaire suivant de ce signal est à son tour appelé. Il appelle la fonction <em/gtk_widget_destroy()/ en lui passant le widget <em/window/ comme paramètre, ce qui provoque la destruction de celui-ci. Ceci force la fenêtre à envoyer un signal "destroy", qui est capturé à son tour et appelle notre fonction de rappel <em/destroy()/ qui ferme simplement GTK. <p> Une autre façon de procéder consiste à utiliser le gestionnaire de fenêtres pour détruire la fenêtre. Cela provoquera l'émission du signal "delete_event" qui sera pris en charge par notre gestionnaire <em/delete_event()/. S'il retourne FALSE, la fenêtre restera telle quelle et rien ne se passera. Retourner TRUE forcera GTK à émettre le signal "destroy" qui, bien sûr, appelera la fonction de rappel <em/destroy()/ provoquant la sortie du GTK. <p> On remarquera que ces signaux ne sont pas les mêmes que les signaux systèmes Unix et ne sont pas implantés en utilisant ceux-ci, bien que la terminologie employée soit presque identique. <sect>Continuons <p> <sect1>Types de données <p> Vous avez probablement noté certaines choses qui nécessitent des explications dans les exemples précédents. les <em/gint/, <em/gchar/, etc. que vous avez pu voir sont des redéfinitions de <em/int/ et <em/char/, respectivement. Leur raison d'être est de s'affranchir des dépendances ennuyeuses concernant la taille des types de données simples lorsqu'on réalise des calculs. Un bon exemple est <em/gint32/ qui désignera un entier codé sur 32 bits pour toutes les plateformes, que ce soit une station Alpha 64 bits ou un PC i386 32 bits. Les redéfinitions de type sont très simples et intuitives. Elles sont toutes décrites dans le fichier <em>glib/glib.h</em> (qui est inclus par <em/gtk.h/). <p> On notera aussi la possibilité d'utiliser un <em/GtkWidget/ lorsque la fonction attend un <em/GtkObject/. GTK possède une architecture orientée objet, et un widget est un objet. <sect1>Compléments sur les gestionnaires de signaux <p> Regardons à nouveau la déclaration de <em/gtk_signal_connect/. <tscreen><verb> gint gtk_signal_connect (GtkObject *object, gchar *name, GtkSignalFunc func, gpointer func_data); </verb></tscreen> Vous avez remarqué que le valeur de retour est de type <em/gint/ ? Il s'agit d'un marqueur qui identifie votre fonction de rappel. Comme on le disait plus haut, on peut avoir autant de fonctions de rappel que l'on a besoin, par signal et par objet, et chacune sera exécutée à son tour, dans l'ordre dans lequel elle a été attachée. Ce marqueur vous permet d'ôter ce rappel de la liste en faisant &;: <tscreen><verb> void gtk_signal_disconnect (GtkObject *object, gint id); </verb></tscreen> Ainsi, en passant le widget dont on veut supprimer le gestionnaire et le marqueur ou identificateur retourné par l'une des fonctions <em/signal_connect/, on peut déconnecter un gestionnaire de signal. <p> Une autre fonction permettant de supprimer tous les gestionnaires de signaux pour un objet est : <tscreen><verb> gtk_signal_handlers_destroy (GtkObject *object); </verb></tscreen> <p> Cet appel n'a pas trop besoin d'explications. Il ôte simplement tous les gestionnaires de signaux de l'objet passé en paramètre. <sect1>Un « Bonjour tout le monde » amélioré <p> Étudions une version légèrement améliorée avec de meilleurs exemples de fonctions de rappel. Ceci permettra aussi d'introduire le sujet suivant : le placement des wigdets. <tscreen><verb> #include <gtk/gtk.h> /* Notre nouveau rappel amélioré. La donnée passée à cette fonction est * imprimée sur stdout. */ void rappel (GtkWidget *widget, gpointer *data) { g_print ("Re-Bonjour - %s a été pressé\n", (char *) data); } /* Un autre rappel */ void delete_event (GtkWidget *widget, GdkEvent *event, gpointer *data) { gtk_main_quit (); } int main (int argc, char *argv[]) { /* GtkWidget est le type pour déclarer les widgets */ GtkWidget *window; GtkWidget *button; GtkWidget *box1; /* Cette fonction est appelée dans toutes les applications GTK. * Les paramètre passés en ligne de commande sont analysés et * retournés à l'application. */ gtk_init (&argc, &argv); /* Création d'une nouvelle fenêtre. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); /* Nouvel appel qui intitule notre nouvelle fenêtre * "Salut les boutons !" */ gtk_window_set_title (GTK_WINDOW (window), "Salut les boutons !"); /* Configuration d'un gestionnaire pour "delete_event" afin de * quitter immédiatement GTK. */ gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (delete_event), NULL); /* Configuration de la largeur du contour de la fenêtre. */ gtk_container_border_width (GTK_CONTAINER (window), 10); /* Création d'une boîte pour y placer les widgets. * Ceci est décrit en détails plus loin dans la section * « placement ». La boîte n'est pas matérialisée, elle est juste * utilisée comme moyen d'arranger les widgets. */ box1 = gtk_hbox_new(FALSE, 0); /* On met la boîte dans la fenêtre principale. */ gtk_container_add (GTK_CONTAINER (window), box1); /* On crée un nouveau bouton portant le label « Bouton 1 ». */ button = gtk_button_new_with_label ("Bouton 1"); /* Lorsque le bouton est cliqué, on appelle la fonction « rappel » * avec un pointeur sur la chaîne « Bouton 1 » comme paramètre. */ gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (rappel), (gpointer) "Bouton 1"); /* Au lieu d'utiliser gtk_container_add, on place ce bouton dans * la boîte invisible qui a été placée dans la fenêtre. */ gtk_box_pack_start(GTK_BOX(box1), button, TRUE, TRUE, 0); /* N'oubliez jamais cette étape qui indique à GTK que la configuration * de ce bouton est terminée et qu'il peut être affiché. */ gtk_widget_show(button); /* On fait la même chose pour créer un deuxième bouton. */ button = gtk_button_new_with_label ("Bouton 2"); /* On appelle la même fonction de rappel avec un paramètre différent, * un pointeur sur la chaîne « Bouton 2 ». */ gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (rappel), (gpointer) "Bouton 2"); gtk_box_pack_start(GTK_BOX(box1), button, TRUE, TRUE, 0); /* L'ordre dans lequel on affiche les boutons n'est pas vraiment * important, mais il est préférable d'afficher la fenêtre en dernier * pour qu'elle surgisse d'un coup. */ gtk_widget_show(button); gtk_widget_show(box1); gtk_widget_show (window); /* Le reste est dans gtk_main et on attend que la fête commence ! */ gtk_main (); return 0; } </verb></tscreen> <p> Compilez ce programme en utilisant les mêmes paramètres que pour l'exemple précédent. Vous remarquerez que, maintenant, il est plus difficile de quitter le programme : vous devez utiliser le gestionnaire de fenêtres ou une commande shell pour le détruire. Un bon exercice pour le lecteur serait d'insérer un troisième bouton « Quitter » qui permettrait de sortir du programme. Vous pouvez aussi jouer avec les options de <em/gtk_box_pack_start()/ en lisant la section suivante. Essayez de redimensionner la fenêtre, et observez son comportement. <p> Juste une remarque : il existe une autre constante utilisable avec <em/gtk_window_new()/ - GTK_WINDOW_DIALOG. Ceci permet d'interagir de façon un peu différente avec le gestionnaire de fenêtres et doit être utilisé pour les fenêtres temporaires comme les boîtes de dialogue, par exemple. <sect>Placement des widgets <p> Lorsqu'on crée une application, on veut mettre plus qu'un simple bouton dans une fenêtre. Notre premier exemple « Bonjour le monde » n'utilisait qu'un seul widget et on pouvait donc simplement faire un appel à <em/gtk_container_add/ pour « placer » le widget dans la fenêtre. Mais si l'on désire en mettre plus, comment peut-on contrôler l'endroit où le widget sera positionné ? C'est ici que le placement entre en jeu. <sect1>Théorie des boîtes de placement <p> La majeure partie du placement est faites en créant des boîtes comme dans l'exemple ci-dessus. Ce sont des widgets containers invisibles où l'on peut placer nos widgets. Elles existent sous deux formes : boîtes horizontales et boîtes verticales. Lorsque l'on place des widgets dans une boîte horizontale, les objets sont insérés horizontalement de gauche à droite ou de droite à gauche selon l'appel utilisé. Dans une boîte verticale, les widgets sont placés de haut en bas ou vice versa. On peut utiliser n'importe quelle combinaison de boîtes à l'intérieur ou à côté d'autres boîtes pour créer l'effet désiré. <p> Pour créer une nouvelle boîte horizontale, on appelle <em/gtk_hbox_new()/, et pour les boîtes verticales, <em/gtk_vbox_new()/. Les fonctions <em/gtk_box_pack_start()/ et <em/gtk_box_pack_end()/ servent à placer les objets à l'intérieur de ces containers. La fonction <em/gtk_box_pack_start()/ placera de haut en bas dans une boîte verticale et de gauche à droite dans une boîte horizontale. <em/gtk_box_pack_end()/ fera le contraire en plaçant de bas en haut et de droite à gauche. En utilisant ces fonctions, on peut aligner à droite ou à gauche nos widgets et même les mélanger de n'importe quelle façon pour obtenir l'effet désiré. Dans la plupart de nos exemples, on utilisera <em/gtk_box_pack_start()/. Un objet peut être un autre container ou un widget. En fait, de nombreux widgets (dont les boutons) sont eux-mêmes des containers, mais on utilise généralement seulement un label dans un bouton. <p> En utilisant ces appels, GTK sait où vous voulez placer vos widgets et il peut donc les dimensionner automatiquement et faire d'autres choses bien pratiques. Il existe aussi plusieurs options permettant de préciser comment les widgets doivent être placés. Comme vous pouvez l'imaginer, cette méthode nous donne pas mal de liberté pour placer et créer les widgets. <sect1>Détails sur les boîtes <p> À cause de cette liberté, le placement des boîtes avec GTK peut paraître déroutant au premier abord. Il existe beaucoup d'options et il n'est pas tout de suite évident de comprendre comment elles s'accordent toutes ensemble. En fait, il y a 5 styles de base différents. <p> <? <IMG ALIGN="center" SRC="packbox1.gif" VSPACE="15" HSPACE="10" ALT="Box Packing Example Image" WIDTH="528" HEIGHT="235"> > Chaque ligne contient une boîte horizontale (<em/hbox/) contenant plusieurs boutons. L'appel à <em/gtk_box_pack/ indique la façon dont sont placés tous les boutons dans la hbox. Chaque bouton est placé dans la hbox de la même façon (mêmes paramètres que la fonction <em/gtk_box_pack_start()/). <p> Voici la déclaration de la fonction <em/gtk_box_pack_start/. <tscreen><verb> void gtk_box_pack_start (GtkBox *box, GtkWidget *child, gint expand, gint fill, gint padding); </verb></tscreen> Le premier paramètre est la boîte dans laquelle on place l'objet, le second est cet objet. Tous les objets sont tous des boutons jusqu'à maintenant, on place donc des boutons dans des boîtes. <p> Le paramètre <em/expand/ de <em/gtk_box_pack_start()/ ou <em/gtk_box_pack_end()/ contrôle la façon dont le widget est placé dans la boîte. S'il vaut TRUE, les widgets sont disposés dans la boîte de façon à en occuper tout l'espace. S'il vaut FALSE, la boîte est rétrécie pour correspondre à la taille du widget. Mettre <em/expand/ à FALSE vous permettra d'aligner à droite et à gauche vos widgets. Sinon, ils s'élargiront pour occuper toute la boîte. Le même effet pourrait être obtenu en utilisant uniquement une des deux fonctions <em/gtk_box_pack_start/ ou <em/pack_end/. <p> Le paramètre <em/fill/ des fonctions <em/gtk_box_pack/ contrôle si de l'espace supplémentaire doit être alloué aux objets eux-mêmes (TRUE), ou si on doit rajouter de l'espace (<em/padding/) dans la boîte autour des objets (FALSE). Il n'a de sens que si le paramètre <em/expand/ vaut TRUE. <p> Lorsque l'on crée une nouvelle boîte, on utilise une fonction comme : <tscreen><verb> GtkWidget * gtk_hbox_new (gint homogeneous, gint spacing); </verb></tscreen> Le paramètre <em/homogeneous/ de <em/gtk_hbox_new/ (et c'est la même chose pour <em/gtk_vbox_new/) vérifie que chaque objet de la boîte ait la même taille (i.e. la même largeur dans une hbox, la même hauteur dans une vbox). S'il vaut TRUE, le paramètre <em/expand/ des fonctions <em/gtk_box_pack/ sera toujours mis à TRUE. <p> Quelle est alors la différence entre les paramètres <em/spacing/ (configuré lorsque la boîte est créée) et <em/padding/ (configuré lorque les éléments sont placés) ? <em/spacing/ ajoute de l'espace entre les objets, et <em/padding/ en ajoute de chaque côté d'un objet. La figure suivante devrait éclairer tout cela : <? <IMG ALIGN="center" SRC="packbox2.gif" VSPACE="15" HSPACE="10" ALT="Box Packing Example Image" WIDTH="509" HEIGHT="213"> > Voici le code utilisé pour créer les images ci-dessus. J'y ai mis beaucoup de commentaires en espérant que vous n'aurez pas de problème pour le relire. Compilez-le et jouez avec les différents paramètres. <sect1>Programme de démonstration des placements <p> <tscreen><verb> #include "gtk/gtk.h" void delete_event (GtkWidget *widget, GdkEvent *event, gpointer *data) { gtk_main_quit (); } /* Construction d'une nouvelle hbox remplie de boutons. Les paramètres qui * nous intéressent sont passés à cette fonction. * On n'affiche pas la boîte, mais tout ce qu'elle contient. */ GtkWidget *make_box (gint homogeneous, gint spacing, gint expand, gint fill, gint padding) { GtkWidget *box; GtkWidget *button; char padstr[80]; /* Création d'une hbox avec les paramètres homogeneous et spacing * voulus. */ box = gtk_hbox_new (homogeneous, spacing); /* Création d'une série de boutons configurés de façon appropriée */ button = gtk_button_new_with_label ("gtk_box_pack"); gtk_box_pack_start (GTK_BOX (box), button, expand, fill, padding); gtk_widget_show (button); button = gtk_button_new_with_label ("(box,"); gtk_box_pack_start (GTK_BOX (box), button, expand, fill, padding); gtk_widget_show (button); button = gtk_button_new_with_label ("button,"); gtk_box_pack_start (GTK_BOX (box), button, expand, fill, padding); gtk_widget_show (button); /* Création d'un bouton portant un label dépendant de la valeur * du paramètre expand. */ if (expand == TRUE) button = gtk_button_new_with_label ("TRUE,"); else button = gtk_button_new_with_label ("FALSE,"); gtk_box_pack_start (GTK_BOX (box), button, expand, fill, padding); gtk_widget_show (button); /* Même chose que ci-dessus mais sous forme abrégée. */ button = gtk_button_new_with_label (fill ? "TRUE," : "FALSE,"); gtk_box_pack_start (GTK_BOX (box), button, expand, fill, padding); gtk_widget_show (button); /* Récupération du paramètre padding sous forme de chaîne. */ sprintf (padstr, "%d);", padding); button = gtk_button_new_with_label (padstr); gtk_box_pack_start (GTK_BOX (box), button, expand, fill, padding); gtk_widget_show (button); return box; } int main (int argc, char *argv[]) { GtkWidget *window; GtkWidget *button; GtkWidget *box1; GtkWidget *box2; GtkWidget *separator; GtkWidget *label; GtkWidget *quitbox; int which; /* Initialisation, à ne jamais oublier ! :) */ gtk_init (&argc, &argv); if (argc != 2) { fprintf (stderr, "usage : %s num, où num vaut 1, 2, ou 3.\n", *argv); /* Nettoyage dans GTK et sortie avec un code d'erreur de 1 */ gtk_exit (1); } which = atoi (argv[1]); /* Création de notre fenêtre. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); /* Il ne faut jamais oublier de connecter le signal "destroy" à la * fenêtre principale. C'est très important pour disposer d'un * comportement intuitif adéquat. */ gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (delete_event), NULL); gtk_container_border_width (GTK_CONTAINER (window), 10); /* Création d'une boîte verticale (vbox) pour y placer les boîtes * horizontales. * Ceci permet de placer les boîtes horizontales contenant les boutons * les unes au dessus des autres dans cette vbox. */ box1 = gtk_vbox_new (FALSE, 0); /* L'exemple à afficher. Ils correspondent aux images ci-dessus. */ switch (which) { case 1: /* Création d'un label. */ label = gtk_label_new ("gtk_hbox_new (FALSE, 0);"); /* Alignement du label à gauche. On précisera cette fonction ainsi * que les autres dans la section sur les attributs des widgets. */ gtk_misc_set_alignment (GTK_MISC (label), 0, 0); /* Placement du label dans la boîte verticale (vbox box1). Il ne * faut pas oublier que les widgets qui s'ajoutent à une vbox sont * placés les uns au dessus des autres. */ gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 0); /* Affichage du label */ gtk_widget_show (label); /* On appelle notre fonction de construction de boîte : * homogeneous = FALSE, spacing = 0, * expand = FALSE, fill = FALSE, padding = 0 */ box2 = make_box (FALSE, 0, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); /* On appelle notre fonction de construction de boîte : * homogeneous = FALSE, spacing = 0, * expand = FALSE, fill = FALSE, padding = 0 */ box2 = make_box (FALSE, 0, TRUE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); /* Paramètres : homogeneous = FALSE, spacing = 0, * expand = TRUE, fill = TRUE, padding = 0 */ box2 = make_box (FALSE, 0, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); /* Création d'un séparateur, on verra cela plus tard, mais ils sont * simples à utiliser. */ separator = gtk_hseparator_new (); /* Placement du séparateur dans la vbox. Ne pas oublier que tous les * widgets sont placés dans une vbox et qu'il seront placés * verticalement. */ gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 5); gtk_widget_show (separator); /* Création d'un nouveau label et affichage de celui-ci. */ label = gtk_label_new ("gtk_hbox_new (TRUE, 0);"); gtk_misc_set_alignment (GTK_MISC (label), 0, 0); gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 0); gtk_widget_show (label); /* Paramètres : homogeneous = TRUE, spacing = 0, * expand = TRUE, fill = FALSE, padding = 0 */ box2 = make_box (TRUE, 0, TRUE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); /* Paramètres : homogeneous = TRUE, spacing = 0, * expand = TRUE, fill = TRUE, padding = 0 */ box2 = make_box (TRUE, 0, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); /* Un autre séparateur */ separator = gtk_hseparator_new (); /* Les 3 derniers paramètres de gtk_box_pack_start sont : * expand = FALSE, fill = TRUE, padding = 5. */ gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 5); gtk_widget_show (separator); break; case 2: /* Création d'un label, box1 est une vbox identique à * celle créée au début de main() */ label = gtk_label_new ("gtk_hbox_new (FALSE, 10);"); gtk_misc_set_alignment (GTK_MISC (label), 0, 0); gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 0); gtk_widget_show (label); /* Paramètres : homogeneous = FALSE, spacing = 10, * expand = TRUE, fill = FALSE, padding = 0 */ box2 = make_box (FALSE, 10, TRUE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); /* Paramètres : homogeneous = FALSE, spacing = 10, * expand = TRUE, fill = TRUE, padding = 0 */ box2 = make_box (FALSE, 10, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); separator = gtk_hseparator_new (); /* Les 3 derniers paramètres de gtk_box_pack_start sont : * expand = FALSE, fill = TRUE, padding = 5. */ gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 5); gtk_widget_show (separator); label = gtk_label_new ("gtk_hbox_new (FALSE, 0);"); gtk_misc_set_alignment (GTK_MISC (label), 0, 0); gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 0); gtk_widget_show (label); /* Paramètres : homogeneous = FALSE, spacing = 0, * expand = TRUE, fill = FALSE, padding = 10 */ box2 = make_box (FALSE, 0, TRUE, FALSE, 10); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); /* Paramètres : homogeneous = FALSE, spacing = 0, * expand = TRUE, fill = TRUE, padding = 10 */ box2 = make_box (FALSE, 0, TRUE, TRUE, 10); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); separator = gtk_hseparator_new (); /* Les 3 derniers paramètres de gtk_box_pack_start sont : * expand = FALSE, fill = TRUE, padding = 5. */ gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 5); gtk_widget_show (separator); break; case 3: /* Ceci est une démonstration de la possibilité d'utiliser * gtk_box_pack_end() pour aligner les widgets à droite. * On crée d'abord une nouvelle boîte comme d'habitude. */ box2 = make_box (FALSE, 0, FALSE, FALSE, 0); /* On crée le label qui sera mis à la fin. */ label = gtk_label_new ("end"); /* On le place en utilisant gtk_box_pack_end(), il est ainsi * mis à droite de la hbox créée par l'appel à make_box(). */ gtk_box_pack_end (GTK_BOX (box2), label, FALSE, FALSE, 0); /* Affichage du label. */ gtk_widget_show (label); /* Placement de box2 dans box1 (la vbox, vous vous rappelez ? :) */ gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); /* Séparateur pour le bas. */ separator = gtk_hseparator_new (); /* Configuration du séparateur en 400x5 pixels. * La hbox que l'on a créée aura donc 400 pixels de large, * et le label "end" sera séparé des autres de la hbox. * Sinon, tous les widgets de la hbox seraient placés les plus * près possible les uns des autres. */ gtk_widget_set_usize (separator, 400, 5); /* Placement du séparateur dans la vbox (box1) * créée au debut de main(). */ gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 5); gtk_widget_show (separator); } /* Création d'une nouvelle hbox.. vous pouvez en utiliser autant que * que vous en avez besoin ! */ quitbox = gtk_hbox_new (FALSE, 0); /* Notre bouton pour quitter. */ button = gtk_button_new_with_label ("Quit"); /* Configuration du signal pour détruire la fenêtre. Ceci enverra le * signal "destroy" à la fenêtre. Ce signal sera à son tour capturé * par notre gestionnaire de signal défini plus haut. */ gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); /* Placement du bouton dans la « quitbox ». * Les 3 derniers paramètres de gtk_box_pack_start sont : * expand = TRUE, fill = FALSE, padding = 0. */ gtk_box_pack_start (GTK_BOX (quitbox), button, TRUE, FALSE, 0); /* Placement de la quitbox dans la vbox (box1) */ gtk_box_pack_start (GTK_BOX (box1), quitbox, FALSE, FALSE, 0); /* Placement de la vbox (box1), qui contient maintenant tous nos * widgets, dans la fenêtre principale. */ gtk_container_add (GTK_CONTAINER (window), box1); /* Affichage */ gtk_widget_show (button); gtk_widget_show (quitbox); gtk_widget_show (box1); /* Affichage de la fenêtre en dernier */ gtk_widget_show (window); /* Ne pas oublier notre fonction principale. */ gtk_main (); /* Le contrôle revient ici lorsque gtk_main_quit() est appelée, * jusqu'à ce que gtk_exit() soitutilisée. */ return 0; } </verb></tscreen> <p> <sect1>Placement avec les tables <p> Étudions une autre méthode de placement : les tables. Elles peuvent s'avérer très utiles dans certaines situations. En utilisant des tables, on crée une grille dans laquelle on peut placer les widgets. Ceux-ci peuvent occuper tous les endroits que l'on désire. La première chose à faire est, bien sûr, d'étudier la fonction <em/gtk_table_new/ : <tscreen><verb> GtkWidget* gtk_table_new (gint rows, gint columns, gint homogeneous); </verb></tscreen> <p> Le premier paramètre est le nombre de lignes de la table et le deuxième, le nombre de colonnes. Le paramètre <em/homogeneous/ s'occupe de la façon dont les cases de la table seront dimensionnées. Si homogeneous vaut TRUE, les cases prennent la taille du plus grand widget de la table. S'il vaut FALSE, la taille des cases dépend du widget le plus haut de la ligne et du plus large de cette colonne. Le nombre de lignes et colonnes va de 0 à n, où n est le nombre spécifié dans l'appel à <em/gtk_table_new/. Ainsi, avec <em/rows/ = 2 et <em/columns/ = 2, la table ressemblera à ceci : <tscreen><verb> 0 1 2 0+----------+----------+ | | | 1+----------+----------+ | | | 2+----------+----------+ </verb></tscreen> <p> On notera que le système de coordonnées part du coin en haut à gauche. Pour placer un widget dans une case, ou utilise la fonction suivante : <tscreen><verb> void gtk_table_attach (GtkTable *table, GtkWidget *child, gint left_attach, gint right_attach, gint top_attach, gint bottom_attach, gint xoptions, gint yoptions, gint xpadding, gint ypadding); </verb></tscreen> <p> Où le premier paramètre (<em/table/) est la table que l'on a créée et le second (<em/child/) est le widget que l'on veut placer dans la table. Les paramètres <em/left_attach/ et <em/right_attach/ spécifient l'emplacement du widget et le nombre de cases à utiliser. Par exemple, si on veut placer un bouton dans le coin inférieur droit de la table décrite plus haut et que l'on désire ne remplir QUE cette case, <em/left_attach/ vaudra 1, <em/right_attach/ vaudra 2; <em/top_attach/ vaudra 1 et <em/bottom_attach/ vaudra 2. Si on veut un widget occupant toute la ligne supérieure de notre table, on utilisera les valeurs 0, 2, 0, 1. Les paramètres <em/xoptions/ et <em/yoptions/ servent à préciser les options de placement et peuvent être combinées par un OU logique pour permettre des options multiples. Ces options sont : <itemize> <item>GTK_FILL - Si la case de la table est plus large que le widget, et que GTK_FILL est spécifié, le widget s'élargira pour occuper toute la place disponible. <item>GTK_SHRINK - Si la table a moins de place qu'il ne lui en faut (généralement, à cause d'un redimensionnement de la fenêtre par l'utilisateur), les widgets sont alors simplement poussés vers le bas de la fenêtre et disparaissent. Si GTK_SHRINK est spécifié, les widgets se réduiront en même temps que la table. <item>GTK_EXPAND - Cette option provoque l'extension de la table pour qu'elle utilise tout l'espace restant dans la fenêtre. </itemize> Le paramêtres de <em/padding/ jouent le même rôle que pour les boîtes, il créent une zone libre, spécifiée en pixels, autour du widget. gtk_table_attach() a BEAUCOUP d'options. Voici donc une fonction-raccourci : <tscreen><verb> void gtk_table_attach_defaults (GtkTable *table, GtkWidget *widget, gint left_attach, gint right_attach, gint top_attach, gint bottom_attach); </verb></tscreen> <em/xoptions/ et <em/options/ valent par défaut GTK_FILL | GTK_EXPAND, et <em/xpadding/ et <em/ypadding/ valent 0. Les autres paramètres sont les mêmes que ceux de la fonction précédente. Il existe aussi les fonctions <em/gtk_table_set_row_spacing()/ et <em/gtk_table_set_col_spacing()/. Elles permettent de placer des espaces après une ligne ou une colonne. <tscreen><verb> void gtk_table_set_row_spacing (GtkTable *table, gint row, gint spacing); </verb></tscreen> et <tscreen><verb> void gtk_table_set_col_spacing (GtkTable *table, gint column, gint spacing); </verb></tscreen> Pour les colonnes, l'espace est ajouté à droite de la colonne et pour les lignes, il est ajouté en dessous. On peut aussi configurer un espacement pour toutes les lignes et/ou colonnes avec : <tscreen><verb> void gtk_table_set_row_spacings (GtkTable *table, gint spacing); </verb></tscreen> <p> Et, <tscreen><verb> void gtk_table_set_col_spacings (GtkTable *table, gint spacing); </verb></tscreen> <p> Avec ces appels, la dernière ligne et la dernière colonne n'ont pas d'espace supplémentaire. <sect1>Exemple de placement avec table <p> Pour le moment, étudiez l'exemple sur les tables (testgtk.c) distribué avec les sources de GTK. <sect>Vue d'ensemble des widgets <p> <p> Les étapes pour créer un widget en GTK sont : <enum> <item> <em/gtk_*_new()/ - une des fonctions disponibles pour créer un nouveau widget. Ces fonctions sont décrites dans cette section. <item> Connexion de tous les signaux que l'on souhaite utiliser avec les gestionnaires adéquats. <item> Configuration des attributs du widget. <item> Placement du widget dans un container en utilisant un appel approprié comme <em/gtk_container_add()/ ou <em/gtk_box_pack_start()/. <item> Affichage du widget grâce à <em/gtk_widget_show()/. </enum> <p> <em/gtk_widget_show()/ permet à GTK de savoir que l'on a fini de configurer les attributs du widget et qu'il est prêt à être affiché. On peut aussi utiliser <em/gtk_widget_hide()/ pour le faire disparaître. L'ordre dans lequel on affiche les widgets n'est pas important, mais il est préférable d'afficher la fenêtre en dernier pour qu'elle surgisse d'un seul coup plutôt que de voir les différents widgets apparaître à l'écran au fur et à mesure. Les fils d'un widget (une fenêtre est aussi un widget) ne seront pas affichés tant que la fenêtre elle-même n'est pas affichée par la fonction <em/gtk_widget_show()/. <sect1> Conversions de types <p> Vous remarquerez, au fur et à mesure que vous progressez, que GTK utilise un système de coercition de type. Celle-ci est toujours réalisée en utilisant des macros qui vérifient si l'objet donné peut être converti et qui réalisent cette coercition. Les macros que vous rencontrerez le plus sont : <itemize> <item> GTK_WIDGET(widget) <item> GTK_OBJECT(object) <item> GTK_SIGNAL_FUNC(function) <item> GTK_CONTAINER(container) <item> GTK_WINDOW(window) <item> GTK_BOX(box) </itemize> Elles sont toutes utilisées pour convertir les paramètres des fonctions. Vous les verrez dans les exemples et, en règle générale, vous saurez les utiliser simplement en regardant la déclaration d'une fonction. Comme vous pouvez le voir dans la hiérarchie de classes ci-dessous, tous les <em/GtkWidgets/ dérivent d'une classe de base <em/GtkObject/. Ceci signifie que vous pouvez utiliser un widget à chaque fois qu'une fonction requiert un objet - il suffit d'utiliser la macro GTK_OBJECT(). Par exemple : <tscreen><verb> gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(fonction_rappel), donnee_de_rappel); </verb></tscreen> Cet appel convertit le bouton en objet et fournit une conversion pour le pointeur de fonction vers la fonction de rappel. De nombreux widgets sont aussi des containers. Si vous regardez la hiérarchie de classe ci-dessous, vous remarquerez que beaucoup de widgets viennent de la classe <em/GtkContainer/. N'importe lequel de ces widgets peut être utilisé avec la macro GTK_CONTAINER pour être passé en paramètre à une fonction qui attend un container. Malheureusement, ces macros ne peuvent être couvertes en détail dans ce didacticiel, Je vous recommande donc de jeter un coup d'oeil sur les fichier en-têtes GTK : ils peuvent s'avérer très instructifs. En fait, il n'est pas difficile de comprendre comment fonctionne un widget, il suffit d'étudier les déclarations des fonctions. <p> <sect1>La hiérarchie des widgets <p> Voici l'arbre de la hiérarchie de classes utilisées pour implanter les widgets. <tscreen><verb> GtkObject +-- GtkData | \-- GtkAdjustment | \-- GtkWidget +-- GtkContainer | +-- GtkBin | | +-- GtkAlignment | | +-- GtkFrame | | | *-- GtkAspectFrame | | | | | +-- GtkItem | | | +-- GtkListItem | | | +-- GtkMenuItem | | | | +-- GtkCheckMenuItem | | | | *-- GtkRadioMenuItem | | | | | | | *-- GtkTreeItem | | | | | +-- GtkViewport | | \-- GtkWindow | | +-- GtkDialog | | \-- GtkFileSelection | | | +-- GtkBox | | +-- GtkHBox | | \-- GtkVBox | | +-- GtkColorSelection | | \-- GtkCurve | | | +-- GtkButton | | +-- GtkOptionMenu | | \-- GtkToggleButton | | \-- GtkCheckButton | | \-- GtkRadioButton | | | +-- GtkList | +-- GtkMenuShell | | +-- GtkMenu | | \-- GtkMenuBar | | | +-- GtkNotebook | +-- GtkScrolledWindow | +-- GtkTable | \-- GtkTree | +-- GtkDrawingArea +-- GtkEntry +-- GtkMisc | +-- GtkArrow | +-- GtkImage | +-- GtkLabel | \-- GtkPixmap | +-- GtkPreview +-- GtkProgressBar +-- GtkRange | +-- GtkScale | | +-- GtkHScale | | \-- GtkVScale | | | \-- GtkScrollbar | +-- GtkHScrollbar | \-- GtkVScrollbar | +-- GtkRuler | +-- GtkHRuler | \-- GtkVRuler | \-- GtkSeparator +-- GtkHSeparator \-- GtkVSeparator </verb></tscreen> <p> <sect1>Widgets sans fenêtre <p> Les widgets suivants n'ont pas de fenêtre associée. Si vous voulez capturer des événements, vous devez utiliser <em/GtkEventBox/. Reportez-vous à la section sur <ref id="sec_The_EventBox_Widget" name="Le widget EventBox"> <tscreen><verb> GtkAlignment GtkArrow GtkBin GtkBox GtkImage GtkItem GtkLabel GtkPaned GtkPixmap GtkScrolledWindow GtkSeparator GtkTable GtkViewport GtkAspectFrame GtkFrame GtkVPaned GtkHPaned GtkVBox GtkHBox GtkVSeparator GtkHSeparator </verb></tscreen> <p> Nous continuerons notre exploration de GTK en examinant chaque widget tour à tour, créant quelques fonctions simples pour les afficher. Une autre source intéressante est le programme <em/testgtk.c/ livré avec GTK. Il se trouve dans le répertoire <em>gtk/</em> <sect>Widgets boutons <p> <sect1>Boutons normaux <p> On a déjà presque vu tout ce qu'il y avait à voir sur le widget bouton. Il est très simple. Cependant, il y a deux façons de créer un bouton. On peut utiliser <em/gtk_button_new_with_label()/ pour créer un bouton avec un label, ou <em/gtk_button_new()/ pour créer un bouton vide. Dans ce dernier cas, c'est à vous de placer un label ou un pixmap sur celui-ci. Pour ce faire, créez une boîte, puis placez vos objets dans celle-ci en utilisant la fonction habituelle <em/gtk_box_pack_start/, utilisez alors <em/gtk_container_add/ pour placer la boîte dans le bouton. <p> Voici un exemple d'utilisation de <em/gtk_button_new()/ pour créer un bouton contenant une image et un label. J'ai séparé du reste le code qui crée une boîte pour que vous puissiez l'utiliser dans vos programmes. <tscreen><verb> #include <gtk/gtk.h> /* Création d'une hbox avec une image et un label. Cette fonction * retourne la boîte... */ GtkWidget *xpm_label_box (GtkWidget *parent, gchar *xpm_filename, gchar *label_text) { GtkWidget *box1; GtkWidget *label; GtkWidget *pixmapwid; GdkPixmap *pixmap; GdkBitmap *mask; GtkStyle *style; /* Création de la boite pour un xpm et un label */ box1 = gtk_hbox_new (FALSE, 0); gtk_container_border_width (GTK_CONTAINER (box1), 2); /* Choix d'un style de bouton... Je suppose que c'est pour obtenir * la couleur du fond. Si quelqu'un connaît la vraie raison, qu'il * m'éclaire sur ce point. */ style = gtk_widget_get_style(parent); /* Chargement de xpm pour créer une image */ pixmap = gdk_pixmap_create_from_xpm (parent->window, &mask, &style->bg[GTK_STATE_NORMAL], xpm_filename); pixmapwid = gtk_pixmap_new (pixmap, mask); /* Création d'un label */ label = gtk_label_new (label_text); /* placement de l'image et du label dans la boîte */ gtk_box_pack_start (GTK_BOX (box1), pixmapwid, FALSE, FALSE, 3); gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 3); gtk_widget_show(pixmapwid); gtk_widget_show(label); return (box1); } /* Notre fonction de rappel habituelle */ void callback (GtkWidget *widget, gpointer *data) { g_print ("Bonjour - %s a été pressé\n", (char *) data); } int main (int argc, char *argv[]) { /* GtkWidget est le type utilisé pour déclarer les widgets */ GtkWidget *window; GtkWidget *button; GtkWidget *box1; gtk_init (&argc, &argv); /* Création d'une fenêtre */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Pixmap'd Buttons!"); /* Il est préférable de faire cela pour toutes les fenêtres */ gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_exit), NULL); /* Configuration du bord de la fenêtre */ gtk_container_border_width (GTK_CONTAINER (window), 10); /* Création d'un bouton */ button = gtk_button_new (); /* Vous devriez être habitué à voir ces fonctions maintenant */ gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (callback), (gpointer) "cool button"); /* Appel de notre fonction de création de boîte */ box1 = xpm_label_box(window, "info.xpm", "cool button"); /* Placement et affichage de tous nos widgets */ gtk_widget_show(box1); gtk_container_add (GTK_CONTAINER (button), box1); gtk_widget_show(button); gtk_container_add (GTK_CONTAINER (window), button); gtk_widget_show (window); /* Le reste est dans gtk_main */ gtk_main (); return 0; } </verb></tscreen> La fonction <em/xpm_label_box()/ peut être utilisée pour placer des xpms et des labels sur tout widget qui peut être container. <sect1> Boutons commutateurs <p> Les boutons commutateurs ressemblent beaucoup aux boutons normaux, sauf qu'ils seront toujours alternativement dans un état ou dans un autre. Le changement d'état s'effectue par un click. Ils peuvent être enfoncés et, lorsqu'on clique dessus, ils se relèvent. Re-cliquez, et ils se renfoncent. Les boutons commutateurs sont la base des cases à cocher ou des boutons radio, donc la plupart des appels utilisés pour les boutons commutateurs sont hérités par les cases à cocher et les boutons radio. J'insisterai là dessus quand nous les aborderons. Création d'un bouton commutateur : <tscreen><verb> GtkWidget* gtk_toggle_button_new (void); GtkWidget* gtk_toggle_button_new_with_label (gchar *label); </verb></tscreen> <p> Comme vous pouvez l'imaginer, elles fonctionnent comme celles des boutons normaux. La première crée un bouton commutateur vide et la deuxième un bouton commutateur contenant déjà un label. <p> Pour récupérer l'état d'un commutateur et cela comprend aussi les cases à cocher et les boutons radio, on utilise une macro comme nous le montrons dans l'exemple qui suit et qui teste l'état du commutateur dans une fonction de rappel. Le signal qui nous intéresse et qui est émis par les boutons commutateurs (ce qui comprend aussi les cases à cocher et les boutons radio), est le signal "toggled". Pour vérifier l'état de ces boutons, on configure un gestionnaire de signal qui capture "toggled" et utilise la macro pour déterminer l'état. La fonction de rappel ressemblera à ceci : <tscreen><verb> void rappel_bouton_commutateur (GtkWidget *widget, gpointer data) { if (GTK_TOGGLE_BUTTON(widget)->active) { /* Si l'on est ici, c'est que le bouton est relâché. */ } else { /* le bouton est enfoncé */ } } </verb></tscreen> <!-- COMMENTED! <tscreen><verb> guint gtk_toggle_button_get_type (void); </verb></tscreen> <p> No idea... they all have this, but I dunno what it is :) <tscreen><verb> void gtk_toggle_button_set_mode (GtkToggleButton *toggle_button, gint draw_indicator); </verb></tscreen> <p> No idea. --> <p> L'appel qui suit peut être utilisé pour configurer l'état d'un bouton commutateur et de ses descendants, les cases à cocher et les boutons radio. On lui passe notre bouton en premier paramètre et TRUE ou FALSE pour spécifier s'il doit être relâché ou enfoncé. Par défaut, il est relâché (FALSE). <tscreen><verb> void gtk_toggle_button_set_state (GtkToggleButton *toggle_button, gint state); </verb></tscreen> <p> On notera que lorsqu'on utilise cette fonction, et que l'état est modifié, cela force le bouton à émettre un signal "clicked". <tscreen><verb> void gtk_toggle_button_toggled (GtkToggleButton *toggle_button); </verb></tscreen> <p> Cet appel ne fait que commuter le bouton et émettre le signal "toggled". <sect1> Cases à cocher <p> Les cases à cocher héritent de nombreuses propriétés et fonctions des boutons commutateurs, mais ont un aspect différent. Au lieu d'être des boutons contenant du texte, ce sont de petits carrés avec un texte sur leur droite. Il sont souvent utilisés pour valider ou non des options dans les applications. Les deux fonctions de création sont identiques à celles des boutons normaux. <tscreen><verb> GtkWidget* gtk_check_button_new (void); GtkWidget* gtk_check_button_new_with_label (gchar *label); </verb></tscreen> La fonction <em/new_with_label/ crée une case à cocher avec un texte à coté d'elle. La vérification de l'état d'une case à cocher est identique à celle des boutons commutateurs. <sect1> Boutons radio <p> Les boutons radio ressemblent aux cases à cocher sauf qu'ils sont groupés de façon à ce qu'un seul d'entre-eux puisse être sélectionné à un moment donné. Ils sont utilisés par les applications lorsqu'il s'agit d'effectuer un choix dans une liste d'options. La création d'un bouton radio s'effectue grâce à l'un des appels suivants : <tscreen><verb> GtkWidget* gtk_radio_button_new (GSList *group); GtkWidget* gtk_radio_button_new_with_label (GSList *group, gchar *label); </verb></tscreen> <p> On notera le paramètre supplémentaire de ces fonctions. Elles nécessitent un groupe pour réaliser correctement leur tâche. Le premier appel doit passer NULL au premier paramètre puis on peut créer un groupe en utilisant : <tscreen><verb> GSList* gtk_radio_button_group (GtkRadioButton *radio_button); </verb></tscreen> <p> On passe alors ce groupe en premier paramètre des appels suivants aux fonctions de création. Il est préférable, aussi, de préciser quel bouton doit être choisi par défaut avec la fonction : <tscreen><verb> void gtk_toggle_button_set_state (GtkToggleButton *toggle_button, gint state); </verb></tscreen> <p> Celle-ci est décrite dans la section sur les boutons commutateurs et fonctionne exactement de la même façon. <p> [Mettre ici un exemple d'utilisation de tout cela car je crois que cela ferait beaucoup de bien...] <sect> Widgets divers <p> <sect1> Labels <p> Les labels sont très utilisés dans GTK et sont relativement simples. Ils n'émettent pas de signaux car ils n'ont pas de fenêtre X qui leur est associée. Si vous avez besoin de capturer des signaux ou de faire des coupures (« clippings »), utilisez un widget EventBox. Pour créer un label, on utilise : <tscreen><verb> GtkWidget* gtk_label_new (char *str); </verb></tscreen> Où l'unique paramètre est la chaîne de caractères que l'on veut que le label affiche. Pour changer le texte d'un label après sa création, on utilise la fonction : <tscreen><verb> void gtk_label_set (GtkLabel *label, char *str); </verb></tscreen> <p> où le premier paramètre est le label que l'on veut modifier, que l'on convertit en utilisant la macro GTK_LABEL(), et le second est la nouvelle chaîne. L'espace nécessaire à la nouvelle chaîne sera automatiquement ajusté si nécessaire. Pour récupérer la chaîne courante, on utilise la fonction : <tscreen><verb> void gtk_label_get (GtkLabel *label, char **str); </verb></tscreen> où le premier paramètre est le label dont on veut récupérer la chaîne et le second sert à retourner cette chaîne. <sect1>Le widget bulle d'aide <p> Ce sont les petits textes qui surgissent lorsque vous laissez votre pointeur sur un bouton ou un autre widget pendant quelques secondes. Ils sont faciles à utiliser, on ne donnera donc pas d'exemple. Si vous voulez voir du code, consultez le programme <em/testgtk.c/ distribué avec GTK. <p> Certains widgets (comme les labels) ne fonctionnent pas avec les bulles d'aide. <p> Le premier appel que vous utiliserez sera pour créer une nouvelle bulle d'aide. Vous n'avez besoin que de le faire une fois dans une fonction donnée. Le <em/GtkTooltip/ que cette fonction retourne peut être utilisé pour créer plusieurs bulles d'aide. <tscreen><verb> GtkTooltips *gtk_tooltips_new (void); </verb></tscreen> Lorsque vous avez créé une nouvelle bulle d'aide et le widget sur lequel vous voulez l'utiliser, vous n'avez qu'à faire cet appel pour la configurer : <tscreen><verb> void gtk_tooltips_set_tips (GtkTooltips *tooltips, GtkWidget *widget, gchar *tips_text); </verb></tscreen> Les paramètres sont la bulle d'aide déjà créée, suivi du widget pour lequel vous voulez voir apparaître cette bulle et le texte que vous voulez qu'elle contienne. <p> Voici un petit exemple : <tscreen><verb> GtkTooltips *tooltips; GtkWidget *button; ... tooltips = gtk_tooltips_new (); button = gtk_button_new_with_label ("bouton 1"); ... gtk_tooltips_set_tips (tooltips, button, "C'est le bouton 1"); </verb></tscreen> D'autres fonctions peuvent être utilisées avec les bulles d'aide. Je ne ferais que les énumérer et les décrire brièvement. <tscreen><verb> void gtk_tooltips_destroy (GtkTooltips *tooltips); </verb></tscreen> Destruction de bulles d'aide. <tscreen><verb> void gtk_tooltips_enable (GtkTooltips *tooltips); </verb></tscreen> Activation d'un ensemble de bulles d'aide désactivées. <tscreen><verb> void gtk_tooltips_disable (GtkTooltips *tooltips); </verb></tscreen> Désactivation d'un ensemble de bulles d'aide activées. <tscreen><verb> void gtk_tooltips_set_delay (GtkTooltips *tooltips, gint delay); </verb></tscreen> Configure le nombre de millisecondes pendant lequel le pointeur soit se trouver sur le widget avant que la bulle d'aide n'apparaisse. Par défaut, ce délai est de 1000 millisecondes, soit 1 seconde. <tscreen><verb> void gtk_tooltips_set_tips (GtkTooltips *tooltips, GtkWidget *widget, gchar *tips_text); </verb></tscreen> Change le texte d'une bulle d'aide déjà créée. <tscreen><verb> void gtk_tooltips_set_colors (GtkTooltips *tooltips, GdkColor *background, GdkColor *foreground); </verb></tscreen> Configure les couleurs de fond et de premier plan des bulles d'aides. Je ne sais toujours pas comment spécifier les couleurs... <p> Et c'est tout concernant les fonctions associées aux bulles d'aide. C'est plus que vous ne vouliez sûrement en savoir :) <sect1> Barres de progression <p> Les barres de progression sont utilisées pour afficher la progression d'une opération. Elles sont très simple à utiliser comme vous pourrez le constater en étudiant le code ci-dessous. Commençons d'abord par l'appel permettant de créer une nouvelle barre. <tscreen><verb> GtkWidget *gtk_progress_bar_new (void); </verb></tscreen> Maintenant que la barre est créée, nous pouvons l'utiliser. <tscreen><verb> void gtk_progress_bar_update (GtkProgressBar *pbar, gfloat percentage); </verb></tscreen> Le premier paramètre est la barre de progression sur laquelle on veut agir, et le second est le pourcentage « effectué », signifiant le remplissage de la barres de 0 à 100 % (réel compris entre 0 et 1). Les barres de progression sont généralement utilisées avec les délais d'expiration ou autres fonctions identiques (voir la section sur <ref id="sec_timeouts" name="Expirations, fonctions d'E/S et d'attente">) pour donner l'illusion du multi-tâches. Toutes emploient la fonction <em/gtk_progress_bar_update/ de la même façon. Voici un exemple de barre de progression mise à jour par des expirations. Ce code montre aussi comment réinitialiser une barre. <tscreen><verb> #include <gtk/gtk.h> static int ptimer = 0; int pstat = TRUE; /* Cette fonction incrémente et met à jour la barre de progression, * elle la réinitialise si pstat vaut FALSE */ gint progress (gpointer data) { gfloat pvalue; /* récupération de la valeur courante de la barre */ pvalue = GTK_PROGRESS_BAR (data)->percentage; if ((pvalue >= 1.0) || (pstat == FALSE)) { pvalue = 0.0; pstat = TRUE; } pvalue += 0.01; gtk_progress_bar_update (GTK_PROGRESS_BAR (data), pvalue); return TRUE; } /* Cette fonction signale une réinitialisation de la barre */ void progress_r (void) { pstat = FALSE; } void destroy (GtkWidget *widget, gpointer *data) { gtk_main_quit (); } int main (int argc, char *argv[]) { GtkWidget *window; GtkWidget *button; GtkWidget *label; GtkWidget *table; GtkWidget *pbar; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (destroy), NULL); gtk_container_border_width (GTK_CONTAINER (window), 10); table = gtk_table_new(3,2,TRUE); gtk_container_add (GTK_CONTAINER (window), table); label = gtk_label_new ("Exemple de barre de progression"); gtk_table_attach_defaults(GTK_TABLE(table), label, 0,2,0,1); gtk_widget_show(label); /* Crée une barre, la place dans la table et l'affiche */ pbar = gtk_progress_bar_new (); gtk_table_attach_defaults(GTK_TABLE(table), pbar, 0,2,1,2); gtk_widget_show (pbar); /* Configure le délai d'expiration pour gérer automatiquement la * mise à jour de la barre */ ptimer = gtk_timeout_add (100, progress, pbar); /* Ce bouton indique à la barre qu'elle doit se réinitialiser */ button = gtk_button_new_with_label ("Reset"); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (progress_r), NULL); gtk_table_attach_defaults(GTK_TABLE(table), button, 0,1,2,3); gtk_widget_show(button); button = gtk_button_new_with_label ("Annuler"); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (destroy), NULL); gtk_table_attach_defaults(GTK_TABLE(table), button, 1,2,2,3); gtk_widget_show (button); gtk_widget_show(table); gtk_widget_show(window); gtk_main (); return 0; } </verb></tscreen> Dans ce petit programme, il y a quatre parties concernant le fonctionnement général des barres de progression, nous les étudierons dans l'ordre de leurs appels. <tscreen><verb> pbar = gtk_progress_bar_new (); </verb></tscreen> Cet appel crée une nouvelle barre, nommée <em/pbar/. <tscreen><verb> ptimer = gtk_timeout_add (100, progress, pbar); </verb></tscreen> Cet appel utilise des délais d'expiration pour permettre un intervalle de temps constant. ces délais ne sont pas nécessaires à l'utilisation des barres de progression. <tscreen><verb> pvalue = GTK_PROGRESS_BAR (data)->percentage; </verb></tscreen> Ce code assigne à <em/pvalue/ la valeur du pourcentage de la barre. <tscreen><verb> gtk_progress_bar_update (GTK_PROGRESS_BAR (data), pvalue); </verb></tscreen> Finalement, ce code met à jour la barre avec la valeur de <em/pvalue/. Et c'est tout ce qu'il y a à savoir sur les barres de progression. Amusez-vous bien. <sect1> Boîtes de dialogue <p> Les widgets boîtes de dialogue sont très simples : ce sont simplement des fenêtres avec plusieurs choses déjà placées dedans. La structure d'une boîte de dialogue est : <tscreen><verb> struct GtkDialog { GtkWindow window; GtkWidget *vbox; GtkWidget *action_area; }; </verb></tscreen> Comme vous le voyez, cela crée simplement une fenêtre et la place dans une vbox suivie d'un séparateur et d'une hbox pour la « zone d'action ». Le widget boîte de dialogue peut servir à produire des messages pour l'utilisateur ainsi qu'à d'autres tâches. Il est vraiment rudimentaire et il n'y a qu'une seule fonction pour les boîtes de dialogue : <tscreen><verb> GtkWidget* gtk_dialog_new (void); </verb></tscreen> Ainsi, pour créer un nouveau dialogue, on utilise : <tscreen><verb> GtkWidget window; window = gtk_dialog_new (); </verb></tscreen> Ceci créera la boîte de dialogue et c'est maintenant à vous de l'utiliser. Vous pouvez, par exemple, placer un bouton dans la zone d'action en faisant quelque chose comme : <tscreen><verb> button = ... gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area), button, TRUE, TRUE, 0); gtk_widget_show (button); </verb></tscreen> Et vous pouvez aussi ajouter un label à la zone de la vboxb : <tscreen><verb> label = gtk_label_new ("Les boîtes de dialogues sont pratiques"); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), label, TRUE, TRUE, 0); gtk_widget_show (label); </verb></tscreen> Comme exemple d'utilisation d'une boîte de dialogue, vous pourriez mettre deux boutons dans la zone d'action (un bouton « Annuler » et un bouton « Ok ») et un label dans la zone de la vbox posant une question à l'utilisateur ou signalant une erreur, etc. Vous pouvez alors attacher un signal différent à chacun des boutons et réaliser l'opération que l'utilisateur a choisie. <sect1> Pixmaps <p> Les pixmaps sont des structures de données contenant des images. Celles-ci peuvent être utilisées à différents endroits, mais le plus souvent comme icônes dans le bureau X Window. Un bitmap est un pixmap de 2 couleurs. Pour utiliser des pixmaps avec GTK, on doit d'abord construire une structure <em/GdkPixmap/ en utilisant les fonctions de la couche GDK. Les pixmaps peuvent soit être créés à partir de données en memoire, ou à partir de données lues dans un fichier. Nous utiliserons chacun des appels pour créer un pixmap. <tscreen><verb> GdkPixmap *gdk_bitmap_create_from_data( GdkWindow *window, gchar *data, gint width, gint height ); </verb></tscreen> <p> Cette fonction sert à créer un pixmap mono-plan (2 couleurs) à partir de données en mémoire. Chaque bit de la donnée <em/data/. <em/width/ et <em/height/ sont exprimés en pixels. Le pointeur vers un <em/GdkWindow/ pointe sur la fenêtre courante car les ressources d'un pixmap n'ont de signification que dans le contexte de l'écran où il doit s'afficher. <tscreen><verb> GdkPixmap* gdk_pixmap_create_from_data( GdkWindow *window, gchar *data, gint width, gint height, gint depth, GdkColor *fg, GdkColor *bg ); </verb></tscreen> Cette fonction est utilisée pour créer un pixmap d'une profondeur donnée (nombre de couleurs) à partir de la donnée spécifiée pas <em/data/. <em/fg/ et <em/bg/ sont les couleurs à utiliser pour l'avant et l'arrière-plan. <tscreen><verb> GdkPixmap* gdk_pixmap_create_from_xpm( GdkWindow *window, GdkBitmap **mask, GdkColor *transparent_color, const gchar *filename ); </verb></tscreen> Le format XPM est une représentation des pixmaps reconnue par le système X Window. Il est largement utilisé et de nombreux utilitaires pour créer des fichiers d'images à ce format sont disponibles. Le fichier <em/filename/ doit contenir une image dans ce format qui sera chargée dans la structure pixmap. Le masque <em/mask/ indique quels sont les bits opaques du pixmap. Tous les autres bits sont colorisés en utilisant la couleur spécifiée par <em/transparent_color/. Un exemple d'utilisation est présenté ci-dessous. <tscreen><verb> GdkPixmap* gdk_pixmap_create_from_xpm_d (GdkWindow *window, GdkBitmap **mask, GdkColor *transparent_color, gchar **data); </verb></tscreen> De petites images peuvent être intégrées dans un programme sous la forme de données <em/data/ au format XPM. Un pixmap est créé en utilisant ces données au lieu de les lire dans un fichier. Un exemple de telles données est : <tscreen><verb> /* XPM */ static const char * xpm_data[] = { "16 16 3 1", " c None", ". c #000000000000", "X c #FFFFFFFFFFFF", " ", " ...... ", " .XXX.X. ", " .XXX.XX. ", " .XXX.XXX. ", " .XXX..... ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " ......... ", " ", " "}; </verb></tscreen> <tscreen><verb> void gdk_pixmap_destroy( GdkPixmap *pixmap ); </verb></tscreen> <p> Lorsqu'on a utilisé un pixmap et que l'on en a plus besoin tout de suite, il est préférable de libérer la ressource en utilisant un appel à <em/gdk_pixmap_destroy/. Les pixmaps doivent être considérées comme une ressource précieuse. Quand le pixmap est créé, on peut l'afficher comme un widget GTK. On doit créer un widget pixmap qui contiendra le pixmap GDK. Ceci est réalisé de la façon suivante : <tscreen><verb> GtkWidget* gtk_pixmap_new( GdkPixmap *pixmap, GdkBitmap *mask ); </verb></tscreen> <p> Les autres fonctions pour les widgets pixmap sont : <tscreen><verb> guint gtk_pixmap_get_type( void ); void gtk_pixmap_set( GtkPixmap *pixmap, GdkPixmap *val, GdkBitmap *mask); void gtk_pixmap_get( GtkPixmap *pixmap, GdkPixmap **val, GdkBitmap **mask); </verb></tscreen> <p> <em/gtk_pixmap_set/ sert à changer le pixmap pris en charge par le widget. <em/val/ est le pixmap créé par le GDK. Voici un exemple illustrant l'utilisation d'un pixmap dans un bouton : <tscreen><verb> #include <gtk/gtk.h> /* données XPM d'une icône "Ouvrir fichier" */ static const char * xpm_data[] = { "16 16 3 1", " c None", ". c #000000000000", "X c #FFFFFFFFFFFF", " ", " ...... ", " .XXX.X. ", " .XXX.XX. ", " .XXX.XXX. ", " .XXX..... ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " .XXXXXXX. ", " ......... ", " ", " "}; /* Termine l'application lorsqu'elle est appelée * via le signal "delete_event" */ void close_application( GtkWidget *widget, GdkEvent *event, gpointer *data ) { gtk_main_quit(); } /* Invoquée lorsque le bouton est cliqué. Affiche simplement * un message. */ void button_clicked( GtkWidget *widget, gpointer *data ) { printf( "bouton cliqué\n" ); } int main( int argc, char *argv[] ) { /* GtkWidget est le type pour déclarer les widgets */ GtkWidget *window, *pixmapwid, *button; GdkPixmap *pixmap; GdkBitmap *mask; GtkStyle *style; /* Crée la fenêtre principale et attache le signal "delete_event" pour * terminer l'application */ gtk_init( &argc, &argv ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_signal_connect( GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (close_application), NULL ); gtk_container_border_width( GTK_CONTAINER (window), 10 ); gtk_widget_show( window ); /* Utilisation de GDK pour créer le pixmap */ style = gtk_widget_get_style( window ); pixmap = gdk_pixmap_create_from_xpm_d( window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **)xpm_data ); /* Création d'un widget pixmap GTK pour contenir le pixmap GDK */ pixmapwid = gtk_pixmap_new( pixmap, mask ); gtk_widget_show( pixmapwid ); /* Création d'un bouton pour contenir le widget pixmap */ button = gtk_button_new(); gtk_container_add( GTK_CONTAINER(button), pixmapwid ); gtk_container_add( GTK_CONTAINER(window), button ); gtk_widget_show( button ); gtk_signal_connect( GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(button_clicked), NULL ); /* Affichage de la fenêtre */ gtk_main (); return 0; } </verb></tscreen> Pour charger un fichier à partir d'un fichier XPM appelé <em/icon0.xpm/ se trouvant dans le répertoire courant, on aurait créé le pixmap ainsi : <tscreen><verb> /* Charge un pixmap à partir d'un fichier */ pixmap = gdk_pixmap_create_from_xpm( window->window, &mask, &style->bg[GTK_STATE_NORMAL], "./icon0.xpm" ); pixmapwid = gtk_pixmap_new( pixmap, mask ); gtk_widget_show( pixmapwid ); gtk_container_add( GTK_CONTAINER(window), pixmapwid ); </verb></tscreen> Utilisation des formes <p> Un désavantage de l'utilisation des pixmaps est que l'objet affiché est toujours rectangulaire, quelle que soit l'image. On voudrait pouvoir créer des bureaux et des applications avec des icônes ayant des formes plus naturelles. Par exemple, pour une interface de jeu, on aimerait avoir des boutons ronds à pousser. Pour faire cela, on doit utiliser des fenêtres avec des formes. Une fenêtre avec forme est simplement un pixmap dont les pixels du fond sont transparents. Ainsi, lorsque l'image d'arrière-plan est multicolore, on ne la cache pas avec le bord de notre icône. L'exemple suivant affiche une image de brouette sur le bureau. <tscreen><verb> #include <gtk/gtk.h> /* XPM */ static char * WheelbarrowFull_xpm[] = { "48 48 64 1", " c None", ". c #DF7DCF3CC71B", "X c #965875D669A6", "o c #71C671C671C6", "O c #A699A289A699", "+ c #965892489658", "@ c #8E38410330C2", "# c #D75C7DF769A6", "$ c #F7DECF3CC71B", "% c #96588A288E38", "& c #A69992489E79", "* c #8E3886178E38", "= c #104008200820", "- c #596510401040", "; c #C71B30C230C2", ": c #C71B9A699658", "> c #618561856185", ", c #20811C712081", "< c #104000000000", "1 c #861720812081", "2 c #DF7D4D344103", "3 c #79E769A671C6", "4 c #861782078617", "5 c #41033CF34103", "6 c #000000000000", "7 c #49241C711040", "8 c #492445144924", "9 c #082008200820", "0 c #69A618611861", "q c #B6DA71C65144", "w c #410330C238E3", "e c #CF3CBAEAB6DA", "r c #71C6451430C2", "t c #EFBEDB6CD75C", "y c #28A208200820", "u c #186110401040", "i c #596528A21861", "p c #71C661855965", "a c #A69996589658", "s c #30C228A230C2", "d c #BEFBA289AEBA", "f c #596545145144", "g c #30C230C230C2", "h c #8E3882078617", "j c #208118612081", "k c #38E30C300820", "l c #30C2208128A2", "z c #38E328A238E3", "x c #514438E34924", "c c #618555555965", "v c #30C2208130C2", "b c #38E328A230C2", "n c #28A228A228A2", "m c #41032CB228A2", "M c #104010401040", "N c #492438E34103", "B c #28A2208128A2", "V c #A699596538E3", "C c #30C21C711040", "Z c #30C218611040", "A c #965865955965", "S c #618534D32081", "D c #38E31C711040", "F c #082000000820", " ", " .XoO ", " +@#$%o& ", " *=-;#::o+ ", " >,<12#:34 ", " 45671#:X3 ", " +89<02qwo ", "e* >,67;ro ", "ty> 459@>+&& ", "$2u+ ><ipas8* ", "%$;=* *3:.Xa.dfg> ", "Oh$;ya *3d.a8j,Xe.d3g8+ ", " Oh$;ka *3d$a8lz,,xxc:.e3g54 ", " Oh$;kO *pd$%svbzz,sxxxxfX..&wn> ", " Oh$@mO *3dthwlsslszjzxxxxxxx3:td8M4 ", " Oh$@g& *3d$XNlvvvlllm,mNwxxxxxxxfa.:,B* ", " Oh$@,Od.czlllllzlmmqV@V#V@fxxxxxxxf:%j5& ", " Oh$1hd5lllslllCCZrV#r#:#2AxxxxxxxxxcdwM* ", " OXq6c.%8vvvllZZiqqApA:mq:Xxcpcxxxxxfdc9* ", " 2r<6gde3bllZZrVi7S@SV77A::qApxxxxxxfdcM ", " :,q-6MN.dfmZZrrSS:#riirDSAX@Af5xxxxxfevo", " +A26jguXtAZZZC7iDiCCrVVii7Cmmmxxxxxx%3g", " *#16jszN..3DZZZZrCVSA2rZrV7Dmmwxxxx&en", " p2yFvzssXe:fCZZCiiD7iiZDiDSSZwwxx8e*>", " OA1<jzxwwc:$d%NDZZZZCCCZCCZZCmxxfd.B ", " 3206Bwxxszx%et.eaAp77m77mmmf3&eeeg* ", " @26MvzxNzvlbwfpdettttttttttt.c,n& ", " *;16=lsNwwNwgsvslbwwvccc3pcfu<o ", " p;<69BvwwsszslllbBlllllllu<5+ ", " OS0y6FBlvvvzvzss,u=Blllj=54 ", " c1-699Blvlllllu7k96MMMg4 ", " *10y8n6FjvllllB<166668 ", " S-kg+>666<M<996-y6n<8* ", " p71=4 m69996kD8Z-66698&& ", " &i0ycm6n4 ogk17,0<6666g ", " N-k-<> >=01-kuu666> ", " ,6ky& &46-10ul,66, ", " Ou0<> o66y<ulw<66& ", " *kk5 >66By7=xu664 ", " <<M4 466lj<Mxu66o ", " *>> +66uv,zN666* ", " 566,xxj669 ", " 4666FF666> ", " >966