(interp, menuPtr, mePtr)
| 1976 | * This procedure arranges for a particular submenu (i.e. the |
| 1977 | * menu corresponding to a given cascade entry) to be |
| 1978 | * posted. |
| 1979 | * |
| 1980 | * Results: |
| 1981 | * A standard Tcl return result. Errors may occur in the |
| 1982 | * Tcl commands generated to post and unpost submenus. |
| 1983 | * |
| 1984 | * Side effects: |
| 1985 | * If there is already a submenu posted, it is unposted. |
| 1986 | * The new submenu is then posted. |
| 1987 | * |
| 1988 | *-------------------------------------------------------------- |
| 1989 | */ |
| 1990 | |
| 1991 | static int |
| 1992 | PostSubmenu(interp, menuPtr, mePtr) |
| 1993 | Tcl_Interp *interp; /* Used for invoking sub-commands and |
| 1994 | * reporting errors. */ |
| 1995 | register Menu *menuPtr; /* Information about menu as a whole. */ |
| 1996 | register MenuEntry *mePtr; /* Info about submenu that is to be |
| 1997 | * posted. NULL means make sure that |
| 1998 | * no submenu is posted. */ |
| 1999 | { |
| 2000 | char string[30]; |
| 2001 | int result, x, y; |
| 2002 | |
| 2003 | if (mePtr == menuPtr->postedCascade) { |
| 2004 | return TCL_OK; |
| 2005 | } |
| 2006 | |
| 2007 | if (menuPtr->postedCascade != NULL) { |
| 2008 | result = Tcl_VarEval(interp, menuPtr->postedCascade->name, |
| 2009 | " unpost", (char *) NULL); |
| 2010 | menuPtr->postedCascade = NULL; |
| 2011 | if (result != TCL_OK) { |
| 2012 | return result; |
| 2013 | } |
| 2014 | } |
| 2015 | |
| 2016 | if ((mePtr != NULL) && (mePtr->name != NULL)) { |
| 2017 | Tk_GetRootCoords(menuPtr->tkwin, &x, &y); |
| 2018 | x += Tk_Width(menuPtr->tkwin); |
| 2019 | y += mePtr->y; |
no test coverage detected