Crea  Modifica  FrontPage  Indici  Cerca  Ultime modifiche  History  RSS  Login

Gtk::AspectFrame

class Gtk::AspectFrame

The Gtk::AspectFrame is useful when you want pack a widget so that it can resize but always retains the same aspect ratio. For instance, one might be drawing a small preview of a larger image. Gtk::AspectFrame derives from Gtk::Frame, so it can draw a label and a frame around the child. The frame will be "shrink-wrapped" to the size of the child.

Class Methods

Gtk::AspectFrame.new(label, xalign, yalign, ratio, obey_child)
Create a new Gtk::AspectFrame.
  • label: Label text.
  • xalign: Horizontal alignment of the child within the allocation of the Gtk::AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned)
  • yalign: Vertical alignment of the child within the allocation of the Gtk::AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned)
  • ratio: The desired aspect ratio.
  • obey_child: If true, ratio is ignored, and the aspect ratio is taken from the requistion of the child.
  • Returns: the new Gtk::AspectFrame.

Instance Methods

set(xalign, yalign, ratio, obey_child)
Set parameters for an existing Gtk::AspectFrame.
  • xalign: Horizontal alignment of the child within the allocation of the Gtk::AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned)
  • yalign: Vertical alignment of the child within the allocation of the Gtk::AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned)
  • ratio: The desired aspect ratio.
  • obey_child: If true, ratio is ignored, and the aspect ratio is taken from the requistion of the child.
  • Returns: self
obey_child?
Gets the current obey_child value.
  • Returns: The current obey_child value.
obey_child=(obey_child)
Sets the obey_child value.
  • obey_child: true or false
  • Returns: obey_child
set_obey_child(obey_child)
Same as Gtk::AspectFrame#obey_child=.
  • obey_child: true or false
  • Returns: self
ratio
Gets the current ratio.
  • Returns: The current ratio value.
ratio=(ratio)
Sets the ratio value.
  • ratio: The desired aspect ratio.
  • Returns: ratio
set_ratio(ratio)
Same as Gtk::AspectFrame#ratio=.
  • ratio: The desired aspect ratio
  • Returns: self
xalign
Gets the current xalign.
  • Returns: The current xalign value
xalign=(xalign)
Sets the horizontal alignment of the child within the allocation of the Gtk::AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned).
  • xalign: The xalign value
  • Returns: xalign
set_xalign(xalign)
Same as Gtk::AspectFrame#xalign=(xalign).
  • xalign: The xalign value
  • Returns: self
yalign
Gets the current yalign.
  • Returns: The current yalign value
yalign=(yalign)
Sets the vertical alignment of the child within the allocation of the Gtk::AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned)
  • yalign: The xalign value
  • Returns: yalign
set_yalign(yalign)
Same as Gtk::AspectFrame#yalign=(yalign)
  • yalign: The xalign value
  • Returns: yalign

Properties

obey-child: true or false (Read/Write)
Force aspect ratio to match that of the frame's child
  • Default value: true
ratio: Float (Read/Write)
Aspect ratio if obey_child is false
  • Allowed values: [1e-04,10000]
  • Default value: 0.5
xalign: Float (Read/Write)
X alignment of the child
  • Allowed values: [0,1]
  • Default value: 0.5
yalign: Float (Read/Write)
Y alignment of the child
  • Allowed values: [0,1]
  • Default value: 0.5

ChangeLog

  • 2006-01-31 Revised. - Masao
Ultima modifica:2007/01/30 02:19:45
Parola chiave:
Referenze:[Gtk::AspectFrame]