Linux Step By Steps

JCC / Xforms Integration


This note is on using jcc/xforms. It will not help you install either of them, back out of here for the installs.


The first thing to say is that these two, completely independent packages, are the bees knees for doing code development work in Linux. There is no other free source that matches them so stop wasting time.


The second thing to say is that neither package knows anything about the other.

Code Crusader is code only. (c, c++ whatever)

Xforms is the gui widget set. Just about anything you ever see as a gui on Linux that is not specifically Gnome / KDE has been built from this wysiwig.


> Is there a trick to managing all those windows JCC opens?

file->new project
...
....
source->add_files

creates a clean-to-see relationhip btwn all your stuff

> How do I embed these forms in my programs?

two answers which apply to all programs you ever write

first, use xforms and do not go anywhere near jcc (code crusader)

build a simple bare-bones widget gui, even a single button will do, but if you have a rough idea of what else you need,,,,, by all means.

select options -> and select
emit callback AND
emit main
in addition to whatever it has also set

when ready, file -> save

THE project file will be my_best_ever.FD

it will _also_ generate three (3) other files

main.c
callback.c
forms.c
^^^ obviously using poetic licence here

now fire up code crusader (jcc)

simply!!! source->add files, the above list and compile!

this will give you a usable gui (not quite, see note 3)

2)
go back to fdesigner (you can stay in code crusader)

unselect emit callback and unselect emit main and NEVER use them again

----

using jcc flesh out the skeleton main.c that fdesigner provided for you in main.c and callback.c

you can modify your gui design any time you like and save. fdesigner is no longer interested in main and callback, you can even rename or delete them for all it cares. *Everything* you create as a widget is inside forms.c. never ever alter forms.c, it will be overwritten by xforms each time. and, if you subsequently add further callbacks, while you would need to emit->callbacks, the structure is so blindingly obvious and consistent you can simply cut and paste an existing one.

---
finally, I really really recommend you look at mime-types on the Steps site. You can add jcc and xforms file associations so that all you have to do is click on a C or an FD file and the two programs will fire.

--

Note 3
Code crusader creates makefiles from information you supply in Make.header. This file is edited by YOU to orient code crusader around the unique libararies you want to use for unique projects.

Since code crusader knows nothing about Xforms, you have to do something about that. Here's how

click on the config button (top right) or edit make.headers directly

at the bottom of the file edit or add the following

FORMSINCLUDE= -lforms. -L/usr/X11R6/lib -lX11

The semantics here are important for you to learn because they affect ALL programs you want to write, not just for including xforms, but imagine any library.

-lforms says load /usr/lib/libforms.so
-L/usr/.... says look in this directory for additional libraries

Use this knowledge when you add further libraries to your projects.