EditorGadget()
Syntax
Result = EditorGadget(#Gadget, x, y, Width, Height)Description
Creates an Editor gadget in the current GadgetList. If #PB_Any is used as '#Gadget' parameter, the new gadget identifier will be returned as 'Result'. #Gadget will be the numeric identifier returned by the EventGadgetID() command.
You can add a 'mini help' to this gadget by using GadgetToolTip().
The following commands can be used to act on the editor content:
- AddGadgetItem(): Add a text line.
- CountGadgetItems(): Return the number of lines in the editor gadget.
- GetGadgetItemText(): Get the specified line text.
- GetGadgetText(): Get the text content of the editor gadget.
- RemoveGadgetItem(): Remove a line in the editor.
- ClearGadgetItemList(): Clear the text content.
- SetGadgetItemText(): Set the specified line text.
- SetGadgetText(): Change the text content of the editor gadget.
Example:If OpenWindow(0,0,0,322,150,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"EditorGadget") And CreateGadgetList(WindowID(0)) EditorGadget(0,8,8,306,133) For a=0 To 5 AddGadgetItem(0,a,"Line "+Str(a)) Next Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow EndIf
Supported OS
Windows, Linux, MacOS X