Blob Blame History Raw
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Property Class Definitions: Glade User Interface Designer Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="Glade User Interface Designer Reference Manual">
<link rel="up" href="catalog.html" title="Part I. Adding your custom widgets">
<link rel="prev" href="widgetclasses.html" title="Widget Adaptor Definitions">
<link rel="next" href="pythonsupport.html" title="Python Gtk widgets support">
<meta name="generator" content="GTK-Doc V1.28 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="catalog.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="widgetclasses.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="pythonsupport.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="properties"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle">Property Class Definitions</span></h2>
<p>Property Classes — 
How to augment or define a <a class="link" href="gladeui-GladePropertyClass.html#GladePropertyClass" title="GladePropertyClass"><span class="type">GladePropertyClass</span></a>
    </p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="id-1.2.4.3"></a><h2>Property Class Configuration</h2>
<p>
Properties are introspected at load time and loaded into <a class="link" href="gladeui-GladePropertyClass.html#GladePropertyClass" title="GladePropertyClass"><span class="type">GladePropertyClass</span></a> structures.
The behaviour of properties can be modified by the catalog and fake properties can be added
for editing purposes. Here is an example of the xml form:
      </p>
<pre class="programlisting">...

&lt;property id="frobnicate-mode" default="FOO_FROBNICATE_RED"&gt;

  ... spec, tooltip etc

  &lt;displayable-values&gt;

    &lt;value id="FOO_FROBNICATE_RED" name="Red"/&gt;
    &lt;value id="FOO_FROBNICATE_BLUE" name="Blue"/&gt;

    ... values here

  &lt;/displayable-values&gt;
&lt;/property&gt;

...</pre>
<p>


    </p>
<p>
Properties of the 'property' tag:
      </p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">id</span></p></td>
<td><p>
This is manditory and specifies the property that we are modifying (or adding)
            </p></td>
</tr>
<tr>
<td><p><span class="term">name</span></p></td>
<td><p>
The name to be used in the interface.
(if name is not specified; it defaults to the nickname of the <a href="/usr/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a>)
            </p></td>
</tr>
<tr>
<td><p><span class="term">since</span></p></td>
<td><p>
A 'major.minor' formed version describing the version of the owning catalog in which this 
property was introduced; example: <code class="literal">since="1.0"</code>. Properties are initialized
to be supported since the introducing <a class="link" href="gladeui-glade-widget-adaptor.html#GladeWidgetAdaptor"><span class="type">GladeWidgetAdaptor</span></a> was supported.
            </p></td>
</tr>
<tr>
<td><p><span class="term">disabled</span></p></td>
<td><p>
Remove this property from this widget class and derived classes
            </p></td>
</tr>
<tr>
<td><p><span class="term">default</span></p></td>
<td><p>
A default value to be used for this property
            </p></td>
</tr>
<tr>
<td><p><span class="term">translatable</span></p></td>
<td><p>
For text properties, whether the property value is translatable in glade
interfaces (this will enable the i18n dialog on text properties). Defaults to False.
            </p></td>
</tr>
<tr>
<td><p><span class="term">common</span></p></td>
<td><p>
If set to "True", the property will end up on the common tab even if
its not a property of GtkWidgetClass.
            </p></td>
</tr>
<tr>
<td><p><span class="term">optional</span></p></td>
<td><p>
Whether this property is an optional property, this will make the property
insensitive and add a check box to enable it (like width/height-request for
example).
            </p></td>
</tr>
<tr>
<td><p><span class="term">optional-default</span></p></td>
<td><p>
If this is in fact an optional property; whether it is enabled by default.
            </p></td>
</tr>
<tr>
<td><p><span class="term">query</span></p></td>
<td><p>
If query is set; the property will be queried from the user in a dialog
when adding the owning widget class instance to the project.
            </p></td>
</tr>
<tr>
<td><p><span class="term">save</span></p></td>
<td><p>
Whether to save this property to the glade file (default "True")
            </p></td>
</tr>
<tr>
<td><p><span class="term">visible</span></p></td>
<td><p>
Whether to show the property in the editor and reset dialog (default "True")
            </p></td>
</tr>
<tr>
<td><p><span class="term">custom-layout</span></p></td>
<td><p>
This is used to avoid loading this property in the editor when implementing
a custom <span class="type">GladeEditable</span> that embeds the base <a class="link" href="gladeui-glade-editor.html#GladeEditorTable" title="struct GladeEditorTable"><span class="type">GladeEditorTable</span></a> implementation,
custom-layout properties will still show up in the reset dialog (default "False)
            </p></td>
</tr>
<tr>
<td><p><span class="term">ignore</span></p></td>
<td><p>
Whether to set the property on the object instance (via g_object_set_property or
plugin override functions) when it changes in the editor (the value in the editor
is the value saved).
            </p></td>
</tr>
<tr>
<td><p><span class="term">themed-icon</span></p></td>
<td><p>
Depicts a string property that is used for an icon from the theme. These will
the appropriate editor.
            </p></td>
</tr>
<tr>
<td><p><span class="term">weight</span></p></td>
<td><p>
A numerical value to specify this properties position in the property editor.
            </p></td>
</tr>
<tr>
<td><p><span class="term">transfer-on-paste</span></p></td>
<td><p>
Used for packing properties; depicts packing properties that should follow
the widget when pasted to a new container that supports the same properties.
            </p></td>
</tr>
<tr>
<td><p><span class="term">save-always</span></p></td>
<td><p>
Specifies that the property should be saved regardless of its value (properties at thier
default values are normally not saved).
            </p></td>
</tr>
</tbody>
</table></div>
<p>
    </p>
<p>
Child tags of the 'property' tag:
      </p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">spec</span></p></td>
<td><p>
Specifies a function to be used to return a <a href="/usr/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> for this property;
this is used to add virtual properties to an object (like the "size" property
on <a href="/usr/share/gtk-doc/html/gtk3/GtkBox.html#GtkBox-struct"><span class="type">GtkBox</span></a>).
            </p></td>
</tr>
<tr>
<td><p><span class="term">tooltip</span></p></td>
<td><p>
The tooltip to be displayed in the property editor for this property. 
The tooltip defaults to the blurb of the associated <a href="/usr/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a>.
            </p></td>
</tr>
<tr>
<td><p><span class="term">visible-lines</span></p></td>
<td><p>
An integer value to specify how many lines will be shown for text properties
in the editor (this doesnt really work because of the complexity of calculating
size of rendered text; instead, just set this to 2 if you want the text property
to be edited in a textview with a scrolled window as opposed to a simple text entry).
            </p></td>
</tr>
<tr>
<td><p><span class="term">displayable-values</span></p></td>
<td><p>
Allows you to specify user friendly strings for enum and flag values as shown in the
example above, use the `id' property in the value tag to depict the real value name
and the `name' property for the human readable one.
            </p></td>
</tr>
</tbody>
</table></div>
<p>
    </p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.28</div>
</body>
</html>