Writing a simple Windows 7 GUI app in Ruby [closed] - ruby

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Has anyone used Ruby to develop a simple GUI app for Windows 7? Which GUI framework did you use? I am considering tK or WxRuby for the GUI and using Ocra to package. Will I need an installer too to install ruby and libs on the users machine?
This is new territory for me, and thoughts would be helpful.

Shoes is a nice ToolKit for a little GUI in no-time. But in Version3, the packager is somewhat broken. "green_shoes" is a shoes implementation as a gem, so packaging via ocra should work.
If you want to build a more complex UI, i recommend using JRuby and Swing (or SWT). With JRuby, you can use the rawr - gem to bundle up your application to a single .jar, .exe or .app, which contains everything you want. Only a Java installation on the target machine is required, which shouldn't be a problem nowadays. Swing is rock-solid and mature, and there are some Tools to build the UI using a visual designer (eg.: netbeans mantisse).
Another alternative may be http://visualruby.net/ which is some kind of IDE for ruby GUI apps using GTK and the Glade-Designer. I didn't use it yet, but it seems to work smoothly.
Last but not Least: The Shoes Team works hard to release Shoes4, which is based on JRuby and SWT. You may try it out if you like the shoes DSL, but it is still in development.
Other Toolkits i know more or less:
TK (since the latest versions it looks good, should work with ocra)
wxruby (seems dead)
fxruby (has a new maintainer, should work, has a
free book, but last time i used it, it looks terribly ugly and
out-of-date)
gtk+ (usable, but see visualruby for some comfort and
guidelines)

Shoes is a cross-platform toolkit for writing graphical apps easily and
artfully using Ruby. Unlike most other GUI toolkits, Shoes is designed to be
easy and straightforward without losing power. Really, it’s easy!
shoesrb.com

Green_shoes work with Ocra. But file is too large and it takes long for windows to appear after clicking icon. Tk is a bit smaller and faster (but still slow).

After using Shoes i had migrate my time free project to Jruby and Swing... I got Ruby sintax and all Java deploy and running aventages... http://sourceforge.net/projects/rmldonkey/

Related

When starting off with Qt Framework, what to choose - Widgets or QT Quick? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have a project in mind and want to take on it and have chosen QT as the preferred framework to begin with. I have been trying to figure out how to start and have Qt package (SDK and Qt Creator) installed. The problem is - I am not able to figure out the exact use-cases of Qt Quick and Qt Widgets. I plan to make the project for a long-term purpose with these properties:
It will be a desktop-only GUI application. If I ever want to make a mobile version, I would do that for the mobile platform in native or HTML5, and not Qt. So code-base compatibility with any mobile platform is not my concern.
Touch UI and animations are also not a part of the feature set. However, down the line support for creating graphs would be great (I can always use QtWebkit and JS to create some though)
Windows is the prime target. Linux and Mac would probably not be used by the target user(s).
It would need to be self-upgradable - now that is not much of a concern in making the choice but if there are problems with either, some knowledge would help me. I do not mind a full application installer download but updating modules independently would be a little better
It would need to talk to a web server for fetching and uploading data (I think HTTP would be Qt core's job but I do not know much about Qt yet).
The app would need tables with inline editing, a small picture gallery, menus, multi-part windows, drag-n-drop support etc. I could not find anything about menus relating to Qt Quick though.
Considering that use-case, what would be a better choice - Qt Widgets or Qt Quick?
A little about me and why I chose Qt - I have been out of touch from C++ since almost 2 years and have not made anything serious in Qt but Qt is a preferable choice over Java (which I do not like much). Again, I lack experience with Python. In addition to that Python UI sucks and if I have to install QT framework for a good UI, why not make the entire thing in Qt anyway (considering I am okay with C++). So Qt is the preferable choice for me. Since the project would need to be cross-platform compatible, Qt is even more attractive to my eyes.
QML will provide more support for customising widgets in a simple manner, Widgets gives you a set of tools ready to go that gives you platform styled controls in a very simple way. Both have their upsides, both have their downsides, I'd personally recommend getting started with Widgets first as there's a lot more historical documentation for them, so if you need to research something you'll have a bigger base to work with.
From your comment above, there's been little development on Widgets as the Qt development team feel that they don't need any additional work at this stage. They're stable, solid and reliable, there's not much that needs to be done to be improved, and when people need custom widgets they end up creating them themselves.

Is Ruby a good option for writing platform independent desktop applications [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Is Ruby a good option for writing (possibly and partially) platform independent desktop applications?
Is there any supported libraries to write code for windows,Linux, Mac Operating systems
I know Java have capabilities to write desktop applications, what about Ruby?
Ruby is a great language, but support for building graphical desktop applications is a bit weak. I would probably use JRuby + your Java GUI library of choice.
I believe JRuby can be pre-compiled to Java bytecode, which might also be a little bit better for closed-source applications than plain-text Ruby. (Although Java bytecode can easily be reverse-compiled.)
The problem with multi-platform GUI libraries is that they look ugly in any platform.
As a OSX user if I see a Java or X interface I automatically and mentally assign 10 less points to the quality of this application, even if it doesn't deserve it.
There is only one multi-platform GUI library that doesn't trigger any of my mental prejudices: HTML5. But of course you can not access to the native OS API.
I would recommend to try to define the architecture of your application is such a way that the 90% of the code is visualization agnostic. And then build this 10% of visualization layer for any platform adhoc.
If you are not worry about the professional perception of your app I can say that any of the propositions that have been done are a good choose.
I'd suggest you to take a look at Shoes.
Whether its a good option or not is a debate that depends on your constraints and preferences. If you are more comfortable with programming in Ruby as opposed to Java or C# then I'd definitely consider it to be a good option.
It depends on what kind of app you are developping. I would not say ruby is that cross plateforme for apps that need a complex gui for instance. Python seems a little bit more X-platform from my experience ,Java is definetly. And why not try C++ and Qt ?
http://qt.nokia.com/products/
Edit : since the question was edited , i would add go either with Java or Qt more than Ruby.
You could try FXRuby, it's based on the FOX Toolkit library and allows for cross-platform Ruby GUI development. Even more exotic platforms like FreeBSD are supported. You can package your Application together with a Ruby interpreter and all required frameworks to minimize target platform dependencies.
IMHO Ruby is a great choice for cross-platform GUIs. However, it depends on what GUI toolkit you use. The tools are: Qt, Tk, wxRuby, Shoes, GTK etc. I chose GTK because you can use the Glade interface designer to build your forms. You can see several examples of GUIs build with ruby at:
http://www.visualruby.net
About the programs' appearance, I've tried my programs on Ubuntu, Win7 and Win XP, and everything looks perfect. Also, if you look at Tks website, they have screenshots of TK GUIs in various platforms, and they look fantastic too.
The major benefit to writing GUIs in ruby, is that you get to use ruby instead of java. Personally, I find ruby a joy to work with. Good Luck.
I believe it can be with TideSDK. I recently discovered this and it seems to the one of the best approaches for multi-platform gui I have seen. It does use HTML5, but it has support for things like system tray and other native behavior.
I have looked into a bunch of the other alleged cross-platform solutions, but I don't find them appealing.
One note about TideSDK today: It only supports Ruby 1.8.7. This is actually a big issue for me as many of the gems I want to use is 1.9.2+. The TideSDK deployed on linux is 1.9, but not osx or windows, they are on 1.8.7. This is something they hopefully will update soon. Would love to see multiple ruby versions.
Anyways. Have a look at it. It is open source also, aka. free, so that is nice.

Right programing language for developing application for Mac

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 days ago.
Improve this question
I'm planing to buy a Mac. I would like to be able to develop GUI applications for Mac as well. Currently I develop in C# using VisualStudio as IDE. I also know Java and I'm familiar with NetBeans IDE. Application created in both of this languages can run on Mac (as can NetBeans IDE) but I was told that neither C# nor Java is recomended for MacOS X development.
So what language is recomended for MacOS X development ? I guess there is some recommendation from Apple for the developers ? I would prefer Object-oriented easy-to-use programing language (nothing like C) with good IDE that supports GUI creating (GUI designer).
Thank you for answers
There really is only one choice and that's Objective-C and XCode, anything else and you'll be running into problems and/or limitations.
As some have mentioned Python is one suggestion but what GUI toolkit to use? Then packaging becomes a problem.
Mono is OK but still a little buggy (and slooooow) on Mac's.
I haven't tried Java but the Apple port of the Java VM has just beed deprecated, make of that what you will.
XCode is very very good and integrates nicely with Mac/iPhone/iPad etc. but Obj-C takes a while to learn coming from a C#/Java background, plus XCode forces you to use MVC patterns in everything which again can be a culture shock.
I would say go with Obj-C and XCode and learn something new.
Objective-C with Cocoa should be your first, second, and third choices. That being said the learning curve can be steep but half the fun of this business is learning something new.
At my job (Seapine Software) we extensively use C++ with the Qt framework on the Mac and it also seems to work fine. If I were starting out I'd definitely go with Objective-C.
It's Objective-C. But if you want a beautiful and easy language, you can use python with wxPython. It'll look as native and, furthermore, it will make your applications multi-platform.
For the GUI designer, check wxFormBuilder. It supports wxPython for exporting.
I'm an iOS developer & use Objective-C every day, but if I were writing an OS X app, I'd definitely try out MacRuby. However, there is little controversy that, at present, if you want to write OS X native apps, you eventually must learn Objective-C. Most, like myself, grow to like it. Moreover, on OS X you have the advantage that you can run it garbage-collected and possibly save yourself some bookkeeping.
Daniel Steinberg says it well in the introduction to his Cocoa Programming book:
Use Objective-C. Sure, you can write Cocoa applications in other languages. But for now, learn the native language. There is a lot of support for new developers on the various Apple lists and in the support documentation, tutorials, and sample code accessible from Xcode. You will have an easier time of getting your question answered if you use the lingua franca of Cocoa development.
Yes it's Objective C. But check this out.
If you are familiar with HTML, CSS and Java Script, you can build platform independent desktop apps using Electron by Github. It's indeed amazing.
The desktop Apps like slack, atom, postman are built using this framework.
Please refer: https://electron.atom.io/
You can also use Qt which is a great cross-platform application development framework that is based on C++.
Please refer: https://www.qt.io/developers/
I started using swift to develop only Mac applications. But I wanted to use c for high performance apps, so I started using objective-c.

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:

Is Ruby any good for GUI development? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am considering creating a GUI-based tool that I want to be cross-platform. I've dismissed Java, as I personally do not like Swing. I'm currently considering C# and using Mono to make it cross-platform. However I'm wondering whether new-fangled cross-platform languages like Ruby can offer me a decent GUI development environment.
The short answer: no (because you said cross-platform).
The long answer: cross-platform GUIs are an age-old problem. Qt, GTK, wxWindows, Java AWT, Java Swing, XUL -- they all suffer from the same problem: the resulting GUI doesn't look native on every platform. Worse still, every platform has a slightly different look and feel, so even if you were somehow able to get a toolkit that looked native on every platform, you'd have to somehow code your app to feel native on each platform.
It comes down to a decision: do you want to minimise development effort and have a GUI that doesn't look and feel quite right on each platform, or do you want to maximise the user experience? If you choose the second option, you'll need to develop a common backend and a custom UI for each platform.
ruby is not a bad choice for your common backend.
You'll have Ruby/GTK, which allows you to use the GTK toolkit under linux. I think that should be working under Windows and Mac Os (as for Gimp, Gaim and so on).
A french magazine post a good beginner article about Ruby/GTK.
Edit : According to main page on the SourceForge project, Ruby-Gnome2 (aka Ruby/GTK) is cross-platform (Windows, Linux, Mac Os).
Ruby has Shoes, but that might be a little lightweight.
With Ruby you can use Tk, which is a mature, cross platform UI toolkit. It is the defacto GUI toolkit for Python and Tcl, and is also available for use with Perl. The most recent versions of Tk make use of native widgets which addresses the primary concern that Tk looks dated.
A language-neutral website devoted to Tk is http://www.tkdocs.com/ which includes examples coded in both Ruby and Tcl.
There's also FXRuby which has the benefit of a Pragmatic Programmer book, as well as wxRuby which is based on the wxWidgets C++ GUI framework.
being a wxperl programmer, i know that wxruby is there as well. Wx is pretty fast and has true crossplatform look and feel.
Take a look at Ruby GUI 2008 Survey Results and the discussion here. You will love to know.
Not sure about Ruby, but you mentioned Mono/C# -- I've used Mono and GTK# quite a bit lately and am very impressed. Seems to be pretty stable and cross-platform portability is nice.
Ruby/GNOME2 works pretty well. You can use Glade to drag and drop window elemtns and load it the UI from your Ruby app.
Have you looked at SWT on Java? It uses native widgets and is much easier to get a nice interface with it than Swing.
If you ever venture over to the mac, check out RubyCocoa. It is obviously only for OSX, but I've seen a lot of folks scratch their head when looking to do GUI development on the mac and if you love ruby RubyCocoa is a lot of fun.
I strongly back Qt for cross platform GUI development. It's awesome and APIs are very intuitive. GUI look and feel almost native with Qt because it uses GUI controls provided by underlying OS.
Though the basic interface with C++ other language bindings are available. For Ruby RubyQt is available. Unfortunately it's very immature.
I would suggest looking at visualruby. Its an IDE to create GUIs using ruby. It uses GTK as its graphics toolkit, and the apps look great to me on any platform. You can see screenshots on Win7, WinXP, Ubuntu, and Mac on the screenshots page:
http://visualruby.net/site/Screen%20Shots.html
You can easily try it on every platform by installing visualruby on various platforms, and running the example programs.
The checked answer was written before visualruby was released.

Resources