Prev | Current Page 921 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

With the little you ??™ ve learned over the last
three pages, and the help of the GTK online documentation, you should be able to piece together any
of the library ??™ s available controls. All that remains, now, is to interact with the controls through the use of
events and event handlers.
In GTK, events are known as signals, and as hxGtk is a generated wrapper for GTK, the term is carried
throughout. Handling events in hxGtk is very similar to how events are handled in nGui , with the
exception that all event handlers in hxGtk follow the same parameter signature. In nGui , the parameters
accepted by an event handler vary from control to control, so it is necessary to know what values are
returned in order to properly construct the handler function. hxGtk does this differently by accepting a
Dynamic value, which essentially provides a container for the return values, regardless of what they
might be. The parameter container looks like this:
{sender : Dynamic, sig_types : Array < Dynamic > , sig_prms : Dynamic}
Here, the sig_types and sig_prms values are linked; sig_types provides an array of the names, in
string value, for each item stored in the sig_prms object.


Pages:
909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933