Silverfrost Forums

Welcome to our forums

%dl and %th combined in same window

19 Dec 2020 3:56 #26803

The following code demonstrates an unexpected problem I came across yesterday when adding %th help messages to a window that also has a %dl timer.

If the same window uses %th and %dl, when the user places (and keeps) the mouse over the control with the %th, the displayed help will appear and then disappear at the next instant the %dl call back is run.

I wonder if the %dl call back should be inhibited internally by Clearwin+ when %th is displaying a help message? Reason - the program is not idle (i.e. awaiting input) since it is displaying a help message.

Ken

module test
implicit none
integer :: k = 1

contains

  integer function increment_cb()
    k = k + 1
    increment_cb = 1
  end function increment_cb

  integer function gui2()
  integer, save :: iw
    iw = winio@('%mn[Exit]&','exit')
    iw = winio@('%th[delay]&', 1, 500)
    iw = winio@('Value of K%ta%`8rd%ta%^?bt[INC][Add 1 to K]&', k, increment_cb)
    iw = winio@('%dl',5.d0,do_something_cb)
    gui2 = 2
  end function gui2

  integer function do_something_cb()
    print*, '%dl call back'
    do_something_cb = 2
  end function do_something_cb

end module test

program main
use test
i = gui2()
end program main
19 Dec 2020 10:02 #26804

This is an interesting problem.

I wonder if, because of the %dl callback, the underlying window would have a 'FOCUS_LOST' event occur? That would explain the help text disappearing.

20 Dec 2020 10:57 #26806

I will take a look at this.

The quick fix is to add %th[ms_style].

20 Dec 2020 11:22 #26807

Paul,

No need to looked at this, I missed the [no_callback_hide] option when reading the documentation.

Ken

Please login to reply.