Skip to content

Commit

Permalink
fixed word list specified check box so that you can hit cancel withou…
Browse files Browse the repository at this point in the history
…t causing an error
  • Loading branch information
Leon Maurer committed May 8, 2008
1 parent afe7264 commit 77f9082
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions styletool.rb
Expand Up @@ -76,11 +76,19 @@ def initialize
}.grid('column'=>2, 'row'=>1,'sticky'=>'w', 'padx'=>5, 'pady'=>5)

wordlisttoggled = proc {
@documents = Array.new
@masterWordList = Array.new
@listbox.delete(0) while @listbox.size != 0
if @wordListSpecified.get_value == "1"
@masterWordList = IO.read(Tk.getOpenFile).downcase.scan(/\w+/).uniq
filename = Tk.getOpenFile
unless filename == ""
@masterWordList = IO.read(filename).downcase.scan(/\w+/).uniq
@documents = Array.new
@listbox.delete(0) while @listbox.size != 0
else #the user hit 'cancel' -- don't change anything!
@wordListSpecified.set_value("0")
end
else
@documents = Array.new
@masterWordList = Array.new
@listbox.delete(0) while @listbox.size != 0
end
}
@wordListSpecified = TkCheckButton.new(@root){
Expand Down

0 comments on commit 77f9082

Please sign in to comment.