We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,608 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Using FXRuby basic window

0
By Dark_Omen on Jan 21st, 2005 8:48 am

This is a basic window coded in Ruby. To download Ruby go to www.ruby-lang.org and download the latest version. The latest version includes the FX toolkit that is needed to create this window.

require 'fox'
include Fox

theApp = FXApp.new

theMainWindow = FXMainWindow.new(theApp, "Hello, World")
theApp.create

theMainWindow.show

theApp.run

I realized I didn't mention what exactly to download. On www.ruby-lang.org, on the right side there is a thing that says download. Once you are on that page find the link that says one click installer. This comes with FreeRIDE which you can write the programs and run them in. Also I download one of them to see if it worked, and it didn't (the final version). The only one that I know of that works is 1.8.2 rc 9, and they dont have it posted, but I can e-mail it to anybody upon request.

Dark_Omen
Posting Pro
573 posts since Apr 2004
Reputation Points: 23
Solved Threads: 6
Skill Endorsements: 0

Greetings Dark! I downloaded Ruby. The sample codes look a little like a mix of Python, Java and C. Got the FreeRide IDE going, cute, but nothing shows up in the output window after running the code. Is there a trick?

vegaseat
DaniWeb's Hypocrite
Moderator
6,499 posts since Oct 2004
Reputation Points: 1,451
Solved Threads: 1,618
Skill Endorsements: 39

Does a dos promt window open as well as a normal looking window? Did you get FXRuby. You can get the one click installer and that would get you everything you need. I don't think the final version is working properly, but I have a working one that I can send you if you want.

Dark_Omen
Posting Pro
573 posts since Apr 2004
Reputation Points: 23
Solved Threads: 6
Skill Endorsements: 0

The samples I ran were console samples that came with Ruby. I was hoping the results would show up in the Output View of FreeRide. Looks like I have to put the directive #!/usr/bin/env ruby in at the start of code to get the console compiled properly (similar to Python). I will test your code after I installed FOX and FXRuby. Thanks...

vegaseat
DaniWeb's Hypocrite
Moderator
6,499 posts since Oct 2004
Reputation Points: 1,451
Solved Threads: 1,618
Skill Endorsements: 39

Yup

Dark_Omen
Posting Pro
573 posts since Apr 2004
Reputation Points: 23
Solved Threads: 6
Skill Endorsements: 0

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.3164 seconds using 2.66MB