From: Josef Wolf Date: 2006-09-03T21:50:54+09:00 Subject: Re: TkDialogBox missing? On Fri, Sep 01, 2006 at 03:00:34PM +0900, Josef Wolf wrote: > On Fri, Sep 01, 2006 at 12:01:13PM +0900, Hidetoshi NAGAI wrote: > > From: Josef Wolf > > > I am pretty new to ruby, but I have used perl/Tk in my previous life ;-) > > > I can't find ruby's aequivalent to perl's Tk::DialogBox. I need to > > > > That is NOT a standard widget of Tcl/Tk. > > Probably, it is a perl/Tk specific one. > > > > I think that "Dialog" widget of BWidget extension is one of > > similar widgets. BWidget extension is written in pure Tcl/Tk. > > So, it is not difficult to install. > > Ruby/Tk supports BWidget extension by 'tkextlib/bwidget.rb'. > > It looks as if it is already installed on my suse box. But I can't find > any documentation. I assume it is to be used similar to ruby/Tk? > Anyway, I'll go dive into it. Thanks again! I can't figure out how to use this widget properly. I have two major problems with it: 1. Tk::BWidget::Dialog don't seem to have a "buttons" option? But without a "buttons" option, options like "cancel", "default" and "separator" don't really make sense, IMHO. 2. It's draw() method returns the id of the widget instead of an indication which button was pressed. This is what I do: pressed=nil dia=Tk::BWidget::Dialog.new('parent'=>parent) label=Tk::BWidget::LabelEntry.new('parent'=>dia, 'label'=>'Entity', 'text'=>'Hello').pack TkButton.new(dia,'text'=>'OK', 'command'=>proc{dia.enddialog(dia); pressed="OK"}).pack TkButton.new(dia,'text'=>'Cancel', 'command'=>proc{dia.enddialog(dia); pressed="Cancel"}).pack dia.draw Is it really meant to be used that way? I bet I am missing some very important details, but I can't figure out what it is. BTW: There seems to be one more widget set called iwidgets. Anybody knows what it is?