Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > TkDialogBox missing?

Reply
Thread Tools

TkDialogBox missing?

 
 
Josef Wolf
Guest
Posts: n/a
 
      09-05-2006
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/iwidgets/>.

> >
> >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

 
Reply With Quote
 
 
 
 
Josef Wolf
Guest
Posts: n/a
 
      09-05-2006
On Tue, Sep 05, 2006 at 01:52:25PM +0900, Hidetoshi NAGAI wrote:

> Please see the next example.


Now with your example, it is pretty clear how it works. Thank you very
much!

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

>
> If you can use "iwidgets", it may be enough for your purpose to imitate
> '<ruby-src>/ext/tk/sample/tkextlib/iwidgets/sample/dialog.rb'.
>
> If you want to install "iwidgets" ([incr Widgets]) from its source,
> you have to compile it.


I have not checked yet whether I can use them. But their bindings seem
to be part of the ruby/tk package:

$ rpm -qf /usr/lib/ruby/1.8/tkextlib/iwidgets.rb
ruby-tk-1.8.2-11
$ cat /etc/SuSE-release
SUSE LINUX 10.0 (i586)
VERSION = 10.0
$

 
Reply With Quote
 
 
 
 
Morton Goldberg
Guest
Posts: n/a
 
      09-05-2006
On Sep 5, 2006, at 12:50 PM, Josef Wolf wrote:

> Yes, but for me, this looks more like a man page than a tutorial.


A man page with sample code and a picture of the result? That's
hardly your typical Unix man page

>> 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 refer to it regularly. I could wish Ruby/Tk were so well documented

>> 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


OK, I'll post and we'll see how it goes. I'll post each example in a
new thread. I think that would be best.

Regards, Morton

 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      09-05-2006
Morton Goldberg wrote:
> On Sep 5, 2006, at 12:50 PM, Josef Wolf wrote:
>
>> Yes, but for me, this looks more like a man page than a tutorial.

>
> A man page with sample code and a picture of the result? That's
> hardly your typical Unix man page
>
>>> 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 refer to it regularly. I could wish Ruby/Tk were so well documented
>
>>> 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

>
> OK, I'll post and we'll see how it goes. I'll post each example in a
> new thread. I think that would be best.
>
> Regards, Morton


Hey all,

I've been doing a LOT of Ruby/TK development lately using a combination
of the builtin widgets and Tile. I was considering contributing back
some documentation and I'd be interested in helping out.

And, Hidetoshi NAGAI: I think I have found some bugs in the Tile
bindings. Are you still the Ruby/Tk maintainer? I have monkey-patched my
code, but I should probably submit the fixes to *someone*...

Andrew - sorry for using ruby-forum (I'm lazy)

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Hidetoshi NAGAI
Guest
Posts: n/a
 
      09-06-2006
From: Josef Wolf <(E-Mail Removed)>
Subject: Re: TkDialogBox missing?
Date: Wed, 6 Sep 2006 02:11:01 +0900
Message-ID: <(E-Mail Removed)>
> I have not checked yet whether I can use them. But their bindings seem
> to be part of the ruby/tk package:
>
> $ rpm -qf /usr/lib/ruby/1.8/tkextlib/iwidgets.rb
> ruby-tk-1.8.2-11
> $ cat /etc/SuSE-release
> SUSE LINUX 10.0 (i586)
> VERSION = 10.0
> $


It doesn't verify whether your Ruby/Tk can load Iwidgets extension or not.
Please exec "ruby /usr/lib/ruby/1.8/tkextlib/pkc_checker.rb".
If it denotes lack of libraries, you cannot use the extension.
For example, the following shows that Iwidgets is NOT available.
-------------------------------------------------------
:
:
Ready : itcl.rb : require->{}
*LACK : itcl/incr_tcl.rb : require->{} FAIL->[["Itcl", ackage]]
Ready : itcl/setup.rb : require->{}

Ready : itk.rb : require->{}
*LACK : itk/incr_tk.rb : require->{} FAIL->[["Itk", ackage]]
Ready : itk/setup.rb : require->{}

*LACK : iwidgets.rb : require->{} FAIL->[["tkextlib/itcl", :require_ruby_lib],
["tkextlib/itk", :require_ruby_lib], ["Iwidgets", ackage]]
Ready : iwidgets/canvasprintbox.rb : require->{}
Ready : iwidgets/buttonbox.rb : require->{}
:
:
-------------------------------------------------------
--
Hidetoshi NAGAI ((E-Mail Removed))

 
Reply With Quote
 
Hidetoshi NAGAI
Guest
Posts: n/a
 
      09-06-2006
From: Andrew Thompson <(E-Mail Removed)>
Subject: Re: TkDialogBox missing?
Date: Wed, 6 Sep 2006 08:41:17 +0900
Message-ID: <(E-Mail Removed)>
> I've been doing a LOT of Ruby/TK development lately using a combination
> of the builtin widgets and Tile. I was considering contributing back
> some documentation and I'd be interested in helping out.
>
> And, Hidetoshi NAGAI: I think I have found some bugs in the Tile
> bindings. Are you still the Ruby/Tk maintainer? I have monkey-patched my
> code, but I should probably submit the fixes to *someone*...


Great! Please post here or send to me.
--
Hidetoshi NAGAI ((E-Mail Removed))

 
Reply With Quote
 
Josef Wolf
Guest
Posts: n/a
 
      09-06-2006
On Wed, Sep 06, 2006 at 11:21:48AM +0900, Hidetoshi NAGAI wrote:
> From: Josef Wolf <(E-Mail Removed)>


> > I have not checked yet whether I can use them. But their bindings seem
> > to be part of the ruby/tk package:
> >
> > $ rpm -qf /usr/lib/ruby/1.8/tkextlib/iwidgets.rb
> > ruby-tk-1.8.2-11
> > $ cat /etc/SuSE-release
> > SUSE LINUX 10.0 (i586)
> > VERSION = 10.0
> > $

>
> It doesn't verify whether your Ruby/Tk can load Iwidgets extension or not.
> Please exec "ruby /usr/lib/ruby/1.8/tkextlib/pkc_checker.rb".
> If it denotes lack of libraries, you cannot use the extension.
> For example, the following shows that Iwidgets is NOT available.
> -------------------------------------------------------
> :
> :
> Ready : itcl.rb : require->{}
> *LACK : itcl/incr_tcl.rb : require->{} FAIL->[["Itcl", ackage]]
> Ready : itcl/setup.rb : require->{}
>
> Ready : itk.rb : require->{}
> *LACK : itk/incr_tk.rb : require->{} FAIL->[["Itk", ackage]]
> Ready : itk/setup.rb : require->{}
>
> *LACK : iwidgets.rb : require->{} FAIL->[["tkextlib/itcl", :require_ruby_lib],
> ["tkextlib/itk", :require_ruby_lib], ["Iwidgets", ackage]]
> Ready : iwidgets/canvasprintbox.rb : require->{}
> Ready : iwidgets/buttonbox.rb : require->{}
> :
> :
> -------------------------------------------------------


$ ruby /usr/lib/ruby/1.8/tkextlib/pkg_checker.rb
[ ... ]
Ready : itcl.rb : require->{}
Ready : itcl/incr_tcl.rb : require->{"Itcl"=>"3.3"}
Ready : itcl/setup.rb : require->{}
[ ... ]
Ready : itk.rb : require->{}
Ready : itk/incr_tk.rb : require->{"Itk"=>"3.3"}
Ready : itk/setup.rb : require->{}

Ready : iwidgets.rb : require->{"Iwidgets"=>"4.0.1"}
Ready : iwidgets/canvasprintbox.rb : require->{}
Ready : iwidgets/buttonbox.rb : require->{}
[ ... ]
Ready : iwidgets/timefield.rb : require->{}
Ready : iwidgets/toolbar.rb : require->{}
Ready : iwidgets/watch.rb : require->{}

Looks like they are ready to be used?

 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      09-06-2006
Hidetoshi NAGAI wrote:
>
> Great! Please post here or send to me.


Okay, it's been a while since I wrote these, so I'm not entirely sure
what I ended up changing... if you have any questions, please ask...
This was all minor tweaks I believe...

#add the 'tab' method so we can do per-tab configuration
class Tk::Tile::TNotebook
def tab(idx, keys=nil)
if keys and keys != None
tk_send('tab', idx, *hash_kv(keys))
else
tk_send('tab', idx)
end
end
def select(idx=nil)
if idx
tk_send('select', idx)
else
tk_send('select')
end
self
end
end

class Tk::Tile::TCombobox
def current
number(tk_send_without_enc('current'))
end
end

#insert should return the rowid
class Tk::Tile::Treeview
def insert(parent, idx, keys={})
keys = _symbolkey2str(keys)
id = keys.delete('id')
if id
tk_send('insert', parent, idx, '-id', id, *hash_kv(keys))
else
tk_send('insert', parent, idx, *hash_kv(keys))
end
end
end

Andrew

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Hidetoshi NAGAI
Guest
Posts: n/a
 
      09-12-2006
From: Josef Wolf <(E-Mail Removed)>
Subject: Re: TkDialogBox missing?
Date: Thu, 7 Sep 2006 01:40:35 +0900
Message-ID: <(E-Mail Removed)>
> $ ruby /usr/lib/ruby/1.8/tkextlib/pkg_checker.rb
> [ ... ]
> Ready : itcl.rb : require->{}
> Ready : itcl/incr_tcl.rb : require->{"Itcl"=>"3.3"}
> Ready : itcl/setup.rb : require->{}
> [ ... ]
> Ready : itk.rb : require->{}
> Ready : itk/incr_tk.rb : require->{"Itk"=>"3.3"}
> Ready : itk/setup.rb : require->{}
>
> Ready : iwidgets.rb : require->{"Iwidgets"=>"4.0.1"}
> Ready : iwidgets/canvasprintbox.rb : require->{}
> Ready : iwidgets/buttonbox.rb : require->{}
> [ ... ]
> Ready : iwidgets/timefield.rb : require->{}
> Ready : iwidgets/toolbar.rb : require->{}
> Ready : iwidgets/watch.rb : require->{}
>
> Looks like they are ready to be used?


I think so.
--
Hidetoshi NAGAI ((E-Mail Removed))

 
Reply With Quote
 
Hidetoshi NAGAI
Guest
Posts: n/a
 
      09-12-2006
From: Andrew Thompson <(E-Mail Removed)>
Subject: Re: TkDialogBox missing?
Date: Thu, 7 Sep 2006 03:23:04 +0900
Message-ID: <(E-Mail Removed)>
> Okay, it's been a while since I wrote these, so I'm not entirely sure
> what I ended up changing... if you have any questions, please ask...


Thank you for your patch. I have some questions.

* Which version of Tile extension is your patch based on?

* [about Tk::Tile::TNotebook#tab]
There are Tk::Tile::TNotebook#tabconfigure, tabconfiginfo, tabcget,
and current_tabconfiginfo (similar as item configuration strategy on
other widgets). Aren't those enough?

* [about Tk::Tile::TNotebook#select]
How about adding new method "Tk::Tile::TNotebook#selected"?
-------------------------------------------
class Tk::Tile::TNotebook
def selected
num_or_str(tk_send_without_enc('select'))
end
end
-------------------------------------------

* [about Tk::Tile::Treeview#insert]
Is the following OK?
-------------------------------------------
class Tk::Tile::Treeview
def insert(parent, idx, keys={})
keys = _symbolkey2str(keys)
id = keys.delete('id')
if id
num_or_str(tk_send('insert', parent, idx, '-id', id, *hash_kv(keys)))
else
num_or_str(tk_send('insert', parent, idx, *hash_kv(keys)))
end
end
end
-------------------------------------------
--
Hidetoshi NAGAI ((E-Mail Removed))

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments