| 1 |
# Copyright (c) 1990 The Regents of the University of California. |
| 2 |
# Copyright (c) 1994-1996 Sun Microsystems, Inc. |
| 3 |
# See the file "license.terms" for information on usage and redistribution |
| 4 |
# of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 5 |
# |
| 6 |
# |
| 7 |
|
| 8 |
=head1 NAME |
| 9 |
|
| 10 |
Tk_SetClass, Tk_Class - set or retrieve a window's class |
| 11 |
|
| 12 |
=for category C Programming |
| 13 |
|
| 14 |
=head1 SYNOPSIS |
| 15 |
|
| 16 |
B<#include E<lt>tk.hE<gt>> |
| 17 |
|
| 18 |
B<Tk_SetClass>(I<tkwin, class>) |
| 19 |
|
| 20 |
Tk_Uid |
| 21 |
B<Tk_Class>(I<tkwin>) |
| 22 |
|
| 23 |
=head1 ARGUMENTS |
| 24 |
|
| 25 |
=over 4 |
| 26 |
|
| 27 |
=item Tk_Window tkwin (in) |
| 28 |
|
| 29 |
Token for window. |
| 30 |
|
| 31 |
=item char *class (in) |
| 32 |
|
| 33 |
New class name for window. |
| 34 |
|
| 35 |
=back |
| 36 |
|
| 37 |
=head1 DESCRIPTION |
| 38 |
|
| 39 |
B<Tk_SetClass> is called to associate a class with a particular |
| 40 |
window. The I<class> string identifies the type of the |
| 41 |
window; all windows with the same general class of behavior |
| 42 |
(button, menu, etc.) should have the same class. By |
| 43 |
convention all class names start with a capital letter, and |
| 44 |
there exists a Tcl command with the same name as |
| 45 |
each class (except all in lower-case) which can be used to |
| 46 |
create and manipulate windows of that class. |
| 47 |
A window's class string is initialized to NULL |
| 48 |
when the window is created. |
| 49 |
|
| 50 |
For main windows, Tk automatically propagates the name and class |
| 51 |
to the WM_CLASS property used by window managers. This happens |
| 52 |
either when a main window is actually created (e.g. in |
| 53 |
B<Tk_MakeWindowExist>), or when B<Tk_SetClass> |
| 54 |
is called, whichever occurs later. If a main window has not been |
| 55 |
assigned a class then Tk will not set the WM_CLASS property for |
| 56 |
the window. |
| 57 |
|
| 58 |
B<Tk_Class> is a macro that returns the |
| 59 |
current value of I<tkwin>'s class. The value is returned |
| 60 |
as a Tk_Uid, which may be used just like a string pointer but also has |
| 61 |
the properties of a unique identifier (see the the documentation for |
| 62 |
B<Tk_GetUid> for details). |
| 63 |
If I<tkwin> has not yet been given a class, then |
| 64 |
B<Tk_Class> will return NULL. |
| 65 |
|
| 66 |
=head1 KEYWORDS |
| 67 |
|
| 68 |
class, unique identifier, window, window manager |