0 votes
by Louis (120 points)

Hello everyone,

I’m a complete beginner to VFX Forth, with no prior experience with the language or its ecosystem. I recently discovered it and would really like to get familiar with the language by working on small visual sketches, things like drawing simple geometries (circles, lines, grids) on an external window or canvas.

Eventually, I’d also love to experiment with some basic interaction, such as responding to mouse or keyboard input.

Is this kind of project feasible with VFX Forth, specifically with the Community Edition under Windows 11? Or would you say that it is not the best tool for this kind of beginner-friendly, graphical exploration?

In any case, I would really appreciate any help or examples showing how to define a simple window or canvas and draw something basic, like a grid of circles.

Best regards,

Louis

1 Answer

0 votes
ago by Bart Nelson (540 points)

I'm surprised nobody else has responded to this.

Drawing in VFX is as simple as abc.

For example:

BLACK PEN RED BRUSH \ Define your edge and fill colours

10 10 100 100 ELLIPSE \ Draw your circle by defining a bounding rectangle

You could easily define a word CIRCLE ( x,y,radius--- ) if you preferred.

There are, of course a few hoops to jump through first.

1. Make sure GTK is installed on your PC.

2. Switch VFX to 64 bit floats, needed by the Cairo graphics library - for some reason VFX come with 80 bit floats at the moment.

3. INCLUDE the GTK bindings and wrappers.

4. INCLUDE the CAIRO bindings and wrappers.

5. Code a little toy program that provides a surface for you to draw on.

An example program that does 2-5 for you, using the latest version of GTK, has been donated to VFX though I'm not sure if it's part of the distribution yet.

If you come to EuroForth 2025 I can show you exactly how it all works.

...