713 "/ The old ST/X mechanism may vanish. |
713 "/ The old ST/X mechanism may vanish. |
714 "/ |
714 "/ |
715 |
715 |
716 menuView action isNil ifTrue:[ |
716 menuView action isNil ifTrue:[ |
717 menuView action:[:menuView :selected | |
717 menuView action:[:menuView :selected | |
718 |actionIndex value sel retVal |
718 |actionIndex value sel retVal selIdx |
719 args selectors checkFlags check| |
719 args selectors checkFlags check| |
720 |
720 |
721 retVal := 0. |
721 retVal := 0. |
|
722 |
|
723 selIdx := menuView selection. |
722 |
724 |
723 args := menuView args. |
725 args := menuView args. |
724 selectors := menuView selectors. |
726 selectors := menuView selectors. |
725 checkFlags := menuView checkFlags. |
727 checkFlags := menuView checkFlags. |
726 |
728 |
727 args isNil ifTrue:[ |
729 args isNil ifTrue:[ |
728 selectors notNil ifTrue:[ |
730 selectors notNil ifTrue:[ |
729 sel0 := selectors at:selected. |
731 sel0 := selectors at:selIdx. |
730 ]. |
732 ]. |
731 ] ifFalse:[ |
733 ] ifFalse:[ |
732 actionIndex := args at:selected. |
734 actionIndex := selected. |
733 actionIndex notNil ifTrue:[ |
735 actionIndex notNil ifTrue:[ |
734 actionValues isNil ifTrue:[ |
736 actionValues isNil ifTrue:[ |
735 selectors notNil ifTrue:[ |
737 selectors notNil ifTrue:[ |
736 "/ mhmh an ST/X menu started the ST-80 way |
738 "/ mhmh an ST/X menu started the ST-80 way |
737 |
739 |
738 sel1 := selectors at:selected. |
740 sel1 := selectors at:selIdx. |
739 arg := actionIndex. |
741 arg := actionIndex. |
740 ] ifFalse:[ |
742 ] ifFalse:[ |
741 retVal := actionIndex |
743 retVal := actionIndex |
742 ] |
744 ] |
743 ] ifFalse:[ |
745 ] ifFalse:[ |
748 ] |
750 ] |
749 ] ifFalse:[ |
751 ] ifFalse:[ |
750 "/ mhmh an ST/X menu started the ST-80 way |
752 "/ mhmh an ST/X menu started the ST-80 way |
751 |
753 |
752 selectors notNil ifTrue:[ |
754 selectors notNil ifTrue:[ |
753 sel0 := selectors at:selected. |
755 sel0 := selectors at:selIdx. |
754 ]. |
756 ]. |
755 ] |
757 ] |
756 ]. |
758 ]. |
757 |
759 |
758 checkFlags notNil ifTrue:[ |
760 checkFlags notNil ifTrue:[ |
759 check := checkFlags at:selected. |
761 check := checkFlags at:selIdx. |
760 check notNil ifTrue:[ |
762 check notNil ifTrue:[ |
761 arg := check. |
763 arg := check. |
762 sel1 := sel0. |
764 sel1 := sel0. |
763 sel0 := nil. |
765 sel0 := nil. |
764 ] |
766 ] |
792 Transcript showCR:(PopUpMenu labels:#('foo' 'bar' 'baz') |
794 Transcript showCR:(PopUpMenu labels:#('foo' 'bar' 'baz') |
793 values:#(foo bar baz)) startUp |
795 values:#(foo bar baz)) startUp |
794 " |
796 " |
795 |
797 |
796 "Created: 10.1.1996 / 20:11:42 / cg" |
798 "Created: 10.1.1996 / 20:11:42 / cg" |
797 "Modified: 25.5.1996 / 16:49:43 / cg" |
799 "Modified: 30.5.1996 / 09:16:57 / cg" |
798 ! |
800 ! |
799 |
801 |
800 startUpWithHeading:aString |
802 startUpWithHeading:aString |
801 "start the menu modal - return the selected value, |
803 "start the menu modal - return the selected value, |
802 or - if no values where specified - return the index. |
804 or - if no values where specified - return the index. |