foxGUIb syntax versus foxruby syntax

View: New views
1 Messages — Rating Filter:   Alert me  

foxGUIb syntax versus foxruby syntax

by cag :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have been going through the foxGUIb tutorial and the foxruby tutorial and noticed that there are subtle differences in the syntax used - for example.

This
   require 'libGUIb16'
   app=FX::App.new
   w=MainWindow.new app
   w.topwin.show(Fox::PLACEMENT_SCREEN)
   app.create
   app.run

Compared to this:
  require 'fox16'
  include Fox
  theApp = FXApp.new
  theMainWindow = FXMainWindow.new(theApp, "Hello")
  theApp.create
  theMainWindow.show

I understand the need for
  require 'libGUIb16'
because I think it extends 'fox16' in some ways.

But I am not clear on why
1.  FX::App.new versus FXApp.new
2.  Different name and number of parrms for MainWindow.new

The reason I would like to understand is because I think all examples in the Pragmatic programmers FXRuby book by  Lyle Johnson use the later which is not the same as that generated by the code generator. Perhaps there is a way to alias or some easy way so I don't need to change the example code much.

Finally I'd like to find a clean way to just initialise the events so that they would be able to call to methods outside the extended class. I think that would be a lot cleaner but might require a module or meta-programming or something cleaver like that.

BTW I also tried to get QT4Ruby working but couldn't even get the gems to install and work for hello world. Something about wrong number of parameters for methods. I think this will iron itself out over the next couple months and I'll take another look at it.

Any advice would be greatly appreciated,
  Carl