⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gtk-resource-files.html

📁 该压缩包包含了GTK+的大量API函数
💻 HTML
📖 第 1 页 / 共 4 页
字号:
><DT><TTCLASS="LITERAL">bg_text[<TTCLASS="REPLACEABLE"><I>state</I></TT>] =      <TTCLASS="REPLACEABLE"><I>color</I></TT></TT></DT><DD><P>         Set a background pixmap to be used in place of         the <TTCLASS="LITERAL">bg</TT> color (or for <AHREF="gtktext.html">GtkText</A>,         in place of the <TTCLASS="LITERAL">base</TT> color.       </P></DD><DT><TTCLASS="LITERAL">font = <TTCLASS="REPLACEABLE"><I>font</I></TT></TT></DT><DD><P>         Set the font for a widget.       </P></DD><DT><TTCLASS="LITERAL">fontset = <TTCLASS="REPLACEABLE"><I>font</I></TT></TT></DT><DD><P>         Set the fontset for a widget. Overrides any         <TTCLASS="LITERAL">font</TT> declarations.       </P></DD></DL></DIV></P><P>The colors and background pixmaps are specified as a function of thestate of the widget. The states are:<P></P><DIVCLASS="VARIABLELIST"><DL><DT><TTCLASS="LITERAL">NORMAL</TT></DT><DD><P>        A color used for a widget in its normal state      </P></DD><DT><TTCLASS="LITERAL">ACTIVE</TT></DT><DD><P>        A variant of the <TTCLASS="LITERAL">NORMAL</TT> color used when the        widget is in the <TTCLASS="LITERAL">GTK_STATE_ACTIVE</TT> state, and also for        the trough of a ScrollBar, tabs of a NoteBook        other than the current tab and similar areas.        Frequently, this should be a darker variant        of the <TTCLASS="LITERAL">NORMAL</TT> color.      </P></DD><DT><TTCLASS="LITERAL">PRELIGHT</TT></DT><DD><P>        A color used for widgets in the <TTCLASS="LITERAL">GTK_STATE_PRELIGHT</TT> state. This        state is the used for Buttons and MenuItems        that have the mouse cursor over them, and for         their children.      </P></DD><DT><TTCLASS="LITERAL">SELECTED</TT></DT><DD><P>        A color used to highlight data selected by the user.        for instance, the selected ListItems in a List widget, and the        selection in an Editable widget.      </P></DD><DT><TTCLASS="LITERAL">INSENSITIVE</TT></DT><DD><P>        A color used for the background of widgets that have        been set insenstivie with gtk_widget_set_senstive()      </P></DD></DL></DIV></P><P>Colors can be specified as a string <TTCLASS="LITERAL">"#rrrrggggbbbb"</TT>,<TTCLASS="LITERAL">"#rrrgggbbb"</TT>, <TTCLASS="LITERAL">"#rrggbb"</TT>,or <TTCLASS="LITERAL">"#rgb"</TT>, where <TTCLASS="LITERAL">r</TT><TTCLASS="LITERAL">g</TT>, and <TTCLASS="LITERAL">b</TT> arehex digits, or they can be specified as a triplet of floats<TTCLASS="LITERAL">{ <TTCLASS="REPLACEABLE"><I>r</I></TT>, <TTCLASS="REPLACEABLE"><I>g</I></TT>,<TTCLASS="REPLACEABLE"><I>b</I></TT>}</TT>.</P></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN4898"></A><H3>Key bindings</H3><P>Key bindings allow the user to specify actions to be taken on particular key presses. The form of a bindingset declaration is:</P><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">binding <TTCLASS="REPLACEABLE"><I>name</I></TT> {  bind <TTCLASS="REPLACEABLE"><I>key</I></TT> {     <TTCLASS="REPLACEABLE"><I>signalname</I></TT> (<TTCLASS="REPLACEABLE"><I>param</I></TT>, ...)    ...  }  ...}</PRE></TD></TR></TABLE><P><TTCLASS="REPLACEABLE"><I>key</I></TT> is a string consisting of a series of modifiers followed by the name of a key. Themodifiers can be:<P></P><TABLEBORDER="0"><TBODY><TR><TD><TTCLASS="LITERAL">&lt;alt&gt;</TT></TD></TR><TR><TD><TTCLASS="LITERAL">&lt;control&gt;</TT></TD></TR><TR><TD><TTCLASS="LITERAL">&lt;mod1&gt;</TT></TD></TR><TR><TD><TTCLASS="LITERAL">&lt;mod2&gt;</TT></TD></TR><TR><TD><TTCLASS="LITERAL">&lt;mod3&gt;</TT></TD></TR><TR><TD><TTCLASS="LITERAL">&lt;mod4&gt;</TT></TD></TR><TR><TD><TTCLASS="LITERAL">&lt;mod5&gt;</TT></TD></TR><TR><TD><TTCLASS="LITERAL">&lt;release&gt;</TT></TD></TR><TR><TD><TTCLASS="LITERAL">&lt;shft&gt;</TT></TD></TR><TR><TD><TTCLASS="LITERAL">&lt;shift&gt;</TT></TD></TR></TBODY></TABLE><P></P><TTCLASS="LITERAL">&lt;shft&gt;</TT> is an alias for <TTCLASS="LITERAL">&lt;shift&gt;</TT> and <TTCLASS="LITERAL">&lt;alt&gt;</TT> is an alias for<TTCLASS="LITERAL">&lt;mod1&gt;</TT>.</P><P>The action that is bound to the key is a sequenceof signal names (strings) followed by parameters for each signal. The signals must be action signals.(See <AHREF="gtk-signals.html#GTK-SIGNAL-NEW">gtk_signal_new</A>()). Each parameter can bea float, integer, string, or unquoted stringrepresenting an enumeration value. The types ofthe parameters specified must match the types of the parameters of the signal.</P><P>Binding sets are connected to widgets in thesame manner as styles, with one addition. A priority can be specified for each pattern,and within each type of pattern, binding setsoverride other binding sets first by priority,and only then by order of specification. (Lateroverrides earlier). The priorities that canbe specified are (highest to lowest):<P></P><TABLEBORDER="0"><TBODY><TR><TD><TTCLASS="LITERAL">HIGHEST</TT></TD></TR><TR><TD><TTCLASS="LITERAL">RC</TT></TD></TR><TR><TD><TTCLASS="LITERAL">APPLICATION</TT></TD></TR><TR><TD><TTCLASS="LITERAL">GTK</TT></TD></TR><TR><TD><TTCLASS="LITERAL">LOWEST</TT></TD></TR></TBODY></TABLE><P></P><TTCLASS="LITERAL">RC</TT> is the default for bindingsread from an RC file, <TTCLASS="LITERAL">APPLICATION</TT>should be used for bindings an application setsup, and <TTCLASS="LITERAL">GTK</TT> is used for bindingsthat GTK+ creates internally.</P></DIV></DIV><DIVCLASS="REFSECT1"><ANAME="AEN4950"></A><H2>Details</H2><DIVCLASS="REFSECT2"><ANAME="AEN4952"></A><H3><ANAME="GTKRCSTYLE"></A>struct GtkRcStyle</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">struct GtkRcStyle{  gchar *name;  gchar *font_name;  gchar *fontset_name;  gchar *bg_pixmap_name[5];  GtkRcFlags color_flags[5];  GdkColor   fg[5];  GdkColor   bg[5];  GdkColor   text[5];  GdkColor   base[5];  GtkThemeEngine *engine;  gpointer        engine_data;  /* Private */  guint ref_count;};</PRE></TD></TR></TABLE><P>The <AHREF="gtk-resource-files.html#GTKRCSTYLE">GtkRcStyle</A> structure is used to represent a setof information about the appearance of a widget.This can later be composited together with other<AHREF="gtk-resource-files.html#GTKRCSTYLE">GtkRcStyle</A> structures to form a <AHREF="gtk-styles.html#GTKSTYLE">GtkStyle</A>.</P></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN4960"></A><H3><ANAME="GTKRCFLAGS"></A>enum GtkRcFlags</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">typedef enum {  GTK_RC_FG   = 1 &lt;&lt; 0,  GTK_RC_BG   = 1 &lt;&lt; 1,  GTK_RC_TEXT = 1 &lt;&lt; 2,  GTK_RC_BASE = 1 &lt;&lt; 3} GtkRcFlags;</PRE></TD></TR></TABLE><P>The <AHREF="gtk-resource-files.html#GTKRCFLAGS">GtkRcFlags</A> enumeration is used as a bitmaskto specify which fields of a <AHREF="gtk-resource-files.html#GTKRCSTYLE">GtkRcStyle</A> have beenset for each state.</P><P></P><DIVCLASS="VARIABLELIST"><DL><DT><TTCLASS="LITERAL">GTK_RC_FG</TT></DT><DD><P>   If present, the foreground color has been set for this state.   </P></DD><DT><TTCLASS="LITERAL">GTK_RC_BG</TT></DT><DD><P>   If present, the background color has been set for this state.   </P></DD><DT><TTCLASS="LITERAL">GTK_RC_TEXT</TT></DT><DD><P>   If present, the text color has been set for this state.   </P></DD><DT><TTCLASS="LITERAL">GTK_RC_BASE</TT></DT><DD><P>   If present, the base color has been set for this state.   </P></DD></DL></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN4988"></A><H3><ANAME="GTKIMAGELOADER"></A>GtkImageLoader ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING"><AHREF=../gdk/gdk-bitmaps-and-pixmaps.html#GDKPIXMAP>GdkPixmap</A>*  (*GtkImageLoader)               (<AHREF=../gdk/gdk-windows.html#GDKWINDOW>GdkWindow</A> *window,                                             <AHREF=../gdk/gdk-colormaps-and-colors.html#GDKCOLORMAP>GdkColormap</A> *colormap,                                             <AHREF=../gdk/gdk-bitmaps-and-pixmaps.html#GDKBITMAP>GdkBitmap</A> **mask,                                             <AHREF=../gdk/gdk-colormaps-and-colors.html#GDKCOLOR>GdkColor</A> *transparent_color,                                             const <AHREF=../glib/glib-basic-types.html#GCHAR>gchar</A> *filename);</PRE></TD></TR></TABLE><P>A GtkImageLoader is used to load a filename found ina RC file.</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN4999"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>window</I></TT>&nbsp;:</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the window for creating image</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>colormap</I></TT>&nbsp;:</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the colormap for this image</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>mask</I></TT>&nbsp;:</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">a pointer to the location to store the mask</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>transparent_color</I></TT>&nbsp;:</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the transparent color for the image</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>filename</I></TT>&nbsp;:</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">filename to load</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><ICLASS="EMPHASIS">Returns</I> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">a <AHREF="gtkpixmap.html">GtkPixmap</A> representing <TTCLASS="PARAMETER"><I>filename</I></TT>&#13;</TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN5030"></A><H3><ANAME="GTKRCTOKENTYPE"></A>enum GtkRcTokenType</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">typedef enum {  GTK_RC_TOKEN_INVALID = G_TOKEN_LAST,  GTK_RC_TOKEN_INCLUDE,  GTK_RC_TOKEN_NORMAL,  GTK_RC_TOKEN_ACTIVE,  GTK_RC_TOKEN_PRELIGHT,  GTK_RC_TOKEN_SELECTED,  GTK_RC_TOKEN_INSENSITIVE,  GTK_RC_TOKEN_FG,  GTK_RC_TOKEN_BG,  GTK_RC_TOKEN_BASE,  GTK_RC_TOKEN_TEXT,  GTK_RC_TOKEN_FONT,  GTK_RC_TOKEN_FONTSET,  GTK_RC_TOKEN_BG_PIXMAP,  GTK_RC_TOKEN_PIXMAP_PATH,  GTK_RC_TOKEN_STYLE,  GTK_RC_TOKEN_BINDING,  GTK_RC_TOKEN_BIND,  GTK_RC_TOKEN_WIDGET,  GTK_RC_TOKEN_WIDGET_CLASS,  GTK_RC_TOKEN_CLASS,  GTK_RC_TOKEN_LOWEST,  GTK_RC_TOKEN_GTK,  GTK_RC_TOKEN_APPLICATION,  GTK_RC_TOKEN_RC,  GTK_RC_TOKEN_HIGHEST,  GTK_RC_TOKEN_ENGINE,  GTK_RC_TOKEN_MODULE_PATH,  GTK_RC_TOKEN_LAST} GtkRcTokenType;</PRE></TD></TR></TABLE><P>The <AHREF="gtk-resource-files.html#GTKRCTOKENTYPE">GtkRcTokenType</A> enumeration represents the tokensin the RC file. It is exposed so that theme enginescan reuse these tokens when parsing the theme-enginespecific portions of a RC file.</P></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN5036"></A><H3><ANAME="GTK-RC-GET-STYLE"></A>gtk_rc_get_style ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING"><AHREF="gtk-styles.html#GTKSTYLE">GtkStyle</A>*   gtk_rc_get_style                (<AHREF="gtkwidget.html">GtkWidget</A> *widget);</PRE></TD></TR></TABLE><P>Finds all matching RC styles for a given widget,composites them together, and then creates a <AHREF="gtk-styles.html#GTKSTYLE">GtkStyle</A> representing the composite appearance.(GTK+ actually keeps a cache of previously created styles, so a new style may not becreated.)</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN5044"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>widget</I></TT>&nbsp;:</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">a <AHREF="gtkwidget.html">GtkWidget</A></TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><ICLASS="EMPHASIS">Returns</I> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the resulting style. The caller shouldreference the result, since GTK+ will retain theinitial reference count itself for the cacheof created styles.&#13;</TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN5058"></A><H3><ANAME="GTK-RC-ADD-WIDGET-NAME-STYLE"></A>gtk_rc_add_widget_name_style ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">void        gtk_rc_add_widget_name_style    (<AHREF="gtk-resource-files.html#GTKRCSTYLE">GtkRcStyle</A> *rc_style,                                             const <AHREF=../glib/glib-basic-types.html#GCHAR>gchar</A> *pattern);</PRE></TD></TR></TABLE><P>Add a RcStyle that will be looked up by a match againstthe widget's pathname. This is equivalent to a:<TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">widget PATTERN style STYLE</PRE></TD></TR></TABLE>statement in a RC file.</P

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -