R TclTk Examples

The following examples have been compiled by James Wettenhall in Windows to help people to learn how to use the tcltk package in R, contributed by Peter Dalgaard. If you are having trouble installing R TclTk in Windows, click here and also read Brian Ripley's R for Windows FAQ in the Help pull-down menu of RGui. Please follow the final link at the bottom of this page to find some very useful external sources of R TclTk examples and documentation.

Last updated on February 25th, 2004.

Message Boxes
Simple toplevel window with OK button
Simple Non-Modal Dialog with OK and Cancel Buttons and a Window Title
A Modal Dialog Box
Making a button trigger a function call
Adding and changing text labels in a window
Checkboxes
Radio Buttons
Pull-Down Menus and Popup Menus
Fonts
Edit Boxes
List Boxes
Drop-Down Combo Boxes
Text Windows (Editable or Non-Editable)
Scrollbars
Binding Events (e.g. a key-press) to Functions and Generating Events
File Open/Save Dialogs
Displaying Images in Tk Windows
The Color-Selection Widget
Specifying which window is active (focused)
Frames
Sliders
Specifying the Layout
Evaluating R code from a text window (a scripting widget)
Plotting graphs with tkrplot
Interactive graphics with tkrplot
Using the Tk Table widget
Using the Tree (Drill-Down) Widget
The Date Entry and Calendar Widgets
The Tabbed Notebook Widget
The Scrollable Frame
The Wait Cursor and Other Cursors
Exception Handling
Other sources of R TclTk help/examples