TIP #286: ADD 'XPOSITION' COMMAND TO MENU WIDGETS =================================================== Version: $Revision: 1.4 $ Author: Schelte Bron State: Final Type: Project Tcl-Version: 8.5 Vote: Done Created: Wednesday, 18 October 2006 URL: https://tip.tcl-lang.org286.html Post-History: ------------------------------------------------------------------------- ABSTRACT ========== There has been a *yposition* subcommand for menu widgets for years, but its counterpart in the x-direction does not currently exist. This TIP intends to rectify that situation. RATIONALE =========== There is currently no way to obtain the x-position of a menu entry while a *menu* subcommand for obtaining the y-position does exist. Even though on a normal menu the x-position will always be 1, there are a few circumstances where the x-position may have some more interesting values. In particular, this is the case for menubars and for menus with column-breaks. PROPOSED NEW COMMAND ====================== This TIP proposes a new subcommand for *menu* widgets, *xposition*, with the following syntax: /pathName/ *xposition* /index/ This returns an integer giving the x-coordinate within (i.e., relative to) the menu window specified by /pathName/ of the leftmost pixel in the entry specified by /index/. The /index/ may take any of the normal forms for identifying a menu entry. REFERENCE IMPLEMENTATION ========================== Submitted to SourceForge as Patch #1152376. [] COPYRIGHT =========== This document has been placed in the public domain. ------------------------------------------------------------------------- TIP AutoGenerator - written by Donal K. Fellows