Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
cdk_menu(3)			 Library calls			   cdk_menu(3)

NAME
       cdk_menu	- Cdk menu widget

SYNOPSIS
       cc [ flag ... ] file ...	 -lcdk [ library ... ]

       #include	<cdk.h>

       int activateCDKMenu (
		      CDKMENU *menu,
		      chtype * actions);

       void destroyCDKMenu (
		      CDKMENU *menu);

       void drawCDKMenu	(
		      CDKMENU *menu,
		      boolean box);

       void drawCDKMenuSubwin (
		      CDKMENU *menu);

       void eraseCDKMenu (
		      CDKMENU *menu);

       void eraseCDKMenuSubwin (
		      CDKMENU *menu);

       void getCDKMenuCurrentItem (
		      CDKMENU *menu,
		      int *menuItem,
		      int *submenuItem);

       chtype getCDKMenuSubTitleHighlight (
		      CDKMENU *menu);

       chtype getCDKMenuTitleHighlight (
		      CDKMENU *menu);

       int injectCDKMenu (
		      CDKMENU *menu,
		      chtype input);

       CDKMENU *newCDKMenu (
		      CDKSCREEN	*cdkscreen,
		      const char *menulist[MAX_MENU_ITEMS][MAX_SUB_ITEMS],
		      int menuListLength,
		      int *submenuListLength,
		      int *menuLocation,
		      int menuPos,
		      chtype titleAttribute,
		      chtype subtitleAttribute);

       void setCDKMenu (
		      CDKMENU *menu,
		      int menuItem,
		      int submenuItem,
		      chtype titleAttribute,
		      chtype subtitleAttribute);

       void setCDKMenuBackgroundAttrib (
		      CDKMENU *menu,
		      chtype attribute);

       void setCDKMenuBackgroundColor (
		      CDKMENU *menu,
		      const char * color);

       void setCDKMenuCurrentItem (
		      CDKMENU *menu,
		      int menuItem,
		      int submenuItem);

       void setCDKMenuPostProcess (
		      CDKMENU *menu,
		      PROCESSFN	callback,
		      void * data);

       void setCDKMenuPreProcess (
		      CDKMENU *menu,
		      PROCESSFN	callback,
		      void * data);

       void setCDKMenuSubTitleHighlight	(
		      CDKMENU *menu,
		      chtype highlight);

       void setCDKMenuTitleHighlight (
		      CDKMENU *menu,
		      chtype highlight);

DESCRIPTION
       The  Cdk	 menu widget creates a pull-down menu list.  The following are
       functions which create or manipulate the	Cdk menu widget.

AVAILABLE FUNCTIONS
       activateCDKMenu
	    activates the menu widget and lets the user	interact with the wid-
	    get.

	    	The parameter menu is a	pointer	to a non-NULL menu widget.

	    	If the actions parameter is passed with	a non-NULL value,  the
		characters in the array	will be	injected into the widget.

		To  activate  the  widget interactively	pass in	a NULL pointer
		for actions.

	    If the character entered into this widget is RETURN	then this then
	    this function returns an integer which is a	value of  the  current
	    menu  list * 100 + the sub-menu number.  It	will also set the wid-
	    get	data exitType to vNORMAL.

	    If the character entered into this widget was ESCAPE then the wid-
	    get	will return a value of -1 and the widget data exitType will be
	    set	to vESCAPE_HIT.

       destroyCDKMenu
	    removes the	widget from the	screen and  frees  memory  the	object
	    used.

       drawCDKMenu
	    draws the menu widget on the screen.

	    If the box parameter is true, the widget is	drawn with a box.

       drawCDKMenuSubwin
	    draws the menu item	subwindow.

       eraseCDKMenu
	    removes  the  widget  from	the screen.  This does NOT destroy the
	    widget.

       eraseCDKMenuSubwin
	    erases the menu item subwindow.

       getCDKMenuCurrentItem
	    returns the	values menuItem	and submenuItem	to  the	 current  menu
	    selection.

       getCDKMenuSubTitleHighlight
	    returns the	highlight attribute of the sub-menu selection bar.

       getCDKMenuTitleHighlight
	    returns the	highlight attributes of	the menu title.

       injectCDKMenu
	    injects a single character into the	widget.

	    	The parameter menu is a	pointer	to a non-NULL menu widget.

	    	The  parameter	character  is the character to inject into the
		widget.

	    The	return value and side-effect (setting the  widget  data	 exit-
	    Type) depend upon the injected character:

	    RETURN or TAB
		   the function	returns	the current menu list *	100 + the sub-
		   menu	number.	 The widget data exitType is set to vNORMAL.

	    ESCAPE the	function returns -1.  to vESCAPE_HIT.  The widget data
		   exitType is set to vESCAPE_HIT.

	    Otherwise
		   unless modified by  preprocessing,  postprocessing  or  key
		   bindings,  the  function returns -1.	 The widget data exit-
		   Type	is set to vEARLY_EXIT.

       newCDKMenu
	    creates a menu widget and returns a	pointer	to it.	Parameters:

	    screen
		 is the	screen you wish	this widget to be placed in.

	    menuList
		 is a list of the menu list titles.

	    menuListLength
		 is the	number of pull down menus.

	    submenuListLength
		 is the	number of menu items under each	menu list.

	    menuLocation
		 tells where each menu is to be	 located.   Valid  values  are
		 LEFT and RIGHT.

	    menuPos
		 tells	whether	 the menu is to	be on the top of the screen or
		 the bottom.  Valid values are TOP and BOTTOM.

	    titleAttribute and

	    subtitleAttribute
		 are the character attributes of the title and sub-titles  re-
		 spectively.

	    If	the  widget  could  not	 be created then a NULL	pointer	is re-
	    turned.

       setCDKMenu
	    lets the programmer	modify certain elements	of  an	existing  menu
	    widget.

	    	The  parameters	 menuItem  and submenuItem set which menu list
		and sub-menu item are going to be highlighted when the	widget
		is activated.

	    	The  other  parameter  names  correspond to the	same parameter
		names listed in	the newCDKMenu function.

       setCDKMenuBackgroundAttrib
	    sets the background	attribute of the widget.

	    The	parameter attribute is a curses	attribute, e.g., A_BOLD.

       setCDKMenuBackgroundColor
	    sets the background	color of the widget.

	    The	parameter color	is in the format of the	Cdk format strings.

	    See	cdk_display (3).

       setCDKMenuCurrentItem
	    sets the current item in the menu widget.

       setCDKMenuPostProcess
	    allows the user to have the	widget call a function after  the  key
	    has	been applied to	the widget.

	    	The parameter function is the callback function.

	    	The parameter data points to data passed to the	callback func-
		tion.

	    To learn more about	post-processing	see cdk_process(3).

       setCDKMenuPreProcess
	    allows  the	user to	have the widget	call a function	after a	key is
	    hit	and before the key is applied to the widget.

	    	The parameter function is the callback function.

	    	The parameter data points to data passed to the	callback func-
		tion.

	    To learn more about	pre-processing see cdk_process(3).

       setCDKMenuSubTitleHighlight
	    sets the highlight attribute of the	sub-menu selection bar.

       setCDKMenuTitleHighlight
	    sets the highlight attributes of the menu title.

KEY BINDINGS
       When the	widget is activated there are  several	default	 key  bindings
       which  will  help the user enter	or manipulate the information quickly.
       The following table outlines the	keys and their actions for  this  wid-
       get.

	     +-----------------+-------------------------------------+
	     | Key	       | Action				     |
	     +-----------------+-------------------------------------+
	     | Left Arrow      | Highlights  the  menu	list  to the |
	     |		       | left of the current menu.	     |
	     +-----------------+-------------------------------------+
	     | Right Arrow     | Highlights the	 menu  list  to	 the |
	     |		       | right of the current menu.	     |
	     +-----------------+-------------------------------------+
	     | Up Arrow	       | Moves the current menu	selection up |
	     |		       | one.				     |
	     +-----------------+-------------------------------------+
	     | Down Arrow      | Moves	the  current  menu selection |
	     |		       | down one.			     |
	     +-----------------+-------------------------------------+
	     | Space	       | Moves the  current  menu  selection |
	     |		       | down one.			     |
	     +-----------------+-------------------------------------+
	     | Tab	       | Highlights  the  menu	list  to the |
	     |		       | right of the current menu.	     |
	     +-----------------+-------------------------------------+
	     | Return	       | Exits the widget  and	returns	 the |
	     |		       | index	of  the	selected item.	This |
	     |		       | also sets the widget data  exitType |
	     |		       | to vNORMAL.			     |
	     +-----------------+-------------------------------------+
	     | Escape	       | Exits	the  widget  and returns -1. |
	     |		       | This  also  sets  the	widget	data |
	     |		       | exitType to vESCAPE_HIT.	     |
	     +-----------------+-------------------------------------+
	     | Ctrl-L	       | Refreshes the screen.		     |
	     +-----------------+-------------------------------------+

SEE ALSO
       cdk(3), cdk_binding(3), cdk_display(3), cdk_screen(3)

				  2025-01-14			   cdk_menu(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=newCDKMenu&sektion=3&manpath=FreeBSD+Ports+15.0>

home | help