[#43266] functions need declaring before use — Daniel <lists@...>
I've noticed that functions require that they be declared before they can
[#43299] Ruby implementation Q's — justinj@... (Justin Johnson)
Apologies in advance for this meaty posting:
[#43309] Happy July Birthdays — <james@...>
It's July; the birthstone for this month is the Ruby.
[#43313] Getting CGI arguments as scalars — Philip Mak <pmak@...>
cgi = CGI.new
[#43324] is this the way it should work? newbie problem... — MIcha <mwohlwend@...>
Hi,
[#43332] Question: ruby vs. ksh — "David Douthitt" <DDouthitt@...>
I don't feel I've been giving Ruby its fair share :-)
[#43341] Re: Happy July Birthdays — "Victor Manuel Reyes Viloria" <vmreyes@...>
[#43346] Problems with Net::POP — Austin Ziegler <austin@...>
I am having problems with ruby 1.6.6 and Net::POP.
[#43358] (0..3) == (0...4) returning false? — Massimiliano Mirra <list@...>
Is there a reason for two ranges holding the same extension but
Hi,
On Tue, Jul 02, 2002 at 05:27:08PM +0900, Yukihiro Matsumoto wrote:
Hi,
[#43384] Building Ruby into VIM — Steve Tuckner <STUCKNER@...>
I have downloaded the latest sources for VIM 6.1 onto my Linux box and I
On Tuesday 02 July 2002 06:50 am, Steve Tuckner wrote:
Ok that worked great. But (even more off-topic), this builds the executable
[#43402] grep regex to ruby regex... — Todd Holloway <todd@...>
[#43416] Segmentation Fault - Ruby Garbage Collection — James Eric Birmingham <avenger@...>
During load testing of our Ruby program, we have been getting
[#43441] Running Curl inside Ruby using Command Expansion — comp Rules <tech7622000@...>
Hello,
[#43449] Make fails with missing header file (OS X) — Bruce Hobbs <brucehobbs@...>
After downloading, unzipping, etc., configure seemed to work fine, but make failed as follows:
I got that too, when trying to compile Ruby 1.7.2 on my
On 7/3/02 1:54 AM, "Bruce Hobbs" <brucehobbs@engineeredsw.com> wrote:
At 11:13 PM +0900 on 7/3/2002, Chris Gehlker wrote:
[#43490] Regular Expression problems — Jonas Bengtsson <caelumse@...>
Hello,
[#43509] set_trace_func — "Larry D'Anna" <smoof-ra@...>
[#43550] Ruby Conference 2002: Second call for presentation proposals — David Alan Black <dblack@...>
********************************************************************
[#43558] Persistant Objects — David Corbin <dcorbin@...>
Is there library/framework for ruby that makes doing persistant objects
[#43562] RE: Persistant Objects — "J.Hawkesworth" <J.Hawkesworth@...>
I'm new to this so forgive me if I'm stating the obvious but won't the
[#43563] Texas: Codefest in August? — "Hal E. Fulton" <hal9000@...>
Hello, all.
[#43570] self_parent — Tom Sawyer <transami@...>
i was wondering what others thought of the idea of having a built in
Hello --
all my real examples are pretty large, mostly to do with using the REXML
>
james@rubyxml.com schrieb:
Hi --
On Fri, Jul 05, 2002 at 07:49:09AM +0900, Tom Sawyer wrote:
On Fri, 2002-07-05 at 05:31, Massimiliano Mirra wrote:
On Sat, 6 Jul 2002 03:32:11 +0900, Tom Sawyer wrote:
> In ten years of professional software development, a good chunk of
okay, i grant you i write code very differently then most others. at
On 2002.07.06, Tom Sawyer <transami@transami.net> wrote:
>
[#43602] is there a better string.each? — Tyler Spivey <tspivey8@...>
well, i have a bit of a problem:
a = "canada"
On 2002.07.05, Tom Sawyer <transami@transami.net> wrote:
Tom Sawyer wrote:
> > thought it was strange myself. personally i'd like it if String
----- Original Message -----
On Fri, 2002-07-05 at 12:31, Hal E. Fulton wrote:
> > Not to be a pedant, but this seems like a huge breakage of the
> > In the first place, POLS is a Matz-centric phenomenon
Hal E. Fulton wrote:
Michael Campbell wrote:
>>>>> "Sean" == Sean Russell <ser@germane-software.com> writes:
----- Original Message -----
> > Someone else mentioned earlier what's been bugging me about this;
> Precisely; no more than I would say a String "is a"[n] Array. A
> by your reasoning: if a string is a string, how can it be
----- Original Message -----
no that is not right.
Hal E. Fulton wrote:
>>>>> "S" == Sean Russell <ser@germane-software.com> writes:
Dossy wrote:
On 2002.07.07, Tobias Reif <tobiasreif@pinkjuice.com> wrote:
Hi,
Hello
Dossy wrote:
[#43611] Powered by Ruby (logo) — Davey <davey@...>
Hey,
Sean Chittenden wrote:
[#43635] Tk configuration issue — Phlip <phlip_cpp@...>
Newsgroupies:
[#43643] digest/md5 problem when using Net::SMTP — Hugh Sasse Staff Elec Eng <hgs@...>
If I use the Net::SMTP module I get
> Script started on Fri 05 Jul 2002 16:25:35 BST
On Fri, 5 Jul 2002, Sean Chittenden wrote:
>>>>> "H" == Hugh Sasse Staff Elec Eng <hgs@dmu.ac.uk> writes:
On Tue, 9 Jul 2002, ts wrote:
[#43667] ri from within irb — Bil Kleb <W.L.Kleb@...>
Is there a better way than
[#43697] Wired magazine being their usual acurate self... — <kentda@...>
(Sorry if this has come up already, I'm not all up to date)
[#43706] VIM/ruby — Steve Tuckner <STUCKNER@...>
I am want to build a class or set of classes to use in VIM so that I can
[#43726] Packaging ideas (was: Re: packaged REXML) — Massimiliano Mirra <list@...>
Sorry for not replying sooner. I wanted to first do my homework and
[#43742] fast "set difference" on arrays — Martin Pirker <crf@...>
[#43752] Ruby Development Enviroment — Davey <davey@...>
Hey,
[#43759] to pass or to be? — Tom Sawyer <transami@...>
so i have a question realted to class inheritence: when a class inherits
[#43770] hideshow mode for ruby-mode.el — Massimiliano Mirra <list@...>
[#43780] passing to objects at the bottom — Tom Sawyer <transami@...>
i have a chain of objects such that one object contains another which
On Sun, Jul 07, 2002 at 08:11:11AM +0900, Tom Sawyer wrote:
hey i found the answer! i got a clue from david. thanks david.
On Sun, Jul 07, 2002 at 04:33:27PM +0900, Tom Sawyer wrote:
[#43795] Pre-RCR... nil.empty? — Dave Thomas <Dave@...>
Hi --
Dave Thomas <Dave@PragmaticProgrammer.com> wrote in message news:<m24rfcb5e7.fsf@zip.local.thomases.com>...
Tom Sawyer <transami@transami.net> wrote in message news:<1026194588.24015.238.camel@silver>...
[#43807] unshifting a directory onto ENV['PATH'] — Bil Kleb <W.L.Kleb@...>
Is there a more elegant (compact?) method than
Simple FTP connection. Linux servers work just fine. Windows seems to
[#43866] FXIrb — Gilles Filippini <gilles.filippini@...>
Hi all,
[#43893] String#each — "Hal E. Fulton" <hal9000@...>
Well, let's come full circle and get back
>
[#43901] What to use for OS-specific module namespaces? — Joe Wreschnig <piman@...>
Hi all,
Hi,
[#43916] How to determine EOF with sysread? — Jim Freeze <jim@...>
Hi:
On Sunday 07 July 2002 08:58 pm, Jim Freeze wrote:
On Mon, Jul 08, 2002 at 01:35:46PM +0900, Ned Konz wrote:
> Thanks all for the answers. Does it strike anyone as bad practice
[#43943] SV: SV: [ANN] Archive 0.2 — Thomas Søndergaard <tsondergaard@...>
DQo+IFRoYW5rcy4gOi0pIEknbSBub3QgdGVycmlibHkgaW4gaHVycnkgdG8gYWRkIFppcCBzdXBw
[#43944] Re: is there a better string.each? — George Ogata <g_ogata@...>
Hi,
On Monday 08 July 2002 04:43 am, George Ogata wrote:
On Mon, 8 Jul 2002 20:43:57 +0900, George Ogata wrote:
Hal E. Fulton wrote:
[#43948] again: Ruby program without ruby installation — "Kontra, Gergely" <kgergely@...>
Hi!
> ps: btw python can do it, eg. blender doesn't need python, however it is
[#43949] for ... else ... end — "Kontra, Gergely" <kgergely@...>
Hi!
----- Original Message -----
(Epiloque: *argh* Do not have time to reedit this mail now,
Yukihiro Matsumoto wrote:
For the keyword war: (silly, dummy example)
On Tue, 9 Jul 2002 23:19:05 +0900, Kontra, Gergely wrote:
Hello --
On Wed, 10 Jul 2002 01:52:38 +0900, David Alan Black wrote:
[#43950] ruby-dev summary 17609-17666 — Takaaki Tateishi <ttate@...>
[#43957] Redirecting standard error — Gilles Filippini <gilles.filippini@...>
Hi,
[#44019] String#split converts string args to regexes -- ? — David Alan Black <dblack@...>
Hello --
Hi,
Hallo,
Hi,
Hi --
Hallo,
Hi --
On Wed, 2002-07-10 at 06:29, David Alan Black wrote:
Hi,
matz,
>>>>> "T" == Tom Sawyer <transami@transami.net> writes:
ummm..the thread is called String#split converts...
[#44025] Net::SSH ??? — Bil Kleb <W.L.Kleb@...>
Does anyone know of a Net::SSH class or of any code that
[#44029] Help with Ruby and web — "VT" <venugops@...>
Hi All,
[#44032] decent example of how to use DBI/ODBC — kkroculick@... (kk)
Hello,
[#44046] Ruby/Tk, TkMessage — katiedhe@... (Dandan He)
Hello,
[#44105] How to connect to sql host using dbi — Radek Hnilica <Radek@...>
Hello,
[#44124] off? [gtk] accented characters under windows — "Kontra, Gergely" <kgergely@...>
Hi!
[#44159] ruby-libxml (2002-07-09)... — Sean Chittenden <sean@...>
http://www.rubynet.org/modules/xml/ruby-libxml/ruby-libxml-20020709.tar.gz
[#44180] Accessing caller's binding? — Philip Mak <pmak@...>
I'm trying to make a function that is called like this:
[#44197] error compiling ruby-libxml — Markus Jais <mjais@...>
hello
[#44199] Case expressions and LHS of assignment.... — Hugh Sasse Staff Elec Eng <hgs@...>
While trying to avoid Repetition in my code I tried to rewrite a case
Perhaps you could use an array to hold you instance variables rather
[#44248] Bug in socket code - high number of simul. conns causes segfault — Wejn <lists+rubytalk@...>
Hi all,
[#44249] Resurrection of the const_added (was class_added) RCR; Re: self_parent — "Christoph" <chr_news@...>
Hi,
[#44265] spliter of for...each: looping — Tom Sawyer <transami@...>
when looping, using each, i find i am often wonton of a few nice
Hello --
hmmm...
Hi --
david,
Hi --
each_with_nindex, rocking! i'll throw that in my library, for sure.
Hi --
On Thu, 2002-07-11 at 04:55, David Alan Black wrote:
>>>>> "T" == Tom Sawyer <transami@transami.net> writes:
Tom Sawyer <transami@transami.net> writes:
> Seems a little cleaner/clearer, but that's IMHO of course :) Your
[#44296] RE: Commercial Support for Ruby — "Berger, Daniel" <djberge@...>
> Hi Everyone,
[#44312] opengl — Tom Sawyer <transami@...>
can any one give me some help installing the opengl interface library? i
On 2002.07.12, Tom Sawyer <transami@transami.net> wrote:
just did apt-get mesag-dev. still the same thing:
On 2002.07.12, Tom Sawyer <transami@transami.net> wrote:
that was it! i still had to apt-get install glutg3-dev. that did it. all
On 2002.07.12, Tom Sawyer <transami@transami.net> wrote:
dossy,
notice: i'm scrapping my web application. now i'm in the market for a
[#44322] Ruby Wiki — Steve Tuckner <STUCKNER@...>
I have a suggestion for the Ruby Wiki. I don't know if this can be done
[#44334] new to ruby,how to make FIFO in ruby? — Maggie Xiao <mxiao@...>
Hi,
[#44372] Destructors in Ruby — Wejn <lists+rubytalk@...>
Hi all,
[#44387] Dynamic Methods — "John" <nojgoalbyspam@...>
Hi all,
Wow! Thanks Dave!
> (What do you propose if more than one possibility matches, by the
> Would it be possible to see if a regular expression intersects with another
Hi --
Basically I thought it was nigh impossible too. But you never know in this
----- Original Message -----
[#44395] cache dbi for web app — Tom Sawyer <transami@...>
okay, so i didn't completely trash my web app, i'm going to create both
[#44409] Socket problems on FreeBSD — Brad Cox <bcox@...>
Sorry to trouble you all but I'm really stumped on this one. Could
On Sat, Jul 13, 2002 at 08:07:51AM +0900, Brad Cox wrote:
[#44411] RE: cache dbi for web app — "Morris, Chris" <chris.morris@...>
> Switching to mod_ruby would help a lot, both removing the interpreter
[#44424] gsub() replacement containing replaced text — Harry Ohlsen <harryo@...>
This feels like a terribly newbie question to be asking, but I'm stymied ...
[#44425] hey! where's #count? — Tom Sawyer <transami@...>
i went to count the number of equal objects in an array and discoverd
"Tom Sawyer" wrote
On Sun, Jul 14, 2002 at 11:41:55PM +0900, Christoph wrote:
so i tried my hand at including count in Enumberable and "normalizing"
>>>>> "T" == Tom Sawyer <transami@transami.net> writes:
On Mon, 2002-07-15 at 02:29, ts wrote:
>>>>> "T" == Tom Sawyer <transami@transami.net> writes:
[#44445] .rb files in WIndows — "Hal E. Fulton" <hal9000@...>
Here's a question for you.
[#44446] DBI create table question — Jim Freeze <jim@...>
Hi:
[#44482] instance_eval — "John" <nojgoalbyspam@...>
Hi all,
[#44524] How to delete a line in a file if....? — Kurt Euler <keuler@...>
All-
[#44534] Has anyone combined Test::Unit with CGI? — Dossy <dossy@...>
Doing some Test::Unit work on my CGI scripts, I wondered if anyone
On Mon, Jul 15, 2002 at 11:35:25AM +0900, Dossy wrote:
Dossy <dossy@panoptic.com> wrote in message news:<20020715023521.GH24646@panoptic.com>...
[#44571] Execution question — "Justin Johnson" <justinj@...>
What happens to 'a' in the following case?
[#44575] cut & paste for code — Matthias Veit <matthias_veit@...>
[#44613] TkText no -textvariable workaround? — Tom Sawyer <transami@...>
well, i've been busy adding tk support to my gui template tool (Miter),
Tom Sawyer wrote:
On Tue, 2002-07-16 at 08:29, Peter Hickman wrote:
[#44618] RE: TkText no -textvariable workaround? — "J.Hawkesworth" <J.Hawkesworth@...>
I think what Tom is after is a neat way to have the widget's display
On Tue, 2002-07-16 at 09:08, J.Hawkesworth wrote:
On 2002.07.17, Tom Sawyer <transami@transami.net> wrote:
actually, Dossy, your post was a bit helpful. what i'm after also sort
On 2002.07.17, Tom Sawyer <transami@transami.net> wrote:
From: "Dossy" <dossy@panoptic.com>
----- Original Message -----
[#44632] Win32OLE: Is getting MSIE HTTP status possible? — Dossy <dossy@...>
Hi,
[#44654] alias_method problem — <mengx@...>
Hi,
[#44712] Downloadable version of "Programming Ruby"? — ravindr@... (Ravindran Vikram)
[#44718] Problems installing FX/Ruby — Harry Ohlsen <harryo@...>
I'm having problems getting FX/Ruby installed on Redhat 7.3 with Ruby 1.6.7.
[#44734] Syntax "surprise" — "David Douthitt" <DDouthitt@...>
I don't know if this qualifies as a real "surprise", but it was to me. I h=
David Douthitt wrote:
Oops! Brad Cox <bcox@virtualschool.edu> was seen spray-painting on a wall:
Brad Cox <bcox@virtualschool.edu> wrote
At 7:48 AM +0900 7/18/02, Avi Bryant wrote:
Yukihiro Matsumoto wrote:
[#44788] Selling ruby to my boss — Francis Hwang <sera@...>
So I've just started working as the sole programmer at a non-profit
On Thu, Jul 18, 2002 at 10:14:18AM +0900, Francis Hwang wrote:
hello all,
Jim Freeze schrieb:
[#44795] What is the EIO error? — Maggie Xiao <mxiao@...>
Hi there,
[#44802] How to name a variable after another variable's value? — Kurt Euler <keuler@...>
All-
[#44829] Q: "print usage_msg, exit 1 if error_flag" does not work — kwatch@... (kwatch)
Hi,
>>>>> "k" == kwatch <kwatch@lycos.jp> writes:
On Thu, 18 Jul 2002, ts wrote:
>>>>> "H" == Hugh Sasse Staff Elec Eng <hgs@dmu.ac.uk> writes:
On Thu, 18 Jul 2002, ts wrote:
[#44852] Ruby/Tk on Mandrake 8.2? — "Boris S." <boris-do@...>
Hi,
[#44855] Ruby in MacOSX 10.2 (Jaguar) — Luc Heinrich <lucsky@...>
It now seems to be "official" that Ruby will come by default with the next iteration of MacOSX.
Also there is this reference in 10.2 Server Web Services Page
[#44860] Just a small language question... — Bob X <bobx@...>
Why does Ruby do single quotes around package names?
[#44881] Can you only catch errors one level deep? — Philip Mak <pmak@...>
In dbi.rb (from the Ruby DBI package), there is the following code:
On Fri, Jul 19, 2002 at 09:04:02AM +0900, Philip Mak wrote:
[#44890] thread, fork, wait and popen3 — Jim Freeze <jfreeze@...>
Hi:
[#44893] amrita 0.8.1 — Taku Nakajima <tnakajima@...>
Amrita is a a html/xhtml template library for Ruby.
On Thu, 2002-07-18 at 20:26, Taku Nakajima wrote:
Amrita is a a html/xhtml template library for Ruby.
Taku Nakajima <tnakajima@brain-tokyo.jp> wrote in message news:<200207190226.LAA24643@brain-tokyo.jp>...
Hi:
[#44901] #name of instance — Tom Sawyer <transami@...>
i'm back at trying to get a form to be automagically update from changes
[#44920] Objective C backend for Ruby? — "James F.Hranicky" <jfh@...>
While people are kicking around ideas for new backends for Ruby,
Thanks, I think I can learn how to translate the command into ruby/tk,but I
In article <a05111b05b95de4b58e30@[63.120.19.221]>,
In article <a05111b10b95f7847af7a@[63.120.19.221]>,
At 6:42 AM +0900 7/21/02, Phil Tomson wrote:
[#44946] Character Code — the Bare <grrr@...>
Hi:
[#44976] GUI's and the Rouge, Part 1 — Tom Sawyer <transami@...>
i just discovered Rouge. a very ambitious project to say the least.
[#44985] GUI's and the Rouge, Part II — Tom Sawyer <transami@...>
in part one of this message i mention the problem of non-POLS and
On Sun, Jul 21, 2002 at 02:00:47AM +0900, Tom Sawyer wrote:
Ned Konz <ned@bike-nomad.com> wrote in message news:<200207201125.13528@ned.bike-nomad.com>...
a bit of an intro: my original thought on the matter of making a
Still looks like plain old Model-View-Controller to me. You've split the
On Wed, Jul 24, 2002 at 10:13:37AM +0900, Albert Wagner wrote:
On 7/24/02 8:54 AM, "Massimiliano Mirra" <list@NOSPAMchromatic-harp.com>
On Thu, Jul 25, 2002 at 11:17:48AM +0900, Chris Gehlker wrote:
On 7/25/02 3:13 AM, "Massimiliano Mirra" <list@NOSPAMchromatic-harp.com>
Tom Sawyer wrote:
What about WX-Windows. There is no ruby bindings for it, but would that fit
On Wed, 2002-07-24 at 08:39, Steve Tuckner wrote:
Hi Tom,
Wayne Vucenic wrote:
On Thu, 2002-07-25 at 07:12, Curt Hibbs wrote:
> Wayne Vucenic wrote:
yct wrote:
Lyle Johnson wrote:
well, i just read over my last post. sorry about all the typos. i needed
[#44994] Learning Japanese — "John" <nojgoalbyspam@...>
Inspired to learn to read Japanese due to a lot of information on Ruby being
John graced us by uttering:
[#45036] ruby-mode.el dies when breaking ternary exp. — Dan Debertin <airboss@...>
ruby-mode.el causes Emacs to consume all available CPU when using the
[#45042] module_eval: adding a method to a class with a proc — Tom Sawyer <transami@...>
i'm having a little problem that i'm not sure how to solve. i'm trying
[#45044] Install troubles — Jim Freeze <jfreeze@...>
Hi:
On 7/21/02 12:13 PM, "Jim Freeze" <jfreeze@freebsdportal.com> wrote:
On Mon, Jul 22, 2002 at 08:21:01AM +0900, Chris Gehlker wrote:
> I did the following:
On 7/21/02 5:52 PM, "Jim Freeze" <jfreeze@freebsdportal.com> wrote:
On 7/21/02 8:00 PM, "Chris Gehlker" <gehlker@fastq.com> wrote:
On Mon, Jul 22, 2002 at 01:37:32PM +0900, Chris Gehlker wrote:
On 7/21/02 10:21 PM, "Jim Freeze" <jfreeze@freebsdportal.com> wrote:
[#45056] FXRuby-1.0.11 install make failed — Jim Freeze <jfreeze@...>
Hi:
[#45061] ruby-mode.el again; imenu this time — Dan Debertin <airboss@...>
Hello,
Hi,
This is better, but still doesn't do what I expect. The code fragment
[#45068] define_method with super in the proc — Tom Sawyer <transami@...>
ran into a serious problemo! i'm trying to create a subclass with
Tom Sawyer wrote:
[#45085] ruby-dev summary 17696-17713 — Minero Aoki <aamine@...>
Hi all,
Minero Aoki <aamine@mx.edit.ne.jp> writes:
>>>>> "D" == Dave Thomas <Dave@PragmaticProgrammer.com> writes:
On Tue, Jul 23, 2002 at 12:28:23AM +0900, Dave Thomas wrote:
Paul Brannan <pbrannan@atdesk.com> writes:
[#45108] piping into ruby at command line — "Shashank Date" <ADATE@...>
How do I make something like this work ?
[#45118] Re: rdtool and rdoc — "David Douthitt" <DDouthitt@...>
I took a look at your comparison page. I've not used either, but some thin=
[#45135] TCPServer bug or and interface change ? — domingo@... (Domingo Alvarez Duarte)
Looking in a way to use ruby to make some servers (like
[#45136] Strings and member-operators — the Bare <grrr@...>
Hi:
On 2002.07.23, the Bare <grrr@wild.net> wrote:
Hi --
On 2002.07.23, David Alan Black <dblack@candle.superlink.net> wrote:
Hi --
Hello,
Hi --
let me get this straight? is the original question how to strip a string
On 2002.07.24, Tom Sawyer <transami@transami.net> wrote:
On 2002.07.24, Dossy <dossy@panoptic.com> wrote:
really? what did it fail on?
Tom Sawyer <transami@transami.net> writes:
[#45178] bdb and $= — Tom Gilbert <tom@...>
Just noticed, bdb's Hash interface doesn't pay attention to $=.
>>>>> "T" == Tom Gilbert <tom@linuxbrit.co.uk> writes:
>>>>> "t" == ts <decoux@moulon.inra.fr> writes:
[#45226] Re: Syntax "surprise" — "David Douthitt" <DDouthitt@...>
To me, that is not an idiom; this is an idiom:
[#45235] ruby on Axis Developer Board LX ( etrax )? — Joseph McDonald <joe@...>
[#45240] YAML4R 0.26 — why the lucky stiff <yaml4r@...>
Here's a quick notice to those of you who are following the YamlForRuby project.
[#45257] Re: GUI's and the Rouge, Part III (yes, finally) 1/2 — Benjamin Peterson <bjsp123@...>
>you have this super application you wrote --the
On Wed, Jul 24, 2002 at 07:04:28PM +0900, Benjamin Peterson wrote:
[#45269] Can I get data back from a fork? — Jim Freeze <jfreeze@...>
Hi:
I should probably clarify:
>>>>> "J" == Jim Freeze <jfreeze@freebsdportal.com> writes:
[#45286] Re: GUI's and the Rouge, Part III (yes, finally) 1/2 — Benjamin Peterson <bjsp123@...>
>its really just SOC on aanother level.
On 2002.07.24, Benjamin Peterson <bjsp123@yahoo.com> wrote:
On Wednesday 24 July 2002 07:15 pm, Dossy wrote:
[#45324] FXRuby without the subclassing — Tom Sawyer <transami@...>
is there a way to use FXRuby without subclassing from an FXObject? every
Tom Sawyer wrote:
On Wed, 2002-07-24 at 17:48, Lyle Johnson wrote:
[#45345] A Code Challenge — Tom Sawyer <transami@...>
Problem:
[#45368] Re: [OT] Re: GUI's and the Rouge, Part III (yes, finally) 1/2 — Benjamin Peterson <bjsp123@...>
>The functionality of a spreadsheet had been around
On Thu, Jul 25, 2002 at 10:41:19PM +0900, Benjamin Peterson wrote:
On Thursday 25 July 2002 08:41 am, Benjamin Peterson wrote:
On Thu, Jul 25, 2002 at 10:52:10PM +0900, Albert Wagner wrote:
On Thu, 2002-07-25 at 08:00, Martin Weber wrote:
clemens fischer <ino-waiting@gmx.net> wrote:
On Fri, Jul 26, 2002 at 07:51:25PM +0900, Thomas Dickey wrote:
On Fri, Jul 26, 2002 at 09:31:22PM +0900, Massimiliano Mirra wrote:
On Fri, Jul 26, 2002 at 09:37:31PM +0900, Martin Weber wrote:
On Sat, Jul 27, 2002 at 12:16:26AM +0900, Massimiliano Mirra wrote:
On Sat, Jul 27, 2002 at 12:29:02AM +0900, Martin Weber wrote:
On Sat, Jul 27, 2002 at 06:15:37AM +0900, Massimiliano Mirra wrote:
On Sat, Jul 27, 2002 at 06:23:26AM +0900, Martin Weber wrote:
----- Original Message -----
----- Original Message -----
On Wed, Jul 31, 2002 at 03:16:27AM +0900, Hal E. Fulton wrote:
[#45385] Re: Moving from TK to Fox. — "lyle@..." <lyle@...>
[#45398] Opinion on Ruby maturity — John Knight <john@...>
Hi All,
[#45406] use of #missing_method — Tom Sawyer <transami@...>
just a quick question. is the use of #missing_method kosher? should i be
[#45422] Singleton Classes & thread safety — David King Landrith <dave@...>
I'm a bit new to Ruby, so please excuse me if this is a simplistic=20
On Thursday 25 July 2002 02:06 pm, David King Landrith wrote:
On Thursday, July 25, 2002, at 05:26 PM, Ned Konz wrote:
On Thursday 25 July 2002 02:44 pm, David King Landrith wrote:
This is going to sound like an odd question, and there's no "right"
for each x in a to p(x)
On Thursday 25 July 2002 06:34 pm, Albert Wagner wrote:
On Thu, 2002-07-25 at 17:41, Albert Wagner wrote:
On Thursday 25 July 2002 06:44 pm, Tom Sawyer wrote:
Questions like this always intrigue me because the various replies seem to say
[#45429] Opinion on Ruby maturity, the missing things — "Paul E.C. Melis" <paul@...>
Hello all,
On Fri, 26 Jul 2002, Paul E.C. Melis wrote:
On Fri, Jul 26, 2002 at 08:44:29AM +0900, John Carter wrote:
[#45465] Ruby-Talk Index — Tom Sawyer <transami@...>
here's a one nighter coding challange for some one feeling the need to
Hi,
On Thu, 2002-07-25 at 23:50, Yukihiro Matsumoto wrote:
You may find better results with searching google.
Jim Freeze <jfreeze@freebsdportal.com> writes:
On Sat, Jul 27, 2002 at 10:22:17PM +0900, Dave Thomas wrote:
[#45511] Some basic Ruby questions — Benjamin Sommerfeld <benlebt@...>
Hi!
On Friday 26 July 2002 11:19 am, Benjamin Sommerfeld wrote:
[#45530] — ruby-talk-admin@...
泌惚宸撃佚嬉氾阻艇嵐蛍宇埜
[#45537] Call-by-need and/or Delayed Evaluation — raganwald@... (Reginald Braithwaite-Lee)
Hello:
[#45579] Regular Expression question — "John" <nojgoalbyspam@...>
All,
[#45585] Ruby Hosting - 3 Questions — jeffc@... (Jeff Cordova)
[1] Is there an inexpensive place to host my Ruby backed website?
[#45593] YAML4R 0.26 tests fail — Holden Glova <dsafari@...>
-----BEGIN PGP SIGNED MESSAGE-----
[#45605] Vim - versions < 6.0 — Doug Kearns <djkea2@...>
Hello all,
[#45621] Seattle.rb meeting tomorrow (7/30) — Pat Eyler <pate@...>
Just a quick reminder that we'll be meeting tomorrow night at 7:00 PM at
Pat Eyler <pate@eylerfamily.org> writes:
[#45644] FormatR 1.06 — Paul Rubel <rubel@...>
A new release of FormatR is out, 1.06. FormatR provides perl-like
Is there an accepted standard as to when to use {} vs do/end?
What's really unfortunate, though, is that Vim has some killer features
On Thu, Aug 01, 2002 at 12:59:01AM +0900, Gavin Sinclair wrote:
On 2002.08.12, Gavin Sinclair <gsinclair@soyabean.com.au> wrote:
[#45660] Re: wxWindows for ruby — Pierre Brengard <pbrengard@...>
[#45672] function reference? — "Marc Beyerlin" <beyerlin@...>
hey again rubys,
[#45678] Procs and scope (function pointers) — Jim Freeze <jim@...>
Hi:
[#45688] Ruby Language Q's — "Justin Johnson" <justinj@...>
"Justin Johnson" <justinj@mobiusent.com> writes:
>>>>> "D" == Dave Thomas <Dave@PragmaticProgrammer.com> writes:
ts <decoux@moulon.inra.fr> writes:
>>>>> "D" == Dave Thomas <Dave@PragmaticProgrammer.com> writes:
On Wed, Jul 31, 2002 at 12:13:10AM +0900, ts wrote:
>>>>> "P" == Paul Brannan <pbrannan@atdesk.com> writes:
On Wed, Jul 31, 2002 at 01:10:55AM +0900, ts wrote:
Hello --
Hi,
> yes = "yes"
On 2002.08.12, Justin Johnson <justinj@mobiusent.com> wrote:
[#45723] Syntax proposal — Massimiliano Mirra <list@...>
I often write things like this:
>>>>> "M" == Massimiliano Mirra <list@NOSPAMchromatic-harp.com> writes:
On Wed, Jul 31, 2002 at 01:53:37AM +0900, ts wrote:
----- Original Message -----
[#45737] ActiveRubyScript and RubyAEOSA — Chris Gehlker <gehlker@...>
I just discovered ActiveRubyScript (sometimes written as two words) by
----- Original Message -----
On 7/30/02 10:59 AM, "Hal E. Fulton" <hal9000@hypermetrics.com> wrote:
> >
On Tuesday 30 July 2002 03:22 pm, JamesBritt wrote:
[#45768] RE: A very basic tail -f implementation — "Berger, Daniel" <djberge@...>
> From: Paul Brannan [mailto:pbrannan@atdesk.com]
Am 2002-07-31 06:15:08 +0900 schrieb Berger, Daniel:
On Wed, 31 Jul 2002 21:02:04 +0900
[#45787] Ruby and Ocaml - my two favorite languages — "MikkelFJ" <mikkelfj-anti-spam@...>
While being away from Ruby land, I did investigate the OCaml language
[#45799] Question about GetoptLong — Patrick Bennett <patrick.bennett@...>
I'm trying to recreate a Perl script in Ruby and have run into a problem.
Sorry, that won't work.
nobu.nokada@softhome.net wrote:
[#45829] Unicode in Ruby now? — Tobias Peters <tpeters@...>
I've read the thread "Unicode in Ruby's Future?" [ruby-talk: 40016]. It
Hi,
On Wed, 31 Jul 2002, Yukihiro Matsumoto wrote:
On Thu, 1 Aug 2002, Tobias Peters wrote:
On Thu, Aug 01, 2002 at 07:53:07PM +0900, Curt Sampson wrote:
On Thu, 1 Aug 2002, Alexander Bokovoy wrote:
On Thu, Aug 01, 2002 at 09:55:48PM +0900, Curt Sampson wrote:
On Thu, 1 Aug 2002, Alexander Bokovoy wrote:
On Thu, Aug 01, 2002 at 11:23:38PM +0900, Curt Sampson wrote:
On Fri, 2 Aug 2002, Alexander Bokovoy wrote:
Curt Sampson wrote:
On Mon, 5 Aug 2002, Clifford Heath wrote:
Curt Sampson wrote:
On Mon, 5 Aug 2002, Clifford Heath wrote:
Curt Sampson wrote:
On Tue, 6 Aug 2002, Clifford Heath wrote:
Curt Sampson wrote:
On Tue, 6 Aug 2002, Clifford Heath wrote:
Matz,
On Thu, 1 Aug 2002, Clifford Heath wrote:
----- Original Message -----
Hi,
Hi,
On Thu, 1 Aug 2002, Yukihiro Matsumoto wrote:
In message "Re: Unicode in Ruby now?"
On Thu, 1 Aug 2002, Yukihiro Matsumoto wrote:
[#45834] How to Emulate C/C++ Pointer/Reference in Ruby? — billtj@... (Bill Tj)
Hi,
[#45850] Late contribution to discussions — "Gavin Sinclair" <gsinclair@...>
I just joined the mailing list, having but read it through the web for
[#45859] matrix challange — Daniel Bretoi <lists@...>
Daniel Bretoi <lists@debonair.net> writes:
[#45876] Emacs is dead, long live whatever comes after that as long as it is made with Ruby — Jani Alanko <jani.alanko@...>
Subject is not exactly right but I was too lazy to invent something that
I didn't see any reference there to using Ruby as a scripting language.
Re: GUI's and the Rouge, Part III (grand finally) 2/2
has anyone gotten a chance to take a look at the GUtopIa code yet?
there's something very strange about it. something i can't figure out. i
mean i wrote it and all, but i never explictly told it how to update the
widget when the object changes. yet it does! how? i keep coming back to
this and looking for some place in the code that does it, but i can't
find it. very spooky.
~transami
On Tue, 2002-07-23 at 18:31, Tom Sawyer wrote:
> well, i just read over my last post. sorry about all the typos. i needed
> a break and didn't bother to proofread. but i'm sure you can make out
> what i was trying to say where i blurbed. okay, now to the good stuff!
>
> i spent the last few days hacking out the first steps in the creation of
> a super-duper ruby gui api, which i have dubbed GUtopIa (thanks rich).
> just to kick things off here's a small clip of one of my examples (note
> MyModels is drawn from an unshown require):
>
> INTERFACE = 'PDA'
> fruitapp = FruitApp.new
> mygui = GUtopIa::GUI.new('Fruity Fun Time')
> names = {
> 'awindow' => fruitapp.appname,
> 'aradio' => fruitapp.fruitbasket.name
> }
> bindings = {
> fruitapp.fruitbasket.name => {
> :value => Proc.new { fruitapp.fruit.isa },
> :value= => Proc.new { |x| fruitapp.fruit.isa = x },
> :items => Proc.new { fruitapp.fruitbasket.contains },
> :event_change => Proc.new { fruitapp.pickafruit }
> }
> }
> model = MyModels.pick_model(mygui, INTERFACE)
> mygui.transaction(bindings, names, &model)
> mygui.build
>
> the idea is that you take an instance of your application (FruitApp in
> this case), completely untouched --you don't have to add or change a
> single line of code (unless you want too ;-) you then create a model. a
> model (not shown in example) is an executable description of the fixed
> aspects of your gui. it has no references to any part of your app
> (although you can do so if you don't care about SOC) it is a completely
> independent entity and as such can be reused in other fitting contexts.
> you can also draw on multiple sub-models. then you create a binding (as
> seen above). this describes how an instance of your application
> "interfaces" with your model. and then presto out comes you gui-ized
> app.
>
> also note that GUtopIa uses a transaction mechinism. this effectivly
> bundles an executable model into a single execution. not only does this
> increase speed, but also offers a means to rollback the effects of a
> transaction should there be an error, adding much greater stability to
> your gui-ized application.
>
> some other things to note: bindings are actually integrated directly
> into the class models of the widgets. when a widget is created it is
> subclassed into a specialized class of that widget which includes
> methods to react to the bindings described.
>
> i've attached my work thus far so you can checkout all of this in
> detail. be sure to run example.rb (the snipet above) and check out
> orig-example.rb, which is a non-SOC version of the original Rouge/Utopia
> example. then check out gutopia.rb which is the heart of the matter.
>
> so that's the the word on implementation. i've taken the advice of
> others and i have worked out what i think is shaping up to be the best
> gui api design in existence. Curt Hibbs has offered me a wiki for this
> project. (thanks curt) i will take him up on it. now i hope i can get
> YOU enthused enough to help. there's real potential here, to not only
> create an awsome gui api for ruby that is unique and powerful, but also
> create a full-fledge game sdk! this thing looks to be awesome indeed.
>
> i need people to take on a few tasks. a ruby wrapper needs to be created
> for ClanLib and we need to build a Themes and Behaviors manager. someone
> needs to hack out the communications layer (i've tried it with DRb and
> ROMP but they bomb). and i could use some help finishing off the main
> api. if we can pull together on this, ruby, our favorite little
> scripting language, will have its very own GUI to rival all others!
>
> as you might be able to tell, i'm very excited! i hope you are too!
>
> thanks for your time and hope to hear from you,
>
> ~transami :-)
>
>
> ----
>
> # GUtopIa Example - Application Layer
> # Copyright (c) 2002 Thomas Sawyer, Ruby License
>
> class FruitApp
> attr_accessor :appname
> attr_reader :fruitbasket, :fruit, :basketname
> def initialize
> @appname = 'Fruity Fun'
> @fruitbasket = FruitBasket.new
> @fruit = Fruit.new
> end
> def pickafruit
> puts "You got a #{@fruit.isa}!"
> end
> end
>
> class FruitBasket
> attr_accessor :name, :contains
> def initialize
> @name = 'Fruit Basket'
> @contains = ["None", "Apple", "Orange", "Banana"]
> end
> end
>
> class Fruit
> attr_accessor :isa
> def initialize
> @isa = "None"
> end
> end
> ----
>
> # GUtopIa Daemon Example - Client
> # Copyright (c) 2002 Thomas Sawyer, Ruby License
>
> require 'drb'
> require 'example-app'
> require 'example-pre'
>
>
> # Configure interface
>
> INTERFACE = 'PDA'
> puts "\nINTERFACE: #{INTERFACE}\n"
>
>
> # Make GUI App
>
> fruitapp = FruitApp.new
>
> DRb.start_service()
> mygui = DRbObject.new(nil, 'druby://localhost:8080')
>
> names = {
> 'awindow' => fruitapp.appname,
> 'aradio' => fruitapp.fruitbasket.name
> }
>
> bindings = {
> fruitapp.fruitbasket.name => {
> :value => Proc.new { fruitapp.fruit.isa },
> :value= => Proc.new { |x| fruitapp.fruit.isa = x },
> :items => Proc.new { fruitapp.fruitbasket.contains },
> :event_change => Proc.new { fruitapp.pickafruit }
> }
> }
>
> model = MyModels.pick_model(mygui, INTERFACE)
>
> mygui.transaction(bindings, names, &model)
>
> mygui.build
>
>
> # Run some tests
>
> puts
> puts "MYGUI "
> p mygui
>
> puts
> puts "MYGUI WIDGETS"
> mygui.widgets.each_key do |k|
> puts k
> end
>
> puts
> puts "THE WINDOW"
> p mygui.widgets[fruitapp.appname].class.superclass
> puts "name: #{fruitapp.appname}"
> puts "width: #{mygui.widgets[fruitapp.appname].width}"
> puts "height: #{mygui.widgets[fruitapp.appname].height}"
>
> puts
> puts "THE RADIO"
> p mygui.widgets[fruitapp.fruitbasket.name].class.superclass
> puts "name: #{fruitapp.fruitbasket.name}"
> puts "items: #{mygui.widgets[fruitapp.fruitbasket.name].items.join(', ')}"
> puts "value: #{mygui.widgets[fruitapp.fruitbasket.name].value}"
>
> puts
> puts
> puts "TRY OUT!"
> puts
> puts "Current state of fruit and its widget:"
> puts "fruit=#{fruitapp.fruit.isa}"
> puts "widget=#{mygui.widgets[fruitapp.fruitbasket.name].value}"
> puts
> puts "Changing widget to: #{mygui.widgets[fruitapp.fruitbasket.name].value = 'Banana'}"
> puts "fruit=#{fruitapp.fruit.isa}"
> puts
> puts "Changing fruit to: #{fruitapp.fruit.isa = 'Orange'}"
> puts "widget=#{mygui.widgets[fruitapp.fruitbasket.name].value}"
> puts
> puts "Trigger event_change event:"
> mygui.widgets[fruitapp.fruitbasket.name].event_change
> puts
> puts "Changing fruit to: #{fruitapp.fruit.isa = 'Apple'}"
> puts "widget=#{mygui.widgets[fruitapp.fruitbasket.name].value}"
> puts
> puts "Changing widget to: #{mygui.widgets[fruitapp.fruitbasket.name].value = 'Banana'}"
> puts "fruit=#{fruitapp.fruit.isa}"
>
> puts
> ----
>
> # GUtopIa Example - Models
> # Copyright (c) 2002 Thomas Sawyer, Ruby License
>
> require 'gutopia'
>
> module MyModels
>
> def MyModels.pick_model(gui, which)
> case which
> when 'PC'
> return MyModels.pc_model(gui)
> when 'PDA'
> return MyModels.pda_model(gui)
> end
> end
>
> private
>
> # PC model using serial notatation (slower)
> def MyModels.pc_model(gui)
>
> Proc.new {
>
> # RadioBox
> r = gui.widgetFactory(:RadioBox, 'aradio')
>
> # Window
> w = gui.widgetFactory(:Window, 'awindow')
> w.width = 640
> w.height = 400
> w.grid = [ [ r ] ]
>
> }
>
> end
>
> # PDA model using parallel notation (faster)
> def MyModels.pda_model(gui)
>
> Proc.new {
>
> # RadioBox
> r = gui.widgetFactory(:RadioBox, 'aradio')
>
> # Window
> w = gui.widgetFactory(:Window, 'awindow',
> :width => 320,
> :height => 240,
> :grid => [ [ r ] ]
> )
>
> }
>
> end
>
> end # MyModels
> ----
>
> # GUtopIa Daemon Example - Client
> # Copyright (c) 2002 Thomas Sawyer, Ruby License
>
> require 'romp/romp'
> require 'example-app'
> require 'example-pre'
>
>
> # Configure interface
>
> INTERFACE = 'PDA'
> puts "\nINTERFACE: #{INTERFACE}\n"
>
>
> # Make GUI App
>
> fruitapp = FruitApp.new
>
> client = ROMP::Client.new('tcpromp://localhost:8080')
> mygui = client.resolve('gutopia-romp')
>
> names = {
> 'awindow' => fruitapp.appname,
> 'aradio' => fruitapp.fruitbasket.name
> }
>
> bindings = {
> fruitapp.fruitbasket.name => {
> :value => Proc.new { fruitapp.fruit.isa },
> :value= => Proc.new { |x| fruitapp.fruit.isa = x },
> :items => Proc.new { fruitapp.fruitbasket.contains },
> :event_change => Proc.new { fruitapp.pickafruit }
> }
> }
>
> model = MyModels.pick_model(mygui, INTERFACE)
>
> mygui.transaction(bindings, names, &model)
>
> mygui.build
>
>
> # Run some tests
>
> puts
> puts "MYGUI "
> p mygui
>
> puts
> puts "MYGUI WIDGETS"
> mygui.widgets.each_key do |k|
> puts k
> end
>
> puts
> puts "THE WINDOW"
> p mygui.widgets[fruitapp.appname].class.superclass
> puts "name: #{fruitapp.appname}"
> puts "width: #{mygui.widgets[fruitapp.appname].width}"
> puts "height: #{mygui.widgets[fruitapp.appname].height}"
>
> puts
> puts "THE RADIO"
> p mygui.widgets[fruitapp.fruitbasket.name].class.superclass
> puts "name: #{fruitapp.fruitbasket.name}"
> puts "items: #{mygui.widgets[fruitapp.fruitbasket.name].items.join(', ')}"
> puts "value: #{mygui.widgets[fruitapp.fruitbasket.name].value}"
>
> puts
> puts
> puts "TRY OUT!"
> puts
> puts "Current state of fruit and its widget:"
> puts "fruit=#{fruitapp.fruit.isa}"
> puts "widget=#{mygui.widgets[fruitapp.fruitbasket.name].value}"
> puts
> puts "Changing widget to: #{mygui.widgets[fruitapp.fruitbasket.name].value = 'Banana'}"
> puts "fruit=#{fruitapp.fruit.isa}"
> puts
> puts "Changing fruit to: #{fruitapp.fruit.isa = 'Orange'}"
> puts "widget=#{mygui.widgets[fruitapp.fruitbasket.name].value}"
> puts
> puts "Trigger event_change event:"
> mygui.widgets[fruitapp.fruitbasket.name].event_change
> puts
> puts "Changing fruit to: #{fruitapp.fruit.isa = 'Apple'}"
> puts "widget=#{mygui.widgets[fruitapp.fruitbasket.name].value}"
> puts
> puts "Changing widget to: #{mygui.widgets[fruitapp.fruitbasket.name].value = 'Banana'}"
> puts "fruit=#{fruitapp.fruit.isa}"
>
> puts
> ----
>
> # GUtopIa Example - Presentation
> # Copyright (c) 2002 Thomas Sawyer, Ruby License
>
> require 'gutopia'
> require 'example-app'
> require 'example-pre'
>
>
> # Configure interface
>
> INTERFACE = 'PDA'
> puts "\nINTERFACE: #{INTERFACE}\n"
>
>
> # Make GUI App
>
> fruitapp = FruitApp.new
>
> mygui = GUtopIa::GUI.new('Fruity Fun Time')
>
> names = {
> 'awindow' => fruitapp.appname,
> 'aradio' => fruitapp.fruitbasket.name
> }
>
> bindings = {
> fruitapp.fruitbasket.name => {
> :value => Proc.new { fruitapp.fruit.isa },
> :value= => Proc.new { |x| fruitapp.fruit.isa = x },
> :items => Proc.new { fruitapp.fruitbasket.contains },
> :event_change => Proc.new { fruitapp.pickafruit }
> }
> }
>
> model = MyModels.pick_model(mygui, INTERFACE)
>
> mygui.transaction(bindings, names, &model)
>
> mygui.build
>
>
> # Run some tests
>
> puts
> puts "MYGUI "
> p mygui
>
> puts
> puts "MYGUI WIDGETS"
> mygui.widgets.each_key do |k|
> puts k
> end
>
> puts
> puts "THE WINDOW"
> p mygui.widgets[fruitapp.appname].class.superclass
> puts "name: #{fruitapp.appname}"
> puts "width: #{mygui.widgets[fruitapp.appname].width}"
> puts "height: #{mygui.widgets[fruitapp.appname].height}"
>
> puts
> puts "THE RADIO"
> p mygui.widgets[fruitapp.fruitbasket.name].class.superclass
> puts "name: #{fruitapp.fruitbasket.name}"
> puts "items: #{mygui.widgets[fruitapp.fruitbasket.name].items.join(', ')}"
> puts "value: #{mygui.widgets[fruitapp.fruitbasket.name].value}"
>
> puts
> puts
> puts "TRY OUT!"
> puts
> puts "Current state of fruit and its widget:"
> puts "fruit=#{fruitapp.fruit.isa}"
> puts "widget=#{mygui.widgets[fruitapp.fruitbasket.name].value}"
> puts
> puts "Changing widget to: #{mygui.widgets[fruitapp.fruitbasket.name].value = 'Banana'}"
> puts "fruit=#{fruitapp.fruit.isa}"
> puts
> puts "Changing fruit to: #{fruitapp.fruit.isa = 'Orange'}"
> puts "widget=#{mygui.widgets[fruitapp.fruitbasket.name].value}"
> puts
> puts "Trigger event_change event:"
> mygui.widgets[fruitapp.fruitbasket.name].event_change
> puts
> puts "Changing fruit to: #{fruitapp.fruit.isa = 'Apple'}"
> puts "widget=#{mygui.widgets[fruitapp.fruitbasket.name].value}"
> puts
> puts "Changing widget to: #{mygui.widgets[fruitapp.fruitbasket.name].value = 'Banana'}"
> puts "fruit=#{fruitapp.fruit.isa}"
>
> puts
> ----
>
> # GUtopIa - ROMP Daemon
> # Copyright (c) 2002 Thomas Sawyer, Ruby License
>
> require 'drb'
> require 'gutopia'
>
> gutopia_drb = GUtopIa::GUI.new('DRb')
>
> DRb.start_service('druby://localhost:8080', gutopia_drb)
> DRb.thread.join
> ----
>
> # GUtopIa - ROMP Daemon
> # Copyright (c) 2002 Thomas Sawyer, Ruby License
>
> require 'romp/romp'
> require 'gutopia'
>
> gutopiad = GUtopIa::GUI.new('Romp')
>
> server = ROMP::Server.new('tcpromp://localhost:8080', nil, true)
> server.bind(gutopiad, 'gutopia-romp')
> server.thread.join
> ----
>
> # GUtopIa API
> # Copyright (c)2002 Thomas Sawyer, Ruby License
>
> module GUtopIa
>
> # Returns a GUIFactory object
> class GUI
>
> attr_reader :name, :widgets
>
> def initialize(name)
> @name = name
> #
> @widgets = {}
> @names = {}
> @bindings = {}
> @transactions = []
> end
>
> # Method used to prefab GUI
> def transaction(bindings={}, names={}, &model)
> @names = names
> @bindings = bindings
> @transactions << Proc.new {
> #commit
> #begin
> model.call #(self)
> #commit
> #rescue ScriptError
> #rollback
> #rescue StandardError
> #rollback
> #end
> }
> end
>
> # Method used to build GUI
> # This runs the all pending transactions
> def build
> @transactions.each do |transaction|
> transaction.call(@bindings)
> end
> @transactions.clear # all done with those
> end
>
> # Widget Factory
> # Returns a new widget object of specialized widget class
> def widgetFactory(widget, name, attributes={})
>
> # a widget string name will work too
> widget = widget.intern if widget.is_a?(String)
>
> # makes an anoynomous class as subclass of desired widget
> widgetClass = Class.new(GUtopIa.const_get(widget))
>
> # specialize class via bindings
> if @bindings[@names[name] || name]
> @bindings[@names[name] || name].each do |k, v|
> widgetClass.class_eval {
> define_method(k, v)
> }
> end
> end
>
> w = widgetClass.new(attributes)
> w.name = @names[name] || name
> @widgets[w.name] = w
>
> return w
>
> end
>
> #
> def alert(msg)
> puts msg
> end
>
> #
> def stop
> puts "stopping...#{@name}"
> exit
> end
>
> # Useful Class Methods?
>
> def GUI.screen_realestate
> # { :height => , :width => , :depth => }
> end
>
> end # GUI
>
>
> # Widgets
>
> # ToDo: add a whole bunch more super widgets :-)
> # attributes require validation
>
> class Widget
> attr_accessor :name
> end
>
>
> class Window < Widget
>
> attr_accessor :height, :width, :colordepth, :flags
> attr_accessor :caption, :icon, :background, :grid
>
> def initialize(attributes={})
> @height = attributes[:height] ? attributes[:height] : 200
> @width = attributes[:width] ? attributes[:width] : 200
> @colordepth = attributes[:colordepth] ? attributes[:colordepth] : 16
> @flags = attributes[:flags] ? attributes[:flags] : 0
> @caption = attributes[:caption] ? attributes[:caption] : nil
> @icon = attributes[:icon] ? attributes[:icon] : nil
> @background = attributes[:background] ? attributes[:background] : nil
> @grid = attributes[:grid] ? attributes[:grid] : []
> #
> super()
> end
>
> def show
> puts "showing window....#{@caption}"
> end
>
> def hide
> puts "hiding window...#{@caption}"
> end
>
> end # Window
>
>
> class Panel < Widget
>
> attr_accessor :height, :width
> attr_accessor :background, :grid
>
> def initialize(attributes={})
> @height = attributes[:height] ? attributes[:height] : 200
> @width = attributes[:width] ? attributes[:width] : 200
> @background = attributes[:background] ? attributes[:background] : nil
> @grid = attributes[:grid] ? attributes[:grid] : []
> #
> super()
> end
>
> end # Panel
>
>
> class Label < Widget
>
> attr_accessor :text
>
> def initialize(attributes={})
> @text = attributes[:text] ? attributes[:text] : nil
> #
> super()
> end
>
> end # Label
>
>
> class TextField < Widget
>
> attr_accessor :text, :value
>
> def initialize(attributes={})
> @text = attributes[:text] ? attributes[:text] : nil
> @value = attributes[:value] ? attributes[:value] : nil
> #
> super()
> end
>
> end # TextField
>
>
> class TextArea < Widget
>
> attr_accessor :text, :value, :cols, :lines
>
> def initialize(attributes={})
> @text = attributes[:text] ? attributes[:text] : nil
> @value = attributes[:value] ? attributes[:value] : nil
> @cols = attributes[:cols] ? attributes[:cols] : nil
> @lines = attributes[:lines] ? attributes[:lines] : nil
> #
> super()
> end
>
> end # TextArea
>
>
> class Button < Widget
>
> attr_accessor :text
> attr_accessor :event_pressed
>
> def initialize(attributes={})
> @text = attributes[:text] ? attributes[:text] : nil
> # events
> @event_pressed = attributes[:event_pressed] ? attributes[:event_pressed] : nil
> #
> super()
> end
>
> end # Button
>
>
> class RadioBox < Widget
>
> attr_accessor :value, :items
> attr_accessor :event_change
>
> def initialize(attributes={})
> @value = attributes[:value] ? attributes[:value] : nil
> @items = attributes[:content] ? attributes[:content] : nil
> # events
> @event_change = attributes[:event_change] ? attributes[:event_change] : nil
> #
> super()
> end
>
> end # RadioBox
>
>
> class MenuBar < Widget
>
> attr_accessor :items
>
> def initialize(attributes={})
> @items = attributes[:items] ? attributes[:items] : nil
> #
> super()
> end
>
> end # MenuBar
>
>
> class Menu < Widget
>
> attr_accessor :text, :items
>
> def initialize(attributes={})
> @text = attributes[:text] ? attributes[:text] : nil
> @items = attributes[:items] ? attributes[:items] : nil
> #
> super()
> end
>
> end # Menu
>
>
> class MenuItem < Widget
>
> attr_accessor :text
> attr_accessor :event_selected
>
> def initialize(attributes={})
> @text = attributes[:text] ? attributes[:text] : nil
> # events
> @event_selected = attributes[:event_selected] ? attributes[:event_selected] : nil
> #
> super()
> end
>
> end # MenuItem
>
> end # GUtopIa
> ----
>
> # GUtopIa Example - Presentation
> # Copyright (c) 2002 Thomas Sawyer, Ruby License
>
> require 'gutopia'
>
> app = GUtopIa::GUI.new('My Application')
>
> # here you must refer to widgets with app.widgets['widget's name']
> bindings = {
> 'quit' => {
> :event_selected => Proc.new {
> app.stop
> }
> },
> 'about' => {
> :event_selected => Proc.new {
> app.widgets['aboutWindow'].show
> }
> },
> 'submit' => {
> :event_pressed => Proc.new {
> app.alert("And the fruit is...#{app.widgets['favoriteFruit'].text}")
> app.widgets['mainWindow'].hide
> app.stop
> }
> },
> 'clear' => {
> :event_pressed => Proc.new {
> app.widgets['favoriteFruit'].text = nil
> }
> },
> 'close' => {
> :event_pressed => Proc.new {
> app.widgets['aboutWindow'].hide
> }
> }
> }
>
> # here you can refer to widgets with local name
> # or the app.widgets['widget's name']
> app.transaction(bindings) {
>
> quit = app.widgetFactory(:MenuItem, 'quit',
> :text => 'Quit'
> )
> about = app.widgetFactory(:MenuItem, 'about',
> :text => 'About'
> )
> file = app.widgetFactory(:Menu, 'file',
> :text => 'File',
> :items => [ app.widgets['quit'] ]
> )
> help = app.widgetFactory(:Menu, 'help',
> :text => 'Help',
> :items => [ about ]
> )
> menu = app.widgetFactory(:MenuBar, 'menu',
> :items => [ file, help ]
> )
> firstName = app.widgetFactory(:TextField, 'firstName',
> :label => 'First Name',
> :label_position => :left
> )
> lastName = app.widgetFactory(:TextField, 'lastName',
> :label => 'Last Name',
> :label_position => :left
> )
> favoriteFruit = app.widgetFactory(:TextArea, 'favoriteFruit',
> :text => 'Banana',
> :cols => 5,
> :lines => 4,
> :readonly => false,
> :label => 'Favorite Fruit',
> :label_position => :top
> )
> submit = app.widgetFactory(:Button, 'submit',
> :text => 'Update',
> :image => 'check.png'
> )
> clear = app.widgetFactory(:Button, 'clear',
> :text => 'Clear'
> )
> fruit_panel = app.widgetFactory(:Panel, 'fruit_panel',
> :grid => [ [ firstName ],
> [ lastName ],
> [ favoriteFruit ],
> [ submit ],
> [ clear ] ]
> )
> mainWindow = app.widgetFactory(:Window, 'mainWindow',
> :caption => 'My Cool Window',
> :icon => 'myIcon.ico',
> :grid => [ [ menu ],
> [ fruit_panel ] ]
> )
> aboutLbl = app.widgetFactory(:Label, 'aboutLbl',
> :text => <<-DATA
> This is a very cool application
> that I created using the GUtopIa
> GUI API.
> DATA
> )
> close = app.widgetFactory(:Button, 'close',
> :text => 'Close'
> )
> aboutWindow = app.widgetFactory(:Window, 'aboutWindow',
> :caption => 'About My Cool App',
> :grid => [ [ aboutLbl ],
> [ close ] ]
> )
>
> }
>
> app.build
>
> puts
> puts "select about from menu"
> app.widgets['about'].event_selected
> puts "click on close"
> app.widgets['close'].event_pressed
> puts "click on submit"
> app.widgets['submit'].event_pressed
> puts
--
~transami