cbmbsw@amiga.UUCP (Mail to BSW) (03/06/86)
Hello, folks. Today, I've got a very cool thing for you! Many developers (including myself) have wished for a RefreshWindowFrame() Intuition function, which function would redraw the entire window frame on demand. The window frame refers to the window border, window title, and all window gadgets (both the system gadgets and your own). The function would be especially handy when you have done something to your window which could wipe out the systemy stuff. Have you ever wished that you could call some magic Intuition incantation to have the whole thing refreshed for you? Frustrated when you found that this ability seemed to be beyond your grasp? Well, guess what ... you already have such a function available to you, but you just didn't know it. I didn't know it until just yesterday. Follow me as I lead you into some of the darker recesses of Intuition ... A little recognized but very real idiosyncracy of the SetWindowTitles() function is that it does in fact cause the entire window frame to be redrawn. Therefore, you can honestly use this function as a pseudo window redraw function. You need only make a define in your include file like this: #define RefreshWindowFrame(w) SetWindowTitles(w,w->Title,-1) Then you are free to use the RefreshWindowFrame() call as you would any other Intuition call. The argument to the RefreshWindowFrame function is a pointer to a window structure, which structure is returned to you by a call to OpenWindow(). struct Window *window; window = OpenWindow(...); RefreshWindowFrame(window); And that's it! Hope you enjoyed this programmer's tool, brought to you by the meek, humble, and distant =RJ Mical= Director of Intuition [PS: this will work with the 1.1 release of Intuition. The mythical forthcoming 1.2 release of the system may not support this shortcut, unless the powers that be (Oh great and powerful and wonderful and handsome and strong Jim Mackraz, are you listening?) leave SetWindowTitles() as is. The cost would be that that SetWindowTitles() will *always* redraw the entire window frame, whether or not its necessary. The benefit is that programmers get a RefreshWindowFrame() function *today*, with the 1.1 release of the system. Cost too much for this great benefit? I don't think so. You decide. But be forewarned that until Mackraz (current Intuition guru) blesses this, it may not work with the 1.2 release, although if enough people start to use this "undocumented feature" of Intuition it will de facto become a documented feature. Or is that treason?]
aglew@ccvaxa.UUCP (03/10/86)
I just love that title: =RJ Mical= Director of Intuition Is there a director of Common Sense, or a manager of Non-Obvious But True Facts?