Your first assignment is just to get oriented with FLTK, Fluid, and our C++
development environment.
- 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
- Under "My Documents", make a subdirectory for this course
and a nested subdirectory for this project, call it "hello".
- 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.
- 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.
- 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.
- 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
-
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.
- 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.
- You optionally may also want to check out
Greg's other FLTK videos.
"CubeView" example
- Make another directory called "CubeView", and
Download all these files into it.
The CubeView.exe executable is a sample solution.
- 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".
- (addendum to ch9 tutorial): you will want to adjust the "Minimum",
"Maximum", and "Step" values in the GUI tab of the slider widgets.
-
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
- No lab write-up is required for this lab.
- Package up all your CubeView files, including the executable:
from within your CubeView directory, run:
tar czf your_name_lab0.tar.gz .
(Update: ZIP is okay, too: your_name_lab0.zip)
- Upload this tarball to eCourses: in the Workspace, under the "Lab0"
folder.
- 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 two days, and it assumes that you've already gotten all
this down fluently.