I’m putting out some text in a window using a TkLabel. The problem is
that the text only seems to appear once the method has finished.
Is there a way to make labels update after .configure immediately?
Code example:
btnExit = TkButton.new() do
text "Exit"
command {
label.configure (“text” => ‘Good bye!’) #never appears!
sleep 2
exit
}
end
Thanks!
Ralf.
pm. Is there an “official” tk and/or gtk newsgroup? Where can I find the
archive of this Ruby group?
I’m putting out some text in a window using a TkLabel. The problem is
that the text only seems to appear once the method has finished.
Is there a way to make labels update after .configure immediately?
Code example:
btnExit = TkButton.new() do
text “Exit”
command {
label.configure (“text” => ‘Good bye!’) #never appears!
sleep 2
exit
}
end
Thanks!
Ralf.
pm. Is there an “official” tk and/or gtk newsgroup? Where can I find the
archive of this Ruby group?
I’m putting out some text in a window using a TkLabel. The problem is
that the text only seems to appear once the method has finished.
Is there a way to make labels update after .configure immediately?
Tk re-draws widgets on a idle-task.
Because an operation of the ‘command’ option is one event-task,
Tk never call an idle-task before ‘exit’ of your script.
You must call ‘Tk.update’ or ‘Tk.update(true)’.
‘Tk.update(true)’ forces to run Tk’s idle-task.
For example,
Code example:
btnExit = TkButton.new() do
text “Exit”
command {
label.configure (“text” => ‘Good bye!’) #never appears!