Manual Pages for UNIX Darwin command on man Tk_Main
MyWebUniversity

Manual Pages for UNIX Darwin command on man Tk_Main

TkMain(3) Tk Library Procedures TkMain(3)

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 creating

and running a wwiisshh-like application.

When it is has finished its own initialization, but before it processes

commands, 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. KKEEYYWWOORRDDSS

application-specific initialization, command-line arguments, main pro-

gram Tk 4.0 TkMain(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™