Ken
I think that the trick is probably to call set_graphics_selection@ as in the following sample which is similar to yours.
!FTN95$WINAPP
!------------------------------------------------------------------
module gr7data
character*32 cstat
end module gr7data
!---------------------------------------------------------------
program gr7
use gr7data
integer i,winio@,RGB@
integer,external::gr_func
cstat=' '
i=winio@('%ww&')
i=winio@('%ca[Box Selection]&')
i=winio@('%mn[E&xit]&','EXIT')
i=winio@('%bg&',RGB@(240,240,240))
i=winio@('%ob&')
i=winio@('%^gr[colour=#f0f0f0,box_selection,smooth8]&',300,300,gr_func)
i=winio@('%cb&')
i=winio@('%ff %nl&')
i=winio@('%ob[status]%20st%cb',cstat)
end
!-----------------------------------------------------------
integer function gr_func()
use clrwin
use gr7data
integer x1,y1,x2,y2,nstat,a,b
integer,parameter::MK_SHIFT=4,MK_CONTROL=8,RED=255
call get_mouse_info@(x1,y1,nstat)
write(cstat(1:30),'(3I7)') x1,y1,nstat
call window_update@(cstat)
if(clearwin_string@('CALLBACK_REASON') == 'MOUSE_LEFT_CLICK')then
call set_line_width@(2)
call get_graphics_selected_area@(x1,y1,x2,y2)
call set_graphics_selection@(0)
if(iand(nstat,MK_SHIFT)==MK_SHIFT) then
call draw_rectangle@(x1,y1,x2,y2,RED)
else if(iand(nstat,MK_CONTROL)==MK_CONTROL) then
a=0.5*(x2-x1)
b=0.5*(y2-y1)
call draw_ellipse@(x1+a,y1+b,a,b,RED)
else
call draw_line_between@(x1,y1,x2,y2,RED)
endif
call set_graphics_selection@(1)
endif
gr_func=2
end
!-----------------------------------------------------------