Go to main content

man pages section 1: User Commands

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

tk_popup (1t)

Name

tk_popup - Post a popup menu

Synopsis

tk_popup menu x y ?entry?

Description

tk_popup(1t)                 Tk Built-In Commands                 tk_popup(1t)



______________________________________________________________________________

NAME
       tk_popup - Post a popup menu

SYNOPSIS
       tk_popup menu x y ?entry?
______________________________________________________________________________

DESCRIPTION
       This  procedure posts a menu at a given position on the screen and con-
       figures Tk so that the menu and its cascaded children can be  traversed
       with  the mouse or the keyboard.  Menu is the name of a menu widget and
       x and y are the root coordinates at which  to  display  the  menu.   If
       entry  is  omitted  or an empty string, the menu's upper left corner is
       positioned at the given point.  Otherwise entry gives the index  of  an
       entry  in  menu  and  the  menu will be positioned so that the entry is
       positioned over the given point.

EXAMPLE
       How to attach a simple popup menu to a widget.
              # Create a menu
              set m [menu .popupMenu]
              $m add command -label "Example 1" -command bell
              $m add command -label "Example 2" -command bell

              # Create something to attach it to
              pack [label .l -text "Click me!"]

              # Arrange for the menu to pop up when the label is clicked
              bind .l <1> {tk_popup .popupMenu %X %Y}


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       +---------------+------------------+
       |ATTRIBUTE TYPE | ATTRIBUTE VALUE  |
       +---------------+------------------+
       |Availability   | runtime/tk-8     |
       +---------------+------------------+
       |Stability      | Uncommitted      |
       +---------------+------------------+

SEE ALSO
       bind(n), menu(n), tk_optionMenu(n)

KEYWORDS
       menu, popup



NOTES
       Source code for open source software components in Oracle  Solaris  can
       be found at https://www.oracle.com/downloads/opensource/solaris-source-
       code-downloads.html.

       This    software    was    built    from    source     available     at
       https://github.com/oracle/solaris-userland.    The  original  community
       source        was        downloaded        from         https://source-
       forge.net/projects/tcl/files/Tcl/8.6.7/tk8.6.7-src.tar.gz/download.

       Further information about this software can be found on the open source
       community website at https://www.tcl.tk/.



Tk                                    4.0                         tk_popup(1t)