# GuiInterface.setWidgetState

Sets the state of a widget

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
guiInterface:setWidgetState( widgetName, state )
```

[Open the full Game reference](../Game-Script-Environment/Userdata/GuiInterface.md#setwidgetstate)

**Availability:** Client only

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `gui` | [GuiInterface](../Game-Script-Environment/Userdata/GuiInterface.md) | The Gui interface |
| `widgetName` | string | The name of the widget |
| `state` | integer | The widget state [sm.gui.widgetStates](../Game-Script-Environment/Static-Functions/sm.gui.md#widgetstates) |
