eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ClickMenuView':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: ClickMenuView


Inheritance:

   Object
   |
   +--GraphicsMedium
      |
      +--DisplaySurface
         |
         +--SimpleView
            |
            +--View
               |
               +--ListView
                  |
                  +--SelectionInListView
                     |
                     +--MenuView
                        |
                        +--ClickMenuView

Package:
stx:libwidg
Category:
Views-Menus
Version:
rev: 1.13 date: 1996/05/25 12:22:42
user: cg
file: ClickMenuView.st directory: libwidg
module: stx stc-classLibrary: libwidg
Author:
Claus Gittinger

Description:


ClickMenuViews are like menuViews, but deselects automatically
after clicked on an entry.

ClickMenuViews can be used as persistent menus (i.e. non-popping); 
for example, the old launcher uses an instance of ClickMenuView.

CAVEAT:
    to support a better NextStep look, some popUpMenus should 
    become automatically a clickMenu ... (really ?)


Related information:

    PopUpMenu
    PullDownMenu
    MenuView

Instance protocol:

event handling
o  buttonRelease: button x: x y: y
redefined to automatically deselect on release


Examples:


stupid example:
    |top menu1 menu2 application|

    application := Plug new.
    application respondTo:#foo
                     with:[Transcript showCR:'foo'].
    application respondTo:#bar 
                     with:[Transcript showCR:'bar'].
    application respondTo:#baz 
                     with:[Transcript showCR:'baz'].
    application respondTo:#more1 
                     with:[Transcript showCR:'more1'].
    application respondTo:#more2 
                     with:[Transcript showCR:'more2'].
    application respondTo:#more3 
                     with:[Transcript showCR:'more3'].
    application respondTo:#quit 
                     with:[top destroy].

    top := StandardSystemView new.
    menu1 := ClickMenuView 
                labels:#(
                         'foo'
                         'bar'
                         'baz '
                         '-'
                         'more foo'
                         '='
                         'quit'
                        )
                selectors:#(
                        foo
                        bar
                        baz
                        nil
                        moreFoo
                        nil
                        quit
                       )
                receiver:application.

    menu1 subMenuAt:#moreFoo put:(
        PopUpMenu labels:#(
                            'more1 '
                            'more2 '
                            'more3'
                           )
               selectors:#(
                            more1
                            more2
                            more3
                           )
    ).
    menu1 resize; open.
    top add:menu1.
    top openWithExtent:(menu1 extent).


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 19 Apr 2024 08:48:42 GMT