Tk_GetVisual



Tk_GetVisual

NAME
SYNOPSIS
ARGUMENTS
DESCRIPTION
CREDITS
KEYWORDS

___________________________

NAME

Tk_GetVisual − translate from string to visual

SYNOPSIS

#include <tk.h>

Visual *
Tk_GetVisual(
interp, tkwin, string, depthPtr, colormapPtr)

ARGUMENTS

Tcl_Interp *interp (in)

Interpreter to use for error reporting.

Tk_Window tkwin (in)

Token for window in which the visual will be used.

const char *string (in)

String that identifies the desired visual. See below for valid formats.

int *depthPtr (out)

Depth of returned visual gets stored here.

Colormap *colormapPtr (out)

If non-NULL then a suitable colormap for visual is found and its identifier is stored here.

______________

DESCRIPTION

Tk_GetVisual takes a string description of a visual and finds a suitable X Visual for use in tkwin, if there is one. It returns a pointer to the X Visual structure for the visual and stores the number of bits per pixel for it at *depthPtr. If string is unrecognizable or if no suitable visual could be found, then NULL is returned and Tk_GetVisual leaves an error message in interp->result. If colormap is non-NULL then Tk_GetVisual also locates an appropriate colormap for use with the result visual and stores its X identifier at *colormapPtr.

The string argument specifies the desired visual in one of the following ways:

class depth

The string consists of a class name followed by an integer depth, with any amount of white space (including none) in between. class selects what sort of visual is desired and must be one of directcolor, grayscale, greyscale, pseudocolor, staticcolor, staticgray, staticgrey, or truecolor, or a unique abbreviation. depth specifies how many bits per pixel are needed for the visual. If possible, Tk_GetVisual will return a visual with this depth; if there is no visual of the desired depth then Tk_GetVisual looks first for a visual with greater depth, then one with less depth.

default

Use the default visual for tkwin’s screen.

pathName

Use the visual for the window given by pathName. pathName must be the name of a window on the same screen as tkwin.

number

Use the visual whose X identifier is number.

best ?depth?

Choose the “best possible” visual, using the following rules, in decreasing order of priority:

(a)

a visual that has exactly the desired depth is best, followed by a visual with greater depth than requested (but as little extra as possible), followed by a visual with less depth than requested (but as great a depth as possible);

(b)

if no depth is specified, then the deepest available visual is chosen;

(c)

pseudocolor is better than truecolor or directcolor, which are better than staticcolor, which is better than staticgray or grayscale;

(d)

the default visual for the screen is better than any other visual.

CREDITS

The idea for Tk_GetVisual, and the first implementation, came from Paul Mackerras.

KEYWORDS

colormap, screen, visual






Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.