Silverfrost Forums

Welcome to our forums

Forcing complete format window update

12 Jul 2007 9:42 #2048

Is there any way of forcing all the controls in a format window to update their values when not within a callback function - ie. the equivalent of returning 1 from a callback. I can always do WINDOW_UPDATE@ on the individual control variables but thought something like a WINDOW_UPDATE@ using the window handle might exist to force the updates.

Thanks, Alan

12 Jul 2007 11:51 #2049

Here's a suggestion - I haven't tried it

Regards

Ian

Use a %dl co execute a callback at the rate you wish to update. This callback would just return setting its value to 1.

If you don't want the update to occur, write a subroutine, such as set_update(i) where the value of i is stored in a common block accessible to the %dl callback and is used as the return value, e.g.

integer update_callback external update_callback

i=winio@('%dl',1d0,update_callback)

  • either activate updates call set_update(1)

  • or deactivate call set_update(2)

integer function update_callback() common/update_mode/ireturn_val

  • prevent a zero value from terminating the program update_callback = max(1,ireturn_val) end

subroutine set_update(i) common/update_mode/ireturn_val ireturn_val = i end

12 Jul 2007 1:01 #2051

There are two kinds of update. The Windows API UpdateWindow updates any areas that have been overlaid by other windows etc. In contrast the ClearWin+ routine window_update@ refreshes the display for a given variable change before calling UpdateWindow with the relevant hwnd.

If you want a global window_update@ for all variables that are displayed in some way then in theory call window_update@(CORE4(0)) should do the trick but it looks like this has got broken somewhere along the line. It should be easy enough to fix but it is broken at the moment.

12 Jul 2007 5:39 #2054

Thanks for that. I've ended up just updating all the control variables this time round.

Paul, while fixing window_update@(CORE4(0)) would it be easy to allow the format window handle to be passed in to just update the controls for that window ? Not a big issue though.

13 Jul 2007 6:24 #2055

would it be easy to allow the format window handle to be passed in to just update the controls for that window?

Not really. You would need a new routine.

Please login to reply.