Introduction to WinX


What is WinX?

WinX is a GUI library for XBlite. It is designed to take care of all the annoying details of the Win32 API, while still allowing you to drop down to the Win32 code if you need it. To this end, the handles returned by WinX can be used with any Win32 function (although the reverse is not always true).

Features

The Structure of an WinX Program

There is a template of a WinX program in the templates folder. It is a good starting point for developing your own applications with WinX.

Before using WinX it is necassary to initialise the library. WinX will crash if this is not done (a bug I'm working on). To initialise the library, use the WinX function. If it returns $$TRUE then the library hasn't initialised itself.

Once the library is initialised, the next step is to create your main window. To do this you will need the WinXNewWindow function. WinX assosiates extra information with a window, so it is important to create your window wth the WinXNewWindow function if you want to use any WinX functions with it. The next step is to create the controls you will be needing, such as toolbars and edit boxes. Register any callbacks you will be needing and display the window with WinXDisplay.

Finnaly, call WinXDoEvents. This function doesn't return untill the main window is destroyed. Once it is called, any events concerning the windows you have created are processed and the appropriate callback functions are executed.

Callback Functions

WinX makes extensive use of callback functions. These are functions you implement in your program which are called by the WinX library. You need to make sure you have the correct number and of parameters and that they are all of the correct type or your program will crash.

Flags

Some functions take a set of flags as a parameter. When this is the case you can specify one or more of the appropriate flag constants, combining them all with the | (OR) operator.

Related Links

Handles and Windows