TUTORIAL T101 - System Setup

File : Examples/T101 - Setup.hws

Welcome to the first HGui tutorial!

First of all what is the HGui library?

The HGui library is an addon for the Hollywood programming language and it's aimed to give a complete GUI framework compatible with every platfrom supported by the Hollywood compiler, this means that applications using HGui for their interfaces will compile for every target machine.

Now let's make the first steps, below you will find how to setup your application to make use of the HGui library.

You will need to install the library package where you wish and edit the file +includes.hws. Open this file and change the first constant :

Const #INC_PATH = "put_here/the_absolute_path/where_this_file_is/"

As you can see all the other paths defined in +includes.hws will be generated on the constant you have changed. This mechanism is quite easy and will let to include libraries with no efforts.

The next step is to create a new file for your project and include the master include file we have just modified with:

@INCLUDE "path/to/include/+includes.hws"

Now all the libraries will be available to your code and ready to be included but for our purposes we only need to include the HGui library with:


Easy! Isn't it?

Ok, now that you have got the basics on including libraries on your projects let's start with this first tutorial.

;::: INCLUDE THE LIBRARIES DEFINITIONS :::::::::::::::::::::::::::::::::::::::::
@INCLUDE "../../+Includes.hws"          ;      Path relative to this application
@INCLUDE #INC_HGUI                      ;               Include the HGui library

Every well-written application should be built setting up your program and wait for events in a While/Wend or Repeat/Forever loop using the WaitEvent() command to reduce the CPU impact, HGui does not make axception to this technique so your GUI should be defined once, then the program will enter in an event detection loop where your code should handle events, modify the GUI and whatever you like, but always without blocking the application from detecting events.

This is a basic rule to make your GUIs react as fast as possible to the user input.

For this first tutorial we only need to add the neverending loop at the end of the GUI definition (ok, right now there is no GUI definition!).


DONE! The first tutorial ends here!

hollywoodlibs/hgui/tutorials/t101.txt · Ultima modifica: 2017/09/16 17:28 da admin
CC Attribution-Noncommercial 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0