ck wrote:
- what is this nil, nil, DECOR_ALL about?
The line:
main = FXMainWindow.new(application, "Hello", nil, nil, DECOR_ALL)
instantiates a new FXMainWindow object and stores a reference to that
object in a local variable, “main”. The first argument to
FXMainWindow.new is “application”, which is a reference to the FXApp
object that you created earlier in the program. The second argument,
“Hello”, is the window title. The third and fourth arguments are
references to the “big” and “mini” icons, respectively, for your
application; since we’re passing in nil for both of these, the program
will just use some default icon for your operating system. The last
argument (DECOR_ALL) tells FOX that we want “all” of the decorations for
this window (e.g. minimize and maximize buttons, a close button, etc.)
- FX::ID_QUIT?
The line:
button = FXButton.new(main, "Hello, World!", nil, application,
FXApp::ID_QUIT)
instantiates a new FXButton object and stores a reference to that object
in a local variable, “button”. Whenever that button generates an event
– namely, you push it – it will send a message to some target object.
The fourth argument of FXButton.new identifies which object is going to
get those messages; in this case it’s the application. The fifth
argument indicates what identifier (a number) will be sent along with
the message; in this case, FXApp::ID_QUIT refers to a constant (ID_QUIT)
defined in the FXApp class that tells the application to shut down. So,
in other words, clicking the “Hello, World!” button will cause the
application to quit.
- PLACEMENT_SCREEN?
PLACEMENT_SCREEN is just one of the placement options for the
FXMainWindow#show method, that tells it to initially place the main
window in the center of the screen. Some other commonly-used options are
PLACEMENT_CURSOR (to place it under the current cursor position) and
PLACEMENT_MAXIMIZED (i.e. window is initially maximized).
- What is contained in the Fox.so file? How can I view its contents?
Not sure exactly what you mean. As the tutorial states, the “fox.so”
file is just a shared library that Ruby can load dynamically.
A good source of introductory material about all this stuff is the FOX
web site, found here:
http://www.fox-toolkit.org
Click on the “Documentation” link on the left side of the home page, and
then start from the top!
Hope this helps,
Lyle