OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [start/] [insight/] [tk/] [doc/] [GetClrmap.3] - Diff between revs 579 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 579 Rev 1765
'\"
'\"
'\" Copyright (c) 1994 The Regents of the University of California.
'\" Copyright (c) 1994 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
'\" RCS: @(#) $Id: GetClrmap.3,v 1.1.1.1 2002-01-16 10:25:48 markom Exp $
'\" RCS: @(#) $Id: GetClrmap.3,v 1.1.1.1 2002-01-16 10:25:48 markom Exp $
'\"
'\"
.so man.macros
.so man.macros
.TH Tk_GetColormap 3 4.0 Tk "Tk Library Procedures"
.TH Tk_GetColormap 3 4.0 Tk "Tk Library Procedures"
.BS
.BS
.SH NAME
.SH NAME
Tk_GetColormap, Tk_FreeColormap \- allocate and free colormaps
Tk_GetColormap, Tk_FreeColormap \- allocate and free colormaps
.SH SYNOPSIS
.SH SYNOPSIS
.nf
.nf
\fB#include \fR
\fB#include \fR
.sp
.sp
Colormap
Colormap
\fBTk_GetColormap(\fIinterp, tkwin, string\fB)\fR
\fBTk_GetColormap(\fIinterp, tkwin, string\fB)\fR
.sp
.sp
\fBTk_FreeColormap(\fIdisplay, colormap\fB)\fR
\fBTk_FreeColormap(\fIdisplay, colormap\fB)\fR
.SH ARGUMENTS
.SH ARGUMENTS
.AS "Colormap" colormap
.AS "Colormap" colormap
.AP Tcl_Interp *interp in
.AP Tcl_Interp *interp in
Interpreter to use for error reporting.
Interpreter to use for error reporting.
.AP Tk_Window tkwin in
.AP Tk_Window tkwin in
Token for window in which colormap will be used.
Token for window in which colormap will be used.
.AP char *string in
.AP char *string in
Selects a colormap:  either \fBnew\fR or the name of a window
Selects a colormap:  either \fBnew\fR or the name of a window
with the same screen and visual as \fItkwin\fR.
with the same screen and visual as \fItkwin\fR.
.AP Display *display in
.AP Display *display in
Display for which \fIcolormap\fR was allocated.
Display for which \fIcolormap\fR was allocated.
.AP Colormap colormap in
.AP Colormap colormap in
Colormap to free;  must have been returned by a previous
Colormap to free;  must have been returned by a previous
call to \fBTk_GetColormap\fR or \fBTk_GetVisual\fR.
call to \fBTk_GetColormap\fR or \fBTk_GetVisual\fR.
.BE
.BE
.SH DESCRIPTION
.SH DESCRIPTION
.PP
.PP
These procedures are used to manage colormaps.
These procedures are used to manage colormaps.
\fBTk_GetColormap\fR returns a colormap suitable for use in \fItkwin\fR.
\fBTk_GetColormap\fR returns a colormap suitable for use in \fItkwin\fR.
If its \fIstring\fR argument is \fBnew\fR then a new colormap is
If its \fIstring\fR argument is \fBnew\fR then a new colormap is
created;  otherwise \fIstring\fR must be the name of another window
created;  otherwise \fIstring\fR must be the name of another window
with the same screen and visual as \fItkwin\fR, and the colormap from that
with the same screen and visual as \fItkwin\fR, and the colormap from that
window is returned.
window is returned.
If \fIstring\fR doesn't make sense, or if it refers to a window on
If \fIstring\fR doesn't make sense, or if it refers to a window on
a different screen from \fItkwin\fR or with
a different screen from \fItkwin\fR or with
a different visual than \fItkwin\fR, then \fBTk_GetColormap\fR returns
a different visual than \fItkwin\fR, then \fBTk_GetColormap\fR returns
\fBNone\fR and leaves an error message in \fIinterp->result\fR.
\fBNone\fR and leaves an error message in \fIinterp->result\fR.
.PP
.PP
\fBTk_FreeColormap\fR should be called when a colormap returned by
\fBTk_FreeColormap\fR should be called when a colormap returned by
\fBTk_GetColormap\fR is no longer needed.
\fBTk_GetColormap\fR is no longer needed.
Tk maintains a reference count for each colormap returned by
Tk maintains a reference count for each colormap returned by
\fBTk_GetColormap\fR, so there should eventually be one call to
\fBTk_GetColormap\fR, so there should eventually be one call to
\fBTk_FreeColormap\fR for each call to \fBTk_GetColormap\fR.
\fBTk_FreeColormap\fR for each call to \fBTk_GetColormap\fR.
When a colormap's reference count becomes zero, Tk releases the
When a colormap's reference count becomes zero, Tk releases the
X colormap.
X colormap.
.PP
.PP
\fBTk_GetVisual\fR and \fBTk_GetColormap\fR work together, in that
\fBTk_GetVisual\fR and \fBTk_GetColormap\fR work together, in that
a new colormap created by \fBTk_GetVisual\fR may later be returned
a new colormap created by \fBTk_GetVisual\fR may later be returned
by \fBTk_GetColormap\fR.
by \fBTk_GetColormap\fR.
The reference counting mechanism for colormaps includes both procedures,
The reference counting mechanism for colormaps includes both procedures,
so callers of \fBTk_GetVisual\fR must also call \fBTk_FreeColormap\fR
so callers of \fBTk_GetVisual\fR must also call \fBTk_FreeColormap\fR
to release the colormap.
to release the colormap.
If \fBTk_GetColormap\fR is called with a \fIstring\fR value of
If \fBTk_GetColormap\fR is called with a \fIstring\fR value of
\fBnew\fR then the resulting colormap will never
\fBnew\fR then the resulting colormap will never
be returned by \fBTk_GetVisual\fR;  however, it can be used in other
be returned by \fBTk_GetVisual\fR;  however, it can be used in other
windows by calling \fBTk_GetColormap\fR with the original window's
windows by calling \fBTk_GetColormap\fR with the original window's
name as \fIstring\fR.
name as \fIstring\fR.
.SH KEYWORDS
.SH KEYWORDS
colormap
colormap
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.