📄 sec-examplercfile.html
字号:
<HTML><HEAD><TITLE>Example rc file</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.49"><LINKREL="HOME"TITLE="GTK+ 1.2 Tutorial"HREF="gtk-tut.html"><LINKREL="UP"TITLE="GTK's rc Files"HREF="ch-gtkrcfiles.html"><LINKREL="PREVIOUS"TITLE="GTK's rc File Format"HREF="sec-gtksrcfileformat.html"><LINKREL="NEXT"TITLE="Writing Your Own Widgets"HREF="ch-writingyourownwidgets.html"></HEAD></head><body bgcolor="#FFFFFF" marginheight=0 marginwidth=0 width="100%"><table cellspacing=6 border=0 cellpadding=0 width="100%"> <tr> <td bgcolor="#FFFFFF" valign=top nowrap> <centeR><A HREF="/"><img src="/images/gtk-logo-rgb.gif" width=107 height=140 border=0></A> <font face="helvetica,lucidia" color="#000000"><BR><BR><b>GTK+<BR>The GIMP Toolkit</b></center><BR><table width=100% cellspacing=0 cellpadding=2 border=0><tr><td bgcolor="#000000"><table width=100% cellspacing=0 cellpadding=4 border=0><tr><td bgcolor="#AAAAEE" nowrap><B>General</B></td></tr><tr><td bgcolor="#FFFFFF" nowrap><A HREF="/">Introduction</A><BR><A HREF="/screenshots/">Screenshots</A><br><A HREF="/download/">Download</A><br><A HREF="/mailinglists.html">Mailing Lists</A><BR><A HREF="/bindings.html">Language Bindings</A><BR><A HREF="http://gtk.themes.org/">Themes</A><BR><A HREF="/bugs.html">Bug Tracker</A><BR></td></tr></table></td></tr></table><BR> <table width=100% cellspacing=0 cellpadding=2 border=0><tr><td bgcolor="#000000"><table width=100% cellspacing=0 cellpadding=4 border=0><tr><td bgcolor="#AAAAEE" nowrap><B>Documentation</B></td></tr><tr><td bgcolor="#FFFFFF" nowrap><A HREF="/faq/">FAQ</A><br><A HREF="/tutorial/">Tutorial</A><BR><A HREF="/api/">API Reference</A><br><A HREF="/books.html">Published Books</A><BR></td></tr></table></td></tr></table><BR> <table width=100% cellspacing=0 cellpadding=2 border=0><tr><td bgcolor="#000000"><table width=100% cellspacing=0 cellpadding=4 border=0><tr><td bgcolor="#AAAAEE" nowrap><B>Projects</B></td></tr><tr><td bgcolor="#FFFFFF" nowrap><A HREF="http://www.pango.org/">Pango</A><BR><A HREF="http://sources.redhat.com/inti/">Inti</A><BR><A HREF="http://www.gnome.org/">GNOME</A><BR><A HREF="http://user.sgic.fi/~tml/gimp/win32/">GTK+ for Win32</A><br><A HREF="http://people.redhat.com/sopwith/gtkfb/">GtkFB (Framebuffer)</A><br><A HREF="http://www.directfb.org/gtk.xml">GTK+ on DirectFB</A><BR><A HREF="/beos/">GTK+ for BeOS</A></td></tr></table></td></tr></table><BR> <table width=100% cellspacing=0 cellpadding=2 border=0><tr><td bgcolor="#000000"><table width=100% cellspacing=0 cellpadding=4 border=0><tr><td bgcolor="#AAAAEE" nowrap><B><B>Applications</B></B></td></tr><tr><td bgcolor="#FFFFFF" nowrap><A HREF="http://www.gimp.org/">GIMP</A><BR><A HREF="http://www.abiword.org/">Abiword</A><BR><A HREF="http://www.lysator.liu.se/~alla/dia/dia.html">Dia</A><BR><A HREF="http://glade.pn.org/">Glade</A><BR><A HREF="http://www.gnucash.org/">GnuCash</A><BR><A HREF="http://www.gnome.org/projects/gnumeric/">Gnumeric</A><BR><BR><A HREF="http://www.gnome.org/applist/">GNOME Software Map</A><br></td></tr></table></td></tr></table><BR> </td> <td bgcolor="#ffffff" valign=top width="99%"><font face="lucida,helvetica"><BODYCLASS="SECT1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">GTK+ 1.2 Tutorial</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="sec-gtksrcfileformat.html"><<< Previous</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 23. GTK's rc Files</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="ch-writingyourownwidgets.html">Next >>></A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="SEC-EXAMPLERCFILE">23.3. Example rc file</A></H1><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING"># 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"</PRE></TD></TR></TABLE></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="sec-gtksrcfileformat.html"><<< Previous</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="gtk-tut.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="ch-writingyourownwidgets.html">Next >>></A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">GTK's rc File Format</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ch-gtkrcfiles.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Writing Your Own Widgets</TD></TR></TABLE></DIV> </td> </tr></table> </td> </tr></table></body></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -