phpgtk__legacy/wiki1/wiki.d/Resources.RcFileHelp,1092076087

15 lines
13 KiB
Text

version=pmwiki-1.0.5
newline=²
text=[[#TopBar]][[notitle]][[#top]]%color=#555555%{{Resources}} / [-[[$Edit edit this page]]-] ²----²![[$Title]]²%comment%YOU CAN USE PREDEFINED STYLES IN THIS PAGE²[[include:PmWiki/PredefinedWikiStyles#PredefStyles#PredefStylesEnd]]²[[#TopBarEnd]]²²GTK's rc File Format²²# Resources/RcSimple - a very simple, example rc file. ²# Resources/RcExample - the "usual" rc file with much more detail. ²# Resources/RcCodesample - A simple code sample that works. ²²Before dealing with rc file you perhaps need to read about gtkstyles or gtkstatetype, here are some links :²* [[http://gtk.php.net/manual/en/gtk.gtkstyle.php GtkStyle doc]]²* [[http://gtk.php.net/manual/en/gtk.enum.gtkstatetype.php GtkStateType doc]]²²²!! Style Attributes Directives ²There are several directives to change the attributes of a widget.²* fg - Sets the foreground color of a widget.²* bg - Sets the background color of a widget.²* bg_pixmap - Sets the background of a widget to a tiled pixmap.²* base - Sets background color of widget like gtktext (rarely used)²* font - Sets the font to be used with the given widget.²²!! Widgets States²In addition to this, there are several states a widget can be in, and you can set different colors, pixmaps and fonts for each state. These states are:²²* 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.²²!! Setting Directives²!!! colour settings²When using the "fg" and "bg" (or "base") keywords to set the colors of widgets, the format is:\\²%code% fg[<STATE>] = { Red, Green, Blue }%%\\²²Where STATE is one of the above states (PRELIGHT, ACTIVE, etc), and the Red, Green and Blue are values in the range of 0 - 1.0, { 1.0, 1.0, 1.0 } being white. They must be in float form, or they will register as 0, so a straight "1" will not work, it must be "1.0". A straight "0" is fine because it doesn't matter if it's not recognized. Unrecognized values are set to 0.²²Another common way is to use hexadecimal values,like html colour codes begining with a '#' like this\\²%code% fg[NORMAL] = "#ff0000"%%\\²this will change the text color to red in normal state²²''Background image settings''²bg_pixmap is very similar to the above, except the colors are replaced by a filename. For example: \\²%code% bg_pixmap[NORMAL] = "background.xpm"%%\\²a background pixmap will be repeat horizontally and vertically²²''pixmap path settings''²pixmap_path is a list of paths separated by ":"'s. These paths will be searched for any pixmap you specify.²[[include:Main/CodeTable]]² # Note there's no '=' symbol!² pixmap_path "./themes/mytheme"²[[include:Main/CodeTableEnd]]²²''Font settings''²The font directive is simply:\\²%code% font = "-*-helvetica-medium-r-normal--16-*-*-*-*-*-*-*"%%\\²The only hard part is figuring out the font string. Using xfontsel or a similar utility should help.²²!! Widget Classes ²The "widget_class" sets the style of a class of widgets. These classes are listed in the widget overview on the class hierarchy.²²The "widget" directive sets a specifically named set of widgets to a given style, overriding any style set for the given widget class. These widgets are registered inside the application using the %code%$widget->set_name()%% call. This allows you to specify the attributes of a widget on a per widget basis, rather than setting the attributes of an entire widget class. I urge you to document any of these special widgets so users may customize them.²²When the keyword parent is used as an attribute, the widget will take on the attributes of its parent in the application.\\²%code% bg_pixmap[NORMAL] = "<parent>"%%\\²²When defining a style, you may assign the attributes of a previously defined style to this new one.²[[include:Main/CodeTable]]² style "main_button" = "button"² {² font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*"² bg[PRELIGHT] = { 0.75, 0, 0 }² }²[[include:Main/CodeTableEnd]]²²This example takes the "button" style, and creates a new "main_button" style simply by changing the font and prelight background color of the "button" style.²²Of course, many of these attributes don't apply to all widgets. It's a simple matter of common sense really. Anything that could apply, should.²²!!Basic RC file²here is a really basic sample :²[[include:Main/CodeTable]]² # path to your xpm files² pixmap_path "./themes/basic"²² # defining a window background image ² style "Window" {² bg_pixmap[NORMAL] = "window_background.xpm"² }² class "GtkWindow" style "Window"²² # defining button styles ² style "Button" {² bg[NORMAL] = "#ffffff"² bg[ACTIVE] = "#DODODO"² fg[NORMAL] = "#000000"² fg[ACTIVE] = "#FF0000"² }² class "GtkButton" style "Button"²² # defining the default font² style "Default" {² font = "-*-helvetica-medium-r-normal--16-*-*-*-*-*-*-*"² fg[NORMAL] = "#333388"² }² class "GtkWidget" style "Default"²[[include:Main/CodeTableEnd]]²²[-This document originally taken from http://gtk.org/tutorial1.2/gtk_tut-21.html and modified to be PHP-GTK specific.-]]²²[[#BottomBar]]²[[#top top]]²----²[[notitle]][[#top]]%color=#555555%{{Resources}} / [-[[$Edit edit this page]]-] ²[[#BottomBarEnd]]
time=1092065883
diff:1092065475:1092065475:=1,107c1²< GTK's rc File Format²< ²< # Resources/RcSimple - a very simple, example rc file. ²< # Resources/RcExample - the "usual" rc file with much more detail. ²< # Resources/RcCodesample - A simple code sample that works. ²< ²< Before dealing with rc file you perhaps need to read about gtkstyles or gtkstatetype, here are some links :²< * [[http://gtk.php.net/manual/en/gtk.gtkstyle.php GtkStyle doc]]²< * [[http://gtk.php.net/manual/en/gtk.enum.gtkstatetype.php GtkStateType doc]]²< ²< ²< !! Style Attributes Directives ²< There are several directives to change the attributes of a widget.²< * fg - Sets the foreground color of a widget.²< * bg - Sets the background color of a widget.²< * bg_pixmap - Sets the background of a widget to a tiled pixmap.²< * base - Sets background color of widget like gtktext (rarely used)²< * font - Sets the font to be used with the given widget.²< ²< !! Widgets States²< In addition to this, there are several states a widget can be in, and you can set different colors, pixmaps and fonts for each state. These states are:²< ²< * 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.²< ²< !! Setting Directives²< !!! colour settings²< When using the "fg" and "bg" (or "base") keywords to set the colors of widgets, the format is:²< %code% fg[<STATE>] = { Red, Green, Blue }²< ²< Where STATE is one of the above states (PRELIGHT, ACTIVE, etc), and the Red, Green and Blue are values in the range of 0 - 1.0, { 1.0, 1.0, 1.0 } being white. They must be in float form, or they will register as 0, so a straight "1" will not work, it must be "1.0". A straight "0" is fine because it doesn't matter if it's not recognized. Unrecognized values are set to 0.²< ²< Another common way is to use hexadecimal values,like html colour codes begining with a '#' like this²< %code% fg[NORMAL] = "#FF0000"²< this will change the text color to red in normal state²< ²< ''Background image settings''²< bg_pixmap is very similar to the above, except the colors are replaced by a filename. For example: ²< %code% bg_pixmap[NORMAL] = "background.xpm"²< a background pixmap will be repeat horizontally and vertically²< ²< ''pixmap path settings''²< pixmap_path is a list of paths separated by ":"'s. These paths will be searched for any pixmap you specify.²< [[include:Main/CodeTable]]²< # Note there's no '=' symbol!²< pixmap_path "./themes/mytheme"²< [[include:Main/CodeTableEnd]]²< ²< ''Font settings''²< The font directive is simply:²< %code% font = "-*-helvetica-medium-r-normal--16-*-*-*-*-*-*-*"²< The only hard part is figuring out the font string. Using xfontsel or a similar utility should help.²< ²< !! Widget Classes ²< The "widget_class" sets the style of a class of widgets. These classes are listed in the widget overview on the class hierarchy.²< ²< The "widget" directive sets a specifically named set of widgets to a given style, overriding any style set for the given widget class. These widgets are registered inside the application using the %code%$widget->set_name()%% call. This allows you to specify the attributes of a widget on a per widget basis, rather than setting the attributes of an entire widget class. I urge you to document any of these special widgets so users may customize them.²< ²< When the keyword parent is used as an attribute, the widget will take on the attributes of its parent in the application.²< %code% bg_pixmap[NORMAL] = "<parent>"²< ²< When defining a style, you may assign the attributes of a previously defined style to this new one.²< [[include:Main/CodeTable]]²< style "main_button" = "button"²< {²< font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*"²< bg[PRELIGHT] = { 0.75, 0, 0 }²< }²< [[include:Main/CodeTableEnd]]²< ²< This example takes the "button" style, and creates a new "main_button" style simply by changing the font and prelight background color of the "button" style.²< ²< Of course, many of these attributes don't apply to all widgets. It's a simple matter of common sense really. Anything that could apply, should.²< ²< = Basic RC file =²< here is a really basic sample :²< [[include:Main/CodeTable]]²< # path to your xpm files²< pixmap_path "./themes/basic"²< ²< # defining a window background image ²< style "Window" {²< bg_pixmap[NORMAL] = "window_background.xpm"²< }²< class "GtkWindow" style "Window"²< ²< # defining button styles ²< style "Button" {²< bg[NORMAL] = "#ffffff"²< bg[ACTIVE] = "#DODODO"²< fg[NORMAL] = "#000000"²< fg[ACTIVE] = "#FF0000"²< }²< class "GtkButton" style "Button"²< ²< # defining the default font²< style "Default" {²< font = "-*-helvetica-medium-r-normal--16-*-*-*-*-*-*-*"²< fg[NORMAL] = "#333388"²< }²< class "GtkWidget" style "Default"²< [[include:Main/CodeTableEnd]]²< ²< [-This document originally taken from http://gtk.org/tutorial1.2/gtk_tut-21.html and modified to be PHP-GTK specific.-]]²\ No newline at end of file²---²> Describe RcFileHelp here.²\ No newline at end of file²
author=nathan
author:1092065475=nathan
host:1092065475=82.120.157.3
name=Resources.RcFileHelp
host=82.120.157.3
agent=Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040615 Firefox/0.8 StumbleUpon/1.908
rev=2
diff:1092065883:1092065475:minor=1,7d0²< [[#TopBar]][[notitle]][[#top]]%color=#555555%{{Resources}} / [-[[$Edit edit this page]]-] ²< ----²< ![[$Title]]²< %comment%YOU CAN USE PREDEFINED STYLES IN THIS PAGE²< [[include:PmWiki/PredefinedWikiStyles#PredefStyles#PredefStylesEnd]]²< [[#TopBarEnd]]²< ²38,39c31,32²< When using the "fg" and "bg" (or "base") keywords to set the colors of widgets, the format is:\\²< %code% fg[<STATE>] = { Red, Green, Blue }%%\\²---²> When using the "fg" and "bg" (or "base") keywords to set the colors of widgets, the format is:²> %code% fg[<STATE>] = { Red, Green, Blue }²43,44c36,37²< Another common way is to use hexadecimal values,like html colour codes begining with a '#' like this\\²< %code% fg[NORMAL] = "#ff0000"%%\\²---²> Another common way is to use hexadecimal values,like html colour codes begining with a '#' like this²> %code% fg[NORMAL] = "#FF0000"²48,49c41,42²< bg_pixmap is very similar to the above, except the colors are replaced by a filename. For example: \\²< %code% bg_pixmap[NORMAL] = "background.xpm"%%\\²---²> bg_pixmap is very similar to the above, except the colors are replaced by a filename. For example: ²> %code% bg_pixmap[NORMAL] = "background.xpm"²60,61c53,54²< The font directive is simply:\\²< %code% font = "-*-helvetica-medium-r-normal--16-*-*-*-*-*-*-*"%%\\²---²> The font directive is simply:²> %code% font = "-*-helvetica-medium-r-normal--16-*-*-*-*-*-*-*"²69,70c62,63²< When the keyword parent is used as an attribute, the widget will take on the attributes of its parent in the application.\\²< %code% bg_pixmap[NORMAL] = "<parent>"%%\\²---²> When the keyword parent is used as an attribute, the widget will take on the attributes of its parent in the application.²> %code% bg_pixmap[NORMAL] = "<parent>"²85c78²< !!Basic RC file²---²> = Basic RC file =²114,120c107²< [-This document originally taken from http://gtk.org/tutorial1.2/gtk_tut-21.html and modified to be PHP-GTK specific.-]]²< ²< [[#BottomBar]]²< [[#top top]]²< ----²< [[notitle]][[#top]]%color=#555555%{{Resources}} / [-[[$Edit edit this page]]-] ²< [[#BottomBarEnd]]²\ No newline at end of file²---²> [-This document originally taken from http://gtk.org/tutorial1.2/gtk_tut-21.html and modified to be PHP-GTK specific.-]]²\ No newline at end of file²
author:1092065883=nathan
host:1092065883=82.120.157.3