3
# This demonstration script creates a toplevel window containing
4
# several radiobutton widgets.
6
# radiobutton widget demo (called by 'widget')
10
if defined?($radio2_demo) && $radio2_demo
15
# demo toplevel widget
16
$radio2_demo = TkToplevel.new {|w|
17
title("Radiobutton Demonstration 2")
23
msg = TkLabel.new($radio2_demo) {
27
text "���ˤ�3�ĤΥ饸���ܥ��롼�פ�ɽ������Ƥ��ޤ����ܥ����å�����ȡ����Υܥ�����������Υ��롼�פ��������ޤ����ƥ��롼�פ��Ф��Ƥ��Υ��롼�פ���ΤɤΥܥ�������Ƥ��뤫���ѿ���������Ƥ��Ƥ��ޤ������ߤ��ѿ����ͤ�ˤϡ��ѿ����ȡץܥ����å����Ƥ���������"
29
msg.pack('side'=>'top')
33
color = TkVariable.new
34
align = TkVariable.new
37
TkFrame.new($radio2_demo) {|frame|
42
tmppath = $radio2_demo
44
$showVarsWin[tmppath.path] = nil
47
}.pack('side'=>'left', 'expand'=>'yes')
51
command proc{showCode 'radio2'}
52
}.pack('side'=>'left', 'expand'=>'yes')
57
showVars($radio2_demo,
58
['size', size], ['color', color], ['compound', align])
60
}.pack('side'=>'left', 'expand'=>'yes')
61
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
64
f_left = TkLabelFrame.new($radio2_demo, 'text'=>'ʸ��������',
66
f_mid = TkLabelFrame.new($radio2_demo, 'text'=>'��',
68
f_right = TkLabelFrame.new($radio2_demo, 'text'=>'�ӥåȥޥå�����',
70
f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
71
f_mid.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
72
f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
75
[10, 12, 18, 24].each {|sz|
76
TkRadioButton.new(f_left) {
77
text "�ݥ���ȥ����� #{sz}"
81
}.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w', 'fill'=>'x')
84
['��', '��', '��', '��', '��', '��'].each {|col|
85
TkRadioButton.new(f_mid) {
91
}.pack('side'=>'top', 'pady'=>2, 'fill'=>'x')
94
label = TkLabel.new(f_right, 'text'=>'��٥�', 'bitmap'=>'questhead',
96
label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top')
97
label.height(TkWinfo.reqheight(label))
98
abtn = ['Top', 'Left', 'Right', 'Bottom'].collect{|a|
100
TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat',
101
'value'=>lower, 'indicatoron'=>0, 'width'=>7,
102
'command'=>proc{label.compound(align.value)})
105
Tk.grid('x', abtn[0])
106
Tk.grid(abtn[1], label, abtn[2])
107
Tk.grid('x', abtn[3])