LUI:the Lame User Interface
To use LUI gadgets, you should pass the XI_LUI tag to xi_init() when starting your program. Only buttons and lists are possible to create yet, but more is to come in a few days.
All gadgets created can be added to the global lists for automatic handling with lui_addgadget(). lui_remgadget() can be used if you want to remove anything before exit (LUI frees all gadgets automatically, though). All the gadgets have several "methods" that can be called for various effects, but these are mostly internal. Of most interest are the destroy() and draw() methods.
When creating a gadget, you need to pass many settings to get it rendered properly. Here's the list of tags which all gadgets support:
Function to call upon click activation (normally left mousebutton).
Function called when the cursor hovers above a gadget. The hook will already have its highlighting done around the time this hook is called.
Optional name for searching, grouping gadgets or whatever you need.
Usable by controls to display a title, if it has any.
- LUI_XPOS, LUI_YPOS, LUI_WIDTH, LUI_HEIGHT
Position and size of gadget. Size is optional, as it is usually derived from the images that make up the gadget.
SDL surface to display to. This may be any valid SDL surface that can display the images you've passed in to create the gadgets previously. It's sometimes useful to render to a view for gadgets that may not always be visible. (Special controls will be made available to make disabling groups of gadgets easier)