FrameGadget()

Syntax

Result = FrameGadget(#Gadget, x, y, Width, Height, Text$ [, Flags])
Description
Creates a Frame gadget in the current GadgetList. This kind of gadget is decorative only.

Parameters

#Gadget A number to identify the new gadget. #PB_Any can be used to auto-generate this number.
x, y, Width, Height The position and dimensions of the new gadget.
Text$ A text to display in the frame. This parameter is only valid if no borders are specified, else it will be ignored.
Flags (optional) Flags to modify the gadget behavior. It can be a combination of the following values:
  #PB_Frame_Container: Enables container support so gadgets can be added to it (strongly recommended to avoid various issues).
                       CloseGadgetList() needs to be called to go back to previous gadget list like any other container gadget.
  #PB_Frame_Single   : Single sunken frame (Windows only).
  #PB_Frame_Double   : Double sunken frame (Windows only).
  #PB_Frame_Flat     : Flat frame (Windows only).

Return value

Returns nonzero on success and zero on failure. If #PB_Any was used as the #Gadget parameter then the return-value is the auto-generated gadget number on success.

Remarks

As this Gadget is decorative only, GadgetToolTip() cannot be used. This Gadget also receives no events.

Example: With Container

  If OpenWindow(0, 0, 0, 320, 250, "FrameGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    FrameGadget(0, 10,  10, 300, 200, "Options", #PB_Frame_Container)
      CheckBoxGadget(1, 10, 40, 200, 30, "Enable Optimizer")
      CheckBoxGadget(2, 10, 75, 200, 30, "Validate Output")
    CloseGadgetList()

    Repeat
    Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf

Example

  If OpenWindow(0, 0, 0, 320, 250, "FrameGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    FrameGadget(0, 10,  10, 300, 50, "FrameGadget Standard")
    FrameGadget(1, 10,  70, 300, 50, "", #PB_Frame_Single)
    FrameGadget(2, 10, 130, 300, 50, "", #PB_Frame_Double)
    FrameGadget(3, 10, 190, 300, 50, "", #PB_Frame_Flat)

    Repeat
    Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf

See Also

GetGadgetText(), SetGadgetText(), ContainerGadget()

Supported OS

All

<- ExplorerTreeGadget() - Gadget Index - FreeGadget() ->