I have a Problem using a dynamic popup menu in combination with a child window: Here is a simple testprogram:
module mod_test
integer(kind=7) :: ihpopup
integer :: iw, winio@
integer :: icnt = 0
character(len=10) :: menu_item
end module mod_test
winapp
!=======================================================================
program testmain
!=======================================================================
use mod_test
external cb_show, add_item
integer :: ihandle_childwindow
! child window
iwin = winio@ ('%ww[naked]&')
iwin = winio@ ('%^bt[Show Item]&', cb_show)
iwin = winio@ ('%pm[*]&',ihpopup)
iwin = winio@ ('%sc&',add_item)
iwin = winio@ ('%`lw', ihandle_childwindow)
! main window
iwin = winio@ ('%sy[3d_thin]&')
iwin = winio@ ('%ch&',ihandle_childwindow)
iwin = winio@ ('%dy&',-0.6d0)
iwin = winio@ (' %^10bt[Add Item] %10bt[Close]',add_item)
stop
end
!======================================================================
subroutine run
!======================================================================
use mod_test
iw = winio@ ('%ca@&',menu_item)
iw = winio@ ('%cn%bt[Close]')
return
end subroutine
!======================================================================
integer function cb_show()
!======================================================================
C_EXTERNAL DISPLAY_POPUP_MENU@ '__display_popup_menu'
cb_show = 2
call DISPLAY_POPUP_MENU@
end function
!======================================================================
integer function add_item()
!======================================================================
use mod_test
C_EXTERNAL ADD_MENU_ITEM@ '__add_menu_item' (VAL,INSTRING,REF, &
&REF,REF)
character(LEN=10) :: string
external run_item
add_item = 2
icnt = icnt + 1
write(string,'(a,i2)') 'Item ',icnt
call add_menu_item@(ihpopup,string,1,0,run_item)
end function
!=======================================================================
integer function run_item()
!=======================================================================
use mod_test
character(len=10) :: clearwin_string@
run_item = 2
menu_item = clearwin_string@('CURRENT_MENU_ITEM')
call run
end function
This program runs fine when compiled as 32bit. Compiled as 64bit the program does not respond any longer if the button 'Show Item' is pressed, which calls DISPLAY_POPUP_MENU@ to show the dynamic popup menu.