Question about GUI API for Ruby

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

On Thu, 12 Jan 2006 12:37:35 +0100, Jacek O. [email protected]
wrote:

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
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 V.

David V. wrote:

On Thu, 12 Jan 2006 12:37:35 +0100, Jacek O. [email protected]
wrote:

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
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 V.

Thanks for reply David!

Fox can be very good… I’ve read some docs on FXRuby site and shown that
FreeRide is using it :slight_smile:

Wxruby can be good but for me documentation is the most important :slight_smile:
(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

On Thu, 12 Jan 2006 12:57:03 +0100, Jacek O. [email protected]
wrote:

Thanks for reply David!

Fox can be very good… I’ve read some docs on FXRuby site and shown that
FreeRide is using it :slight_smile:

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.

Wxruby can be good but for me documentation is the most important :slight_smile:
(and as you said there isn’t a lot of docs for wxruby).

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

David V.

On Thursday 12 January 2006 08:37 pm, Jacek O. wrote:

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… :slight_smile: 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

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 :frowning:

Regards
Jacek

On 1/12/06, David V. [email protected] wrote:

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=1223&group_id=300&func=browse). 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.

On Thu, 12 Jan 2006 18:20:15 +0100, Lyle J.
[email protected]
wrote:

reports that sound like what you’re describing (see
http://rubyforge.org/tracker/?atid=1223&group_id=300&func=browse). 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
used “Reply to all” by mistake. In any case, I received this message
both
via ruby-talk, and via my normal e-mail address.

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

That said, I should probably get some screenshots done and file a rep
once
I get around to it.

David V.

Jacek O. wrote:

Fox can be very good… I’ve read some docs on FXRuby site and shown that
FreeRide is using it :slight_smile:

Fox is very good :D. It has very consistent API (every constructor takes
pointer/reference to parent widget/container so it is easy to create
automation code that read’s configuration file and builds the whole gui
at runtime (and actually this solution works very fast). The
interpreting code takes approximately 500 loc. An example is attached
(it can be xml or indentation based format)

lopex

On Thu, 12 Jan 2006 17:44:33 +0100, [email protected] wrote:

changes
rdale wants… so until its frozen… :slight_smile: 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

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
really follow happenings around Gtk. Also, anything with a version
number
lower than 1.0 tends to be difficult to get past Managers That Think
They
Know Tech But Really Don’t. And on ocassion, I’ve had some Windows
programs that bundle a binary Gtk build along not work (notably
MudMagic,
haven’t really investigated the problem much).

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.

David V.

David V. 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…

On Friday 13 January 2006 06:23 am, David V. wrote:

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 :slight_smile:

Tsume

On Fri, 13 Jan 2006 08:13:05 +0100, [email protected] wrote:

On Friday 13 January 2006 06:23 am, David V. wrote:

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?

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
follow happenings in Gtk - last time I checked (a long time ago) I’m
not
sure if the available installer was official, and I recall not being
able
to get it to work. As unrelated as these arguments may be to the quality
Gtk itself, they’re more than enough for me to go for what Just Works

instead of tackling quirks.

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.

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

Of course, for applications that have to be maintained for a long time,
your point stands.

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

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

David V.

On Friday 13 January 2006 09:59 pm, tony summerfelt wrote:

David V. 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…

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

On 1/13/06, Joe Van D. [email protected] wrote:

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.

On 1/13/06, Wilson B. [email protected] wrote:

respect.
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.

http://sourceforge.net/mailarchive/message.php?msg_id=14281233

On 1/13/06, [email protected] [email protected] wrote:

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 :slight_smile:

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.

From: [email protected]
Subject: Re: Question about GUI API for Ruby
Date: Sat, 14 Jan 2006 01:09:07 +0900
Message-ID: [email protected]

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.:wink:
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).

Jamey C. 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…

On Sat, 14 Jan 2006 04:00:36 +0900
Wilson B. [email protected] wrote:

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 C.

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.