Download Latest Version SGT_FW_latest.zip (1.3 MB)
Email in envelope

Get an email when there's a new version of SGT_FW

Home
Name Modified Size InfoDownloads / Week
sgt_release_notes.txt 2025-07-01 1.1 kB
sgt_fw_readme.txt 2025-07-01 4.6 kB
SGT_FW_latest.zip 2025-07-01 1.3 MB
Totals: 3 Items   1.3 MB 10

The version of the latest downloadable zip is: 0.17.65
------------------------------------------------------

The sgt_images folder contains 3 free button images downloaded from the: https://www.freepik.com site.
They are free, as the site promised.
I am not a professsional image drawing man.
I will accept happily any free image contribution for the project.


            How to join the SGT_FW to your program
            ======================================

SGT_FW (Simple GUI Toolkit and Framework) is an API to develop Graphical User Interface (GUI) in 3D Gamestudio suit.
The GUI toolkit provides objects and their methods for creating and combining 2D GUI elements.
The framework provides easy access and usage of the defaults, configs and styles.
It also enables the usage of the objects at a higher abstraction level and various parameterization of them.

For more information see the Technical Reference and User's Guide documents.
They can be found in the SGT_FW/sgt_doc folder.
(These are also in pre-alpha state)

---------------------------------------------------------------
Notice the following configuration setting!

The framework can use the DevIL.dll. The name is an abbreviation of: Developer's Image Library.
It is exclusively for checking image files (are they complete, valid etc.).
Its usage is configurable the following way:

To enable the dll usage feature, put the following line into the sgt_defaults.sff after sgt_config_name line:
        sgt_devil_in_use = "yes"

To disable the dll usage feature, put the following line into the sgt_defaults.sff after sgt_config_name line:
        sgt_devil_in_use = "no"

The default of this property is "no" and it is in the shipped zip file.

The  sgt_defaults.sff file can be found at the following path: SGT_FW/sgt_data/sgt_defaults.

This dll should be in the main folder next to the main program.
It is downloadable from here: https://openil.sourceforge.net
---------------------------------------------------------------


        Deploying the framework:
        ------------------------

Download the SGT_FW_latest.zip and rename the resulted folder to SGT_FW.
Unzip the sgt_images.zip in SGT_FW/sgt_data folder, it is going to create the sgt_images directory.

NEW!    NEW!    NEW!

Unzip the sgt_style_custom_1.zip in SGT_FW/sgt_data folder, it is going to create the sgt_style_custom_1 directory.


        Proving the framework:
        ----------------------

It has two example programs: test_app.c and sgt_smalldemo.c

If you want to only play with SGT_FW you don't need embed it into another program, it is usable alone.
In this case open one of the example programs in the SED and run it.

Naturally, when you are playing with these programs you don't need the following part of this readme.
The last part of this readme, the code examples, can be still interesting.
For more detailed information see the Technical Reference and User's Guide documents.


        Using the framework in your own program:
        ----------------------------------------

Place the SGT_FW folder into your application source folder next to the main program.
Include the SGT_FW sources into your main program like this:

    #include <strio.c>
    #define PRAGMA_PATH "sgt_code"
    #include "sgt_root_incl.h"

Insert this function before the main() function:

    function app_exit() {
        sgt_fw.shutdown();
    }

This three lines be the first (or close to that) in the main() function:

    on_exit = app_exit;    // put here your exit function that must to call the sgt_fw.shutdown()
    sgt_fw = sgt_framework__new();
    sgt_fw.boot("SGT_FW/sgt_data/sgt_defaults/sgt_defaults.sff");

Voila! Now you can use the API for creating and using SGT objects.


        Code examples:
        --------------

Example, create an SGT_LABEL object with caption and place that to the 30, 30 position on the screen:

    SGT_LABEL* my_label;
    my_label = sgt_new(SGT_GUI_LABEL);
    my_label.show(true);
    my_label.rel_pos_set(30, 30);
    my_label.caption_set("my_label");

It has a shorter form like this:

    SGT_LABEL* my_label;
    my_label = sgt_new(SGT_GUI_LABEL, sgt_ptr8(NULL, NULL, "my_label"));
    my_label.show(true);
    my_label.rel_pos_set(30, 30);

There is a more shorter form:

    SGT_LABEL* my_label;
    my_label = sgt_new(SGT_GUI_LABEL, sgt_ptr8(NULL, NULL, "my_label"), sgt_dbl8(30, 30));
    my_label.show(true);

You can use the SGT_FW forum to write your remarks or comments in the Discussion part of the project:
https://sourceforge.net/p/sgt-fw/discussion/

Good luck!

Source: sgt_fw_readme.txt, updated 2025-07-01