CMPT 370 Spring 2009 Lab0 (5 pts): FLTK Orientation

Your first assignment is just to get oriented with FLTK, Fluid, and our C++ development environment.

  1. Login to a PC on the senior lab. If you don't have an account, ask Dave Friesen or Joel Schwartz. Note that this lab is isolated from the rest of campus; your "My Documents" here is different from your "My Documents" (enoch) in the campus drop-in lab.

    "Hello World" example

  2. Under "My Documents", make a subdirectory for this course and a nested subdirectory for this project, call it "hello".
  3. Right-click to download this template Makefile and this hello.cxx code into your "hello" directory. Make sure the Makefile doesn't have any file extension; Firefox/IE sometimes try to add an ".htm" extension.
  4. Get to a Cygwin prompt: there should be an icon on your desktop, or try the Programs menu, Cygwin, "Cygwin bash shell". Use "cd" to get to your "hello" directory.
  5. Work through ch2 of the FLTK-1 documentation (the "Hello World" example). To compile, run "make" in your "hello" directory. To run, type "./hello.exe" in that directory. The "./" is needed to tell Cygwin bash to look in the current directory to find the executable, rather than the default run PATH.
  6. Read through both the hello.cxx code and the Makefile and make sure you understand roughly what's going on. Make sure you know how to modify the Makefile to fit your own projects. Play around with the fltk-config command.

    FLUID video

  7. Watch Greg Ercolano's cool Fluid tutorial in flash (16 mins). You may wish to pause the video and follow along in your own Fluid window. Be sure you know how to do everything in the video.
  8. If you copy Greg's Fluid "Execute command" (Alt-X), you can try this command instead: make && ./hello.exe (use the name of your executable). Unfortunately, I don't know how to get Fluid to remember this command across sessions.
  9. You optionally may also want to check out Greg's other FLTK videos.

    "CubeView" example

  10. Make another directory called "CubeView", and Download all these files into it. The CubeView.exe executable is a sample solution.
  11. Work through ch9 of the FLTK-1 documentation. Make sure to name your Fluid file "CubeViewUI.fl", so that the output source code is "CubeViewUI.cxx" and "CubeViewUI.h".
  12. (addendum to ch9 tutorial): you will want to adjust the "Minimum", "Maximum", and "Step" values in the GUI tab of the slider widgets.
  13. Run "make" and test it out! Again, read through the Fluid-generated code and through CubeView.cxx to make sure you understand what's going on.

    Electronic turn-in

  14. No lab write-up is required for this lab.
  15. Package up all your CubeView files, including the executable, into one ZIP or tar.gz file: name it your_name_lab0.zip (or your_name_lab0.tar.gz, as appropriate).
  16. Upload this tarball to eCourses: in the Workspace, under the "Lab0" folder.
  17. This lab is worth fewer point than the others, but be sure you've completed all these steps and understand FLTK and fluid by the due date! The first "real" lab is in one week, and it assumes that you've already gotten all this down fluently.