A button widget displays a textual label and/or image, and evaluates a command when pressed.
tic_button(
text,
command,
textvariable,
image,
compound,
width,
bind = NULL,
pack = NULL,
...
)Specifies a text string to be displayed inside the widget.
textSimple character string containing the name
textvariableReactive variable containing a string
Function to evaluate when the widget is invoked.
pathname of image to display
Specifies how to display the image relative to the text,
in the case both text and image are present.
Possible values:
textDisplay text only
imageDisplay image only
top,bottom,left,right,centerDisplay image with this position relative to the text
noneDisplay the image if present, otherwise the text
If greater than zero, specifies how much space, in character widths, to allocate for the text label. If less than zero, specifies a minimum width. If zero or unspecified, the natural width of the text label is used.
bind commands to particular events on this element. This may be
a single result of bind_opts() or a list of them for multiple
events.
a named list of pack options for how to incorporate this element into its
parent container. Default: NULL means to use the standard packing.
See pack_opts() as a way of creating a valid list of pack options.
Other arguments are parsed as follows:
named argumentsFurther options to be used during the creation of this widget. See the tcl/tk documentation for all arguments possible for this widget.
unnamed argumentsContainer widgets (e.g. tic_frame()) treat any
unnamed arguments as child objects. Non-container widgets
(e.g tic_button()) will
raise an error if there are any unnamed widgets.
A tic_spec object containing the widget specification.
See tcl/tk documentation for more information on this element https://www.tcl.tk/man/tcl8.6/TkCmd/ttk_button.htm
Other widgets:
tic_canvas(),
tic_checkbutton(),
tic_combobox(),
tic_label(),
tic_menubutton(),
tic_menuitem(),
tic_menu(),
tic_progressbar(),
tic_radiobutton(),
tic_separator(),
tic_sizegrip(),
tic_slider(),
tic_spinbox(),
tic_submenu(),
tic_textbox(),
tic_textentry()
if (FALSE) {
tic_window(
title = "Hello",
tic_button(text = "Button", command = function() { message("Button clicked") })
)
}