BBjPopupMenu::setUserData

Description

In BBj 3.01 and higher, this method associates an object with this BBjPopupMenu.

Syntax

Return Value

Method

void

setUserData(Object object)

Parameters

None.

Return Value

None.

Remarks

None.

Example

rem ' BBjPopupMenu::setUserData

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(100,100,200,200,"BBjPopupMenu",$00090003$)
window!.setCallback(window!.ON_CLOSE,"eoj")
button! = window!.addButton(1,50,50,100,25,"Button")
button!.setCallback(button!.ON_BUTTON_PUSH,"event")
PopupMenu! = Button!.addPopupMenu()
Item1! = PopupMenu!.addMenuItem(-201,"Item 1")
Item1!.setCallback(Item1!.ON_POPUP_ITEM_SELECT,"popup")
Item2! = PopupMenu!.addMenuItem(-202,"Item 2")
Item2!.setCallback(Item2!.ON_POPUP_ITEM_SELECT,"popup")
print "getUserData ",PopupMenu!.getUserData()
hashMap! = new java.util.HashMap()
hashMap!.put("username","user")
hashMap!.put("password","xyzzy")
PopupMenu!.setUserData(hashMap!)
print "getUserData ",PopupMenu!.getUserData()
process_events

eoj:
release

event:
    event! = sysgui!.getLastEvent()
    i = msgbox(event!.getControl().getText(),0,event!.getEventName())
return

popup:
    event! = sysgui!.getLastEvent()
    i = msgbox(event!.getMenuItem().getText(),0,event!.getEventName())
return

See Also

BBjAPI

BBjWindow Methods

Object Variables

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.