View previous topic :: View next topic |
Author |
Message |
simon
Joined: 05 Jul 2006 Posts: 268
|
Posted: Tue Mar 08, 2011 10:36 pm Post subject: %co |
|
|
The following program prompts for an integer, creates a graphics area and then has an OK button. If the user tries to change the integer, and then moves the mouse over the graphics area the integer gets reset to the initial value of 2000. If the check_on_focus_loss line is deleted, then the reset value is retained because the default full_check is used. However, I really want to use check_on_focus_loss because; with %il imposing a lower limit of 1950, it can be annoying trying to type in the integer rather than using the up and down arrows. Removing full_mouse_input from %gr also solves the problem, but I need that for interacting with the graphics area.
How can I get the program to retain the changed input as the mouse is moved over the graphics area?
Code: | MODULE m
CONTAINS
FUNCTION f()
INTEGER :: f
f=1
RETURN
END FUNCTION f
END MODULE m
WINAPP
PROGRAM p
!
USE clrwin, ONLY: winio@
USE m
!
INTEGER :: i=2000
!
iw=winio@('%co[check_on_focus_loss]&')
iw=winio@('%il&',1950,2011)
iw=winio@('%dd%rd &',1,i)
iw=winio@('%^gr[full_mouse_input] &',100,100,f)
iw=winio@('%bt[OK]')
!
END PROGRAM p
|
|
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Thu May 26, 2011 12:48 pm Post subject: |
|
|
Doesn't anyone know the answer to this?
(Just to keep the thread alive)
Eddie |
|
Back to top |
|
|
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: Düsseldorf, Germany
|
Posted: Thu May 26, 2011 1:12 pm Post subject: |
|
|
Hmmm... I'm not sure if this is the solution, but if you set the value of f to 2 (instead of 1) in the module m, then it works.
Regards - Wilfried |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Thu May 26, 2011 2:24 pm Post subject: |
|
|
Wilfried, You just made it more mysterious ....
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7929 Location: Salford, UK
|
Posted: Thu May 26, 2011 2:47 pm Post subject: |
|
|
%co[chek_on_focus_loss] is having an unwanted side effect in this context.
Do you need it here?
Basically it is a bug in ClearWin= but it won't be easy to fix.
The return of f=2 prevents a screen update but more often you need to update the screen after applying the callback. |
|
Back to top |
|
|
|