Creating a full application with Ruby

Hi,

I have a desk-top application that I created using Actionscript 3.0 and
AIR, nothing fancy it just basically calculates the quantity of
rectangular parts that can fit in a bigger rectangular part based on the
user’s input, the thing is that it ALSO dynamically creates the actual
rectangles and show them on the screen based on the same factors and I
was wondering if this is something I can create with Ruby and may be
FXRuby, I do understand that Ruby is not meant for big application but
for something like this I think it would be nice to give it try since I
want to start working more with Ruby and this would be the perfect time
since I need to update the application.

I guess my question is what do I need to create full applications
because I have no doubt that it can be done with Ruby I just need to
know what tools do I need to create it?

What GUI can dynamically create objects?

I currently have FXRuby installed in my machine and I also bought the
book but when I go to their website it looks outdated and I’m wondering
if it would be worth it to learn it or is it even the right tool to
create the application I’m describing (see screen-shot).

Just to give you an idea in the attached screen shot I’m calculating how
many times I can fit a 15”x2” part into a 60”x120”

Thanks

Fily S. wrote in post #992154:

…was wondering if this is something I can create with Ruby and may be
FXRuby,
…What GUI can dynamically create objects?
…Just to give you an idea in the attached screen shot…

hi fily -

this looks like something you could do relatively easily with ruby -
give it a shot!
i agree that shoes is probably the easiest, though i really haven’t
used it at all. i use gtk2 for gui’s, and you can redraw shapes
relatively easily…

http://ruby-gnome2.sourceforge.jp/hiki.cgi?Ruby/GTK
http://zetcode.com/tutorials/rubygtktutorial/cairo/#shapes

-j

Thank you all for your reply.

It looks like Shoes is the easiest GUI but I’m a little afraid when I
dont have a book or something to learn from thats why I went with FXRuby
because it has a book, but since it looks like learning a GUI is like
learning a new language I want to make the right decision and stick with
one for a while.

I will give Shoes a try.

Excuse my ignorance but is it possible to make small animations with
Ruby? If yes, is this what the GUI is for?

When I say small animation I’m talking about mouse over transitions and
all the simple stuff NOT animations for banners or anything like that.

Do I need a separate program to package the application?

I usually get exited about being able to create an application using a
language like ruby, thats why I want to give it a try.

Thanks a lot

Fily S. wrote in post #992195:

is it possible to make small animations with
Ruby? If yes, is this what the GUI is for?

hi fily -

simple animations are easy with gtk2…
http://ruby-gnome2.sourceforge.jp/ja/hiki.cgi?Gdk::PixbufAnimation

for example:

require ‘gtk2’

win = Gtk::Window.new()

anim = Gdk::PixbufAnimation.new(“TradyBlix.gif”)
image = Gtk::Image.new(anim)

win.add(image)
win.show_all

win.signal_connect(“destroy”){Gtk.main_quit}

Gtk.main

“TradyBlix.gif” is a simple animation i made in gimp.

i don’t know about animations with shoes or wxRuby, as i don’t use
them, but it’s probably also possible.

Do I need a separate program to package the application?

ruby apps can be made executable (so you don’t have to type “ruby”
before the app name to run it… how you do that depends on your
system, and the target system - there’s plenty of info with a google
search.

have fun…

-j

Hi Fily,

I’m a little afraid when I dont have a book
How about the Shoes manual?

http://shoes.heroku.com/manual/Hello.html

or Nobody Knows Shoes (a big pdf file)

http://cloud.github.com/downloads/shoes/shoes/nks.pdf

I will give Shoes a try.
Cool!
If you have any questions, feel free to ask in Shoes ML.

http://shoes.heroku.com/current-progress

When I say small animation I’m talking about mouse over transitions
Umm,…

Try out the following snippet with your Shoes.
When the mouse enters the black oval, it’ll change the color to red.

Shoes.app do
  o = oval 100, 100, 100
  o.hover{o.style fill: red}
end

Cheers,
ashbb

Fily S. wrote in post #992154:

Hi,

I have a desk-top application that I created using Actionscript 3.0 and
AIR, nothing fancy it just basically calculates the quantity of
rectangular parts that can fit in a bigger rectangular part based on the
user’s input, the thing is that it ALSO dynamically creates the actual
rectangles and show them on the screen based on the same factors and I
was wondering if this is something I can create with Ruby and may be
FXRuby, I do understand that Ruby is not meant for big application

Among others, the creators of the application Ruby on Rails would
disagree with you.

but
for something like this I think it would be nice to give it try since I
want to start working more with Ruby and this would be the perfect time
since I need to update the application.

Then go for it.

I guess my question is what do I need to create full applications
because I have no doubt that it can be done with Ruby I just need to
know what tools do I need to create it?

What GUI can dynamically create objects?

I would imagine most of them. You might want to check out Shoes, which
is a simplistic gui toolkit that is easy to learn. See here:

http://shoesrb.com/manual/Art.html

I currently have FXRuby installed in my machine and I also bought the
book but when I go to their website it looks outdated and I’m wondering
if it would be worth it to learn it or is it even the right tool to
create the application I’m describing (see screen-shot).

Just to give you an idea in the attached screen shot I’m calculating how
many times I can fit a 15”x2” part into a 60”x120”

Thanks

I prefer wxRuby for gui applications, although drawing shapes is a
little more involved than with Shoes. See here:

http://wxruby.rubyforge.org/doc/dc.html

Hi jake,

If you like both gtk2 and Shoes, how about Green Shoes? :wink:

http://rubygems.org/gems/green_shoes

Green Shoes is one of the colorful Shoes.
It is written in pure ruby with gtk2.

Cheers,
ashbb

I was reading the documentation from the Shoes’ website and it looks
simple but I was surprised because apparently you don’t have to have
Ruby installed so I started wondering how is your code going to work
without Ruby?

Is Ruby embedded in Shoes?

Can you write your own code or you are limited to the the pre-built
functions from Shoes?

Thanks a lot for your help!

Fily S. wrote in post #992314:

I was reading the documentation from the Shoes’ website and it looks
simple but I was surprised because apparently you don’t have to have
Ruby installed so I started wondering how is your code going to work
without Ruby?

Please point us to what you are referring to.

A ruby interpreter is required to run ruby programs. However, any ruby
program can be packaged up with an interpreter so that the user doesn’t
have to have ruby installed. Of course that makes your programs bigger.

Satoshi A. wrote in post #992299:

Hi jake,

If you like both gtk2 and Shoes, how about Green Shoes? :wink:

http://rubygems.org/gems/green_shoes

Green Shoes is one of the colorful Shoes.
It is written in pure ruby with gtk2.

Cheers,
ashbb

i’ll give it a look - thanks…

-j

Hey there! Maintainer of Shoes here!

You don’t need to install Ruby because Shoes is like its own Ruby
distribution. It comes with a Ruby 1.9.1 built inside of it.

What are the limitation of using Shoes? I like it and even if there are
some limitations I will definitely give it a try.

The main limitation is that you can’t use gems with C extensions. We’ve
included a few with Shoes: bloopsaphone, chipmunk, ftsearch, hpricot,
json,
and squite3, but that’s all you’re going to get.

The second limitation is that Shoes can still be a bit strange in
places.
I’m currently undergoing an effort to increase documentation and add
tests,
but you can run into strange corners sometimes.

The last big limitation is that some larger Shoes programs can be a bit
unstable on Windows sometimes. I can’t reproduce this myself, but
Hackety
Hack (the largest Shoes program I know of) will just die on certain
systems
after about 15 minutes of running. It has something to do with Ruby
1.9.1
and threads, and I’m working on it, but be aware of that. Smaller
programs
seem to have no issues, and it’s not on every system, just some.

With that said, Shoes is a lot of fun to code with, and you get all
three
platforms for free, so… yeah!

Any other questions about Shoes, I’ll be happy to answer them.

Please point us to what you are referring to.
Here.
http://shoes.heroku.com/manual/Installing.html

I have been reading the book “No Body Knows Shoes” and it seems to be
pretty simple and makes me wonder if shoes is really a complete GUI
program, or is simply for very simple stuff.

What are the limitation of using Shoes? I like it and even if there are
some limitations I will definitely give it a try.

It is a lot simpler than FXRuby.

Thanks a lot

Thank you for your reply!

I’m currently trying it and as I said its way too easy, I like it.

What would you considere a small-big program?

I also heard that with shoes you can not create menus, like File, Save
as, Version etc. is this true?

Thanks a lot!

I’m currently trying it and as I said its way too easy, I like it.

Glad to hear it. :slight_smile:

What would you considere a small-big program?

I dunno, a couple of hundred lines? Check out Hackety Hack, for example:
https://github.com/hacketyhack/hacketyhack

I also heard that with shoes you can not create menus, like File, Save
as, Version etc. is this true?

Yes, we don’t have a good solution for this yet. Basically,
cross-platform
menus are hard to do right, since they end up looking different on every
platform… ashbb’s suggestion is how most Shoes apps handle such
things.

Thank you all for your help!

You can find lots of way in the ShoeBox: http://the-shoebox.org/
Thank you for the link.

What would you considere a small-big program?

I dunno, a couple of hundred lines? Check out Hackety Hack, for example:
https://github.com/hacketyhack/hacketyhack

Are you saying that Hackety Hack is a perfect example of a program that
may unexpectedly quit after 15 minutes using it? Now, this is a Windows
problem only right?

Thanks

Are you saying that Hackety Hack is a perfect example of a program that
may unexpectedly quit after 15 minutes using it?

heheh, yes, that may be what I’m referring to. :confused: Working on it!

Now, this is a Windows
problem only right?

Yep. Flawless on my Mac and Linux. In fact, mostly flawless on my
Windows,
too: it’s only some configurations.

Hi Fily,

I also heard that with shoes you can not create menus,
like File, Save as, Version etc. is this true?
Umm,… No.
You can use list_box like this:

Shoes.app do
  list_box items: %w[File Save Version]
end

Or, you can write your original menu method with image or shape
elements of Shoes. :wink:

You can find lots of way in the ShoeBox: http://the-shoebox.org/

Cheers,
ashbb

Thank you for your help!

There are currently 19 users using the application I described im my
original post and a little worried about stability since they are all
Windows users, I know its a small application but it can create up to
50,000 rectangle shapes.

Could this be a problem if I create it using Shoes?

Now, is it even possible to pack and distribute an application created
in Shoes?

Thanks a lot!

Could this be a problem if I create it using Shoes?

Only way to know for sure is to try. :wink:

Now, is it even possible to pack and distribute an application created
in Shoes?

Absolutely! There should be a ‘package an app’ screen on the main shoes
screen. It’ll give you a .exe of your app.

Thanks a lot for your help!

I will try to create the app and see how it goes. Where can I ask future
questions about Shoes? I’m sure I will have some…

Thanks

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs