Paul,
A very quick question.
A %pl[native,external] cannot have a callback and consequently plot_mode@ cannot be used with the [external] option.
Is this correct, or am I missing something?
Welcome to our forums
Paul,
A very quick question.
A %pl[native,external] cannot have a callback and consequently plot_mode@ cannot be used with the [external] option.
Is this correct, or am I missing something?
Ken
At the moment you can't have a callback function with %pl[external] but my comment in the ClearWin+ code has 'at least for now'. So at the time I must have thought that a callback might be possible and useful.
A parent %gr (for %pl) could possibly have a callback which could then be used for mouse events (in %pl) particularly when [full_mouse_input] is enabled. But I have not experimented with this.
Paul,
Thanks for confirming that (at present) %pl[native,external,link=user] is not possible.
Ken
Could you explain when it might be useful?
At the moment my thinking is that the callback would have to be attached to the parent %gr and one could do that as things are.
Paul,
The following code is a very simple example to demonstrate using %gr and %pl[external], and to copy the contents of the hidden %pl[external] over to the visible %gr region.
The question of %pl[external,link=user] which requires a %pl callback stems from this example, simply as the next 'improvement'. At which point I saw the error message about this particular %pl not being allowed a callback - one which I don't remember seeing before.
module pl_external1_mod
use clrwin
use mswin
implicit none
integer :: uidgr1=1000, uidgr2=2000, gw=500, gh=500
contains
integer function start()
integer :: i, iw, ilw
real*8 x(20), y(20)
x = [(i,i=1,20)]
y = x*x
iw = winio@('%fn[Tahoma]%ts&',1.5d0)
iw = winio@('%`gr[green]&',500,500,uidgr1)
iw = winio@('%lw',ilw)
call sleep@(5.0)
i = create_graphics_region@(uidgr2,500,500)
if (i .ne. 1) STOP 'create_graphics_region@ failed.'
i = select_graphics_object@(uidgr2)
if (i .ne. 1) STOP 'select_graphics_region@ failed.'
call winop@('%pl[native,x_array,frame,colour=blue,width=3,external]')
iw = winio@('%pl',20,x,y)
iw = copy_graphics_region@(uidgr1, 0, 0, 500, 500, &
uidgr2, 0, 0, 500, 500, srccopy )
i = delete_graphics_region@(uidgr2)
if (i .ne. 1) STOP 'delete_graphics_region@ failed.'
start = 1
end function start
end module pl_external1_mod
program pl_external1
use pl_external1_mod
i = start()
end program pl_external1
Ken
I have made a note to review this issue.
Ken
For the next release I have modified %pl[external] so that it can take a callback function when it is associated with a %gr. If the %gr already has a callback function then it is replaced.
The result is the same as attaching the callback to %gr.
Thanks Paul, I took forward to experimenting with this addition.