[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Is it possible to create a GUI/TUI toolkit using ruby?

simonh

1/5/2006 8:28:00 PM

this may be a daft question, but is it possible to create a widget
toolkit using a scripting language? I know that most are written in C /
C++ (QT, fox, wx), also ncurses for terminal interfaces. Therefore, is
it impossible to do such a thing with ruby? Or is it just to much hard
work?

Please can someone put my mind at rest and possibly give an
understandable explanation as to why it can't be done.

many thanks

8 Answers

Dan Shafer

1/5/2006 8:51:00 PM

0

I suspect it would be possible but I also suspect it would be quite
difficult. And I think the absence of a direct-manipulation graphical
IDE is one of the things that keeps Ruby adoption somewhat restrained.

That said, Ruby does include graphical extensions for using Gtk and
Fox. I've never looked at Fox but the Gtk toolkit is, while somewhat
primitive, eminently usable.

On Jan 5, 2006, at 12:32 PM, simonh wrote:

> this may be a daft question, but is it possible to create a widget
> toolkit using a scripting language? I know that most are written in
> C /
> C++ (QT, fox, wx), also ncurses for terminal interfaces. Therefore, is
> it impossible to do such a thing with ruby? Or is it just to much hard
> work?
>
> Please can someone put my mind at rest and possibly give an
> understandable explanation as to why it can't be done.
>
> many thanks
>
>



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
Dan Shafer
Technology Visionary - Technology Assessment - Documentation
"Looking at technology from every angle"
http://www.eclec...




Alec Ross

1/5/2006 9:18:00 PM

0

In message <1136492908.994621.112070@o13g2000cwo.googlegroups.com>,
simonh <simonharrison@fastmail.co.uk> writes
>this may be a daft question, but is it possible to create a widget
>toolkit using a scripting language? I know that most are written in C /
>C++ (QT, fox, wx), also ncurses for terminal interfaces. Therefore, is
>it impossible to do such a thing with ruby? Or is it just to much hard
>work?
>
Is

http://wxruby.rubyforge.org/wi...

of interest?

....

--
Alec Ross

Hynek Schlawack

1/5/2006 9:32:00 PM

0

* "simonh" <simonharrison@fastmail.co.uk> wrote:

> this may be a daft question, but is it possible to create a widget
> toolkit using a scripting language? I know that most are written in C
> / C++ (QT, fox, wx), also ncurses for terminal interfaces. Therefore,
> is it impossible to do such a thing with ruby? Or is it just to much
> hard work?

It is possible. You'd just need an interface to the low-level graphical
interface (in UNIX's case: X11). It's just pretty useless due to the
poor performance that would be expectable from a scripting language.

Ilmari Heikkinen

1/5/2006 9:42:00 PM

0

On 1/5/06, simonh <simonharrison@fastmail.co.uk> wrote:> this may be a daft question, but is it possible to create a widget> toolkit using a scripting language? I know that most are written in C /> C++ (QT, fox, wx), also ncurses for terminal interfaces. Therefore, is> it impossible to do such a thing with ruby? Or is it just to much hard> work?>> Please can someone put my mind at rest and possibly give an> understandable explanation as to why it can't be done.>> many thanks>Sure. All you need is a drawing backend and way to get input events.OpenGL for drawing and GLUT / SDL for input & windowsystem handlingwould work I guess.Just drawing the stuff and mapping pointer positions to interfaceelements is easy, doing the interface logic is a bit harder, but Idoubt there are any Really Hard Problems in writing a widget toolkit.Unless doing something with Indesign-level layout capabilities...which would be nice.

Kero van Gelder

1/6/2006 12:18:00 AM

0

On 2006-01-05, Hynek Schlawack <hynek@usenet-2006.ularx.de> wrote:
> * "simonh" <simonharrison@fastmail.co.uk> wrote:
>
>> this may be a daft question, but is it possible to create a widget
>> toolkit using a scripting language? I know that most are written in C
>> / C++ (QT, fox, wx), also ncurses for terminal interfaces. Therefore,
>> is it impossible to do such a thing with ruby? Or is it just to much
>> hard work?
>
> It is possible. You'd just need an interface to the low-level graphical
> interface (in UNIX's case: X11). It's just pretty useless due to the
> poor performance that would be expectable from a scripting language.

Indeed: http://wise.ruby...

(but it's been ages since I worked on it; Xlib is a beast, a monster; lots
of speedup can be achieved, e.g. communicating with the X server is slower
than a few Ruby calls; The more interesting discussions on a toolkit are
about the Ruby API, not the underlying implementation -- if I read "closely
matches the C(++) API", I immediately think "so it is not Ruby")

But why the question? *curious*

Bob Hutchison

1/6/2006 3:49:00 AM

0


On Jan 5, 2006, at 3:32 PM, simonh wrote:

> this may be a daft question, but is it possible to create a widget
> toolkit using a scripting language? I know that most are written in
> C /
> C++ (QT, fox, wx), also ncurses for terminal interfaces. Therefore, is
> it impossible to do such a thing with ruby? Or is it just to much hard
> work?
>
> Please can someone put my mind at rest and possibly give an
> understandable explanation as to why it can't be done.

It certainly can be done. The thing is it is a huge never-ending
task... something really hard for an open source project (not
technically, but socially). Of course, that's a gross
characterisation that the wx/wxPython effort contradicts -- let's
just say that I *really* applaud and appreciate their effort.

My personal criteria include cross platform: OS/X, Linux, and
Windows. That, unfortunately, changes things.

There are a few UI toolkits that almost work for me: GTk, QT, Fox.
They've all got multiple scripting language interfaces.

I'm going to ignore the low-level interfaces to GL and other graphics
engines.

Tk is too slow for my purposes but it does work across platforms. And
it works with pretty much every scripting language you can imagine.

Wx is a contender. There is a wxPython out there that is quite
active. The Ruby version is behind. The Common Lisp version is under
development and appears to be problematic.

Smalltalk... Don't know, I'll have to look more closely. Squeak
doesn't look too good on OS/X (might be my problem though). Cincom is
in some weird state on OS/X -- I *think* it is only targeted at X11
but that's hard to believe (as I said I should look).

Common Lisp... Lispworks has CAPI which is very very nice but I can't
do what I need cross platform (current requirements include some kind
of styled text editing and this isn't going to happen under linux
with CAPI). There is a wx effort underway, but not there yet. There
is an interesting GL based thing called Cells but that isn't ready
yet. There are some other toolkits under development but they also
are not ready.

RealBasic... pretty good actually.

Runtime Revolution... the most interesting of the bunch I think. I
can't use it yet but I wish I could.

You want a second killer app for Ruby? Write a Rails/ActionPack
native front end to a web-based (i.e. Rails) back end. There is a
project called Dabo <http://dabodev.com/wiki/Fro... underway in
the python world. It is using wx to front a web engine.

Cheers,
Bob

>
> many thanks
>
>

----
Bob Hutchison -- blogs at <http://www.rec...
hutch/>
Recursive Design Inc. -- <http://www.rec...>
Raconteur -- <http://www.raconteur...
xampl for Ruby -- <http://rubyforge.org/projects/...





M. Edward (Ed) Borasky

1/7/2006 9:26:00 PM

0

In addition to Gtk and Fox, Qt is supported, as is Tk. I'm not sure but
I think wx is supported as well. I don't recall seeing anything about
Ruby bindings for fltk though.

IMHO the Qt widgets are the best looking, so that's the direction I've
taken. Plus there is an excellent book on Qt (and KDE) Ruby at

http://pragmaticprogrammer.com/titles/ctrubyqt/...



Dan Shafer wrote:

> I suspect it would be possible but I also suspect it would be quite
> difficult. And I think the absence of a direct-manipulation graphical
> IDE is one of the things that keeps Ruby adoption somewhat restrained.
>
> That said, Ruby does include graphical extensions for using Gtk and
> Fox. I've never looked at Fox but the Gtk toolkit is, while somewhat
> primitive, eminently usable.
>
> On Jan 5, 2006, at 12:32 PM, simonh wrote:
>
>> this may be a daft question, but is it possible to create a widget
>> toolkit using a scripting language? I know that most are written in C /
>> C++ (QT, fox, wx), also ncurses for terminal interfaces. Therefore, is
>> it impossible to do such a thing with ruby? Or is it just to much hard
>> work?
>>
>> Please can someone put my mind at rest and possibly give an
>> understandable explanation as to why it can't be done.
>>
>> many thanks
>>
>>
>
>
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> Dan Shafer
> Technology Visionary - Technology Assessment - Documentation
> "Looking at technology from every angle"
> http://www.eclec...
>
>
>
>

--
M. Edward (Ed) Borasky

http://linuxcapacitypl...



tsumeruby

1/8/2006 11:29:00 PM

0

On Sunday 08 January 2006 06:26 am, M. Edward (Ed) Borasky wrote:
> In addition to Gtk and Fox, Qt is supported, as is Tk. I'm not sure but
> I think wx is supported as well. I don't recall seeing anything about
> Ruby bindings for fltk though.
>
> IMHO the Qt widgets are the best looking, so that's the direction I've
> taken. Plus there is an excellent book on Qt (and KDE) Ruby at


Qt widgets best looking? The GTK widgets look like candy as well when you use
the theme daemon. I'll agree Qt id definitely best at being rock solid and
having stable releases. The problem is the bindings for ruby are not as
complete as wished for qtruby/4. Qtruby/3 bindings I never could compile a
stable version on windows(which matters for making the most money from the
world still). the Best current bindings at this time which are rock solid,
stable, and the base toolkit as well are.. GTK, tk, and widestudio. These
bindings *and* toolkits have 1) frozen library APIs 2) very decent interfaces
to ruby 3) work everywhere *X11 on mac == works :)* 4) support multiple
language encodings

Current status of the qtruby/4 bindings work on windows, but they are missing
1) ui file loading, and 2) rdale is working on improving the signal/slots
declarations if he hasn't done so already.

Tsume