[adsense][/adsense]
# 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>
# 这里列出所有状态。注意有些状态不能用在一定的元件上。
#
# NORMAL -元件的一般状态,如滑鼠不位于元件上方,键未按下时元件所处的状态。
#
# PRELIGHT - 当滑鼠移到元件上方,在此状态下定义的颜色生效。
#
#
# ACTIVE -当处于元件上的滑鼠键被按下或点击时,该元件被启用,相应的属性值将生效。
#
#
# INSENSITIVE -当元件被设置为不敏感 (insensitive) 时,它不能被启用,相应属性值起作用。
#
#
# SELECTED -选择一个物件时,取相应的属性值。
#
# 给定了这些状态,我们就能使用以下指令设置在这些状态下元件的属性。
#
# fg - 设置元件的前景色。
# fg - 设置元件的背景色。
# bg_pixmap - 设置元件的背景为一幅像素图。
# font - 设置给定元件所用的字型。
#
# 本例设置一种名为"button"的风格。这个名称实际不重要,因为在档案的后面会指定给实际的元件。
style "window"
{
#此处设置视窗背景为指定的像素图。
#bg_pixmap[<STATE>] = "<pixmap filename>"
bg_pixmap[NORMAL] = "warning.xpm"
}
style "scale"
{
#设置"NORMAL"状态下前景色(字型颜色)为红色。
fg[NORMAL] = { 1.0, 0, 0 }
#设置此元件的背景图案为其父元件的背景图案。
bg_pixmap[NORMAL] = "<parent>"
}
style "button"
{
# 显示一个按钮的所有可能状态,唯一未用的状态是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 }
}
# 在本例中,我们继承"button"风格的属性,然后重设PRELIGHT状态下的字型和背景色以创建一个新的"main_button"风格。
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 }
# 这里设置toggle_button的背景图案为其父元件的图案(在应用程式中已定义)。
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"
# 下面设置使用以上所定义风格的元件类型。
# 元件类型是在类别的组织中列出的,但是恰有可能在档案中列出供用户参考。
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"
# 设置作为“main windows”的子元件的所有按钮元件为main_button风格。
# 这些(专门命名的元件)都必须附有文件说明让用户更好地使用它们。
widget "main window.*GtkButton*" style "main_button"
|
1 則留言
Comments are closed.