TIP #286 Version 1.2: Add 'xposition' Command to Menu Widgets

This is not necessarily the current version of this TIP.


TIP:286
Title:Add 'xposition' Command to Menu Widgets
Version:$Revision: 1.2 $
Author:Schelte Bron <sbron at wanadoo dot nl>
State:Draft
Type:Project
Tcl-Version:8.5
Vote:In progress
Created:Wednesday, 18 October 2006
Keywords:Tk

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. [1]

Copyright

This document has been placed in the public domain.


Powered by TclThis is not necessarily the current version of this TIP.

TIP AutoGenerator - written by Donal K. Fellows