{ ----------------------------------------------------------------------------- NOTICE: THESE MATERIALS are UNSUPPORTED by OSS! If you do not understand how to use them do not contact OSS for help! We will not teach you how to program in Pascal. If you find an error in these materials, feel free to SEND US A LETTER explaining the error, and how to fix it. THE BOTTOM LINE: Use it, enjoy it, but you are on your own when using these materials! DISCLAIMER: OSS makes no representations or warranties with respect to the contents hereof and specifically disclaim all warranties of merchantability or fitness for any particular purpose. This document is subject to change without notice. OSS provides these materials for use with Personal Pascal. Use them in any way you wish. -------------------------------------------------------------------------- } Redisplaying Text Fields in a Dialog Box September 25, 1986 You may have noticed that Redo_Dialog does not redisplay text fields that you have changed using Set_Dtext. This is normal, since Redo_Dialog does not actually redraw the dialog box. The solution is to use the undocumented but ever-popular Obj_Draw. How do you use it? Let's see now... First you need to declare Obj_Draw so your program can access it. Include the folowing lines in your program (after global VAR declarations): { Now we declare the obj_draw as external... } PROCEDURE Obj_Draw( BOX : Dialog_Ptr; ITEM : Tree_Index; DEPTH, X, Y, W, H : Integer ); EXTERNAL; { The rest of your program follows... } What are all those parameters? Here is a brief (too brief?) description of each: BOX the dialog box pointer ITEM the item you wish to redraw (the one you changed with Set_DText) DEPTH how many levels deep the tree should be redrawn. 0 through 8 are safe numbers, but we recommend 1. X, Y The coordinates (in pixels) of the upper left corner of the clipping rectangle. Set these equal to the values returned by Work_Rect for window handle 0 (the entire desktop). W, H The Width and Height (in pixels) of the clipping rectangle. Set these equal to the values returned by Work_Rect for window handle 0 (the entire desktop). Now, after you have changed your text fields in your dialog box using Set_DText, all you have to do is call Obj_Draw with the proper parameters and the text will be redisplayed. Obj_Draw may be used to display a dialog box without ever waiting for interaction. A good example of this usage is the format box when formatting floppy disks in the GEM desktop. } IF ( ( f^.Re