From: "Kontra, Gergely" Date: 2002-04-24T01:57:30+09:00 Subject: Re: Tk under Ruby [newbie to ruby] >"Kontra, Gergely" wrote: >> >> Hello! >> >> I'd like to use Tk under ruby. >> >> My main problem, that I want to use Tk in the other way: it must listen >> to a port, and display incoming data. >> >> My problem: when I call Tk.mainloop, it will never return. >> Shall I write? >> >> Thread.new { Tk.mainloop } >> >> Looks ugly... >> >> +-[Kontra, Gergely @ Budapest University of Technology and Economics]-+ >> | Email: kgergely@mcl.hu, kgergely@turul.eet.bme.hu | >> | URL: turul.eet.bme.hu/~kgergely Mobile: (+36 20) 356 9656 | >> +-------"Olyan langesz vagyok, hogy poroltoval kellene jarnom!"-------+ >> . >> Magyar php mirror es magyar php dokumentacio: http://hu.php.net > >use Tk.after in a thread to read in your socket, then launch >Tk.mainloop. > >beside that: I think That Tk.mainloop should be re-written in the ruby's >interpreter source, but who can do that ? > Now I don't think Thread.new { Tk.mainloop } looks ugly anymore. Perhaps in the future require 'tk' should implicitly start Tk.mainloop in background, so everything happens 'immediate', as in Tcl/tk, without explicitly starting Tk.mainloop. What do you think about it? Gergo +-[Kontra, Gergely @ Budapest University of Technology and Economics]-+ | Email: kgergely@mcl.hu, kgergely@turul.eet.bme.hu | | URL: turul.eet.bme.hu/~kgergely Mobile: (+36 20) 356 9656 | +-------"Olyan langesz vagyok, hogy poroltoval kellene jarnom!"-------+ . Magyar php mirror es magyar php dokumentacio: http://hu.php.net