An Overview of the Tk C Library

Main Programs and Command-Line Arguments

The Tk_Main procedure does the standard setup for your application's main window and event loop. The Tk_ParseArgv procedure parses command-line arguments. This procedure is designed for use by main programs. It uses a table of Tk_ArgvInfo records to describe your program's arguments. These procedures are illustrated by Example 44-14 on page 632.

If your extension uses the Tk library, you should link against the Tk stub library. In this case, you must call Tk_InitStubs in your extension's initialization routine.

Creating Windows

The Tk_Init procedure creates the main window for your application. It is described in the TkInit man page. The Tk_CreateWindow and Tk_CreateWindowFromPath ...

Get Practical Programming in Tcl & Tk, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.