12 Replies - 4184 Views - Last Post: 27 January 2010 - 06:06 AM Rate Topic: -----

#1 erik.price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 485
  • View blog
  • Posts: 2,690
  • Joined: 18-December 08

Ruby GUI Toolkits

Posted 30 November 2009 - 03:41 PM

So I started Ruby sometime last week, and I'm already loving it. I've got most of the basics down, and am working on some more difficult elements of the syntax now. I am aware that this forum isn't exactly bursting with life, but I was hoping some people with Ruby experience could help me out.

I'm looking for a good, solid, GUI toolkit. Every document I've read on the subject is probably outdated by now (most of them were written pre-2003). I originally considered Tk, but from what I've read, it is a primitive and no longer supported library. I've done some basic wxWidgets in C (just enough to start hating it) and I know that is a pretty decent cross platform library, but again, I have no idea how well it translates into Ruby.


So if anyone has suggestions, I would love to hear them :)

Edit: I did post a poll, but I think I screwed something up :)

Is This A Good Question/Topic? 0
  • +

Replies To: Ruby GUI Toolkits

#2 EdwinNameless  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 120
  • View blog
  • Posts: 710
  • Joined: 15-October 09

Re: Ruby GUI Toolkits

Posted 01 December 2009 - 03:45 AM

View Posterik.price, on 30 Nov, 2009 - 02:41 PM, said:

So if anyone has suggestions, I would love to hear them :)


I have been using JRuby and SWT with some success. The cool thing is that you can use Java iterators Ruby-style, and that's just cool.

I haven't looked into windowing framework for Ruby, other than gtk+ (as I'm on Ubuntu): it looked easy enough, but I dunno what the status is for Win apps.
Was This Post Helpful? 0
  • +
  • -

#3 erik.price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 485
  • View blog
  • Posts: 2,690
  • Joined: 18-December 08

Re: Ruby GUI Toolkits

Posted 01 December 2009 - 09:49 AM

I guess I'll take another look at JRuby then. When I tried it before, it was unbearably slow on my computer. But since I know Java anyway, I guess this would be a good suggestion.


Thanks :)
Was This Post Helpful? 0
  • +
  • -

#4 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 902
  • View blog
  • Posts: 3,163
  • Joined: 12-May 09

Re: Ruby GUI Toolkits

Posted 02 December 2009 - 07:20 PM

I've heard decent things about wxSugar.
Was This Post Helpful? 0
  • +
  • -

#5 crummydo  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 223
  • Joined: 06-January 09

Re: Ruby GUI Toolkits

Posted 08 December 2009 - 10:09 PM

You could go with the built in GUI tool kit. TCL/TK

Or try GTK.

I am reading old books too, but just because the book is old, doesn't mean the language is invalid. Some things may have been changed, versions upgraded, but just try what is in the book for a primer, then look around on the net for the new sytax if any.

I just found a good GTK tutorial from their sourforge site.
http://ruby-gnome2.s...i.cgi?tutorials

This post has been edited by crummydo: 08 December 2009 - 10:28 PM

Was This Post Helpful? 1
  • +
  • -

#6 erik.price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 485
  • View blog
  • Posts: 2,690
  • Joined: 18-December 08

Re: Ruby GUI Toolkits

Posted 09 December 2009 - 06:56 AM

Thanks, that looks like a pretty awesome resource. I'll check it out. :)
Was This Post Helpful? 0
  • +
  • -

#7 braindeaf  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 12-January 10

Re: Ruby GUI Toolkits

Posted 13 January 2010 - 09:50 AM

View PostEdwinNameless, on 1 Dec, 2009 - 02:45 AM, said:

View Posterik.price, on 30 Nov, 2009 - 02:41 PM, said:

So if anyone has suggestions, I would love to hear them :)


I have been using JRuby and SWT with some success. The cool thing is that you can use Java iterators Ruby-style, and that's just cool.

I haven't looked into windowing framework for Ruby, other than gtk+ (as I'm on Ubuntu): it looked easy enough, but I dunno what the status is for Win apps.


Edwin...you say you have some success with JRuby and SWT. Do you have any good basic examples of this to get me started? Anything you could put on github? I quite interested in trying this myself but the only example I've seen is in the Redcar gem and I'm coming at this from a non-java and no gui experience (in any form). I've not touched JRuby at all although I used Ruby and Rails daily for other things.
Was This Post Helpful? 0
  • +
  • -

#8 erik.price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 485
  • View blog
  • Posts: 2,690
  • Joined: 18-December 08

Re: Ruby GUI Toolkits

Posted 13 January 2010 - 02:21 PM

Your question wasn't directed at me, but I found some good resources.

http://rubylearning....y_tutorial.html
http://wiki.netbeans.org/SwingJRuby #will be even more useful if you use NetBeans

Also, welcome to dream in code! :)
Was This Post Helpful? 0
  • +
  • -

#9 EdwinNameless  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 120
  • View blog
  • Posts: 710
  • Joined: 15-October 09

Re: Ruby GUI Toolkits

Posted 15 January 2010 - 12:35 AM

View Postbraindeaf, on 13 Jan, 2010 - 03:50 PM, said:

Do you have any good basic examples of this to get me started?


I had posted a snippet a while back, but it's been refused “coz it exists somewhere else”. If I can motivate myself to produce more content for DIC, I'll post a tutorial. I wouldn't hold my breath, though.
Was This Post Helpful? 0
  • +
  • -

#10 erik.price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 485
  • View blog
  • Posts: 2,690
  • Joined: 18-December 08

Re: Ruby GUI Toolkits

Posted 15 January 2010 - 10:13 PM

View PostEdwinNameless, on 1 Dec, 2009 - 05:45 AM, said:

I have been using JRuby and SWT with some success. The cool thing is that you can use Java iterators Ruby-style, and that's just cool.


Even though you posted this over a month ago, I just thought I should let you know I just started experimenting with JRuby + Swing. Ruby's syntax plus Java's methods and classes is a win. I managed to create a (barebones, like only post for now) Twitter client in about 40 lines of code (well the GUI part at least, the Twitter implementation is a library I'm working on in Ruby which is about half finished so far.)

Anyway, although JRuby is definitely slower than the default Ruby implementation, it's got some awesome features

This post has been edited by erik.price: 15 January 2010 - 10:15 PM

Was This Post Helpful? 0
  • +
  • -

#11 EdwinNameless  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 120
  • View blog
  • Posts: 710
  • Joined: 15-October 09

Re: Ruby GUI Toolkits

Posted 18 January 2010 - 04:42 AM

View Posterik.price, on 16 Jan, 2010 - 04:13 AM, said:

Anyway, although JRuby is definitely slower than the default Ruby implementation, it's got some awesome features


Is is indeed slower, but being able to do things like this is quite awesome:

require 'java'
# Iterator
list = java.util.ArrayList.new
list.add("one")
list.add("two")
list.add("three")
list.each{ |item| puts item.upcase }
# Enumeration
jar = java.util.jar.JarFile.new("jruby.jar")
jar.entries.each{ |entry| puts entry.to_s }



That is, doing Java iterations the Ruby way!!

Regarding JRuby and SWT, I had forgotten I had posted this on the subject... Interestingly enough, your RSS feed snippet had sparked this post!
Was This Post Helpful? 0
  • +
  • -

#12 erik.price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 485
  • View blog
  • Posts: 2,690
  • Joined: 18-December 08

Re: Ruby GUI Toolkits

Posted 20 January 2010 - 10:11 AM

That's pretty awesome, I didn't know that was possible with JRuby. :^:

Do you have any suggestions for references or tutorials for JRuby? Everything I've seen says a different thing, some say require 'java' others include Java
Was This Post Helpful? 0
  • +
  • -

#13 EdwinNameless  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 120
  • View blog
  • Posts: 710
  • Joined: 15-October 09

Re: Ruby GUI Toolkits

Posted 27 January 2010 - 06:06 AM

View Posterik.price, on 20 Jan, 2010 - 04:11 PM, said:

That's pretty awesome, I didn't know that was possible with JRuby. :^:

Do you have any suggestions for references or tutorials for JRuby? Everything I've seen says a different thing, some say require 'java' others include Java



The "official" website gives examples with require 'java', and I must admit I prefer this because this is "the Ruby way".
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1