HideGadget()

Syntax

HideGadget(#Gadget, State)
Description
Hide or show a gadget.

Parameters

#Gadget The gadget to use.
State The new state of the gadget. If State = 1, the gadget will be hidden, if State = 0 it will be shown.

Return value

None.

Example

  Procedure HideEvent()
    Static Visible = #True
    
    If Visible = #True     ; ButtonGadget is displayed
      HideGadget(0, 1)    ; => hide it
      Visible = #False
      SetGadgetText(1, "Show Button 1")
    Else                  ; ButtonGadget is hidden
      HideGadget(0, 0)    ; => show it
      Visible = #True
      SetGadgetText(1, "Hide Button 1")
    EndIf
    
  EndProcedure
  
  If OpenWindow(0, 0, 0, 180, 120, "HideGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ButtonGadget(0, 10, 10, 160, 50, "Button 1")       : button = #True   ; Button is displayed
    ButtonGadget(1, 10, 80, 160, 30, "Hide Button 1")
    
    BindGadgetEvent(1, @HideEvent())
  EndIf

See Also

DisableGadget()

Supported OS

All

<- GetGadgetText() - Gadget Index - HyperLinkGadget() ->