Cross Platform GUI Library for Ruby - ruby

Does anyone have recommendations on a cross platform GUI Library for Ruby. I have looked at https://github.com/brixen/wxruby and it seems like its dead (the last code push is more than 2 years ago), but I need something on similar lines. The goal is to build a native app for Windows/OS X and Linux. My other option currently is to learn pascal and buy Delphi :(

I'd look into qtruby. It's actively developed, works on Windows, OSX and Linux and there even is an (old) ebook about it.

I will try:
http://shoesrb.com/

Related

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.

How do I code applications on a Mac so that they use the native UI elements?

I'm starting to program. Already did some things with Java: a calculator, one document management system powered with a database and some other home projects. But I don't like the visual look. I love however how mi Mac's Apps look. And I want to create Apps for mac. Already buy one but when I open netbeans to program it looks like the Apps doesn't feel like mac.
Is there any specific java code to make the controls looks like how the other mac apps look? My dad mention something about Object C but I don't understand. Can someone please explain me.
AFAIK You'll never get the look and feel of Aqua (Mac's UI Kit) by using Java. Why? Because to make Java platform independent some things needs to get ripped off. And native controls are one of them.
I think you're taking about Objective C which is the native development language for building Mac Apps. I'll recommend you the book "Learn Objective-C on the Mac" is pretty useful.
P.S. I'll encourage you to start with iOS (iPhone and iPad apps). Why? Well, I think is easier to begin with. Things like fixed resolution and so on make your development efforts small while beginning with. (Just my 2 cents)
If you want to code in Objective-C, you'll first need to trek over to the App Store and download Xcode. This will install C/C++/Objective-C compilers on your Mac and then you can start getting your hands dirty.
Depending on what you are trying to accomplish, you can just google/read/learn and build your own frameworks from the ground up or look at something like Cocoa to get started as well.
http://developer.apple.com/technologies/mac/cocoa.html
Cocoa Frameworks
The Cocoa frameworks consist of libraries, APIs, and runtimes that form the development layer for all of Mac OS X. By developing with Cocoa, you will be creating applications the same way Mac OS X itself is created. Your application will automatically inherit the great behaviors and appearances of Mac OS X, with full access to the underlying power of the UNIX operating system. Using Cocoa with the Xcode IDE is simply the best way to create native Mac applications.
Good luck!
Apple has deprecated a lot of the Java support in OS X. It's possible to have a Java application integrated, but there are some annoying bits missing. See one of my questions demonstrating some issues with Java applications in the Dock. You would be better off using Objective-C instead, since Apple has lots of documentation and tutorials available.
You're thinking of Objective C. You can also do applications for Mac using C/C++ but as of late the "popular" language for Mac development is Objective-C. There are tons of tutorials and plenty of documentation to walk you through writing apps for both Mac and iOS.

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.

Developing for Mac OS X, on Windows?

Well, simple situation. I happen to be a software engineer who uses mostly Delphi and C# for software development. Delphi is great for desktop applications while C# is ideal combined with ASP.NET for web applications. However, I am considering to teach myself more about software development for the Mac. Xcode and Cocoa would be the environments to start with. Learning new languages is no problem for me!
However, before starting to write code on a Mac, I first need to buy one and they're reasonable expensive so buying one is a decision that will take me a few months before I know which one I need. So, to help me right now, I would like to know the possibilities that I have to learn more about Mac development without the need for a Mac!
For example, does OS X work in a VMWare environment? Are the development tools also available for Windows? Is there a clear API overview of the OS X libraries?
Or should I first buy a Mac, play with it for a few weeks and then decide on how to develop software for it? In other words, should I start spending now, or in a few months? :-)
Perhaps a macmini would be the best bet but failing that:
MacOSX in VMWare: http://wiki.osx86project.org/wiki/index.php/Vmware_how_to
Development tools for windows? I'd stick to XCode as it can compile multi-binary apps.
Here's the clearest overview I can think of: http://developer.apple.com/referencelibrary/MacOSX/index.html
Hope this helps!
Mac OS X works in a VMWare...
Unfortunately XCode works only on Mac OS...
There are versions of Max OS, which runs on x86 machines. You can avoid buying a Mac PC, but you have to pay for the OS and XCode...
EDIT: Xcode is free
You definitely want a Mac if you want to develop for the Mac. Even Java requires local testing.
That said, Macs are not very expensive and run Windows too.
If you want to learn and start programming before you have a Mac, I recommend either Java or .NET, specifically Delphi Prism.
See here my own first experiment with Delphi prism:
http://leaukiprog.blogspot.com/2009/07/delphi-prism-first-experiment.html
You can write a program for Windows, keep GUI code and other code separate and later replace the Winforms GUI with a native Cocoa GUI on the Mac.
I found that Pascal is a good language for accessing native APIs from .NET. Everything looks cleaner than with C#, I think.
The new version of Delphi Prism is coming out on the 25th, as far as I know.
You might also look into the GNUstep project. This will let you experience objective-c a little bit before you make the plunge, albeit with the GNU libs instead of cocoa.
Good Mac (or iPhone) software is an artisan product; it reflects the culture and tastes of Mac (or iPhone) users. Because the Mac is a premium platform, users tend to be more sensitive to the feel and polish of the apps. Thus to successfully program for the Mac/iPhone or even grok the Cocoa frameworks properly, you have to grok the Mac user experience. Although many coming from the Windows or other-UNIX world try to skip this step, they do so at their own peril.
So, as a Mac developer (who also writes for other UNIX OSes), my recommendation is buy a Mac and start using it, full time if you can. A Mac Mini is completely adequate for development and will set you back only a few hundered dollars, including the OS. Consider that on Windows, this is often less than the price of a full VS license. Everything else (Xcode, libraries, etc.) are free.
Once you have a Mac and begin to grok the feel of things, you'll discover that there are a number of development options. Besides the Cocoa frameworks--which can be used from Python (via the built-in PyObjC bridge), Ruby (via MacRuby or RubyCocoa)—-there are a number of other options. Qt from Nokia and Mono are viable. Often cross-platform apps written in Qt or Mono are disliked on the Mac because they don't feel "native" (see above), but really the problem is not the framework. If you get the Mac user experience you can write a very passable Mac app in a cross platform framework. You just have to intend to write a Mac app, not get a Windows app working on the Mac.
If you code in RealBasic or Lazarus, you can run and compile your apps for both Mac OS and Windows (and Linux in the case of Lazarus). RealBasic isn't that popular outside of the Mac Platform, and isn't free. Lazarus is still a little rough around the edges, but is basically a free version of Delphi.
Lazarus is working hard on a native COCOA port with the next major version of FPC (though that will probably be available only in 2011)
Macs use Objective C. The APIs are very useful and there are many tutorials online. You'll be using Xcode, the Mac equivalent to Windows' Visual Studio and Linux's Glade.
I love making cross-platform applications. In a few hours I can prototype an application in Mac and publish it online. Then it'll take a day or two to port to Windows.
A Mac looks expensive, but it's not if you look what you get for your money.
It is entierly up to you if you buy one or not. I guarantee you'll have a lot fun with it, next to programming. If you want a cheap Mac, just buy a Mac Mini for 500 dollars, which you can connect to the Display you already own.
I recommend doing this on Mac OS X rather than Windows, but again: it's up to you.
P.S. You can use VMWare, but I think it's slow if you have less then 4 GB RAM.
A Mac really isn't that expensive if you go down the second hand route, I was put off by the price of brand new Macbooks so I got a late 2007 model for £350 and added an extra gig of RAM to it.
Reasonably priced, less hassle for development as well!
If you want to have just a general feeling about ObjC and the object libraries, why not giving a try to GNUStep?
Take a look at it here:
http://wiki.gnustep.org/index.php/Main_Page

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