NAME
TkMain - main program for Tk-based applications
SYNOPSIS
##iinncclluuddee <
TTkkMMaaiinn(argc, argv, appInitProc) AARRGGUUMMEENNTTSS int argc (in) Number of elements in argv. char *argv[] (in) Array of strings containing> command-line arguments.
TclAppInitProc *appInitProc (in) Address of an application-
specific initialization pro-
cedure. The value for this argument is usually TTccllAAppppIInniitt.DESCRIPTION
TTkkMMaaiinn acts as the main program for most Tk-based applications.
Starting with Tk 4.0 it is not called mmaaiinn anymore because it is part of the Tk library and having a function mmaaiinn in a library (particularly a shared library) causes problems on many systems. Having mmaaiinn in the Tk library would also make it hard to use Tk in C++ programs, since C++ programs must have special C++ mmaaiinn functions. Normally each application contains a small mmaaiinn function that does nothing but invoke TTkkMMaaiinn. TTkkMMaaiinn then does all the work of creatingand running a wwiisshh-like application.
When it is has finished its own initialization, but before it processescommands, TTkkMMaaiinn calls the procedure given by the appInitProc argu-
ment. This procedure provides a ``hook'' for the application to per-
form its own initialization, such as defining application-specific com-
mands. The procedure must have an interface that matches the type TTccllAAppppIInniittPPrroocc: typedef int TclAppInitProc(TclInterp *interp); AppInitProc is almost always a pointer to TTccllAAppppIInniitt; for more details on this procedure, see the documentation for TTccllAAppppIInniitt. KKEEYYWWOORRDDSSapplication-specific initialization, command-line arguments, main pro-
gram Tk 4.0 TkMain(3)