[2018] | 1 | # pixmap_path "<dir 1>:<dir 2>:<dir 3>:..." |
---|
| 2 | # |
---|
| 3 | pixmap_path "/usr/include/X11R6/pixmaps:/home/imain/pixmaps" |
---|
| 4 | # |
---|
| 5 | # style <name> [= <name>] |
---|
| 6 | # { |
---|
| 7 | # <option> |
---|
| 8 | # } |
---|
| 9 | # |
---|
| 10 | # widget <widget_set> style <style_name> |
---|
| 11 | # widget_class <widget_class_set> style <style_name> |
---|
| 12 | |
---|
| 13 | # Here is a list of all the possible states. Note that some do not apply to |
---|
| 14 | # certain widgets. |
---|
| 15 | # |
---|
| 16 | # NORMAL - The normal state of a widget, without the mouse over top of |
---|
| 17 | # it, and not being pressed, etc. |
---|
| 18 | # |
---|
| 19 | # PRELIGHT - When the mouse is over top of the widget, colors defined |
---|
| 20 | # using this state will be in effect. |
---|
| 21 | # |
---|
| 22 | # ACTIVE - When the widget is pressed or clicked it will be active, and |
---|
| 23 | # the attributes assigned by this tag will be in effect. |
---|
| 24 | # |
---|
| 25 | # INSENSITIVE - When a widget is set insensitive, and cannot be |
---|
| 26 | # activated, it will take these attributes. |
---|
| 27 | # |
---|
| 28 | # SELECTED - When an object is selected, it takes these attributes. |
---|
| 29 | # |
---|
| 30 | # Given these states, we can set the attributes of the widgets in each of |
---|
| 31 | # these states using the following directives. |
---|
| 32 | # |
---|
| 33 | # fg - Sets the foreground color of a widget. |
---|
[2050] | 34 | # bg - Sets the background color of a widget. |
---|
[2018] | 35 | # bg_pixmap - Sets the background of a widget to a tiled pixmap. |
---|
| 36 | # font - Sets the font to be used with the given widget. |
---|
| 37 | # |
---|
| 38 | |
---|
| 39 | # This sets a style called "button". The name is not really important, as |
---|
| 40 | # it is assigned to the actual widgets at the bottom of the file. |
---|
| 41 | |
---|
| 42 | style "window" |
---|
| 43 | { |
---|
| 44 | #This sets the padding around the window to the pixmap specified. |
---|
| 45 | #bg_pixmap[<STATE>] = "<pixmap filename>" |
---|
| 46 | #bg_pixmap[NORMAL] = "warning.xpm" |
---|
| 47 | bg[NORMAL] = { 0, 0, 0 } |
---|
[2050] | 48 | fg[NORMAL] = { 0, 1.0, 0 } |
---|
| 49 | base[NORMAL] = { 0, 0, 0 } |
---|
| 50 | base[INSENSITIVE] = { 0, 0, 0 } |
---|
[2018] | 51 | } |
---|
| 52 | |
---|
| 53 | style "scale" |
---|
| 54 | { |
---|
| 55 | #Sets the foreground color (font color) to red when in the "NORMAL" |
---|
| 56 | #state. |
---|
| 57 | |
---|
[2050] | 58 | fg[NORMAL] = { 0, 1.0, 0 } |
---|
| 59 | bg[NORMAL] = { 0, 1.0, 0 } |
---|
| 60 | bg[INSENSITIVE] = { 0, 1.0, 0 } |
---|
| 61 | bg[PRELIGHT] = { 0, 1.0, 0 } |
---|
| 62 | bg[ACTIVE] = {0.2, 0.2, 0.2 } |
---|
[2018] | 63 | |
---|
| 64 | #Sets the background pixmap of this widget to that of its parent. |
---|
| 65 | bg_pixmap[NORMAL] = "<parent>" |
---|
| 66 | } |
---|
| 67 | |
---|
| 68 | style "button" |
---|
| 69 | { |
---|
| 70 | # This shows all the possible states for a button. The only one that |
---|
| 71 | # doesn't apply is the SELECTED state. |
---|
| 72 | |
---|
| 73 | fg[PRELIGHT] = { 0, 0, 0 } |
---|
[2050] | 74 | bg[PRELIGHT] = { 0, 1.0, 0 } |
---|
| 75 | bg[ACTIVE] = { 0, 1.0, 0 } |
---|
[2018] | 76 | fg[ACTIVE] = { 0, 1.0, 0 } |
---|
| 77 | bg[NORMAL] = { 0, 0, 0 } |
---|
[2050] | 78 | fg[NORMAL] = { 0, 1.0, 0 } |
---|
| 79 | bg[INSENSITIVE] = { 1.0, 0, 1.0 } |
---|
[2018] | 80 | fg[INSENSITIVE] = { 1.0, 0, 1.0 } |
---|
[2050] | 81 | base[NORMAL] = { 0, 1.0, 0 } |
---|
| 82 | base[PRELIGHT] = { 0, 1.0, 0 } |
---|
[2018] | 83 | } |
---|
| 84 | |
---|
| 85 | # In this example, we inherit the attributes of the "button" style and then |
---|
| 86 | # override the font and background color when prelit to create a new |
---|
| 87 | # "main_button" style. |
---|
| 88 | |
---|
| 89 | style "main_button" = "button" |
---|
| 90 | { |
---|
| 91 | font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*" |
---|
[2050] | 92 | bg[PRELIGHT] = { 0, 0.75, 0 } |
---|
[2018] | 93 | } |
---|
| 94 | |
---|
| 95 | style "toggle_button" = "button" |
---|
| 96 | { |
---|
[2050] | 97 | fg[NORMAL] = { 0, 1.0, 0 } |
---|
| 98 | fg[ACTIVE] = { 0, 1.0, 0 } |
---|
[2018] | 99 | text[NORMAL] = { 0, 0, 0} |
---|
| 100 | # This sets the background pixmap of the toggle_button to that of its |
---|
| 101 | # parent widget (as defined in the application). |
---|
| 102 | #bg_pixmap[NORMAL] = "<parent>" |
---|
| 103 | } |
---|
| 104 | |
---|
| 105 | style "text" |
---|
| 106 | { |
---|
| 107 | #bg_pixmap[NORMAL] = "marble.xpm" |
---|
[2050] | 108 | fg[NORMAL] = { 0, 1.0, 0 } |
---|
[2018] | 109 | } |
---|
| 110 | |
---|
| 111 | style "ruler" |
---|
| 112 | { |
---|
| 113 | font = "-adobe-helvetica-medium-r-normal--*-20-*-*-*-*-*-*" |
---|
| 114 | } |
---|
| 115 | |
---|
| 116 | # pixmap_path "~/.pixmaps" |
---|
| 117 | |
---|
| 118 | # These set the widget types to use the styles defined above. |
---|
| 119 | # The widget types are listed in the class hierarchy, but could probably be |
---|
| 120 | # just listed in this document for the users reference. |
---|
| 121 | |
---|
[3299] | 122 | widget_class "GtkWindow" style "window" |
---|
| 123 | widget_class "GtkFrame" style "window" |
---|
| 124 | widget_class "Gtk*EventBox" style "window" |
---|
| 125 | widget_class "GtkDialog" style "window" |
---|
| 126 | widget_class "GtkFileSelection" style "window" |
---|
| 127 | widget_class "*Gtk*Scale" style "scale" |
---|
| 128 | widget_class "*GtkCheckButton*" style "toggle_button" |
---|
| 129 | widget_class "*Gtk*Menu*" style "toggle_button" |
---|
| 130 | widget_class "*GtkRadioButton*" style "toggle_button" |
---|
| 131 | widget_class "*GtkButton*" style "button" |
---|
| 132 | widget_class "*Ruler" style "ruler" |
---|
| 133 | widget_class "*GtkText" style "text" |
---|
| 134 | widget_class "*GtkLabel" style "text" |
---|
[2018] | 135 | |
---|
| 136 | |
---|
| 137 | # This sets all the buttons that are children of the "main window" to |
---|
| 138 | # the main_button style. These must be documented to be taken advantage of. |
---|
| 139 | widget "main window.*GtkButton*" style "main_button" |
---|