Question about GUI API for Ruby

J

Jacek Olszak

Hi... currently I'm developing a small gui application. I don't know
which API for gui creating should I use. I've tried Tk only. For me it
is quite good (but not so many examples, tutorials is available on the
net). I'm looking for an API, in which I'll be able to create text
viever widgets which supports different colors, fonts and styles in one
widget.

Please help...
Jacek
 
D

David Vallner

Hi... currently I'm developing a small gui application. I don't know
which API for gui creating should I use. I've tried Tk only. For me it
is quite good (but not so many examples, tutorials is available on the
net). I'm looking for an API, in which I'll be able to create text
viever widgets which supports different colors, fonts and styles in one
widget.

Please help...
Jacek


A very frequently used toolkit is FOX. I have certain issues with the =20
toolkit, religious and from personal observation of certain persistent =20
quirks, but at any rate, it's indeed fast, mature, and easy to use / =20
deploy. It seems to feature a styled text widget too.

Other ones you might want to consider is wxruby if you can handle with =20
slightly lacking documentation, or a Gtk binding, which might be tricky =20
getting to work on Windows machines.

David Vallner
 
J

Jacek Olszak

David said:
A very frequently used toolkit is FOX. I have certain issues with the
toolkit, religious and from personal observation of certain persistent
quirks, but at any rate, it's indeed fast, mature, and easy to use /
deploy. It seems to feature a styled text widget too.

Other ones you might want to consider is wxruby if you can handle with
slightly lacking documentation, or a Gtk binding, which might be tricky
getting to work on Windows machines.

David Vallner

Thanks for reply David!

Fox can be very good.. I've read some docs on FXRuby site and shown that
FreeRide is using it :)

Wxruby can be good but for me documentation is the most important :)
(and as you said there isn't a lot of docs for wxruby). Gtk for me is
not good too, because my primary os is Windows.

Regards
Jacek
 
D

David Vallner

Thanks for reply David!

Fox can be very good.. I've read some docs on FXRuby site and shown tha= t
FreeRide is using it :)

I -have- been getting strange behaviour from it sometimes that occured to=
=20
other people - dialogs opening with the top left corner being =20
significantly off the screen. Might be dependent on how the computer is =20
set up so do check for that when deploying the application.
Wxruby can be good but for me documentation is the most important :)
(and as you said there isn't a lot of docs for wxruby).

Usually, it's possible to make do with the primary wxWidgets =20
documentation, but I haven't really used it that extensively to rule out =
=20
subtle bugs / incompatibility issues. Also, the project entered the "long=
=20
boring rewrite" phase a while ago, and there isn't much apparent activity=
=20
the like of public releases. I favor it mostly because of the use of =20
native widgets (somewhat of a religious issue), and usually swallow the =20
bitter pill and do my GUI work in wxPython. I wouldn't quite recommend =20
wxruby for production code yet.

David Vallner
 
J

Jacek Olszak

Ok... I've created simple application in FOX, which uses FXText widget.
I'm able to define some styles (called FXHiliteStyle here) to this text
and use them in the future. But I cannot create links, join multiple
defined styles (for example join 'red' with 'bold') etc. (or can I?)
So.... propably I'll back to Tk :(

Regards
Jacek
 
T

tsumeruby

Hi... currently I'm developing a small gui application. I don't know
which API for gui creating should I use. I've tried Tk only. For me it
is quite good (but not so many examples, tutorials is available on the
net). I'm looking for an API, in which I'll be able to create text
viever widgets which supports different colors, fonts and styles in one
widget.

Please help...
Jacek

Hey, you want to use GTK if you are targetting windows or linux. The GTK
bindings support unicode, and the GTK API is frozen. There are several
downsides to FOX, but it is included with one click. GTK really should be too
as its been around longer and trusted. Reasons have been explained before on
ruby-talk. Should grep the google groups for the reasons. theres also qtruby,
which bound to a rock solid library, but I'm not sure how many more changes
rdale wants.. so until its frozen.. :) GTK is most likely the most stable if
you're wanting pretty. Also, you said you used Tk, check out the Tk::Tile
library, which you'll have to download apart from ruby or tk.

Tsume
 
L

Lyle Johnson

I -have- been getting strange behaviour from it sometimes that occured to
other people - dialogs opening with the top left corner being
significantly off the screen. Might be dependent on how the computer is
set up so do check for that when deploying the application.

It's not clear from your description whether this is a bug in the
application or a bug in FXRuby. At any rate, there are no open bug
reports that sound like what you're describing (see
http://rubyforge.org/tracker/?atid=3D1223&group_id=3D300&func=3Dbrowse). If
you do believe that it's an FXRuby bug and can file a bug report that
describes the problem and how to reproduce it, I'd appreciate it.
 
D

David Vallner

It's not clear from your description whether this is a bug in the
application or a bug in FXRuby. At any rate, there are no open bug
reports that sound like what you're describing (see
http://rubyforge.org/tracker/?atid=3D1223&group_id=3D300&func=3Dbrowse)= If
you do believe that it's an FXRuby bug and can file a bug report that
describes the problem and how to reproduce it, I'd appreciate it.


[OT]: your client seems to be acting up, or your fingers slipped and you =
=20
used "Reply to all" by mistake. In any case, I received this message both=
=20
via ruby-talk, and via my normal e-mail address.

The bug I described I -think- occurs in both FreeRide for the =20
configuration dialog and the dialog.rb example that comes with the gem. I=
=20
believe it's tied to me having set Windows to 120 dpi fonts, which as far=
=20
as I know very few other people even know of, much less use, which would =
=20
explain the lack of a bug report so far.

That said, I should probably get some screenshots done and file a rep onc=
e =20
I get around to it.

David Vallner
 
D

David Vallner

Hey, you want to use GTK if you are targetting windows or linux. The GT= K
bindings support unicode, and the GTK API is frozen. There are several
downsides to FOX, but it is included with one click. GTK really should = =20
be too
as its been around longer and trusted. Reasons have been explained =20
before on
ruby-talk. Should grep the google groups for the reasons. theres also =20
qtruby,
which bound to a rock solid library, but I'm not sure how many more =20
changes
rdale wants.. so until its frozen.. :) GTK is most likely the most =20
stable if
you're wanting pretty. Also, you said you used Tk, check out the Tk::Ti= le
library, which you'll have to download apart from ruby or tk.

Tsume


I blame Gtk being mentally associated with a lack of an official binary =20
distribution for Windows - although I'm going out on a limb here, I don't=
=20
really follow happenings around Gtk. Also, anything with a version number=
=20
lower than 1.0 tends to be difficult to get past Managers That Think They=
=20
Know Tech But Really Don't. And on ocassion, I've had some Windows =20
programs that bundle a binary Gtk build along not work (notably MudMagic,=
=20
haven't really investigated the problem much).

A frozen API isn't everything, ease of deployment is _very_ valuable in =20
making end-user applications, and fxruby does deliver perfectly in that =20
respect.

David Vallner
 
T

tsumeruby

I blame Gtk being mentally associated with a lack of an official binary
distribution for Windows - although I'm going out on a limb here, I don't

There are windows binaries for ruby-gtk2 and a gtk installer, what are you
talking about?
A frozen API isn't everything, ease of deployment is _very_ valuable in
making end-user applications, and fxruby does deliver perfectly in that
respect.

A frozen API is very important not only for the programmer, but for
distribution. When you have an app with 20,000 lines of code, you don't want
the app to break just because you now have to handle another add-in.

and ease of deployment is very easy with Gtk/ruby-gtk2 as well.. if you read
the fine site :)

Tsume
 
T

tony summerfelt

David Vallner wrote on 1/12/2006 4:23 PM:
A frozen API isn't everything, ease of deployment is _very_ valuable in
making end-user applications,

agreed, as much as i like gtk i have to move on...i keep coming back
to tk. i don't really like the 'feel' of tk in other languages (than
tcl) because it feels tacked on and the syntax is cumbersome, but for
the most part it works, and a one file executable is possible...
 
D

David Vallner

There are windows binaries for ruby-gtk2 and a gtk installer, what are = =20
you
talking about?

I never said they weren't, and am in fact quite aware of them.

The Gtk installer definately seems new to me, although I don't really =20
follow happenings in Gtk - last time I checked (a _long_ time ago) I'm no=
t =20
sure if the available installer was official, and I recall not being able=
=20
to get it to work. As unrelated as these arguments may be to the quality =
=20
Gtk itself, they're more than enough for me to go for what Just Works (tm=
) =20
instead of tackling quirks.
A frozen API is very important not only for the programmer, but for
distribution. When you have an app with 20,000 lines of code, you don't= =20
want
the app to break just because you now have to handle another add-in.

You might be confusing your environments a little. The convention on =20
Windows is for applications to bundle their dependencies along and use =20
those versions. If you keep building your 20,000 lines of code against a =
=20
version of a library that works, you're also going to redistribute said =20
library in this version, and rare is the adventurous end user that will g=
o =20
on and replace DLLs applications use. For "single-use" internal tools, =20
this is a perfectly acceptable way of doing things if it lets you use =20
"deploy by copy".

Of course, for applications that have to be maintained for a long time, =20
your point stands.
and ease of deployment is very easy with Gtk/ruby-gtk2 as well.. if you= =20
read
the fine site :)

As I said, I blame some aforementioned pet peeves that would make someone=
=20
not make Gtk his first choice on Windows. I never said Gtk wasn't easy to=
=20
deploy, just that it's understandable that people in a production =20
environment won't readily switch from something that works like a charm =20
into the unknown unless their current tools shoot them in the foot. =20
(That's why personal hacking is so essential to a programmer)

David Vallner
 
T

tsumeruby

David Vallner wrote on 1/12/2006 4:23 PM:

agreed, as much as i like gtk i have to move on...i keep coming back
to tk. i don't really like the 'feel' of tk in other languages (than
tcl) because it feels tacked on and the syntax is cumbersome, but for
the most part it works, and a one file executable is possible...

If you don't like the feel of tk but are addicted to the toolkit, I recommend
you look in to the Tk::Tile extension.

Tsume
 
J

Joe Van Dyk

't

There are windows binaries for ruby-gtk2 and a gtk installer, what are yo= u
talking about?

A frozen API is very important not only for the programmer, but for
distribution. When you have an app with 20,000 lines of code, you don't w= ant
the app to break just because you now have to handle another add-in.

and ease of deployment is very easy with Gtk/ruby-gtk2 as well.. if you r= ead
the fine site :)

Some guy recently posted to ruby-gnome2 about a .zip file that he made
that contained a ruby + gnome2 executable that you could run without
having anything installed previously. Pretty neat. And the
application looked pretty good too.
 
W

Wilson Bilkovich

Some guy recently posted to ruby-gnome2 about a .zip file that he made
that contained a ruby + gnome2 executable that you could run without
having anything installed previously. Pretty neat. And the
application looked pretty good too.

Do you have a link to the mailing list posting? I've been struggling
with Rubyscript2EXE, attempting to deploy a Ruby/GTK application I
wrote. I'm having a lot of trouble bundling non-ruby/dll resources,
such as YAML files and glade configs. I'm just about ready to write
an NSIS installer instead.
 
J

Jamey Cribbs

Do you have a link to the mailing list posting? I've been struggling
with Rubyscript2EXE, attempting to deploy a Ruby/GTK application I
wrote. I'm having a lot of trouble bundling non-ruby/dll resources,
such as YAML files and glade configs. I'm just about ready to write
an NSIS installer instead.

Are you putting the non-ruby files in the application directory and
using tar2rubyapp (or whatever it's called) in conjunction with
rubyscript2exe?

I've used rubyscript2exe a lot to deploy both FXRuby apps and Ruby-Gtk2
apps and, if I remember correctly, if you place the non-ruby files like
dlls and image files in the application directory that you use in
conjunction with tar2rubyscript, it will include these files in the exe.

HTH,

Jamey Cribbs

Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments.
 
H

Hidetoshi NAGAI

From: (e-mail address removed)
Subject: Re: Question about GUI API for Ruby
Date: Sat, 14 Jan 2006 01:09:07 +0900
Message-ID: said:
If you don't like the feel of tk but are addicted to the toolkit, I recommend
you look in to the Tk::Tile extension.

Additional Information.;-)
On ruby-1.8.4, "Tk::Tile.__Import_Tile_Widgets__!" method was added.
After calling the method, some widget classes denote classes on Tile
(e.g. TkButton.new generates a Tk::Tile::Button widget).
 
T

tony summerfelt

Jamey Cribbs wrote on 1/13/2006 3:12 PM:
Are you putting the non-ruby files in the application directory and
using tar2rubyapp (or whatever it's called) in conjunction with
rubyscript2exe?
conjunction with tar2rubyscript, it will include these files in the exe.

tried that, and the dll's are included, but there's still something
missing. i'm thinking it's a gtk directory structure problem, and that
environment variables will need to be set when the rubyscript2exe exe
is run...

i've worked at it for awhile but no luck yet...
 
T

tony summerfelt

Wilson Bilkovich wrote on 1/13/2006 2:00 PM:
Do you have a link to the mailing list posting? I've been struggling
with Rubyscript2EXE, attempting to deploy a Ruby/GTK application I
wrote. I'm having a lot of trouble bundling non-ruby/dll resources,

that's where i'm at with ruby/gtk. i've been on the ruby-gnome mailing
list for a few weeks , but i must have missed that post...
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top