| 1 |
578 |
markom |
'\"
|
| 2 |
|
|
'\" Copyright (c) 1990 The Regents of the University of California.
|
| 3 |
|
|
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
| 4 |
|
|
'\"
|
| 5 |
|
|
'\" See the file "license.terms" for information on usage and redistribution
|
| 6 |
|
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 7 |
|
|
'\"
|
| 8 |
|
|
'\" RCS: @(#) $Id: SetClass.3,v 1.1.1.1 2002-01-16 10:25:48 markom Exp $
|
| 9 |
|
|
'\"
|
| 10 |
|
|
.so man.macros
|
| 11 |
|
|
.TH Tk_SetClass 3 "" Tk "Tk Library Procedures"
|
| 12 |
|
|
.BS
|
| 13 |
|
|
.SH NAME
|
| 14 |
|
|
Tk_SetClass, Tk_Class \- set or retrieve a window's class
|
| 15 |
|
|
.SH SYNOPSIS
|
| 16 |
|
|
.nf
|
| 17 |
|
|
\fB#include \fR
|
| 18 |
|
|
.sp
|
| 19 |
|
|
\fBTk_SetClass\fR(\fItkwin, class\fR)
|
| 20 |
|
|
.sp
|
| 21 |
|
|
Tk_Uid
|
| 22 |
|
|
\fBTk_Class\fR(\fItkwin\fR)
|
| 23 |
|
|
.SH ARGUMENTS
|
| 24 |
|
|
.AS Tk_Window parent
|
| 25 |
|
|
.AP Tk_Window tkwin in
|
| 26 |
|
|
Token for window.
|
| 27 |
|
|
.AP char *class in
|
| 28 |
|
|
New class name for window.
|
| 29 |
|
|
.BE
|
| 30 |
|
|
|
| 31 |
|
|
.SH DESCRIPTION
|
| 32 |
|
|
.PP
|
| 33 |
|
|
\fBTk_SetClass\fR is called to associate a class with a particular
|
| 34 |
|
|
window. The \fIclass\fR string identifies the type of the
|
| 35 |
|
|
window; all windows with the same general class of behavior
|
| 36 |
|
|
(button, menu, etc.) should have the same class. By
|
| 37 |
|
|
convention all class names start with a capital letter, and
|
| 38 |
|
|
there exists a Tcl command with the same name as
|
| 39 |
|
|
each class (except all in lower-case) which can be used to
|
| 40 |
|
|
create and manipulate windows of that class.
|
| 41 |
|
|
A window's class string is initialized to NULL
|
| 42 |
|
|
when the window is created.
|
| 43 |
|
|
.PP
|
| 44 |
|
|
For main windows, Tk automatically propagates the name and class
|
| 45 |
|
|
to the WM_CLASS property used by window managers. This happens
|
| 46 |
|
|
either when a main window is actually created (e.g. in
|
| 47 |
|
|
\fBTk_MakeWindowExist\fR), or when \fBTk_SetClass\fR
|
| 48 |
|
|
is called, whichever occurs later. If a main window has not been
|
| 49 |
|
|
assigned a class then Tk will not set the WM_CLASS property for
|
| 50 |
|
|
the window.
|
| 51 |
|
|
.PP
|
| 52 |
|
|
\fBTk_Class\fR is a macro that returns the
|
| 53 |
|
|
current value of \fItkwin\fR's class. The value is returned
|
| 54 |
|
|
as a Tk_Uid, which may be used just like a string pointer but also has
|
| 55 |
|
|
the properties of a unique identifier (see the manual entry for
|
| 56 |
|
|
\fBTk_GetUid\fR for details).
|
| 57 |
|
|
If \fItkwin\fR has not yet been given a class, then
|
| 58 |
|
|
\fBTk_Class\fR will return NULL.
|
| 59 |
|
|
|
| 60 |
|
|
.SH KEYWORDS
|
| 61 |
|
|
class, unique identifier, window, window manager
|