~ubuntu-branches/ubuntu/hardy/ruby1.8/hardy-updates

« back to all changes in this revision

Viewing changes to ext/tk/sample/demos-jp/states.rb

  • Committer: Bazaar Package Importer
  • Author(s): akira yamada
  • Date: 2007-03-13 22:11:58 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070313221158-h3oql37brlaf2go2
Tags: 1.8.6-1
* new upstream version, 1.8.6.
* libruby1.8 conflicts with libopenssl-ruby1.8 (< 1.8.6) (closes: #410018)
* changed packaging style to cdbs from dbs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# listbox widget demo 'states' (called by 'widget')
 
3
#
 
4
 
 
5
# toplevel widget ��¸�ߤ���к������
 
6
if defined?($states_demo) && $states_demo
 
7
  $states_demo.destroy 
 
8
  $states_demo = nil
 
9
end
 
10
 
 
11
# demo �Ѥ� toplevel widget ������
 
12
$states_demo = TkToplevel.new {|w|
 
13
  title("Listbox Demonstration (states)")
 
14
  iconname("states")
 
15
  positionWindow(w)
 
16
}
 
17
 
 
18
# label ����
 
19
msg = TkLabel.new($states_demo) {
 
20
  font $font
 
21
  wraplength '4i'
 
22
  justify 'left'
 
23
  text "���ˤ���Τ���ƻ�ܸ�̾�����ä�����������С��դΥꥹ�ȥܥå����Ǥ����ꥹ�Ȥ򥹥������뤵����Τϥ���������С��Ǥ�Ǥ��ޤ������ꥹ�ȥܥå�������ǥޥ����Υܥ���2(��ܥ���)�򲡤����ޤޥɥ�å����Ƥ�Ǥ��ޤ���"
 
24
}
 
25
msg.pack('side'=>'top')
 
26
 
 
27
# frame ����
 
28
TkFrame.new($states_demo) {|frame|
 
29
  TkButton.new(frame) {
 
30
    #text 'λ��'
 
31
    text '�Ĥ���'
 
32
    command proc{
 
33
      tmppath = $states_demo
 
34
      $states_demo = nil
 
35
      tmppath.destroy
 
36
    }
 
37
  }.pack('side'=>'left', 'expand'=>'yes')
 
38
 
 
39
  TkButton.new(frame) {
 
40
    text '�����ɻ���'
 
41
    command proc{showCode 'states'}
 
42
  }.pack('side'=>'left', 'expand'=>'yes')
 
43
 
 
44
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
 
45
 
 
46
# frame ����
 
47
states_lbox = nil
 
48
TkFrame.new($states_demo, 'borderwidth'=>'.5c') {|w|
 
49
  s = TkScrollbar.new(w)
 
50
  states_lbox = TkListbox.new(w) {
 
51
    setgrid 1
 
52
    height 12
 
53
    yscrollcommand proc{|first,last| s.set first,last}
 
54
  }
 
55
  s.command(proc{|*args| states_lbox.yview(*args)})
 
56
  s.pack('side'=>'right', 'fill'=>'y')
 
57
  states_lbox.pack('side'=>'left', 'expand'=>1, 'fill'=>'both')
 
58
}.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'y')
 
59
 
 
60
ins_data = [
 
61
  '����','�Ŀ�','����','����','���','���','��ɲ',
 
62
  '��ʬ','���','����','����','����','������','������',
 
63
  '����','����','����','����','����','���','����',
 
64
  '����','�Ų�','�纬','����','���','����','����',
 
65
  'Ļ��','�ٻ�','Ĺ��','Ĺ��','����','����','ʼ��',
 
66
  '����','ʡ��','ʡ��','ʡ��','�̳�ƻ','����','�ܾ�',
 
67
  '�ܺ�','����','����','����','�²λ�'
 
68
]
 
69
 
 
70
states_lbox.insert(0, *ins_data)
 
71