# Text labels in Tk windows

Text labels can easily be added to a toplevel window using the tklabel() or ttklable() functions in tcltk, or the tk2label() function in tcltk2. It is not necessary to assign the result of tklabel() to a variable unless you want to change the text later on.

The following code illustrates how the text in a label can be linked to a variable:

Running the R code above gives the following window:

Pressing the “Change text label” button, gives the following window: