Create  Edit  FrontPage  Index  Search  Changes  History  RSS  Back  Login

Gtk::Alignment Diff - Ruby-GNOME2 Project Website

  • Added parts are displayed like this.
  • Deleted parts are displayed like this.

= class Gtk::Alignment

The Gtk::Alignment widget controls the alignment and size of its child widget. It has four settings: xscale, yscale, xalign, and yalign.

The scale settings are used to specify how much the child widget should expand to fill the space allocated to the Gtk::Alignment. The values can range from 0 (meaning the child doesn't expand at all) to 1 (meaning the child expands to fill all of the available space).

The align settings are used to place the child widget within the available area. The values range from 0 (top or left) to 1 (bottom or right). Of course, if the scale settings are both set to 1, the alignment settings have no effect.

== Object Hierarchy

* Object
  * GLib::Instantiatable
    * GLib::Object
      * GLib::InitiallyUnowned
        * Gtk::Object
          * Gtk::Widget
            * Gtk::Container
              * Gtk::Bin
                * Gtk::Alignment

== Class Methods

--- Gtk::Alignment.new(xalign, yalixn, xscale, yscale)

    Creates a new Gtk::Alignment.
    * xalign: the horizontal alignment of the child widget, from 0 (left) to 1 (right).  
    * yalign: the vertical alignment of the child widget, from 0 (top) to 1 (bottom).  
    * xscale: the amount that the child widget expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all of the space allocated for the Gtk::Alignment.  
    * yscale: the amount that the child widget expands vertically to fill up unused space, from 0 to 1. The values are similar to xscale.  
    * Returns: a new Gtk::Alignment.

== Instance Methods

--- set(xalign, yalign, xscale, yscale)

    Sets the Gtk::Alignment values.
    * xalign: the horizontal alignment of the child widget, from 0 (left) to 1 (right).  
    * yalign: the vertical alignment of the child widget, from 0 (top) to 1 (bottom).  
    * xscale: the amount that the child widget expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all of the space allocated for the Gtk::Alignment.  
    * yscale: the amount that the child widget expands vertically to fill up unused space, from 0 to 1. The values are similar to xscale.  
    * Returns: self

--- xalign

    Returns the xalign value.
    * Returns: the xalign value

--- xalign=(xalign)

    Sets the xalign value.
    * xalign: xalign value
    * Returns: xalign

--- set_xalign(xalign)

    Same as Gtk::Alignment#xalign=.
    * xalign: xalign value
    * Returns: self

--- yalign

    Returns the yalign value.
    * Returns: yalign value

--- yalign=(yalign)

    Sets the yalign value.
    * yalign: yalign value
    * Returns: yalign

--- set_yalign(yalign)

    Same as Gtk::Alignment#yalign=.
    * yalign: yalign value
    * Returns: self

--- xscale

    Returns the xscale value.
    * Returns: the xscale value.

--- xscale=(xscale)

    Sets the xscale value.
    * xscale: xscale value
    * Returns: xscale

--- set_xscale(xscale)

    Same as Gtk::Alignment#xscale=.
    * xscale: xscale value
    * Returns: self

--- yscale

    Returns the yscale value.
    * Returns: the yscale value.

--- yscale=(yscale)

    Sets the xscale value.
    * yscale: yscale value
    * Returns: yscale

--- set_yscale(yscale)

    Same as Gtk::Alignment#yscale=.
    * yscale: yscale value
    * Returns: self

--- padding

    Gets the padding on the different sides of the widget. See Gtk::Alignment#set_padding. ((* Since 2.4 *))
    * Returns: [top, bottom, left, right]
      * top: the padding for the top of the widget
      * bottom: the padding for the bottom of the widget
      * left: the padding for the left of the widget
      * right: the padding for the right of the widget

--- set_padding(top, bottom, left, right)

    Sets the padding on the different sides of the widget. The padding adds blank space to the sides of the widget. For instance, this can be used to indent the child widget towards the right by adding padding on the left. ((* Since 2.4 *))
     * top: the padding for the top of the widget
     * bottom: the padding for the bottom of the widget
     * left: the padding for the left of the widget
     * right: the padding for the right of the widget
     * Returns: self

--- top_padding

    Gets the padding to insert at the top of the widget. ((* Since 2.4 *))
    * Returns: The padding to insert at the top of the widget.

--- top_padding=(top_padding)

    Sets the padding to insert at the top of the widget. ((* Since 2.4 *))
    * top_padding: The padding to insert at the top of the widget.
    * Returns: top_padding

--- set_top_padding(top_padding)

    Same as Gtk::Alignment#top_padding=. ((* Since 2.4 *))
    * top_padding: The padding to insert at the top of the widget.
    * Returns: self

--- bottom_padding

    Gets the  padding to insert at the bottom of the widget. ((* Since 2.4 *))
    * Returns: The padding to insert at the bottom of the widget.

--- bottom_padding=(bottom_padding)

    Sets the padding to insert at the bottom of the widget. ((* Since 2.4 *))
    * bottom_padding: The padding to insert at the bottom of the widget.
    * Returns: bottom_padding

--- set_bottom_padding(bottom_padding)

    Same as Gtk::Alignment#bottom_padding=. ((* Since 2.4 *))
    * bottom_padding: The padding to insert at the bottom of the widget.
    * Returns: self

--- left_padding

    Gets the padding to insert at the left of the widget. ((* Since 2.4 *))
    * Returns: The padding to insert at the left of the widget.

--- left_padding=(left_padding)

    Sets the padding to insert at the left of the widget. ((* Since 2.4 *))
    * left_padding: The padding to insert at the left of the widget.
    * Returns: left_padding

--- set_left_padding(left_padding)

    Same as Gtk::Alignment#left_padding=. ((* Since 2.4 *))
    * left_padding: The padding to insert at the left of the widget.
    * Returns: self

--- right_padding

    Gets the padding to insert at the right of the widget. ((* Since 2.4 *))
    * Returns: The padding to insert at the right of the widget.

--- right_padding=(right_padding)

    Sets the padding to insert at the right of the widget. ((* Since 2.4 *))
    * right_padding: The padding to insert at the right of the widget.
    * Returns: right_padding

--- set_right_padding(right_padding)

    Same as Gtk::Alignment#right_padding=. ((* Since 2.4 *))
    * right_padding: The padding to insert at the right of the widget.
    * Returns: self

--- ref_accessible

    See Atk::Implementor#ref_accessible.

--- add_child

    See Gtk::Buildable#add_child.

--- construct_child

    See Gtk::Buildable#construct_child.

--- get_internal_child

    See Gtk::Buildable#get_internal_child.

--- name

    See Gtk::Buildable#name.

--- name=

    See Gtk::Buildable#name=.

--- set_buildable_property

    See Gtk::Buildable#set_buildable_property.

--- set_name

    See Gtk::Buildable#set_name.

--- builder_name

    See Gtk::Buildable#builder_name.

--- builder_name=

    See Gtk::Buildable#builder_name=.

--- set_builder_name

    See Gtk::Buildable#set_builder_name.

== Properties

--- xalign: Float (Read/Write)

    Horizontal position of child in available space. 0.0 is left aligned, 1.0 is right aligned
    * Allowed values: [0,1]
    * Default value: 0.5

--- xscale: Float (Read/Write)

    If available horizontal space is bigger than needed for the child, how much of it to use for the child. 0.0 means none, 1.0 means all
    * Allowed values: [0,1]
    * Default value: 1

--- yalign: Float (Read/Write)

    Vertical position of child in available space. 0.0 is top aligned, 1.0 is bottom aligned
    * Allowed values: [0,1]
    * Default value: 0.5

--- yscale: Float (Read/Write)

    If available vertical space is bigger than needed for the child, how much of it to use for the child. 0.0 means none, 1.0 means all
    * Allowed values: [0,1]
    * Default value: 1

--- bottom-padding: Integer (Read/Write)

    The padding to insert at the bottom of the widget. ((* Since 2.4 *))
    * Allowed values: <= GLib::MAXINT
    * Default value: 0

--- left-padding: Integer (Read/Write)

    The padding to insert at the left of the widget. ((* Since 2.4 *))
    * Allowed values: <= GLib::MAXINT
    * Default value: 0

--- right-padding: Integer (Read/Write)

    The padding to insert at the right of the widget. ((* Since 2.4 *))
    * Allowed values: <= GLib::MAXINT
    * Default value: 0

--- top-padding: Integer (Read/Write)

    The padding to insert at the top of the widget. ((* Since 2.4 *))
    * Allowed values: <= GLib::MAXINT
    * Default value: 0

== See Also

== ChangeLog

* 2006-01-31 Apply 2.4 methods - ((<Masao>))