The integer gadget is really a special case of the string gadget type. Initialize the gadget as a string gadget, then set the gact_longint flag in the gadget's activation field. The user interacts with an integer gadget using exactly the same rules as for a string gadget, but intuition filters the input, allows the user to enter only a plus or minus sign and digits. The integer gadget returns a signed 32-bit integer in the stringinfo variable longint. To initialize an integer gadget to a value, preload the input buffer with an ASCII representation of the initial integer. It is not sufficient to initialize the gadget by merely setting a value in the longint variable. Integer gadgets have the longint value updated whenever the ascii contents of the gadget changes, and again when the gadget is deactivated.