Get or modify the state of Tk widgets.

tk_get_default_enabled_state(obj, ...)

tk_set_default_enabled_state(obj, state, ...)

tk_get_state(obj, ...)

tk_set_state(obj, state, ...)

tk_normalize(obj, ...)

tk_activate(obj, ...)

tk_read_only(obj, ...)

tk_enable(obj, ...)

tk_disable(obj, ...)

# S3 method for default
tk_get_default_enabled_state(obj, ...)

# S3 method for default
tk_get_state(obj, ...)

# S3 method for default
tk_set_default_enabled_state(
  obj,
  state = c("active", "normal", "readonly"),
  ...
)

# S3 method for default
tk_set_state(obj, state, ...)

# S3 method for default
tk_normalize(obj, ...)

# S3 method for default
tk_activate(obj, ...)

# S3 method for default
tk_read_only(obj, ...)

# S3 method for default
tk_disable(obj, ...)

Arguments

obj

Tk widget or a string with the ID of an existing Tk widget (e.g., ".1.2.5").

...

other options to be passed to tcltk::tkconfigure().

state

(character) The state of widget. Usually one of "normal", "active", "diabled", "readonly".

Details

The function to get widget's state:

  • tk_get_state()

The functions to set widget's state to:

  • tk_normalize() to "normal";

  • tk_activate() to "active";

  • tk_read_only() to "readonly";

  • tk_disable() to "disable";

  • tk_enable() to default non-disabled state;

  • tk_set_state() to the indicated state.

The functions to manage widget's state to:

  • tk_get_default_enabled_state() get default default enabled state. If not set, "normal" is returned.

  • tk_set_default_enabled_state() change the default enabled state to either "normal", "active" or "readonly".

See also

Examples

# tk_get_state(obj)
# tk_get_state(".1.2.5")

# tk_disable(obj)
# tk_normalize(obj)
# tk_set_state(obj, "normal")