IPAddressGadget()
Syntax
Result = IPAddressGadget(#Gadget, x, y, Width, Height)Description
Creates an IPAddress gadget in the current GadgetList. If #PB_Any is used as '#Gadget' parameter, the new gadget number will be returned as 'Result'. It allows you to easily enter a full IPv4 address. #Gadget will be the numeric number returned by the EventGadget() command.
You can add a 'mini help' to this gadget by using GadgetToolTip().
The following commands can be used to act on this gadget:
- GetGadgetState(): Returns the current IP address (Use IPAddressField() to get the value of each field).
- SetGadgetState(): Changes the current IP address (Use MakeIPAddress() to build a valid IP address).
- GetGadgetText(): Returns the current IP address as text, in decimal dotted form ("127.0.0.1", for example).
- SetGadgetText(): Only used to clear the IP address contents, by passing an empty string.
Example:If OpenWindow(0, 0, 0, 180, 50, "IPAddressGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0)) IPAddressGadget(0, 10, 15, 160, 20) SetGadgetState(0, MakeIPAddress(127, 0, 0, 1)) ; set a valid ip address Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow EndIf
Supported OS
All