From: Kevin Smith Date: 2000-12-18T15:35:59+09:00 Subject: [ruby-talk:7548] Re: DialogBox not supported by Ruby/Tk ?? harryo@zipworld.com.au (Harry Ohlsen) wrote: >Thanks to Marc Dashevsky, I now have a simple example of how to create >a pop-up dialog with a data entry field. > >However, his example was in Perl and it uses a class called >Tk::DialogBox, which is separate to Dialog (which only seems to >support the specification of a number of buttons, plus some message >text). > >As far as I can tell, Ruby/Tk doesn't provide a hook to use this >(presumably Tk) class. > >Can anyone give me a clue as to how I might extend (or even copy part >of) the code in tk.rb to allow me to use DialogBox? > >Yes, I'm getting desperate :-). > >It seems to me like DialogBox is pretty much the missing piece from >the Ruby/Tk library. If it were added, arbitrarily complex things >could then be achieved. My Perl/Tk book implied that DialogBox is a composite widget written in perl (it refers to DialogBox.pm). So I went looking on the web... I found a copy of the source code (I didn't want to download the 3 meg Perl/Tk library that normally contains it). You can see it by doing a google search for: "dialogbox.pm" source faqchest It seems to be about 150 lines of code. If you wait long enough, at some point I'll need it for my own application, and will try to port it over. Given that I don't know perl, I'll hope that someone beats me to it. It doesn't look too bad, though. Kevin