PROGRAM JPOPUPMNU!       Example popupmenu.f

! Code converted using TO_F90 by Alan Miller
! Date: 2001-03-15  Time: 12:33:15

USE JAPI 

INTEGER :: frame,menubar,FILE,pop,obj
INTEGER :: choose,CLOSE,quit

IF( .NOT. j_start()) THEN
  PRINT*, "can't connect to JAPI server"
  GO TO 20
END IF

frame   = j_frame("Popup Menu Demo")
menubar = j_menubar(frame)
FILE    = j_menu(menubar,"Do it")
pop     = j_menuitem(FILE,"Popup")

choose  = j_popupmenu(frame,"Choose")
CLOSE   = j_menuitem(choose,"Close")
quit    = j_menuitem(choose,"Quit")

CALL j_show(frame)
NEXTACTION: DO
      obj =  j_nextaction()

IF(obj == quit) EXIT NEXTACTION

IF(obj == pop) CALL j_showpopup(choose,100,100)

END DO NEXTACTION

20  continue
CALL j_quit()
END PROGRAM JPOPUPMNU



