Looking for good reads on Ruby TK GUI programming

H

Harry Truax

------=_NextPart_000_0013_01C642A1.752F9BA0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hello,

Could anyone suggest any good examples, articles, books, etc. for Ruby TK
GUI programming with particular emphasis on multi-screen/window GUI
applications? For example, someone is working on one window, clicks on a
button and another window 'takes-over the screen', they finish with that one
and return to the previous window.

Thanks,

Harry

------=_NextPart_000_0013_01C642A1.752F9BA0--
 
H

Hidetoshi NAGAI

From: "Harry Truax" <[email protected]>
Subject: Looking for good reads on Ruby TK GUI programming
Date: Thu, 9 Mar 2006 01:14:47 +0900
Message-ID: said:
Could anyone suggest any good examples, articles, books, etc. for Ruby TK
GUI programming with particular emphasis on multi-screen/window GUI
applications? For example, someone is working on one window, clicks on a
button and another window 'takes-over the screen', they finish with that one
and return to the previous window.

Do you mean about such like as TkWindow#grab or TkWindow#focus?
Or usage of 'screen' option of TkToplevel widget?
Or again, how to control another {Ruby|Tcl}/Tk process on the
same or other machine with RemoteTkIp class?

Did you check samples in 'ext/tk/sample' directory
on your ruby source tree?
 
H

Harry Truax

Hi,

I didn't check the source tree you mentioned, but I will, thanks.

I am looking for info on the routines needed to have a GUI that involves
more
Than one screen/window - I guess TKToplevel is one of them. Most of the
stuff I
Find is just the code being used with no explanation, the user is assumed to
Know what it does. I am looking for something that explains the routines.

I basically want to switch between one or more windows, each window takes up
the
whole screen, the user would enter/view data in each window, basic GUI
stuff.

Thanks,

Harry

-----Original Message-----
From: Hidetoshi NAGAI [mailto:[email protected]]
Sent: Wednesday, March 08, 2006 9:21 PM
To: ruby-talk ML
Subject: Re: Looking for good reads on Ruby TK GUI programming

From: "Harry Truax" <[email protected]>
Subject: Looking for good reads on Ruby TK GUI programming
Date: Thu, 9 Mar 2006 01:14:47 +0900
Message-ID: said:
Could anyone suggest any good examples, articles, books, etc. for Ruby
TK GUI programming with particular emphasis on multi-screen/window GUI
applications? For example, someone is working on one window, clicks on
a button and another window 'takes-over the screen', they finish with
that one and return to the previous window.

Do you mean about such like as TkWindow#grab or TkWindow#focus?
Or usage of 'screen' option of TkToplevel widget?
Or again, how to control another {Ruby|Tcl}/Tk process on the same or other
machine with RemoteTkIp class?

Did you check samples in 'ext/tk/sample' directory on your ruby source tree?
 
C

ChrisH

Harry said:
Hello,

Could anyone suggest any good examples, articles, books, etc. for Ruby TK
GUI programming ...

I haven't had a chance to check myself, but I understand the some of
the Perl/TK books are good if you can grok Perl.

cheers
 
K

Karl von Laudermann

Harry said:
Hello,

Could anyone suggest any good examples, articles, books, etc. for Ruby TK
GUI programming with particular emphasis on multi-screen/window GUI
applications?

No. And it's frustrating. The only Ruby/Tk tutorials I've been able to
find, including the Ruby/Tk chapter of the Pickaxe, just provide a few
simple examples, then tell you to go find some other Tk API
documentation and translate it in your head into Ruby/Tk. It took me
maybe two hours of Googling just to figure out how to programmatically
select some text in a TkText widget. (The answer is that TkText has a
concept called "tags", and you can apply any arbitrary tag to any range
of text in the widget, and to select some text you apply a predefined
tag called "sel" to the desired range using the tag_add() method.
Because a set_selection() method would have been too straightforward
and useful.)

It would be really nice if someone would write a definitive book on
developing GUI apps with Ruby/Tk. What I'm envisioning is a complete
guide on how to develop GUI apps using Tk, covering all necessary
concepts such as how to use most widgets (buttons, checkboxes, text
controls, menus, etc.), how to do modal and non-modal dialogs, how to
manage multiple windows, event handling, key shortcuts, etc. And it
would use Ruby and Ruby/Tk exclusively as the language and API for its
code samples. And of course include a complete Ruby/Tk API reference as
it's second half.

And if, say, the Pragmatic Programmers were to write such a book, that
would rock.
 
H

Harry Truax

Karl,

I know what you mean. I have found several Perl/TK examples, but found it
Difficult in discovering the translation to Ruby/TK. I guess I will go and
Buy a good TK book on GUI programming and start there.

Harry

-----Original Message-----
From: Karl von Laudermann [mailto:[email protected]]
Sent: Thursday, March 09, 2006 10:39 AM
To: ruby-talk ML
Subject: Re: Looking for good reads on Ruby TK GUI programming

Harry said:
Hello,

Could anyone suggest any good examples, articles, books, etc. for Ruby
TK GUI programming with particular emphasis on multi-screen/window GUI
applications?

No. And it's frustrating. The only Ruby/Tk tutorials I've been able to find,
including the Ruby/Tk chapter of the Pickaxe, just provide a few simple
examples, then tell you to go find some other Tk API documentation and
translate it in your head into Ruby/Tk. It took me maybe two hours of
Googling just to figure out how to programmatically select some text in a
TkText widget. (The answer is that TkText has a concept called "tags", and
you can apply any arbitrary tag to any range of text in the widget, and to
select some text you apply a predefined tag called "sel" to the desired
range using the tag_add() method.
Because a set_selection() method would have been too straightforward and
useful.)

It would be really nice if someone would write a definitive book on
developing GUI apps with Ruby/Tk. What I'm envisioning is a complete guide
on how to develop GUI apps using Tk, covering all necessary concepts such as
how to use most widgets (buttons, checkboxes, text controls, menus, etc.),
how to do modal and non-modal dialogs, how to manage multiple windows, event
handling, key shortcuts, etc. And it would use Ruby and Ruby/Tk exclusively
as the language and API for its code samples. And of course include a
complete Ruby/Tk API reference as it's second half.

And if, say, the Pragmatic Programmers were to write such a book, that would
rock.
 
R

Randy Kramer

Do you mean about such like as TkWindow#grab or TkWindow#focus?
Or usage of 'screen' option of TkToplevel widget?
Or again, how to control another {Ruby|Tcl}/Tk process on the
same or other machine with RemoteTkIp class?

Did you check samples in 'ext/tk/sample' directory
on your ruby source tree?

Sorry for piggybacking here, but I thought someone reading this thread might
know--does Ruby TK have an HTML rendering "widget"?

Randy Kramer
 
H

Hidetoshi NAGAI

From: "Karl von Laudermann" <[email protected]>
Subject: Re: Looking for good reads on Ruby TK GUI programming
Date: Fri, 10 Mar 2006 00:38:42 +0900
Message-ID: said:
It would be really nice if someone would write a definitive book on
developing GUI apps with Ruby/Tk.

I wrote a resume for my Ruby/Tk seminar (at 2004/12/08;
based on Ruby 1.8.2-prevew).
It has about 2000 lines and refers about 150 exsamples.
(total line count of samples is about 5000 lines.)
Of course, it is not a complete manual of Ruby/Tk.
But I think it includes some key-points of Ruby/Tk.

Unfortunately, the text is witten in Japanese.
Does anyone translate it in English?
If someone is up for that, I'll send the text and the examples.
 
H

Hidetoshi NAGAI

From: Randy Kramer <[email protected]>
Subject: Does Ruby TK have an HTML rendering "widget"? (was Re: Looking for good reads on Ruby TK GUI programming)
Date: Fri, 10 Mar 2006 01:45:31 +0900
Message-ID: said:
Sorry for piggybacking here, but I thought someone reading this thread might
know--does Ruby TK have an HTML rendering "widget"?

One of such widget is "Tkhtml" (http://www.hwaci.com/sw/tkhtml/).
Another one is "scrolledhtml" widget included in [incr Widgets]
(http://incrtcl.sourceforge.net/iwidgets/).
Those Tk extensions are available on current Ruby/Tk.
If you use ActiveTcl binary package for your Ruby/Tk,
you'll be able to use those extentions already.
 
R

Randy Kramer

One of such widget is "Tkhtml" (http://www.hwaci.com/sw/tkhtml/).
Another one is "scrolledhtml" widget included in [incr Widgets]
(http://incrtcl.sourceforge.net/iwidgets/).
Those Tk extensions are available on current Ruby/Tk.
If you use ActiveTcl binary package for your Ruby/Tk,
you'll be able to use those extentions already.

Thanks!

I took a quick look at those, and they may be what I need. (I was/am
considering khtml also, but I think one of these will have a shorter learning
curve.) One thing I want to be able to do is send HTML to them (rather than
have them fetch a URL) and the sample code for TkHTML does exactly that!

I'm sure I'll have more questions as time goes by, but I'll mention two that
spring to mind immediately (in case somebody can answer them easily):

* I presume I can have multiple instances of the widget without interfering
with each other?

* In the application I'm hoping to build, I'll want to send occasional
updates of the HTML (either append or clear and send new HTML) to an instance
of the widget without needing to create a new instance (I don't want to wait
for the widget to start again). Possible?

Thanks again!
Randy Kramer
 
H

Hidetoshi NAGAI

From: Randy Kramer <[email protected]>
Subject: Re: Does Ruby TK have an HTML rendering "widget"?
Date: Tue, 14 Mar 2006 02:16:53 +0900
Message-ID: said:
* I presume I can have multiple instances of the widget without
interfering with each other?

I think so too.
* In the application I'm hoping to build, I'll want to send occasional
updates of the HTML (either append or clear and send new HTML) to an instance
of the widget without needing to create a new instance (I don't want to wait
for the widget to start again). Possible?

Tk::HTML_Widget#clear and Tk::HTML_Widget#parse(html_txt)
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top