mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 19:40:43 -05:00
layout, box: Write long description for Box
Also have an example of how to create a Box with a layout manager and how to use the pack() method.
This commit is contained in:
parent
9f06f726d4
commit
adca939101
@ -2,7 +2,44 @@
|
|||||||
* SECTION:clutter-box
|
* SECTION:clutter-box
|
||||||
* @short_description: A Generic layout container
|
* @short_description: A Generic layout container
|
||||||
*
|
*
|
||||||
* #ClutterBox is a FIXME
|
* #ClutterBox is a #ClutterActor sub-class implementing the #ClutterContainer
|
||||||
|
* interface. A Box delegates the whole size requisition and size allocation to
|
||||||
|
* a #ClutterLayoutManager instance.
|
||||||
|
*
|
||||||
|
* <example id="example-clutter-box">
|
||||||
|
* <title>Using ClutterBox</title>
|
||||||
|
* <para>The following code shows how to create a #ClutterBox with
|
||||||
|
* a #ClutterLayoutManager sub-class, and how to add children to
|
||||||
|
* it via clutter_box_pack().</para>
|
||||||
|
* <programlisting>
|
||||||
|
* ClutterActor *box;
|
||||||
|
* ClutterLayoutManager *layout;
|
||||||
|
*
|
||||||
|
* /* Create the layout manager first */
|
||||||
|
* layout = clutter_box_layout_new ();
|
||||||
|
* clutter_box_layout_set_homogeneous (CLUTTER_BOX_LAYOUT (layout), TRUE);
|
||||||
|
* clutter_box_layout_set_spacing (CLUTTER_BOX_LAYOUT (layout), 12);
|
||||||
|
*
|
||||||
|
* /* Then create the ClutterBox actor. The Box will take
|
||||||
|
* * ownership of the ClutterLayoutManager instance by sinking
|
||||||
|
* * its floating reference
|
||||||
|
* */
|
||||||
|
* box = clutter_box_new (layout);
|
||||||
|
*
|
||||||
|
* /* Now add children to the Box using the variadic arguments
|
||||||
|
* * function clutter_box_pack() to set layout properties
|
||||||
|
* */
|
||||||
|
* clutter_box_pack (CLUTTER_BOX (box), actor,
|
||||||
|
* "x-align", CLUTTER_BOX_ALIGNMENT_CENTER,
|
||||||
|
* "y-align", CLUTTER_BOX_ALIGNMENT_END,
|
||||||
|
* "expand", TRUE,
|
||||||
|
* NULL);
|
||||||
|
* </programlisting>
|
||||||
|
* </example>
|
||||||
|
*
|
||||||
|
* #ClutterBox<!-- -->'s clutter_box_pack() wraps the generic
|
||||||
|
* clutter_container_add_actor() function, but it also allows setting
|
||||||
|
* layout properties while adding the new child to the box.
|
||||||
*
|
*
|
||||||
* #ClutterBox is available since Clutter 1.2
|
* #ClutterBox is available since Clutter 1.2
|
||||||
*/
|
*/
|
||||||
@ -237,6 +274,9 @@ clutter_box_real_get_preferred_width (ClutterActor *actor,
|
|||||||
{
|
{
|
||||||
ClutterBoxPrivate *priv = CLUTTER_BOX (actor)->priv;
|
ClutterBoxPrivate *priv = CLUTTER_BOX (actor)->priv;
|
||||||
|
|
||||||
|
/* if we don't have any children don't bother proxying the
|
||||||
|
* call to the layout manager instance
|
||||||
|
*/
|
||||||
if (priv->children == NULL)
|
if (priv->children == NULL)
|
||||||
{
|
{
|
||||||
if (min_width)
|
if (min_width)
|
||||||
@ -262,6 +302,9 @@ clutter_box_real_get_preferred_height (ClutterActor *actor,
|
|||||||
{
|
{
|
||||||
ClutterBoxPrivate *priv = CLUTTER_BOX (actor)->priv;
|
ClutterBoxPrivate *priv = CLUTTER_BOX (actor)->priv;
|
||||||
|
|
||||||
|
/* if we don't have any children don't bother proxying the
|
||||||
|
* call to the layout manager instance
|
||||||
|
*/
|
||||||
if (priv->children == NULL)
|
if (priv->children == NULL)
|
||||||
{
|
{
|
||||||
if (min_height)
|
if (min_height)
|
||||||
|
Loading…
Reference in New Issue
Block a user