Seth Woolley's Man Viewer

Tk_GetVisual(3) - Tk_GetVisual - translate from string to visual - man 3 Tk_GetVisual

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

Tk_GetVisual(3)              Tk Library Procedures             Tk_GetVisual(3)



______________________________________________________________________________

NAME
       Tk_GetVisual - translate from string(3,n) to visual

SYNOPSIS
       #include <tk.h>

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

ARGUMENTS
       Tcl_Interp   *interp        (in(1,8))      Interpreter   to  use  for  error(8,n)
                                             reporting.

       Tk_Window    tkwin          (in(1,8))      Token for  window  in(1,8)  which  the
                                             visual will be used.

       CONST char   *string(3,n)        (in(1,8))      String    that   identifies   the
                                             desired visual.   See  below  for
                                             valid formats.

       int          *depthPtr      (out)     Depth  of  returned  visual  gets(3,n)
                                             stored here.

       Colormap     *colormapPtr   (out)     If non-NULL then a suitable  col-
                                             ormap for visual is found and its
                                             identifier is stored here.
_________________________________________________________________


DESCRIPTION
       Tk_GetVisual takes a string(3,n) description of a visual and finds  a  suit-
       able  X Visual for use in(1,8) tkwin, if(3,n) 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(3,n) is unrecognizable or if(3,n) no
       suitable visual could be found, then NULL is returned and  Tk_GetVisual
       leaves  an  error(8,n)  message  in(1,8) 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(3,n) argument specifies the desired visual in(1,8) one of the follow-
       ing ways:

       class depth    The string(3,n) consists of a class name followed by an inte-
                      ger  depth,  with  any  amount of white space (including
                      none) in(1,8) between.  class selects what sort(1,3) of visual  is
                      desired  and  must  be  one  of  directcolor, grayscale,
                      greyscale, pseudocolor, staticcolor, staticgray, static-
                      grey,  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(3,n) there is no visual  of  the  desired
                      depth  then  Tk_GetVisual  looks first for a visual with
                      greater depth, then one with less(1,3) depth.

       default        Use the default visual for tkwin's screen.

       pathName       Use the visual for the window given by pathName.   path-
                      Name  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(1,8)  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 lit-
                      tle extra as possible), followed by a visual  with  less(1,3)
                      depth than requested (but as great a depth as possible);
                      (b) if(3,n) no depth is specified, then the deepest available
                      visual  is  chosen; (c) pseudocolor is better than true-
                      color 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



Tk                                    4.0                      Tk_GetVisual(3)

References for this manual (incoming links)