Looking for reference for Ruby/Tk and Ruby/MySQL

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

Patrick L. wrote:

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. :slight_smile:

Patrick L. wrote:

Good evening,

Will someone make a recommendation.

This link has Ruby/TK class descriptions, but not much how-to info:
http://www.jbrowse.com/text/rubytk_en.html

Cheers

On Fri, 15 Sep 2006, Patrick L. 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 Ruby/Tk
Tutorial
; a three part article by Christopher Roach - parts
1,
2
and 3;
Ruby-Tk FAQ;
and Ruby/Tk
classes and Modules
.

    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/

From: Patrick L. [email protected]
Subject: Looking for reference for Ruby/Tk and Ruby/MySQL
Date: Fri, 15 Sep 2006 09:08:06 +0900
Message-ID: [email protected]

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.

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

Patrick L. wrote:

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. Edward (Ed) Borasky wrote:

Patrick L. wrote:

I’m ok now with Tcl/Tk…
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.

Ed,
Thanks for the ‘heads up’…I’ll try this again over the weekend…
Good weekend,
Pat

Patrick L. wrote:

I’m ok now with Tcl/Tk…
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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs