RC file example @ GTK + 2.0 Chinese tutorial serialization

Source: Internet
Author: User
RC file example
# 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>

# All statuses are listed here. Note that some statuses cannot be used on certain components.
#
# Normal-the general state of the component. For example, if the mouse is not over the component, the state of the component is not pressed.
#
# Prelight-when you move the cursor over a widget, the color defined in this status takes effect.
#
#
# Active-when the mouse button on the widget is pressed or clicked, the widget is activated and the corresponding attribute values take effect.
#
#
# Insensitive-when a component is set to insensitive, it cannot be activated and the corresponding attribute value takes effect.
#
#
# Selected-when an object is selected, the corresponding attribute value is obtained.
#
# Given these statuses, we can use the following command to set the attributes of the component in these statuses.
#
# FG-set the foreground color of the component.
# FG-set the background color of the component.
# Bg_pixmap-set the background of the component to a pixel chart.
# Font-set the font used by the given component.
#

# In this example, set a style named "button. This name is not really important, because the style behind this file is divided
# Assigned to the actual component.

Style "window"
{
# Set the window background to the specified pixel chart.
# Bg_pixmap [<State>] = "<pixmap FILENAME>"
Bg_pixmap [Normal] = "Warning. XPM"
}

Style "scale"
{
# Set the foreground color (font color) to red in the "normal" status.

FG [Normal] = {1.0, 0, 0}

# Set the background pixel of this component to the background pixel of its parent component.
Bg_pixmap [Normal] = "<parent>"
}

Style "button"
{
# Display all possible statuses of A button. The only unused status is selected.

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 "button" style attribute and reset the font and background color in the prelight state 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}

# Set the background pixel chart of toggle_button as the pixel chart of its parent component (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"

# The following settings use the component types defined above.
# The component types are listed in the class organization, but they may be listed in this document for your 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 "* r0000" style" r0000"
Widget_class "* gtktext" style "text"

# Set all button components as child components of main windows to main_button.
# These (specially named components) must be accompanied by instructions for users to better use them.
Widget "Main Window. * gtkbutton *" style "main_button"
<Previous Home Next >>>
Gtk rc file format Up Compile Your Own Components

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.