[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

does Ruby generate WINDOWS and dialog boxes?

Ken Laninga

12/16/2006 8:09:00 PM

I just heard about Ruby and it looks fascinating. I see lots of code being
discussed but I see no mention of the actual windows and input/output
boxes/windows which it may or may not produce.

Does it make windows?

--


*************
http://www.stic... Ken Laninga





57 Answers

David Vallner

12/16/2006 8:38:00 PM

0

Ken Laninga wrote:
> I just heard about Ruby and it looks fascinating. I see lots of code being
> discussed but I see no mention of the actual windows and input/output
> boxes/windows which it may or may not produce.
>
> Does it make windows?
>

Oi, this might get bloody.

Firstly, not all programming involves graphical user interfaces (windows
/ dialogs; I'll just use GUI onwards).

But, here goes. For Ruby (and most anything that isn't Visual Basic),
GUI is a thing that is handled in a library. (Mostly because Ruby aims
to be a crossplatform language, and trying to handle GUIs crossplatform
is finicky and would probably end in tragedy if tried.)

As far as I'm aware, Ruby doesn't include a GUI library in the standard
library.

However, such libraries are available. I'll audaciously presume your
background to be Windows. In this case, you can either do raw Win32 API
callouts (even if it might be slightly maddening.), which is part of the
standard Windows distribution.

Also, if you're using the One Click Installer (which you should, since
it's by far the Path Least Annoying), you will get both VisualuRuby (a
Windows-only higher-level wrapper around the GUI calls, aims to look
VB-like from the programming point of view in the vruby variant), and
FOX (a synthethic crossplatform toolkit with probably more bells and
whistles than VisualuRuby, but you have to bear with what I consider
ugly-looking results - YMMV).

If those don't work for you, there's always Gtk, so far the only GUI
library I can recall that comes with prebuilt Windows bindings mature
enough I would consider usable outside personal code. Gtk visual quality
and native veracity has improved from a sorry status recently, but is
still lacking in a few areas if you have pet peeves. (Like I do,
specifically non-native file choosers.) I do have hopes for the
wxWidgets binding maturing, and a prebuilt Qt4 one appearing though,
those two toolkits are the ones I prefer - wx for nigh-on-perfect native
veracity, Qt4 for Designer, Linguist, Assistant, and the whole shebang,
and the API style. (Which is very friendly to metaprogramming.) I
currently use the latter from its Python binding (both wx and Qt4 have
well-maintained and uptodate Python bindings), so if you want to get
something done, as opposed to poking around specifically Ruby, you might
try The Other Language.

David Vallner

Joel VanderWerf

12/16/2006 10:08:00 PM

0

David Vallner wrote:
...
> As far as I'm aware, Ruby doesn't include a GUI library in the standard
> library.

Tk is in the standard library. Don't laugh, it can be useful! :)

I'm using the Tk canvas for some easy-to-set-up animations that don't
really need opengl.

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

David Vallner

12/16/2006 10:34:00 PM

0

Joel VanderWerf wrote:
> David Vallner wrote:
> ...
>> As far as I'm aware, Ruby doesn't include a GUI library in the standard
>> library.
>
> Tk is in the standard library. Don't laugh, it can be useful! :)
>

Wooer. I subconsciously ignore Tk by now. Go me. Or something.
/me puts on a dunce hat.

David Vallner

Suraj Kurapati

12/17/2006 1:10:00 AM

0

Joel VanderWerf wrote:
> David Vallner wrote:
> ...
>> As far as I'm aware, Ruby doesn't include a GUI library in the standard
>> library.
>
> Tk is in the standard library. Don't laugh, it can be useful! :)
>
> I'm using the Tk canvas for some easy-to-set-up animations that don't
> really need opengl.

Tk is wonderful! It's really simple to manipulate widgets and graphics
in the way you'd expect. IMHO, Tk is the Ruby of GUI toolkits.

I don't know why people hate it so much. They seem to prefer "desktop
integration" and eye-candy instead of clean, functional interfaces.
Sigh. :-(

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

M. Edward (Ed) Borasky

12/17/2006 2:44:00 AM

0

Quoting Suraj Kurapati <snk@gna.org>:

> Tk is wonderful! It's really simple to manipulate widgets and graphics
> in the way you'd expect. IMHO, Tk is the Ruby of GUI toolkits.
>
> I don't know why people hate it so much. They seem to prefer "desktop
> integration" and eye-candy instead of clean, functional interfaces.
> Sigh. :-(
I don't actually *hate* Tk -- I just never learned how to use it, and I think
its widgets are ugly relative to, say, Qt. Now Tcl, on the other hand -- that I
*do* hate. :-) It was the first scripting language, but I find Tcl code
virtually unreadable.

RichardOnRails

12/17/2006 3:09:00 AM

0


Ken Laninga wrote:
> I just heard about Ruby and it looks fascinating. I see lots of code being
> discussed but I see no mention of the actual windows and input/output
> boxes/windows which it may or may not produce.
>
> Does it make windows?
>
> --
>
>
> *************
> http://www.stic... Ken Laninga

I'm planning to implement desk-top applications the same way I'm
implementing websites: use Ruby on Rails. That gives me essentially
one cross-platform application environment. Is there something wrong
with that plan?
---
Richard

David Vallner

12/17/2006 3:29:00 AM

0

Richard wrote:
> Ken Laninga wrote:
>> I just heard about Ruby and it looks fascinating. I see lots of code being
>> discussed but I see no mention of the actual windows and input/output
>> boxes/windows which it may or may not produce.
>>
>> Does it make windows?
>>
>> --
>>
>>
>> *************
>> http://www.stic... Ken Laninga
>
> I'm planning to implement desk-top applications the same way I'm
> implementing websites: use Ruby on Rails. That gives me essentially
> one cross-platform application environment. Is there something wrong
> with that plan?
> ---
> Richard
>
>

How would that be a desktop application?

Or, in slightly other words, do you have an architecture to go with that
plan?

David Vallner

David Vallner

12/17/2006 3:56:00 AM

0

Suraj Kurapati wrote:
> I don't know why people hate it so much. They seem to prefer "desktop
> integration" and eye-candy instead of clean, functional interfaces.
> Sigh. :-(
>

Some of us have to "sell" software, at least to managers - then it matters.

[Hide the women, children and livestock. This just got bloody as I
predicted.]

Also, you're missing the point. It's a GUI, noone really gives a damn if
the programmer had an easier time coding it if there's hundreds of users
that will feel constantly alienated by it because of some detail the
programmer didn't feel like bothering with.

User interface design isn't the same as programming a user interface.
Programmers, especially the lazy sort, tend to suck, suck-oh-so-horribly
at user interface design. Approaching user interface design with a
programmer's mindset can only end in pain, tragedy, and Tk.

Also, you're confusing internal UI consistency, and external UI
consistency. Internal UI consistency is when the features of the UI fit
together to make working with the software alone productive (your clean
and functional).

External consistency is when the UI incorporates features that make
working with that software in connection with other software on the
computer productive. This means panels will scroll when the mouse is
over them and won't require clicking on the buttons. This means that the
file chooser, on XP, will have a "My Documents" button as the third one
in a button sidepanel on the left. (I can't describe the rage I feel
when a toolkit opens a file chooser that doesn't even try to look alike
and leaves me flailing about trying to find my way back home.) I've seen
Tk interfaces fail at all the above when they're capabilities the damn
system below them gets right out of the box, and I've no doubt that's
barely the tip of the iceberg.

Both internal and external consistency are, for pretty much most
applications, factors that contribute to productivity. Having an
externally consistent program in no way excludes it being internally
consistent, so no point in setting up that straw man.

Any GUI toolkit will let you achieve internal consistency, and getting
really good usability from a GUI is 1% toolkit choice, 99% blood and
sweat. (My favourite GUI programs in terms of UI usability, and
consequently the ones I use most are firstly Opera, written in nothing
publically known for Windows, Qt3 for Linux, and IntelliJ IDEA, based on
the by-default-horrid Swing it makes sing and dance.) However, the
mindset of most Tk users seems to be to fight achieving external
consistency kicking and screaming and inventing nonarguments to prove
such patent nonsense as external consistence being undesirable. (That's
usually laziness, youthful zealotry, incompetence, or short time budget
speaking. Prove me wrong.)

Also, to set you right. People, or at least I (the only part of "people"
I can confidently speak for - for what part were you speaking and with
how much confidence when you used the words "people" and "they" again? -
obviously not yourself), don't just prefer eye candy. I want usable
interfaces that do what I need, do what I want, and do even what I
didn't know I wanted, and pay close attention now, that *also* look
good, look native-or-better (Java 6 giving me subpixel font AA on
Windows 2000 machines at work or under uncooperative Linux window
managers), act native-or-better (cf. some Windows programs that emulate
"scroll widget under cursor"). Both. And. No. Less. I am willing to and
have paid money to get that, and when forced to make a choice, there
will be something pissing me off with either alternative making me
wrestle lossage of some sort.

(PS: Just writing desktop integration in quotes doesn't make it of no
value. Refer to the missing the point by leagues bit above.)

Oh, and to make my position fully clear, I do hate Tk as a programmer
too. I find Qt linearly superior because of the object-oriented design,
MVC support, and the mixin architecture for separating UI and controller
logic, and QMetaObject::connectSlotsByName very reliably killing event
handler wireup boilerplate. And who really cares how you lay out the
widgets when there's Designer (the form designer that made me stop
hating form designers) to do that. Oh, and even with those features,
it's probably faster than Tk.

Tk isn't hardly the Ruby of GUI toolkits, with the massive advocating of
/ tolerance to mediocrity of results, it's the PHP of GUI toolkits.

David Vallner
No Way Someone Reads This Whole

Michael T. Richter

12/17/2006 4:11:00 AM

0

On Sun, 2006-17-12 at 12:56 +0900, David Vallner wrote:


> No Way Someone Reads This Whole



I did. And applauded most of the way through it. Programmers have a
very annoying habit of not only disregarding the end-users but, indeed,
actively sneering at them. This is why software sucks almost, but not
quite, universally.

--
Michael T. Richter
Email: ttmrichter@gmail.com, mtr1966@hotpop.com
MSN: ttmrichter@hotmail.com, mtr1966@hotmail.com; YIM:
michael_richter_1966; AIM: YanJiahua1966; ICQ: 241960658; Jabber:
mtr1966@jabber.cn

"My paramount object in this struggle is to save the Union, and is not
either to save or to destroy slavery." --Abraham Lincoln

RichardOnRails

12/17/2006 4:25:00 AM

0


David Vallner wrote:
> How would that be a desktop application?

To us programmers it would be a web app with a local server, but to
the user it would be indistinguishable from, say, an application built
with Visual C++ and Microsoft Foundation Classes running on a Windows
OS.

Does that make sense to you?

---
Richard