[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

TkDialogBox missing?

Josef Wolf

8/31/2006 10:51:00 PM

Hello!

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
implement something similar to firefox's "preferences" dialog. The
TkDialog class don't look as if it can maintain arbitrary widgets.

I have checked the archives and google, but could find only a thread[*]
dated back to the year 2000.

What is the current status? Are dialog boxes still not supported?
Or am I just misunderstanding something? Maybe there's some sort of
work-around?

[*] http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-talk/7548...

22 Answers

Hidetoshi NAGAI

9/1/2006 3:01:00 AM

0

Josef Wolf

9/1/2006 6:01:00 AM

0

On Fri, Sep 01, 2006 at 12:01:13PM +0900, Hidetoshi NAGAI wrote:

Thanks for your quick reply! (BTW: is Hidetishi your first name?)

> From: Josef Wolf <jw@raven.inka.de>
> > 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!

Josef Wolf

9/3/2006 12:51:00 PM

0

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 <jw@raven.inka.de>
> > > 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?

Morton Goldberg

9/4/2006 2:30:00 AM

0

On Sep 3, 2006, at 8:50 AM, Josef Wolf wrote:

> BTW: There seems to be one more widget set called iwidgets.
> Anybody knows
> what it is?

The iwidget widget set is Ruby support for [incr Widgets]. You can
find documentation at <http://incrtcl.sourceforge.net/iwi....
This is Tk documentation, but the Ruby implementation seems to
follows it closely.

I have just began to experiment with [incr Widgets]. So far so good.
They are higher level than the basic Tk widgets and seem to easy to use.

Here is a list:

buttonbox
calendar
canvasprintbox
canvasprintdialog
checkbox
combobox
dateentry
datefield
dialog
dialogshell
disjointlistbox
entryfield
extbutton
extfileselectionbox
extfileselectiondialog
feedback
fileselectionbox
fileselectiondialog
finddialog
hierarchy
hyperhelp
labeledframe
labeledwidget
mainwindow
menubar
messagebox
messagedialog
notebook
optionmenu
panedwindow
promptdialog
pushbutton
radiobox
regexpfield
scrolledcanvas
scrolledframe
scrolledhtml
scrolledlistbox
scrolledtext
scrolledwidget
selectionbox
selectiondialog
shell
spindate
spinint
spinner
spintime
tabnotebook
tabset
timeentry
timefield
toolbar

Regards, Morton



Josef Wolf

9/4/2006 5:25:00 PM

0

On Mon, Sep 04, 2006 at 11:30:01AM +0900, Morton Goldberg wrote:

Thanks for your reply, Morton!

> >BTW: There seems to be one more widget set called iwidgets.
> > Anybody knows what it is?
>
> The iwidget widget set is Ruby support for [incr Widgets]. You can
> find documentation at <http://incrtcl.sourceforge.net/iwi....

This page mentions examples and tutorials, but I can't find them on
this site. A google search did not reveal anything useful, too. Could
you find anything useful?

> This is Tk documentation, but the Ruby implementation seems to
> follows it closely.
>
> I have just began to experiment with [incr Widgets]. So far so good.
> They are higher level than the basic Tk widgets and seem to easy to use.

Would you dare to share some examples how the ruby bindings are to be
used?

Hidetoshi NAGAI

9/5/2006 4:52:00 AM

0

Morton Goldberg

9/5/2006 5:14:00 AM

0

On Sep 4, 2006, at 1:25 PM, Josef Wolf wrote:

> On Mon, Sep 04, 2006 at 11:30:01AM +0900, Morton Goldberg wrote:
>
> Thanks for your reply, Morton!
>
>>> BTW: There seems to be one more widget set called iwidgets.
>>> Anybody knows what it is?
>>
>> The iwidget widget set is Ruby support for [incr Widgets]. You can
>> find documentation at <http://incrtcl.sourceforge.net/iwi....
>
> This page mentions examples and tutorials, but I can't find them on
> this site. A google search did not reveal anything useful, too.
> Could
> you find anything useful?

Did you try clicking on any of the widget names in the sidebar? When
I click on the name of a widget, I get a tutorial with example code
for that widget. In the lower right corner of the tutorial is a set
of buttons that link to reference material for the given widget.
Altogether I think this the [incr Widgets] are pretty well
documented. I could wish Ruby/Tk were so well documented.

>> This is Tk documentation, but the Ruby implementation seems to
>> follows it closely.
>>
>> I have just began to experiment with [incr Widgets]. So far so good.
>> They are higher level than the basic Tk widgets and seem to easy
>> to use.
>
> Would you dare to share some examples how the ruby bindings are to be
> used?

I am new to both Ruby and Tk -- I have just started exploring, so I
don't have much to offer. All I have done (and only for a two of the
[incr Widgets]) is translate the web site's example code into Ruby/Tk
and probably not very elegantly. With that disclaimer in mind, do you
still want me to post my code?

Regards, Morton

Hidetoshi NAGAI

9/5/2006 10:12:00 AM

0

Morton Goldberg

9/5/2006 10:53:00 AM

0

On Sep 5, 2006, at 6:12 AM, Hidetoshi NAGAI wrote:

> From: Morton Goldberg <m_goldberg@ameritech.net>
> Subject: Re: TkDialogBox missing?
> Date: Tue, 5 Sep 2006 14:13:47 +0900
> Message-ID: <3E8F8726-AF8F-4C85-B30B-7EC96C4B0FD0@ameritech.net>
>> I am new to both Ruby and Tk -- I have just started exploring, so I
>> don't have much to offer. All I have done (and only for a two of the
>> [incr Widgets]) is translate the web site's example code into Ruby/Tk
>> and probably not very elegantly. With that disclaimer in mind, do you
>> still want me to post my code?
>
> Do you have any requests for Iwidgets support of Ruby/Tk?
> --
> Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

Not at this stage of my explorations. So far what little I've tried
seems to work much as I expected. I really haven't gotten in deep
enough so that anything I've done moves me to make a support request.
There are still many [incr Widgets] with which I need to become
familiar before I use them in a real application. When I reach the
stage of building a real application, I think then I might find
myself moved to request support, but not before.

But thank you for asking.

Regards, Morton



Josef Wolf

9/5/2006 4:50:00 PM

0

On Tue, Sep 05, 2006 at 02:13:47PM +0900, Morton Goldberg wrote:
> On Sep 4, 2006, at 1:25 PM, Josef Wolf wrote:

> >>The iwidget widget set is Ruby support for [incr Widgets]. You can
> >>find documentation at <http://incrtcl.sourceforge.net/iwi....
> >
> >This page mentions examples and tutorials, but I can't find them on
> >this site. A google search did not reveal anything useful, too.
> >Could you find anything useful?
>
> Did you try clicking on any of the widget names in the sidebar?

Yes, but for me, this looks more like a man page than a tutorial. ;-)

> Altogether I think this the [incr Widgets] are pretty well
> documented. I could wish Ruby/Tk were so well documented.

Well, the iwidgets are documented for tcl. tcl documentation for Tk
is available, too. ;-)

> I am new to both Ruby and Tk -- I have just started exploring, so I
> don't have much to offer. All I have done (and only for a two of the
> [incr Widgets]) is translate the web site's example code into Ruby/Tk
> and probably not very elegantly. With that disclaimer in mind, do you
> still want me to post my code?

We could try to reduce the documentation-vacuum by collecting some
examples how to use them. The examples need not be perfect from the
beginning. I bet many readers from this list would happily help
improving the code :-)