*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> Vk/VkGetResource (3)              
Title
Content
Arch
Section
 

Contents


VkGetResource(3x)					     VkGetResource(3x)


NAME    [Toc]    [Back]

     VkGetResource - Convenience functions for retrieving resources

HEADER FILE    [Toc]    [Back]

     #include <Vk/VkResource.h>

FUNCTIONS    [Toc]    [Back]

	   char	* VkGetResource(const char *name,
				const  char *className);

	   XtPointer VkGetResource(Widget w,
				   const char *names,
				   const char *classNames,
				   const char *desiredType,
				   const char *defaultValue);

DESCRIPTION    [Toc]    [Back]

	  These	functions provide simple ways to retrieve resources.  The
	  first	form retrieves a resource by name and class name from the
	  application's	resource database relative to the entire application.
	  The second form allows applications to retrieve a a resource
	  relative to a	specific widget. The resource can be specified as a
	  dot-separated	list of	names and classes, allowing "virtual" subresources
 to be retrieved.  The second form also allows a target
	  type to be specified.	 VkGetResource will convert the	retrieved
	  value, (or the default value if no value is retrieved), to the
	  specified type.

EXAMPLES    [Toc]    [Back]

	  Suppose an application wishes	to draw	an image and wishes to allow
	  the user to select various aspects of	the style in which the image
	  is drawn. For	example, each style might include a color and fill
	  pattern (a pixmap) with which	it is drawn.  Each aspect of each
	  style	could be specified as a	resource which could be	retrieved as
	  follows.

	   Widget shell	= XtAppInitialize(/* args */ );

	   Widget canvas = XmCreateDrawingArea(shell, "canvas",
					       NULL, 0);

	   Pixel fgOne = (Pixel) VkGetResource(canvas,
					 "styleOne.foreground",
					 "Style.Foreground",
					 XmRString, "Black");

	   Pixel fgTwo = (Pixel) VkGetResource(canvas,
					 "styleTwo.foreground",
					 "Style.Foreground",
					  XmRString, "Black");




									Page 1






VkGetResource(3x)					     VkGetResource(3x)



	   Pixel fgThree = (Pixel) VkGetResource(canvas,
					  "styleThree.foreground",
					  "Style.Foreground",
					   XmRString, "Black");

	   Pixel bgOne = (Pixel) VkGetResource(canvas,
					  "styleOne.background",
					  "Style.Background",
					   XmRString, "White");

	   Pixel bgTwo = (Pixel) VkGetResource(canvas,
					  "styleTwo.background",
					  "Style.Background",
					  XmRString, "White");

	   Pixel bgThree = (Pixel) VkGetResource(canvas,
					  "styleThree.background",
					  "Style.Background",
					   XmRString, "White");

	   Pixmap pixOne = (Pixmap) VkGetResource(canvas,
				       "styleOne.pixmap",
				       "Style.Pixmap",
				       XmRString, "background");

	   Pixmap pixTwo = (Pixmap) VkGetResource(canvas,
				       "styleTwo.pixmap",
				       "Style.Pixmap",
				       XmRString, "background");

	   Pixmap pixThree = (Pixmap) VkGetResource(canvas,
					   "styleThree.pixmap",
					   "Style.Pixmap",
					   XmRString, "background");

     These calls attempt to load a resource by the complete resource
     specification:

	  shell.canvas.styleOne.foreground

     and so on.	All of the usual wild card uses	apply. Data returned by
     VkGetResource() should not	be freed.

SEE ALSO    [Toc]    [Back]

      
      
     ViewKit Programmer's Guide
     The X Window System, DEC Press, Bob Sheifler and Jim Gettys
     The X Window System Toolkit, DEC Press, Paul Asente and Ralph Swick
     The OSF/Motif Programmers Reference, Prentice Hall, OSF


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
XmRenditionUpdate HP-UX A convenience function that modifies resources
XmRenditionRetrieve HP-UX A convenience function that retrieves rendition resources
proplist Tru64 The storing, parsing, and retrieving of Extended File Attributes
iflDataSize IRIX convenience functions for using IFL data types
VkPixmap IRIX Convenience functions that work with libXpm
iflTypeNames IRIX convenience functions IFL enumerated types to strings
vn_write NetBSD high-level convenience functions for vnode operations
vn_stat NetBSD high-level convenience functions for vnode operations
vn_poll NetBSD high-level convenience functions for vnode operations
vn_read NetBSD high-level convenience functions for vnode operations
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service