新規作成  編集  Ruby-GNOME2 Project Website  ページ一覧  検索  更新履歴  編集履歴  RSS  ログイン

Gtk::AspectFrame

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.

インクルードされているモジュール

  • Gtk::Buildable?
  • Atk::Implementor
  • GLib::Interface?

クラスメソッド

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.

インスタンスメソッド

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

プロパティ

obey-child: true or false (Read/Write)
Force aspect ratio to match that of the frame's child
ratio: Float (Read/Write)
Aspect ratio if obey_child is FALSE
xalign: Float (Read/Write)
X alignment of the child
yalign: Float (Read/Write)
Y alignment of the child

更新履歴

  • 2014-06-15 インクルードされているモジュールの項目を追加。 - きたがわ
  • - Masao?
更新日時:2014/06/15 19:25:41
キーワード:
参照:[gtk2-tut-widget-overview] [Ruby/GTK Object Hierarchy] [Gtk::AspectFrame] [Ruby/GTK]