Project

General

Profile

Backport #8319 ยป 295.patch

zzak (Zachary Scott), 04/24/2013 01:59 PM

View differences:

ext/tk/sample/demos-en/text.rb
117 117
      end
118 118
}
119 119

  
120
7. Resize the window.  This widget has been configured with the "setGrid"
120
8. Resize the window.  This widget has been configured with the "setGrid"
121 121
option on, so that if you resize the window it will always resize to an
122 122
even number of characters high and wide.  Also, if you make the window
123 123
narrow you can see that long lines automatically wrap around onto
124
- 
ext/tk/sample/demos-en/tree.rb
67 67
  path = tree.get(node, :fullpath)
68 68
  tree.delete(tree.children(node))
69 69
  Dir.glob("#{path}/*").sort.each{|f|
70
    type = File.ftype(f)
70
    type = File.ftype(f) rescue nil
71 71
    id = tree.insert(node, :end,
72 72
                     :text=>File.basename(f), :values=>[f, type]).id
73 73
    if type == 'directory'
ext/tk/sample/demos-en/widget
683 683
      end
684 684
    }
685 685
  }
686
  Tk.update
686
  Tk.update rescue nil
687 687
end
688 688

  
689 689
# invoke --
......
699 699

  
700 700
  cursor = txt.cget('cursor')
701 701
  txt.cursor('watch')
702
  Tk.update
702
  Tk.update rescue nil
703 703
  # eval(IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, _null_binding)
704 704
  # Tk.update
705 705
  eval_samplecode(IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, tag[5..-1] + '.rb')
......
1058 1058
  no_launcher = true if ARGV.size > 0
1059 1059
else
1060 1060
  # show the root widget to make it lower then demo windows
1061
  Tk.update
1061
  Tk.update rescue nil
1062 1062
end
1063 1063
ARGV.each{|cmd|
1064 1064
  if cmd =~ /(.*).rb/
1065
- 
ext/tk/lib/tk/canvas.rb
85 85

  
86 86
  # create a canvas item without creating a TkcItem object
87 87
  def create(type, *args)
88
    type = TkcItem.type2class(type.to_s) unless type.kind_of?(TkcItem)
88
    if TkcItem.type2class(type.to_s)
89
      type = TkcItem.type2class(type.to_s)
90
    elsif type.kind_of?(Class) and type.ancestors.member?(TkcItem)
91
    else
92
      raise "type must a TkcItem class, or a string in CItemTypeToClass"
93
    end
89 94
    type.create(self, *args)
90 95
  end
91 96

  
92
-