Ruby-tk-separator

提供:Dev Guides
移動先:案内検索

Ruby/TK-区切りウィジェット

*Separator* ウィジェットは、ウィンドウを論理的な部分に分割する便利な方法を提供します。 ウィジェットのグループ間の細い水平または垂直の規則を使用して、ウィジェットを1つのディスプレイにグループ化できます。

構文

このウィジェットを作成する簡単な構文は次のとおりです-

Tk::Tile::Separator.new(root) {
   .....Standard Options....
   .....Widget Specific Options....
}

標準オプション

  • クラス
  • カーソル
  • 状態
  • スタイル *フォーカス

ウィジェット固有のオプション

Sr.No. Options & Description
1
  • orient* ⇒ String

    *horizo​​ntal* または *vertical* のいずれか。 セパレーターの方向を指定します。

require 'tk'
require 'tkextlib/tile'

$resultsVar = TkVariable.new
root = TkRoot.new
root.title = "Window"

n = Tk::Tile::Notebook.new(root)do
   height 110
   place('height' => 100, 'width' => 200, 'x' => 10, 'y' => 10)
end

f1 = TkFrame.new(n)
f2 = TkFrame.new(n)
f3 = TkFrame.new(n)

n.add f1, :text => 'One'
n.add f2, :text => 'Two'
n.add f3, :text => 'Three'

s1 = Tk::Tile::Separator.new(f1) do
   orient 'vertical'
   place('height' => 200, 'x' => 40, 'y' => 10)
end

s2 = Tk::Tile::Separator.new(f1) do
   orient 'vertical'
   place('height' => 200, 'x' => 80, 'y' => 10)
end

Tk.mainloop

これは、次の結果を生成します-

Ruby/Tk Separator