From: nagai@... Date: 2001-09-12T11:26:43+09:00 Subject: [ruby-talk:21158] Re: Is Ruby/Tk being maintained? From: Jim Menard Subject: [ruby-talk:21083] Re: Is Ruby/Tk being maintained? Date: Tue, 11 Sep 2001 21:19:23 +0900 Message-ID: jimm> I, too, have reported a bug here. What is the best way to get it to jimm> Hidetoshi Nagai? Yesterday, I subscribed ruby-talk ML. :-) # I can speek only a little English, # so probably my mail text is a broken English-LIKE text. Sorry. jimm> Here's the bug report: jimm> I've run into a mystery. I create a TkListbox and fill it with items. They jimm> display correctly. When I call jimm> list.bbox(i) jimm> to retrieve the bounding box of item i, there is a problem. Only the 0'th jimm> item returns the bounding box. All others return an empty string. It is *NOT* a bug. If you want to get the bounding box, the target must be displayed on your screen. To display Tk widgets, you must run Tk's event loop. Your script has no event loop step. Therefore, you cannot get the right bounding box. # wish does event loop on background. To do event loop step, please call Tk.mainloop. But if you want to know the bounding box before calling Tk.mainloop, you can call Tk.update. Because Tk.update can do one event loop step, generated widgets will be displayed and answer right bounding boxes. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)