Blame docs/tutorial/html/x2177.html

Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
>Example rc file
Packit 98cdb6
>
Packit 98cdb6
NAME="GENERATOR"
Packit 98cdb6
CONTENT="Modular DocBook HTML Stylesheet Version 1.79">
Packit 98cdb6
REL="HOME"
Packit 98cdb6
TITLE="GTK+ 2.0 Tutorial"
Packit 98cdb6
HREF="book1.html">
Packit 98cdb6
REL="UP"
Packit 98cdb6
TITLE="GTK's rc Files"
Packit 98cdb6
HREF="c2116.html">
Packit 98cdb6
REL="PREVIOUS"
Packit 98cdb6
TITLE="GTK's rc File Format"
Packit 98cdb6
HREF="x2136.html">
Packit 98cdb6
REL="NEXT"
Packit 98cdb6
TITLE="Writing Your Own Widgets"
Packit 98cdb6
HREF="c2180.html">
Packit 98cdb6
>
Packit 98cdb6
CLASS="SECT1"
Packit 98cdb6
BGCOLOR="#FFFFFF"
Packit 98cdb6
TEXT="#000000"
Packit 98cdb6
LINK="#0000FF"
Packit 98cdb6
VLINK="#840084"
Packit 98cdb6
ALINK="#0000FF"
Packit 98cdb6
>
Packit 98cdb6
CLASS="NAVHEADER"
Packit 98cdb6
>
Packit 98cdb6
SUMMARY="Header navigation table"
Packit 98cdb6
WIDTH="100%"
Packit 98cdb6
BORDER="0"
Packit 98cdb6
CELLPADDING="0"
Packit 98cdb6
CELLSPACING="0"
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
COLSPAN="3"
Packit 98cdb6
ALIGN="center"
Packit 98cdb6
>GTK+ 2.0 Tutorial
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
WIDTH="10%"
Packit 98cdb6
ALIGN="left"
Packit 98cdb6
VALIGN="bottom"
Packit 98cdb6
>
Packit 98cdb6
HREF="x2136.html"
Packit 98cdb6
ACCESSKEY="P"
Packit 98cdb6
><<< Previous
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
WIDTH="80%"
Packit 98cdb6
ALIGN="center"
Packit 98cdb6
VALIGN="bottom"
Packit 98cdb6
>GTK's rc Files
Packit 98cdb6
>
Packit 98cdb6
WIDTH="10%"
Packit 98cdb6
ALIGN="right"
Packit 98cdb6
VALIGN="bottom"
Packit 98cdb6
>
Packit 98cdb6
HREF="c2180.html"
Packit 98cdb6
ACCESSKEY="N"
Packit 98cdb6
>Next >>>
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
ALIGN="LEFT"
Packit 98cdb6
WIDTH="100%">
Packit 98cdb6
>
Packit 98cdb6
CLASS="SECT1"
Packit 98cdb6
>
Packit 98cdb6
CLASS="SECT1"
Packit 98cdb6
>
Packit 98cdb6
NAME="SEC-EXAMPLERCFILE"
Packit 98cdb6
>Example rc file
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
BORDER="0"
Packit 98cdb6
BGCOLOR="#E0E0E0"
Packit 98cdb6
WIDTH="100%"
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
CLASS="PROGRAMLISTING"
Packit 98cdb6
># pixmap_path "<dir 1>:<dir 2>:<dir 3>:..."
Packit 98cdb6
#
Packit 98cdb6
pixmap_path "/usr/include/X11R6/pixmaps:/home/imain/pixmaps"
Packit 98cdb6
#
Packit 98cdb6
# style <name> [= <name>]
Packit 98cdb6
# {
Packit 98cdb6
#   <option>
Packit 98cdb6
# }
Packit 98cdb6
#
Packit 98cdb6
# widget <widget_set> style <style_name>
Packit 98cdb6
# widget_class <widget_class_set> style <style_name>
Packit 98cdb6
Packit 98cdb6
# Here is a list of all the possible states.  Note that some do not apply to
Packit 98cdb6
# certain widgets.
Packit 98cdb6
#
Packit 98cdb6
# NORMAL - The normal state of a widget, without the mouse over top of
Packit 98cdb6
# it, and not being pressed, etc.
Packit 98cdb6
#
Packit 98cdb6
# PRELIGHT - When the mouse is over top of the widget, colors defined
Packit 98cdb6
# using this state will be in effect.
Packit 98cdb6
#
Packit 98cdb6
# ACTIVE - When the widget is pressed or clicked it will be active, and
Packit 98cdb6
# the attributes assigned by this tag will be in effect.
Packit 98cdb6
#
Packit 98cdb6
# INSENSITIVE - When a widget is set insensitive, and cannot be
Packit 98cdb6
# activated, it will take these attributes.
Packit 98cdb6
#
Packit 98cdb6
# SELECTED - When an object is selected, it takes these attributes.
Packit 98cdb6
#
Packit 98cdb6
# Given these states, we can set the attributes of the widgets in each of
Packit 98cdb6
# these states using the following directives.
Packit 98cdb6
#
Packit 98cdb6
# fg - Sets the foreground color of a widget.
Packit 98cdb6
# fg - Sets the background color of a widget.
Packit 98cdb6
# bg_pixmap - Sets the background of a widget to a tiled pixmap.
Packit 98cdb6
# font - Sets the font to be used with the given widget.
Packit 98cdb6
#
Packit 98cdb6
Packit 98cdb6
# This sets a style called "button".  The name is not really important, as
Packit 98cdb6
# it is assigned to the actual widgets at the bottom of the file.
Packit 98cdb6
Packit 98cdb6
style "window"
Packit 98cdb6
{
Packit 98cdb6
  #This sets the padding around the window to the pixmap specified.
Packit 98cdb6
  #bg_pixmap[<STATE>] = "<pixmap filename>"
Packit 98cdb6
  bg_pixmap[NORMAL] = "warning.xpm"
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
style "scale"
Packit 98cdb6
{
Packit 98cdb6
  #Sets the foreground color (font color) to red when in the "NORMAL"
Packit 98cdb6
  #state.
Packit 98cdb6
  
Packit 98cdb6
  fg[NORMAL] = { 1.0, 0, 0 }
Packit 98cdb6
  
Packit 98cdb6
  #Sets the background pixmap of this widget to that of its parent.
Packit 98cdb6
  bg_pixmap[NORMAL] = "<parent>"
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
style "button"
Packit 98cdb6
{
Packit 98cdb6
  # This shows all the possible states for a button.  The only one that
Packit 98cdb6
  # doesn't apply is the SELECTED state.
Packit 98cdb6
  
Packit 98cdb6
  fg[PRELIGHT] = { 0, 1.0, 1.0 }
Packit 98cdb6
  bg[PRELIGHT] = { 0, 0, 1.0 }
Packit 98cdb6
  bg[ACTIVE] = { 1.0, 0, 0 }
Packit 98cdb6
  fg[ACTIVE] = { 0, 1.0, 0 }
Packit 98cdb6
  bg[NORMAL] = { 1.0, 1.0, 0 }
Packit 98cdb6
  fg[NORMAL] = { .99, 0, .99 }
Packit 98cdb6
  bg[INSENSITIVE] = { 1.0, 1.0, 1.0 }
Packit 98cdb6
  fg[INSENSITIVE] = { 1.0, 0, 1.0 }
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
# In this example, we inherit the attributes of the "button" style and then
Packit 98cdb6
# override the font and background color when prelit to create a new
Packit 98cdb6
# "main_button" style.
Packit 98cdb6
Packit 98cdb6
style "main_button" = "button"
Packit 98cdb6
{
Packit 98cdb6
  font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*"
Packit 98cdb6
  bg[PRELIGHT] = { 0.75, 0, 0 }
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
style "toggle_button" = "button"
Packit 98cdb6
{
Packit 98cdb6
  fg[NORMAL] = { 1.0, 0, 0 }
Packit 98cdb6
  fg[ACTIVE] = { 1.0, 0, 0 }
Packit 98cdb6
  
Packit 98cdb6
  # This sets the background pixmap of the toggle_button to that of its
Packit 98cdb6
  # parent widget (as defined in the application).
Packit 98cdb6
  bg_pixmap[NORMAL] = "<parent>"
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
style "text"
Packit 98cdb6
{
Packit 98cdb6
  bg_pixmap[NORMAL] = "marble.xpm"
Packit 98cdb6
  fg[NORMAL] = { 1.0, 1.0, 1.0 }
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
style "ruler"
Packit 98cdb6
{
Packit 98cdb6
  font = "-adobe-helvetica-medium-r-normal--*-80-*-*-*-*-*-*"
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
# pixmap_path "~/.pixmaps"
Packit 98cdb6
Packit 98cdb6
# These set the widget types to use the styles defined above.
Packit 98cdb6
# The widget types are listed in the class hierarchy, but could probably be
Packit 98cdb6
# just listed in this document for the users reference.
Packit 98cdb6
Packit 98cdb6
widget_class "GtkWindow" style "window"
Packit 98cdb6
widget_class "GtkDialog" style "window"
Packit 98cdb6
widget_class "GtkFileSelection" style "window"
Packit 98cdb6
widget_class "*Gtk*Scale" style "scale"
Packit 98cdb6
widget_class "*GtkCheckButton*" style "toggle_button"
Packit 98cdb6
widget_class "*GtkRadioButton*" style "toggle_button"
Packit 98cdb6
widget_class "*GtkButton*" style "button"
Packit 98cdb6
widget_class "*Ruler" style "ruler"
Packit 98cdb6
widget_class "*GtkText" style "text"
Packit 98cdb6
Packit 98cdb6
# This sets all the buttons that are children of the "main window" to
Packit 98cdb6
# the main_button style.  These must be documented to be taken advantage of.
Packit 98cdb6
widget "main window.*GtkButton*" style "main_button"
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
CLASS="NAVFOOTER"
Packit 98cdb6
>
Packit 98cdb6
ALIGN="LEFT"
Packit 98cdb6
WIDTH="100%">
Packit 98cdb6
SUMMARY="Footer navigation table"
Packit 98cdb6
WIDTH="100%"
Packit 98cdb6
BORDER="0"
Packit 98cdb6
CELLPADDING="0"
Packit 98cdb6
CELLSPACING="0"
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
WIDTH="33%"
Packit 98cdb6
ALIGN="left"
Packit 98cdb6
VALIGN="top"
Packit 98cdb6
>
Packit 98cdb6
HREF="x2136.html"
Packit 98cdb6
ACCESSKEY="P"
Packit 98cdb6
><<< Previous
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
WIDTH="34%"
Packit 98cdb6
ALIGN="center"
Packit 98cdb6
VALIGN="top"
Packit 98cdb6
>
Packit 98cdb6
HREF="book1.html"
Packit 98cdb6
ACCESSKEY="H"
Packit 98cdb6
>Home
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
WIDTH="33%"
Packit 98cdb6
ALIGN="right"
Packit 98cdb6
VALIGN="top"
Packit 98cdb6
>
Packit 98cdb6
HREF="c2180.html"
Packit 98cdb6
ACCESSKEY="N"
Packit 98cdb6
>Next >>>
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
WIDTH="33%"
Packit 98cdb6
ALIGN="left"
Packit 98cdb6
VALIGN="top"
Packit 98cdb6
>GTK's rc File Format
Packit 98cdb6
>
Packit 98cdb6
WIDTH="34%"
Packit 98cdb6
ALIGN="center"
Packit 98cdb6
VALIGN="top"
Packit 98cdb6
>
Packit 98cdb6
HREF="c2116.html"
Packit 98cdb6
ACCESSKEY="U"
Packit 98cdb6
>Up
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
WIDTH="33%"
Packit 98cdb6
ALIGN="right"
Packit 98cdb6
VALIGN="top"
Packit 98cdb6
>Writing Your Own Widgets
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
>
Packit 98cdb6
>