soccer jersey forums.silverfrost.com :: View topic - %mn items become unresposive
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

%mn items become unresposive

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
Kenneth_Smith



Joined: 18 May 2012
Posts: 697
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Mon Aug 14, 2023 4:37 pm    Post subject: %mn items become unresposive Reply with quote

The following code has been puzzling me for a few days.

In the program below, a file is initially written. There are four lines each containing four random numbers.

After this a simple plot is generated using %pl. There is a call back function attached to the %pl.

If the call back reason is �plot_adjust�, set_plot_mode is called with argument (1) and the call back reads the data in the file, treating each of the four numbers in each line as two pairs of (x,y,) coordinates. A line is drawn between the two pairs of points using draw_line_betweenD@

A DO loop is used to read the file. Since the number of lines in the file is unknown, IOSTAT is used in the read statement to detect the EOF condition, which exits the DO loop. At this point, set_plot_mode@(0) is called.

The resulting graphic plot is as expected. However, with the 64 bit compiler the %mn items become unresponsive after the plot is updated by the call back function. This does not occur with the 32 bit compiler.

Can anyone else reproduce this, or identify what I am doing wrong here?

Code:
  program demo
  use clrwin
  implicit none
  integer iw, i,j
  real*8 cord(4)
  integer pl_cb ; external pl_cb
  integer another_cb ; external another_cb
  open(unit=10,file='cord.txt',status='unknown')
! Write four lines each containing four random numbers to the file cord.txt
  do i = 1, 4
    call random_number(cord)
    write(10,*) (cord(j),j=1,4)
  end do
! Create a simple pl plot
  iw = winio@('%mn[Exit]&','Exit')
  iw = winio@('%mn[Do something]&',another_cb)
  call winop@('%pl[native,x_array,frame,gridlines]')
  call winop@('%pl[link=user,dx=0.1,dy=0.1]')
  iw = winio@('%^pl&',500,500,2,[0.d0,1.d0],[0.d0,1.d0],pl_cb)
  iw = winio@('')
  end program demo

  integer function pl_cb()
  use clrwin
  implicit none
  real*8 x1,y1,x2,y2
  integer stat
    print*, 'Beginning pl_cb'
    if (CLEARWIN_STRING@('CALLBACK_REASON') .eq. 'PLOT_ADJUST') then
      print*, 'Plot_adjust'
      call SET_PLOT_MODE@(1)
!     Read each line of file on unit 10, treating the values as two sets of (x,y) pairs
!     Since we don't necessarily know the number of lines in the file exit the do loop using
!     IOSTAT value     
      rewind 10
      do
        read(10,*,IOSTAT=stat) x1,y1,x2,y2
        if (stat .eq. 0) then
           call draw_line_betweenD@(x1,y1,x2,y2,rgb@(255,0,0))
           write(*,'(A,2F8.4,A,2F8.4)') 'Line between ', x1, y1, ' and ', x2, y2
        else if (stat .eq. -1) then
           print*, 'EOF' ; exit
        else if (stat .eq. -2) then
           print*, 'EOR' ; exit
        end if
      end do
      print*, 'Loop terminated'
      call SET_PLOT_MODE@(0)
    end if
    pl_cb = 2
  end function pl_cb

  integer function another_cb()
    print*, 'another_cb'
    another_cb = 2
  end function another_cb
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7942
Location: Salford, UK

PostPosted: Tue Aug 15, 2023 7:00 am    Post subject: Reply with quote

Ken

Here is what I get in the DOS box which I think means that it runs OK for me (64 bits).
I am using the latest clearwin64.dll which is available in the Sticky Post.

Code:
 Beginning pl_cb
 Beginning pl_cb
 Plot_adjust
Line between   0.6731  0.1475 and   0.3442  0.7364
Line between   0.6145  0.0055 and   0.5421  0.4351
Line between   0.2655  0.1596 and   0.3860  0.8333
Line between   0.8738  0.8252 and   0.9301  0.6753
 EOF
 Loop terminated

p.s. I am using Windows 11
 another_cb
 another_cb
 another_cb
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



Joined: 18 May 2012
Posts: 697
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Tue Aug 15, 2023 11:17 am    Post subject: Reply with quote

Thanks Paul,

I had not noticed the 1st August update for 64 bit.

For the 64 bit compiler, the %mn items become unresponsive with the 28th June DLLs.

With the 1st August �Alternative� Clearwin 64 dlls, this does not occur.

I have tested this under both Windows 10 and 11.

So it looks like the problem has been fixed in the latest �beta� 64 bit DLLs.

Ken
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group