Desktop Environment in Ruby - ruby

I want to create a very simple window manager for Ubuntu using Ruby. Where should I start?
I am somewhat familiar with Qt (from when I used to use C++), but I don't mind using other frameworks.

There's this great presentation, presenting several toolkit alternatives. It's in Portuguese, but it should not be hard to understand the toolkit names and screnshots :)
http://www.slideshare.net/guest2a3a90/ruby-no-desktop-marcelo-castellani

Related

Creating Ruby applications for Windows

I want to develop a Windows application. Honestly I care little about cross-platforms for now (but still would be good)
I want to use Ruby, since it has quite a simple syntax and is so.. well, simple and easy to learn.
My application is like a "game level creator", where you can design your own level and then run it with another application which is a "game level player" by reading the project file created by the creator app. You get the idea.
Now, I got a new PC and is completely clean. Absolutely no trace of my old Ruby experiments and fails.
First of all, I will need to choose a GUI platform for my Ruby application! Can you recommend me one? I have heard of Shoes and Tk, but want to know what you think.
Have you considered IronRuby? It's an implementation of Ruby that runs on the .Net platform, which means you have access to all of the standard Windows Forms libraries, if you decide to run in Windows. http://ironruby.net/
According to david4dev, it also runs well on Mono, which makes it great for cross-platform compatibility, as the Mono platform runs on Mac OSX and Linux, as well as Windows.
Jorg W Mittag says that using the WPF (Windows Presentation Framework) is an even better option for creating GUI's since Mono has a very strong implementation of the WPF. The WPF was created to be platform agnostic and is better suited for cross-platform development over WinForms, since WinForms is tightly coupled with the Windows OS.
I recommend using Shoes out of the 2. Shoes is a nice simple way to build small applications using Ruby. The reason why Shoes is better than TK for your application is that it makes it very simple to create graphics.
Shoes is well suited to small apps and it will be quite hard to create a game creator using it.
You are probably better off using an SDL based game framework such as Rubygame . This works on Linux, Windows and OSX.
For the simple, typical editing most GUI kit will do just fine. However, for the more complicated (and especially the level creation/editing) you're mostly gonna end up using a lot of self-made rendering in DirectX/OpenGL.
I don't know a lot about Ruby though, but I'd consider GUI kits Or frameworks with that aspect in mind.
Just thought I'd share my 2 cents :)

Ruby for cross-platform desktop applications?

Please share you experience building desktop applications with Ruby programming language. What GUI toolkits have you used? How have you packed everything into one installer? What troubles have you spotted?
I saw few articles about using Ruby for desktop, but in teory everything is always great. I would like to know about real-world applications build with ruby.
you can check this out
Non-trivial desktop apps that use Ruby?
i used redcar & its available as a Gem

Can Ruby be used to develop simple Windows applications?

I've been developing Windows based applications for a long time and most of my present clients still desire a desktop or client/server Windows application. Is it possible to use Ruby for such applications as opposed to its primary purpose of being a Web-programming language?
Ruby is not primarily a web programming language even though Ruby on Rails is certainly suited for web development. Ruby is a general purpose scripting language.
The FXRuby and WxRuby frameworks are the most fully featured GUI frameworks for Ruby. You can write the apps in Ruby and then generate a Windows executable. The frameworks are cross-platform, so you could also run the apps written in these on other platforms, like Linux or Mac OS X.
There are also a few other less popular approaches like QtRuby and Shoes, and you can even use IronRuby (a CLR Ruby implementation) to write a .Net application.
Ruby is a general purpose object oriented scripting language. Ruby on Rails is a web application framework. Ruby predates Rails by about ten years. Don't confuse the two.
Yes, you can. Ruby is a full scripting language. You might want to start with the Ruby language homepage to see the capabilities and libraries that are available.
However, just because you can doesn't mean that you should. Before jumping in and using Ruby for a project, see if Ruby can give you things that other languages can't or if there are any disadvantages to using Ruby.
I know this thread is old, but for future reference to anyone who's looking into options for using Ruby for a GUI app, don't use QtRuby. I had developed a project for school in about a week, fully functional and pretty, only to find out that I could not release it. There was simply no way to package and distribute the application without having your users simulate your exact environment (install all the gem dependencies, build Qt development libraries etc). I tried using:
Crate: supposedly cross-platform, but I found only 1 usage example that's written in 2008 out of ~2 hours of googling, and the example basically covers a very specific subset of applications (some ssl/https authentication gem or w/e...)
Ocra: this looks like a candidate, but it's windows-only and didn't meet my requirements, as I had to target the three primary platforms
tar2rubyscript + rubyscript2exe: I had spent most of my time trying to get this to work because I've come across many who claimed that this is the way to go for distributing GUI apps built in ruby (albeit using other toolkits, Tk/GTK/wxRuby) but it didn't work either; I was endlessly faced with a cryptic error that basically breaks Qt::UiLoader functionality, in other words, you can't load .ui sheets you create with QtDesigner so...
Yes I'm angry and frustrated honestly, because I don't see the point of creating software that you just can't release for anyone to use. Now I'm left with a deadline coming up in a week, and I just hope I make it in time porting the app to C++.
So my answer is, don't use QtRuby. At least for now.
On a mac, you can use the Ruby Cocoa lib to create (what appear to be) native applications. If you want something more cross platform then you might consider a wrapper like shoes or qt.
The Qt toolkit seems the most popular way to do it. The website is http://www.darshancomputing.com/qt4-qtruby-tutorial/
I'm currently writing a little app in a wrapper called Shoes. This seems to make it as simple as pie to create windowed apps in ruby. http://shoes.heroku.com/ is the website.
At the moment Shoes looks suitable only for small personal apps. I say this because it's author recently went AWOL and it's not clear whether it will be developed further. I'm using it to write a game log parser to generate statistics from a flight sim. It's ticking along nicely.
Ruby can be used for developing GUI applications, whether Windows specific or cross-platform.
For Windows targetted you should look at the work going on with IronRuby since they have good integration with the .NET framework overall and with Silverlight, in the event you want to do apps that can bridge web and desktop. At this point IronRuby can be used to develop for Windows Presentation Foundation (WPF) or WinForms.
For cross-platform you have Ruby bindings for QT, FOX and others.
You should look at IronRuby - WPF and windows forms are both supported:

Can Ruby be used for UI based Windows apps?

I'm sorry if this question is noob-ish but I'm not having much luck with Google. Can Ruby be used for UI based Windows apps? I'm not looking for a Rails app, just Ruby.
Thanks
You have couple of options.
Use Gtk Ruby which works on Windows as well (http://ruby-gnome2.sourceforge.jp/).
You can use WxRuby or Tk.
You can use JRuby and Swing.In fact there are high level libraries which can help you there, such as (http://monkeybars.rubyforge.org/)
Yes, but the experience will vary depending on how you hook up the UI. TK or gtk, wxRuby, ruby shoes (not sure how alive that one is right now), Qt (which is cool) and fox (aka fxRuby) are some of the options. If you like to hurt yourself, you can hook directly to Win32 libraries, but I doubt you'll want to.
Additionally, if you target the nascent IronRuby, you can use WinForms or WPF.
I also prefer wxRuby. It looks great, uses native components, yet is cross-platform. On the Ruby On Windows blog there is a great write-up of how to get started. It helped me a lot.
You bet. wxRuby is what I use, but others use GTK. wxRuby also works on Linux which is where I am writing a program, but it should suit your needs. You can install it using
gem install wxruby
You could check out wxRuby..
Depends what kind of Window app are you going to implement. If this is your own pet project, then definitely you can try WxRuby or GTK. There is no risk here.
However if this is going to be serious, commercial windows app then you have to think twice. It is really worth using Ruby? It is great language. I use it on daily basis. But for a Windows app, C# integration with the whole environment is hard to beat.
check out Shoooes!

What language is good to write simple nice GUI apps?

I never did to much GUI programming (besides a bit of QT and Delphi).
I need to write simple GUI app which would interactively visualize graphs.
Very similar tool to "GraphViz GUI for Mac".
What would you suggest?
Thanks.
I think it really depends on the platform that you're targeting. If you are writing native apps for the Mac, Objective-C is probably the best choice, as the APIs are built around that. If you're writing for Windows, you probably want C/C++ or C#, for the same reason. Cross-platform apps would make you choose a platform-neutral language, such as Java, or Python (as jldupont suggested).
I use quite a few and I'd say C# in Visual Studio on Windows (which is great, and free!), and something like C#+MonoDevelop (or equally a scripting language like Perl) and Glade/GTK on Linux/BSD/other UNIX's while on Mac OS then XCode and Interface Builder are the obvious choice.
I would say C# with Visual Studio Express is the easiest and XCode and Interface Builder have the steepest learning curve. I've not used QT though, so can't compare but imagine it's similar to GTK.
Thinking outside the box a little REALBasic is also excellent at getting the job done (if you can get past the fact that it's OO Basic). It's not free but they recently greatly reduced the price and it's really great to use for simple GUI app development.
Consider Python with PyGTK: cross-platform, documented, proven.
JRuby is a good choice - it's cross platform, and you get the double benefit of a large number of components available for java (for instance, someone probably has done an interactive graph visualisation panel already) and the ability to connect and use them from ruby (which is a great language to program in).

Resources