[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How to update text field contents during looping process

Craig Williams

6/2/2008 4:51:00 PM

I am running a loop over AppleScript files in a directory tree. Each
time through
the loop "osadecompiles" the script and adds the script text to an
array. When
it is through it populates a table.

What I have been attempting to do is update a text field with the
current iteration.

I am using the following code but I have tried many variations.

I have tried with and without the Thread. It *does* log to the console
through each
iteration just not the window.

def update_run_count
Thread.new do
text = "Processing #{@c} of #{@file_count}"
puts text
@text_field.setStringValue(text)
@text_field.setNeedsDisplay(true)
@text_field.setTextColor(NSColor.redColor)
end
end

Thanks,

Craig
--
Posted via http://www.ruby-....