MAN page from Old RedHat 5.X tk-8.0.2-16.i386.rpm
Tk_CreateWindow
Section: Tk Library Procedures (3)
Updated: 4.2
Index
NAME
Tk_CreateWindow, Tk_CreateWindowFromPath, Tk_DestroyWindow, Tk_MakeWindowExist - create or delete window
SYNOPSIS
#include <tk.h>Tk_WindowTk_CreateWindow(interp, parent, name, topLevScreen)Tk_WindowTk_CreateWindowFromPath(interp, tkwin, pathName, topLevScreen)Tk_DestroyWindow(tkwin)Tk_MakeWindowExist(tkwin)
ARGUMENTS
- Tcl_Interp *interp (out)
Tcl interpreter to use for error reporting. If no error occurs,then *interp isn't modified. - Tk_Window parent (in)
Token for the window that is to serve as the logical parent ofthe new window. - char *name (in)
Name to use for this window. Must be unique among all children ofthe same parent. - char *topLevScreen (in)
Has same format as screenName. If NULL, then new window iscreated as an internal window. If non-NULL, new window is created asa top-level window on screen topLevScreen. If topLevScreenis an empty string (``'') then newwindow is created as top-level window of parent's screen. - Tk_Window tkwin (in)
Token for window. - char *pathName (in)
Name of new window, specified as path name within application(e.g. .a.b.c).
DESCRIPTION
The procedures Tk_CreateWindowand Tk_CreateWindowFromPathare used to create new windows foruse in Tk-based applications. Each of the procedures returns a tokenthat can be used to manipulate the window in other calls to the Tklibrary. If the window couldn't be created successfully, then NULLis returned and interp->result is modified to hold an errormessage.
Tk supports two different kinds of windows: internalwindows and top-level windows.An internal window is an interior window of a Tk application, such as ascrollbar or menu bar or button. A top-level window is one that iscreated as a child of a screen's root window, rather than as aninterior window, but which is logically part of some existing mainwindow. Examples of top-level windows are pop-up menus and dialog boxes.
New windows may be created by callingTk_CreateWindow. If the topLevScreen argument isNULL, then the new window will be an internal window. IftopLevScreen is non-NULL, then the new window will be atop-level window: topLevScreen indicates the name ofa screen and the new window will be created as a child of theroot window of topLevScreen. In either case Tk willconsider the new window to be the logical child of parent:the new window's path name will reflect this fact, options maybe specified for the new window under this assumption, and so on.The only difference is that new X window for a top-level windowwill not be a child of parent's X window. For example, a pull-downmenu's parent would be the button-like window used to invoke it,which would in turn be a child of the menu bar window. A dialog box mighthave the application's main window as its parent.
Tk_CreateWindowFromPath offers an alternate way of specifyingnew windows. In Tk_CreateWindowFromPath the newwindow is specified with a token for any window in the targetapplication (tkwin), plus a path name for the new window.It produces the same effect as Tk_CreateWindow and allowsboth top-level and internal windows to be created, depending onthe value of topLevScreen. In calls to Tk_CreateWindowFromPath,as in calls to Tk_CreateWindow, the parent of the new windowmust exist at the time of the call, but the new window must notalready exist.
The window creation procedures don'tactually issue the command to X to create a window.Instead, they create a local data structure associated withthe window and defer the creation of the X window.The window will actually be created by the first call toTk_MapWindow. Deferred window creation allows variousaspects of the window (such as its size, background color,etc.) to be modified after its creation without incurringany overhead in the X server. When the window is finallymapped all of the window attributes can be set while creatingthe window.
The value returned by a window-creation procedure is not theX token for the window (it can't be, since X hasn't beenasked to create the window yet). Instead, it is a tokenfor Tk's local data structure for the window. Mostof the Tk library procedures take Tk_Window tokens, ratherthan X identifiers. The actualX window identifier can be retrieved from the localdata structure using the Tk_WindowId macro; seethe manual entry for Tk_WindowId for details.
Tk_DestroyWindow deletes a window and all the datastructures associated with it, including any event handlerscreated with Tk_CreateEventHandler. In addition,Tk_DestroyWindow will delete any children of tkwinrecursively (where children are defined in the Tk sense, consistingof all windows that were created with the given window as parent).If tkwin was created by Tk_CreateInternalWindow then eventhandlers interested in destroy eventsare invoked immediately. If tkwin is a top-level or main window,then the event handlers will be invoked later, after X has seenthe request and returned an event for it.
If a window has been createdbut hasn't been mapped, so no X window exists, it ispossible to force the creation of the X window bycalling Tk_MakeWindowExist. This procedure issuesthe X commands to instantiate the window given by tkwin.
KEYWORDS
create, deferred creation, destroy, display, internal window,screen, top-level window, window
Index
- NAME
- SYNOPSIS
- ARGUMENTS
- DESCRIPTION
- KEYWORDS
This document was created byman2html,using the manual pages.