First of all, what is an event?

An event is something that happen in a specific condition, for example, if the user moves a window dragging it around the screen the window generate an event, a move event to be precise.

Events are useful because allow the programmer to attach to them actions called callback functions, a callback function is a function that is executed when a specific event occurs.

The callback function is usally called with some arguments that helps to identify the event, for example, in the above case, the arguments passed to the callback function will specify which window has generated the event with some more details depending on the event type.

In this page you can find all events supported by HGui windows with the arguments passed to the callback function when it is executed.

All window's callback functions are stored in HGui.Window.Events table, you can set them directly or you can used the window's :Set() method to modify them; of course you can define callback functions at creation time like in this example.

All callback functions are called with two arguments, the first one is a table with the event's details, the second one is the window object that have generated the event.

Here are all window's events:

Event Name Description Callback's First Table Argument
OnClose Generated when the window is closed FIXME
OnMove Generated when the window is moved .x : Current horizontal position
.y : Current vertical position
.action = “MoveWindow”
.id : Hollywood Display ID
.previousx : Previous x coord.
.previousy : Previous y coord.
OnActivate Generated when the window is activated .id : Hollywood Display ID
.action : “ActiveWindow”
OnDeactivate Generated when the windows is deactivated .id : Hollywood Display ID
.action : “InactiveWindow”
OnHide Generated when the window is hided or iconified .id : Hollywood Display ID
.action : “HideWIndow”
OnShow Generated when the window is showed or deiconified .id : Hollywood Display ID
.action : “ShowWindow”
OnSize Generated when the window is resized .action : “SizeWindow”
.id : Hollywood Display ID
.height : CUrrent Window's Height
.width : Current Window's Width
hollywoodlibs/hgui/windows_events.txt · Ultima modifica: 2017/09/28 18:34 da admin
CC Attribution-Noncommercial 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0