Looking for reference for Ruby/Tk and Ruby/MySQL

P

Patrick Lynch

Good evening,

I need to create an app that will use Ruby/TK and Ruby/MySql.
It will be a standalone pc app...

I'm going thru the "Pickaxe" book...and it contains a chapter on Tk -
but I'm looking for a good reference that covers Ruby and Tk in greater
detail. I'll be doing a lot of mathematical curve drawing [ie, plotting
some statistical functions].

The "Pickaxe" doesn't cover databases...I'm particularly interested in
using MySQL with Ruby.

I prefer textbooks...

Will someone make a recommendation.

THX,
Pat
 
M

M. Edward (Ed) Borasky

Patrick said:
Good evening,

I need to create an app that will use Ruby/TK and Ruby/MySql.
It will be a standalone pc app...

I'm going thru the "Pickaxe" book...and it contains a chapter on Tk -
but I'm looking for a good reference that covers Ruby and Tk in greater
detail. I'll be doing a lot of mathematical curve drawing [ie, plotting
some statistical functions].

The "Pickaxe" doesn't cover databases...I'm particularly interested in
using MySQL with Ruby.

I prefer textbooks...

Will someone make a recommendation.

THX,
Pat
I can't help you on MySQL -- I'm a PostgreSQL fanatic. As far as Ruby
Tk, the recommendation in the Pickaxe book is to pick up "Mastering
Perl/Tk" and just convert to Ruby. You'll also find lots of examples in
Tcl when you load Tcl and Tk to port to Ruby.

That said, unless you need Windows support, I'd recommend QTRuby. The
documentation is much better than what's available for *Ruby* Tk,
especially if you consider the Pragmatic Programmers' "Friday" series
PDF book.

I think the QT widgets look prettier than the Tk widgets as well. :)
 
H

Hugh Sasse

On Fri, 15 Sep 2006, Patrick Lynch wrote:

[...]
but I'm looking for a good reference that covers Ruby and Tk in greater

To quote my ruby page [1]:

Resources for Tk include <a href="http://httpd.chello.nl/k.vangelder/ruby/learntk/">Ruby/Tk
Tutorial</a>; a three part article by Christopher Roach - parts
<a href="http://www.macdevcenter.com/pub/a/mac/2004/06/25/ruby_pt1.html">1</a>,
<a href="http://www.macdevcenter.com/pub/a/mac/2004/07/23/ruby_pt1.html">2</a>
and <a href="http://www.macdevcenter.com/pub/a/mac/2004/07/27/ruby_pt3.html">3</a>;
<a href="http://approximity.com/ruby/rubytk.html">Ruby-Tk FAQ</a>;
and <a href="http://www.jbrowse.com/text/rubytk_en.html">Ruby/Tk
classes and Modules</a>.

HTH
Hugh

[1] Sorry if that sounds egotistical, it's just that it explains the
format, and from where I dug out the info. If you really want
the url it's http://www.eng.cse.dmu.ac.uk/~hgs/ruby/
 
H

Hidetoshi NAGAI

From: Patrick Lynch <[email protected]>
Subject: Looking for reference for Ruby/Tk and Ruby/MySQL
Date: Fri, 15 Sep 2006 09:08:06 +0900
Message-ID: said:
I'm going thru the "Pickaxe" book...and it contains a chapter on Tk -

On "Pickaxe" book, "command" option of TkScrollbar and yscrollcommand
option of the scrolled widget are used for scrolling.
Of course, that has no problem except bothering you.
However, Ruby/Tk supports "xscrolbar" method and "yscrollbar" method
for scrollable widgets. Those methods make such relationship between
a widget and a scrollbar.

-----<example on Pickaxe>--------------------------------------------
list_w = TkListbox.new(frame, 'selectmode' => 'single')
scroll_bar = TkScrollbar.new(frame,
'command' => proc { |*args| list_w.yview *args })
scroll_bar.pack('side' => 'left', 'fill' => 'y')
list_w.yscrollcommand(proc { |first,last|
scroll_bar.set(first,last) })
---------------------------------------------------------------------
|
v
-----<use "yscrollbar" method>-----------------------------------------
list_w = TkListbox.new(frame, 'selectmode'=>'single')
list_w.yscrollbar(TkScrollbar.new(frame).pack('side'=>'left', 'fill'=>'y'))
---------------------------------------------------------------------

If you want to scroll simultaneously some listboxes by one scrollbar,
TkScrollbar#assign method may help you.
Please see the example "ext/tk/sample/tkmultilistframe.rb" on your
Ruby source tree.
I'll be doing a lot of mathematical curve drawing [ie, plotting
some statistical functions].

Ruby/Tk can support many (almost all) of graph libraries which can
work with Tcl/Tk.
Even if there is no Ruby/Tk's wrapper for such graph library, Ruby/Tk
can call Tcl/Tk's commands to control the library with Tk.tk_call.
If 2D graphs are enough for your purpose, BLT extension may be suitable.
 
P

Patrick Lynch

Patrick said:
Good evening,

I need to create an app that will use Ruby/TK and Ruby/MySql.
It will be a standalone pc app...

I'm going thru the "Pickaxe" book...and it contains a chapter on Tk -
but I'm looking for a good reference that covers Ruby and Tk in greater
detail. I'll be doing a lot of mathematical curve drawing [ie, plotting
some statistical functions].

The "Pickaxe" doesn't cover databases...I'm particularly interested in
using MySQL with Ruby.

I prefer textbooks...

Will someone make a recommendation.

THX,
Pat

I'm ok now with Tcl/Tk...
However, I'm still baffled by connecting Rudy to MySql...
I tried downloading Gem but couldn't get past the question requesting
what I wanted to install...the list contained about 30 items...each
numbered...I replied with a 2 but it was rejected...

It looks like DBI is another way to go...

I'd appreicate any advice.

Thanks,
Pat
 
M

M. Edward (Ed) Borasky

Patrick said:
Patrick said:
Good evening,

I need to create an app that will use Ruby/TK and Ruby/MySql.
It will be a standalone pc app...

I'm going thru the "Pickaxe" book...and it contains a chapter on Tk -
but I'm looking for a good reference that covers Ruby and Tk in greater
detail. I'll be doing a lot of mathematical curve drawing [ie, plotting
some statistical functions].

The "Pickaxe" doesn't cover databases...I'm particularly interested in
using MySQL with Ruby.

I prefer textbooks...

Will someone make a recommendation.

THX,
Pat

I'm ok now with Tcl/Tk...
However, I'm still baffled by connecting Rudy to MySql...
I tried downloading Gem but couldn't get past the question requesting
what I wanted to install...the list contained about 30 items...each
numbered...I replied with a 2 but it was rejected...

It looks like DBI is another way to go...

I'd appreicate any advice.

Thanks,
Pat
Some of the gems have two versions -- a source version for those folks
like me who run a Gnu/Linux platform, and a pre-compiled Windows
version. And if the gem has multiple version numbers, there will be two
choices for each of those. So in general:

1. If you're on Windows, pick the "mswin" version, otherwise, pick the
source version.
2. Unless you have reasons to use an older version, pick the most recent
one.
3. If you did *that* and "got rejected", file a bug report with the
package maintainer.
 
P

Patrick Lynch

M. Edward (Ed) Borasky said:
Some of the gems have two versions -- a source version for those folks
like me who run a Gnu/Linux platform, and a pre-compiled Windows
version. And if the gem has multiple version numbers, there will be two
choices for each of those. So in general:

1. If you're on Windows, pick the "mswin" version, otherwise, pick the
source version.
2. Unless you have reasons to use an older version, pick the most recent
one.
3. If you did *that* and "got rejected", file a bug report with the
package maintainer.

Ed,
Thanks for the 'heads up'...I'll try this again over the weekend...
Good weekend,
Pat
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top