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

···

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

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

···

On Thu, 12 Jan 2006 12:37:35 +0100, Jacek Olszak <jacekolszak@o2.pl> 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

···

On Thursday 12 January 2006 08:37 pm, Jacek Olszak 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

David Vallner 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 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 :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:37:35 +0100, Jacek Olszak <jacekolszak@o2.pl> > wrote:

--
Posted via http://www.ruby-forum.com/\.

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 Vallner

···

On Thu, 12 Jan 2006 17:44:33 +0100, <tsumeruby@tsumelabs.com> wrote:

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

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 Vallner

···

On Thu, 12 Jan 2006 12:57:03 +0100, Jacek Olszak <jacekolszak@o2.pl> wrote:

Jacek Olszak 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

simulation.xdl (14.7 KB)

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 Friday 13 January 2006 06:23 am, David Vallner wrote:

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

···

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,

--
http://home.cogeco.ca/~tsummerfelt1
telnet://ventedspleen.dyndns.org

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

···

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

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 1/12/06, David Vallner <david@vallner.net> 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.

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 (tm) 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 Vallner

···

On Fri, 13 Jan 2006 08:13:05 +0100, <tsumeruby@tsumelabs.com> wrote:

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

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 Friday 13 January 2006 09:59 pm, tony summerfelt wrote:

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

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.

···

On 1/13/06, tsumeruby@tsumelabs.com <tsumeruby@tsumelabs.com> wrote:

On Friday 13 January 2006 06:23 am, David Vallner 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:

[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 Vallner

···

On Thu, 12 Jan 2006 18:20:15 +0100, Lyle Johnson <lyle.johnson@gmail.com> wrote:

On 1/12/06, David Vallner <david@vallner.net> 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.

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, Joe Van Dyk <joevandyk@gmail.com> wrote:

On 1/13/06, tsumeruby@tsumelabs.com <tsumeruby@tsumelabs.com> wrote:
> On Friday 13 January 2006 06:23 am, David Vallner 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:

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.

Message-ID: <200601140109.39164.tsumeruby@tsumelabs.com>

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

···

From: tsumeruby@tsumelabs.com
Subject: Re: Question about GUI API for Ruby
Date: Sat, 14 Jan 2006 01:09:07 +0900
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

i will do that :slight_smile:

···

tsumeruby@tsumelabs.com wrote on 1/13/2006 11:09 AM: > 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.

--
http://home.cogeco.ca/~tsummerfelt1
telnet://ventedspleen.dyndns.org

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

···

On 1/13/06, Wilson Bilkovich <wilsonb@gmail.com> wrote:

On 1/13/06, Joe Van Dyk <joevandyk@gmail.com> wrote:
> On 1/13/06, tsumeruby@tsumelabs.com <tsumeruby@tsumelabs.com> wrote:
> > On Friday 13 January 2006 06:23 am, David Vallner 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:
>
> 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.

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.

···

On Sat, 14 Jan 2006 04:00:36 +0900 Wilson Bilkovich <wilsonb@gmail.com> 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.