⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gtkfaq.sgml

📁 gtk是linux一款强大的夸平台的图形化开发工具
💻 SGML
📖 第 1 页 / 共 5 页
字号:
<!doctype linuxdoc system><article><!-- Title information --><title>GTK+ FAQ<!-- NOTE: Use only one author tag, otherwise sgml2txt barfs - TRG --> <author>Nathan Froyd, Tony Gale, Shawn T. Amundson, Emmanuel Deloget<date>August 29th 1999<abstract> This document is intended to answer questions that are likely to be frequently asked by programmers using GTK+ or people who are just looking at using GTK+. </abstract><!-- Table of contents --><toc><!-- Begin the document --><!-- ***************************************************************** --><sect>General Information<!-- ----------------------------------------------------------------- --><sect1>Before anything else: the greetings<p>The FAQ authors want to thank:<itemize><item>Havoc Pennington<item>Erik Mouw<item>Owen Taylor<item>Tim Janik<item>Thomas Mailund Jensen<item>Joe Pfeiffer<item>Andy Kahn<item>Federico Mena Quintero<item>Damon Chaplin<item>and all the members of the GTK+ lists</itemize>If we forgot you, please email us !Thanks again (I know, it's really short :)<!-- ----------------------------------------------------------------- --><sect1>Authors<p>The original authors of GTK+ were:<itemize><item>Peter Mattis<item>Spencer Kimball<item>Josh MacDonald</itemize>Since then, much has been added by others. Please see the AUTHORSfile in the distribution for the GTK+ Team.<!-- ----------------------------------------------------------------- --><sect1>What is GTK+?<p>GTK+ is a small and efficient widget set designed with the generallook and feel of Motif.  In reality, it looks much better than Motif.It contains common widgets and some more complex widgets such as afile selection, and color selection widgets.GTK+ provides some unique features. (At least, I know of no otherwidget library which provides them). For example, a button does notcontain a label, it contains a child widget, which in most instanceswill be a label.  However, the child widget can also be a pixmap,image or any combination possible the programmer desires.  Thisflexibility is adhered to throughout the library.<!-- ----------------------------------------------------------------- --><sect1>What is the + in GTK+?<P>Peter Mattis informed the gtk mailing list that:<quote>"I originally wrote gtk which included the three libraries, libglib,libgdk and libgtk. It featured a flat widget hierarchy. That is, youcouldn't derive a new widget from an existing one. And it containeda more standard callback mechanism instead of the signal mechanism nowpresent in gtk+. The + was added to distinguish between the originalversion of gtk and the new version. You can think of it as being anenhancement to the original gtk that adds object oriented features."</quote><!-- ----------------------------------------------------------------- --><sect1>Does the G in GTK+, GDK and GLib stand for?<p>GTK+ == Gimp ToolkitGDK == Gtk+ Drawing KitGLib == G Library<!-- ----------------------------------------------------------------- --><sect1>Where is the documentation for GTK+?<p>In the GTK+ distribution's doc/ directory you will find thereference material for both GTK and GDK, this FAQ and theGTK Tutorial.In addition, you can find links to HTML versions of these documents by going to <htmlurl url="http://www.gtk.org/" name="http://www.gtk.org/">. A packaged version of the GTK Tutorial,with SGML, HTML, Postscript, DVI and text versions can be found in<htmlurl url="ftp://ftp.gtk.org/pub/gtk/tutorial"name="ftp://ftp.gtk.org/pub/gtk/tutorial">There is also a book available that details programming with GTK+ andGDK which has been written by Eric Harlow. It is entitled "DevelopingLinux Applications with GTK+ and GDK" and is available at all goodbook stores. The ISBN is 0-7357-0021-4The example code from Eric's book is available on-line at<htmlurl url="http://www.bcpl.net/~eharlow/book"name="http://www.bcpl.net/~eharlow/book"><!-- ----------------------------------------------------------------- --><sect1>Is there a mailing list (or mailing list archive) for GTK+?<p>Information on mailing lists relating to GTK+ can be found at:<htmlurl url="http://www.gtk.org/mailinglists.html"name="http://www.gtk.org/mailinglists.html"><!-- ----------------------------------------------------------------- --><sect1>How to get help with GTK+<p>First, make sure your question isn't answered in the documentation, thisFAQ or the tutorial. Done that? You're sure you've done that, right? Inthat case, the best place to post questions is to the GTK+ mailing list.<!-- ----------------------------------------------------------------- --><sect1>How to report bugs in GTK+<p>Bugs should be reported to the GNOME bug trackingsystem (<htmlurl url="http://bugs.gnome.org"name="http://bugs.gnome.org">). To report a problem about GTK+, sendmail to submit@bugs.gnome.org.The subject of the mail should describe your problem. In the body ofthe mail, you should first include a "pseudo-header" that gives thepackage and version number. This should be separated by a blank linefrom the actual headers.<verb> Package: gtk+ Version: 1.2.0</verb>Substitute 1.2.0 with the version of GTK+ that you have installed.Then describe the bug. Include:<itemize><item> Information about your system. For instance:   <itemize>   <item> What operating system and version   <item> What version of X   <item> For Linux, what version of the C library   </itemize>  And anything else you think is relevant.<item> 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.  (Bugs that can be reproduced within the  GIMP are almost as good   as bugs that can be reproduced in testgtk. If you are reporting a   bug found with the GIMP, please include the version number of the GIMP   you are using)<item> If the bug was a crash, the exact text that was printed out  when the crash occured.<item> Further information such as stack traces may be useful, but  are 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 <tt/--sync/ command  line option.</itemize><!-- ----------------------------------------------------------------- --><sect1>Is there a Windows version of GTK+?<p>There is an on going port of GTK+ to the Windows platform which ismaking impressive progress.See <htmlurl url="http://www.iki.fi/tml/gimp/win32"name="http://www.iki.fi/tml/gimp/win32"> for more information.<!-- ----------------------------------------------------------------- --><sect1>What applications have been written with GTK+?<p>A list of some GTK+ based application can be found on the GTK+ webserver at <htmlurl url="http://www.gtk.org/apps/"name="http://www.gtk.org/apps/"> and contains more than 350applications.Failing that, look for a project to work on for the GNOME project,<htmlurl url="http://www.gnome.org/" name="http://www.gnome.org/">Write a game. Write something that is useful.Some of these are:<itemize><item>GIMP (<htmlurl url="http://www.gimp.org/"                   name="http://www.gimp.org/">),         an image manipulation program<item>AbiWord (<htmlurl url="http://www.abisource.com/"         name="http://www.abisource.com/">),        a professional word processor<item>GUBI (<htmlurl url="http://www.SoftHome.net/pub/users/timj/gubi/index.htm"            name="http://www.SoftHome.net/pub/users/timj/gubi/index.htm">),        a user interface builder<item>Gzilla (<htmlurl url="http://www.levien.com/gzilla/"         name="http://www.levien.com/gzilla/">),        a web browser<item>SANE (<htmlurl url="http://www.azstarnet.com/~axplinux/sane/"         name="http://www.azstarnet.com/~axplinux/sane/"> ),        a universal scanner interface<item>XQF (<htmlurl url="http://www.botik.ru/~roma/quake/"         name="http://www.botik.ru/~roma/quake/">),        a QuakeWorld/Quake2 server browser and launcher<item>ElectricEyes (<htmlurl url="http://www.labs.redhat.com/ee.shtml"         name="http://www.labs.redhat.com/ee.shtml">),        an image viewer that aims to be a free replacement for xv<item>GPK - the General Proxy Kit (<htmlurl url="http://www.humanfactor.com/gpk/"         name="http://www.humanfactor.com/gpk/">),        an add-on library to permit thread-safe access to GTK+<item>GCK - the General Convenience Kit (<htmlurl url="http://www.ii.uib.no/~tomb/gck.html"         name="http://www.ii.uib.no/~tomb/gck.html">),        miscellaneous functions intended to ease color handling, UI construction,        vector operations, and math functions<item>GDK Imlib (<htmlurl url="http://www.labs.redhat.com/imlib/"         name="http://www.labs.redhat.com/imlib/">),        a fast image loading and manipulation library for GDK<item>Glade (<htmlurl url="http://glade.pn.org/"        name="http://glade.pn.org/">),        a GTK+ based RAD tool which produces GTK+ applications</itemize><p>In addition to the above, the GNOME project (<htmlurl url="http://www.gnome.org"name="http://www.gnome.org">)is using GTK+ to build a free desktop for Linux. Many more programs can be foundthere.<!-- ----------------------------------------------------------------- --><sect1>I'm looking for an application to write in GTK+. How about an IRC client? <p> Ask on gtk-list for suggestions. There are at least three IRCclients already under development (probably more in fact. The server at<htmlurl url="http://www.forcix.cx/irc-clients.html"name="http://www.forcix.cx/irc-clients.html"> list a bunch of them).<itemize><item>girc. (Included with GNOME)<item>Bezerk (<htmlurl url="http://www.gtk.org/~trog/"                       name="http://www.gtk.org/~trog/">)<item>gsirc. (In the gnome CVS tree)</itemize><!-- ***************************************************************** --><sect>How to find, configure, install, and troubleshoot GTK+<!-- ***************************************************************** --><!-- ----------------------------------------------------------------- --><sect1>What do I need to run GTK+?<p>To compile GTK+, all you need is a C compiler (gcc) and the X Window Systemand associated libraries on your system.<!-- ----------------------------------------------------------------- --><sect1>Where can I get GTK+?<p>The canonical site is:<verb>ftp://ftp.gtk.org/pub/gtk</verb>This site tends to get busy around the time of a new GTK+ releaseso try and use one of the mirror sites that are listed in<htmlurl url="ftp://ftp.gtk.org/etc/mirrors"name="ftp://ftp.gtk.org/etc/mirrors">Here's a few mirror sites to get you started:<itemize><item>Africa - ftp://ftp.is.co.za/applications/gimp/<item>Australia - ftp://ftp.au.gimp.org/pub/gimp/<item>Finland - ftp://ftp.funet.fi/pub/sci/graphics/packages/gimp<item>Germany - ftp://infosoc.uni-koeln.de/pub/ftp.gimp.org/<item>Japan - ftp://SunSITE.sut.ac.jp/pub/archives/packages/gimp/<item>UK - ftp://ftp.flirble.org/pub/X/gimp/<item>US - ftp://ftp.insync.net/pub/mirrors/ftp.gimp.org/</itemize><sect1>How do I configure/compile GTK+?<p>Generally, all you will need to do is issue the commands:<verb>./configuremake</verb>in the gtk+-version/ directory.<!-- ----------------------------------------------------------------- --><sect1>When compiling GTK+ I get an error like: <tt/make: file `Makefile' line 456: Syntax error/<p>Make sure that you are using GNU make (use <tt/make -v/ to check). There aremany weird and wonderful versions of make out there, and not all of themhandle the automatically generated Makefiles.<!-- ----------------------------------------------------------------- --> <sect1>I've compiled and installed GTK+, but I can't get any programs to link with it!<p>This problem is most often encountered when the GTK+ libraries can't be found or are the wrong version. Generally, the compiler will complain about an'unresolved symbol'.  There are two things you need to check:<itemize><item>Make sure that the libraries can be found. You want to edit /etc/ld.so.conf to include the directories which contain the GTK libraries, so it looks something like:<verb>/usr/X11R6/lib/usr/local/lib</verb>Then you need to run /sbin/ldconfig as root. You can find what directoryGTK is in using<verb>gtk-config --libs</verb>If your system doesn't use ld.so to find libraries (such as Solaris), thenyou will have to use the LD_LIBRARY_PATH environment variable (or compilethe path into your program, which I'm not going to cover here). So, with aBourne type shell you can do (if your GTK libraries are in /usr/local/lib):<verb>export LD_LIBRARY_PATH=/usr/local/lib</verb>and in a csh, you can do:<verb>setenv LD_LIBRARY_PATH /usr/local/lib</verb><item>Make sure the linker is finding the correct set of libraries. If youhave a Linux distribution that installs GTK+ (e.g. RedHat 5.0) then this older version may be used. Now (assuming you have a RedHatsystem), issue the command<verb>rpm -e gtk gtk-devel</verb>You may also want to remove the packages that depend on gtk (rpm will tell youwhich ones they are).  If you don't have a RedHat Linux system, check to make sure

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -