{\rtf1\mac\deff2 {\fonttbl{\f0\fswiss Chicago;}{\f2\froman New York;}{\f3\fswiss Geneva;}{\f4\fmodern Monaco;}{\f13\fnil Zapf Dingbats;}{\f14\fnil Bookman;}{\f15\fnil N Helvetica Narrow;}{\f16\fnil Palatino;}{\f18\fnil Zapf Chancery;}{\f20\froman Times;} {\f21\fswiss Helvetica;}{\f22\fmodern Courier;}{\f23\ftech Symbol;}{\f33\fnil Avant Garde;}{\f34\fnil New Century Schlbk;}{\f55\fnil Code 3 of 9;}{\f256\fnil TaxType;}{\f257\fnil TaxTypeCondensed;}{\f258\fnil TaxType Mono;}{\f259\fnil TaxType Pi;} {\f1904\fnil AppleIcon;}{\f2029\fnil Nadianne;}{\f2052\fnil Zeal;}{\f12899\fnil AppleGaramond LtIt;}{\f12900\fnil AppleGaramond BkIt;}{\f12901\fnil AppleGaramond BdIt;}{\f12902\fnil AppleGaramond Lt;}{\f12903\fnil AppleGaramond Bk;} {\f12904\fnil AppleGaramond Bd;}{\f14003\fnil Newt Espy Plain;}{\f14004\fnil Newt Espy Bold;}}{\colortbl\red0\green0\blue0;\red0\green0\blue255;\red0\green255\b lue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\ red255\green255\blue0; \red255\green255\blue255;}{\stylesheet{\s243\qj\fi180\sa240\keep\tqc\tx43 20\tqr\tx8640 \f20 \sbasedon0\snext243 footer;}{\s254\qj\sb120\sa240\keep \b\f20 \sbasedon0\snext0 heading 2;}{\s255\qj\sb240\sa240\keep \f20\fs36 \sbasedon0\snext0 heading 1;}{ \qj\fi180\sa240\keep \f20 \sbasedon222\snext0 Normal;}{\s2\fi-360\li720\sa60\keep \f20 \sbasedon0\snext2 BulletList;}{\s3\li360\sa240\keep \f22 \sbasedon0\snext0 code;}{\s4\qc\fi180\sa240\keep \f20\fs48 \sbasedon0\snext4 Title;}{\s5\qc\fi180\sa240\keep \f20\fs28 \sbasedon0\snext5 Byline;}{\s6\qc\fi180\sa240\keep \f20 \sbasedon0\snext0 Caption;}{\s7\qj\sb240\sa240\keep \f22\fs36 \sbasedon255\snext7 CodeRef;}}\margl720\margr720\margt1080\margb720\deftab360\widowctrl\ftnbj \sectd \sbknone\linemod0\linex0\cols1\endnhere \pard\plain \s4\qc\fi180\sa240\keep \f20\fs48 View Tips\par \pard\plain \qc\fi180\sa240\keep \f20 {\fs36 DRAFT 3\par }\pard\plain \s5\qr\fi180\sa240\keep \f20\fs28 Michael S. Engber\line Apple Computer - Newton ToolBox Group\line Copyright \'a9 1994 - Michael S. Engber\par \pard\plain \fi180\sa240\keep \f20 This article was (will be) published in the May 1994 issue of PIE Developers magazine. For information about PIE Developers, contact Creative Digital Systems at CDS.SEM@APPLELINK.APPLE.COM or 415.621.4252.\par \pard\plain \s255\qj\sb240\sa240\keep \f20\fs36 Introduction\par \pard\plain \qj\fi180\sa240\keep \f20 This article discusses a few techniques for optimizing your view drawing performance. Often, applications are slowed down because of unnecessary redrawing of their views. Some insight into how the view system handles updates can be a big help in preventing this problem. I assume the reader has some experience using NTK to write Newton applications.\par Note that this article is based on details of the view system implementation which could change in future products. This should not discourage you from using the techniques presented. They won't break in future products \endash it's just that improvements to the view system system may eventually make these techniques unnecessary.\par \pard\plain \s255\qj\sb240\sa240\keep \f20\fs36 Dirtying Views\par \pard\plain \qj\fi180\sa240\keep \f20 When you dirty a view, normally as the result of calling SetValue, it is not redrawn immediately. Instead, the view system keeps track of what has been dirtied and periodically performs updates to the screen. The view system tries to optimize these updates by keeping track of the enclosing rectangle of all the dirtied views and only redrawing views which intersect this rectangle. I call this rectangle the update rectangle.\par In addition, the view system also keeps track of a view which it uses to search for views to redraw for the update. I call this view the update view. When an update occurs, the view system starts from the update view, examining it and its descendants, look ing for views that intersect the update rectangle, and therefore need to be redrawn.\par \pard \qj\fi180\sa240\keep No te that becoming the update view is not the same as being dirtied. The update view only affects where the search for views to update begins. Contrast this with dirtying a view, which forces the view and all its descendants to be redrawn.\par Because only a single update view is maintained, when a view is dirtied the view system finds the closest common ancestor of the update view and the newly dirtied view and makes this ancestor the new update view. This has some interesting implications. Con sider the simple view hierarchy shown in Figure 1.\par \pard \qc\fi180\sa240\keep {{\pict\macpict\picw224\pich131 107b00be0021014101011101a00082a10064000a53504e5403e800010000a10064000e535 04e540cd000be00210141010101000a00be002101410101220001ff9dffffa100c0070225 2050322d763136202d20436f7079726967687420313939312053696c69636f6e204265616 36820536f6674776172652c20496e632e0d 75736572646963742f6d64206b6e6f776e7b63757272656e7464696374206d642065717d7 b66616c73657d6966656c73657b62757d69662063757272656e74646963742f50325f6420 6b6e6f776e206e6f747b2f50325f627b50325f640d626567696e7d62696e64206465662f5 0325f642033332064696374206465662075 736572646963742f6d64206b6e6f776e7b63757272656e7464696374206d642065717d7b6 6616c73657d6966656c73652050325f6220647570206475700d2f6d6b2065786368206465 667b6d642f706174206b6e6f776e206d642f7367206b6e6f776e206d642f6772206b6e6f7 76e20616e6420616e647d7b66616c73657d 6966656c73652f706b2065786368206465667b6d640d2f73657454784d6f6465206b6e6f7 76e7d7b66616c73657d6966656c73652f736b206578636820646566206d6b7b6d642f786c 206b6e6f776e7d7b66616c73657d6966656c73652f786b2065786368206465662f627b626 96e64206465667d62696e64206465662f73 617b6d61747269782063757272656e746d61747269782050325f74700d636f6e636174206 16c6f616420706f707d622f73627b6d61747269782063757272656e746d61747269782065 78636820636f6e6361742050325f7470206d617472697820696e766572746d61747269782 0636f6e63617420616c6f61640d706f707d 622f73657b6d6174726978206173746f7265207365746d61747269787d622f62627b67736 176652050325f747020636f6e636174206e657770617468206d6f7665746f7d622f62637b 6375727665746f7d622f626c0d7b6c696e65746f7d622f62787b636c6f7365706174687d6 22f62707b677361766520656f66696c6c20 67726573746f72657d622f62667b7363616c652031207365746c696e65776964746820737 4726f6b657d622f62650d7b67726573746f72657d622f707b2f67662066616c7365206465 667d6220702f677b2f67662074727565206465667d6220706b7b2f5f7061742f706174206 c6f6164206465662f5f67722f6772206c6f 6164206465667d7b2f5f67720d7b36342e302064697620736574677261797d627d6966656 c736520736b7b2f5f73544d2f73657454784d6f6465206c6f6164206465667d69662f6778 7b2f74672065786368206465667d6220302067782f78367b6d6b7b61762036382067740d7 b66616c73657d69667d69667d622f627073 203820737472696e67206465662f62706d5b38203020302038203020305d6465662f62707 07b6270737d6465662f6f62707b677361766520736574726762636f6c6f72206270732063 6f707920706f700d64757020302067657420382064697620666c6f6f72206376692038206 d756c203120696e64657820322067657420 382064697620666c6f6f72206376692038206d756c203220696e646578203120676574203 82064697620666c6f6f72206376692038206d756c200d38203420696e6465782033206765 7420382064697620666c6f6f72206376692038206d756c7b3220696e64657820382033206 96e6465787b3120696e6465782067736176 65207472616e736c61746520382038207363616c65203820382066616c73652062706d2f6 270700d6c6f616420696d6167656d61736b2067726573746f72657d666f7220706f707d66 6f7220706f7020706f7020706f702067726573746f72657d6220656e642050325f6220706 b20656e647b2f7061747b50325f62206766 7b656e6420706f702073670d50325f62206d6b20656e647b61762036382067747b706f707 d69667d69667d7b2f5f706174206c6f616420656e6420657865637d6966656c73657d6269 6e64206465667d7b2f7061747b50325f6220706f70205f677220656e647d62696e640d646 5667d6966656c73652050325f6220736b20 656e647b2f73657454784d6f64657b50325f622f5f73544d206c6f616420656e642065786 5632050325f622074672064757020302067657b2f5f6772206c6f616420656e6420657865 637d0d7b706f7020656e647d6966656c73657d62696e64206465667d7b2f73657454784d6 f64657b706f702050325f62207467206475 7020302067657b2f5f6772206c6f616420656e6420657865637d7b706f7020656e647d696 6656c73657d62696e640d6465667d6966656c73652050325f6220786b20656e647b50325f 642f5f786c2f786c206c6f6164207075742f786c7b50325f62203220636f70792050325f7 470203420676574206164642050325f7470 20342033202d3120726f6c6c207075740d50325f7470203520676574206164642050325f7 47020352033202d3120726f6c6c207075742f5f786c206c6f616420656e6420657865637d 62696e64206465667d69667d69660d07000000002200bf0022ffffa100c00067333320313 930203120696e646578206e656720312069 6e646578206e6567206d6174726978207472616e736c6174652033203120726f6c6c0d637 57272656e74706f696e74203220636f7079206d6174726978207472616e736c6174652036 203120726f6c6c0d22014001000101a100c00084323537203332312063757272656e74706 f696e74203120696e646578203620696e64 657820737562203420696e646578203920696e64657820737562206469760d3120696e646 578203620696e64657820737562203420696e646578203920696e64657820737562206469 760d6d6174726978207363616c65203131203120726f6c6c0da100c0006f5b20392031207 26f6c6c20636c656172746f6d61726b0d33 203220726f6c6c206d617472697820636f6e6361746d61747269780d65786368206d61747 2697820636f6e6361746d61747269780d2f50325f74702065786368206465660d50325f62 206d6b20656e647b626e7d69660d0700010001220001ff9dffffa10064000a53504e540bb 80004000207000200023000be0021014100 9ea10064000a53504e540bb8000400030900000000000000003100e0002f00ef003e09fff fffffffffffff38a10064000a53504e540bb8000400030900000000000000003100e00040 00ef004f09ffffffffffffffff38a10064000a53504e540bb800040003090000000000000 0003100e0005100ef006009ffffffffffff ffff38a10064000a53504e540bb8000400030900000000000000003100e0006200ef00710 9ffffffffffffffff38a10064000a53504e540bb8000400030900000000000000003100e0 007300ef008209ffffffffffffffff38a10064000a53504e540bb80004000309000000000 00000003100e0008400ef00930700010001 09ffffffffffffffff38a10064000a53504e540bb8000400030900000000000000003100f 0002f00ff003e070002000209ffffffffffffffff38a10064000a53504e540bb800040003 0900000000000000003100f0004000ff004f09ffffffffffffffff38a10064000a53504e5 40bb8000400030900000000000000003100 f0005100ff006009ffffffffffffffff38a10064000a53504e540bb800040003090000000 0000000003100f0006200ff007109ffffffffffffffff38a10064000a53504e540bb80004 00030900000000000000003100f0007300ff008209ffffffffffffffff38a10064000a535 04e540bb800040003090000000000000000 3100f0008400ff0093070001000109ffffffffffffffff38a10064000a53504e540bb8000 40003090000000000000000310100002f010f003e070002000209ffffffffffffffff38a1 0064000a53504e540bb8000400030900000000000000003101000040010f004f09fffffff fffffffff38a10064000a53504e540bb800 0400030900000000000000003101000051010f006009ffffffffffffffff38a10064000a5 3504e540bb8000400030900000000000000003101000062010f007109ffffffffffffffff 38a10064000a53504e540bb8000400030900000000000000003101000073010f008209fff fffffffffffff38a10064000a53504e540b b8000400030900000000000000003101000084010f0093070001000109fffffffffffffff f38a10064000a53504e540bb800040003090000000000000000310110002f011f003e0700 02000209ffffffffffffffff38a10064000a53504e540bb80004000309000000000000000 03101100040011f004f09ffffffffffffff ff38a10064000a53504e540bb8000400030900000000000000003101100051011f006009f fffffffffffffff38a10064000a53504e540bb80004000309000000000000000031011000 62011f007109ffffffffffffffff38a10064000a53504e540bb8000400030900000000000 000003101100073011f008209ffffffffff ffffff38a10064000a53504e540bb8000400030900000000000000003101100084011f009 3070001000109ffffffffffffffff38a10064000a53504e540bb800040002a100c0000b50 325f62206720656e640d070002000209aa55aa55aa55aa553000c60028013c007aa100640 02253504e540cee00020010005600000026 000000560000000000000000000000000000a10064000a53504e540bb800020002a100640 00e53504e540c9e00d800b300d80079a100c0000b50325f62207020656e640da0008c0700 01000109ffffffffffffffff2200d800b3d20071001e00d3007900dd008500d8008500d30 08500d8007900dd008500d80085a0008da1 0064000a53504e540bb800020002a10064000e53504e540c9e00c900b200c9009da0008c2 200c900b2f70071001e00c4009d00ce00a900c900a900c400a900c9009d00ce00a900c900 a9a0008da10064000853504e540cee0000a10064000a53504e540bb800010000a10064001 a53504e540c2600c000b400d300f0000400 02ffffffffffffffffa10064000a53504e540c9400000000a10096000c050000000200000 0000000002c000c00150948656c7665746963610300150d00092e0004000000002bb9cc0b 7570646174652076696577a00097a10064000a53504e540bb800010000a10064001a53504 e540c2600cf00b400e2010100040002ffff ffffffffffffa10064000a53504e540c9400000000a10096000c050000000200000000000 0002a0f107570646174652072656374616e676c65a00097a10064000a53504e540bb8000b 0000a0008ca10064000a53504e540bb800010000a10064001a53504e540c2601260042013 a007900040002ffffffffffffffffa10064 000a53504e540c9400000000a10096000c0500000002000000000000002c0009000306476 56e657661030003280134004709427574742d48656164a00097a10064000a53504e540bb8 0005000207000200020b000800084001260042013a0078a10064000a53504e540bb8000c0 000a0008da10064000a53504e540bb8000b 0000a0008ca10064000a53504e540bb800010000a10064001a53504e540c2600c8003100d c005a00040002ffffffffffffffffa10064000a53504e540c9400000000a10096000c0500 000002000000000000002800d6003606426561766973a00097a10064000a53504e540bb80 00500024000c8002a00dc0060a10064000a 53504e540bb8000c0000a0008da10064000653504e5403e9a00083ff}}\par \pard\plain \s6\qc\fi180\sa240\keep \f20 Figure 1 - Beavis & Butt-Head Update Scenario I\par \pard\plain \qj\fi180\sa240\keep \f20 If we do a SetValue on Beavis immediately followed by a SetValue on Butt-Head, then their parent becomes the update view. When the update occurs Beavis, Butt-Head, their parent, and all of the children shown in heavy borders will be redrawn.\par \pard \qj\fi180\sa240\keep A simple work around for this is to call RefreshViews right after we call SetValue on Beavis. The RefreshViews will cause Beavis to be redrawn and will empty out the update rectangle. The n when we call SetValue on Butt-Head we won't cause his parent to become the update view and we won't end up with this large update rectangle that forces everyone to redraw. The only two views that get redrawn will be Beavis and Butt-Head \- precisely what we want.\par \pard \qj\fi180\sa240\keep Lets consider another scenario in which exactly the same problem occurs. Suppose clicking on Beavis brings up a pop-up menu and that we change Butt-Head when an item from the menu is selected. This scenario is depicted in Figure 2.\par \pard \qc\fi180\sa240\keep {{\pict\macpict\picw224\pich131 11c300be0021014101011101a00082a10064000a53504e5403e800010000a10064000e535 04e540cd000be00210141010101000a0000000002f90258220001ff9dffffa100c0070225 2050322d763136202d20436f7079726967687420313939312053696c69636f6e204265616 36820536f6674776172652c20496e632e0d 75736572646963742f6d64206b6e6f776e7b63757272656e7464696374206d642065717d7 b66616c73657d6966656c73657b62757d69662063757272656e74646963742f50325f6420 6b6e6f776e206e6f747b2f50325f627b50325f640d626567696e7d62696e64206465662f5 0325f642033332064696374206465662075 736572646963742f6d64206b6e6f776e7b63757272656e7464696374206d642065717d7b6 6616c73657d6966656c73652050325f6220647570206475700d2f6d6b2065786368206465 667b6d642f706174206b6e6f776e206d642f7367206b6e6f776e206d642f6772206b6e6f7 76e20616e6420616e647d7b66616c73657d 6966656c73652f706b2065786368206465667b6d640d2f73657454784d6f6465206b6e6f7 76e7d7b66616c73657d6966656c73652f736b206578636820646566206d6b7b6d642f786c 206b6e6f776e7d7b66616c73657d6966656c73652f786b2065786368206465662f627b626 96e64206465667d62696e64206465662f73 617b6d61747269782063757272656e746d61747269782050325f74700d636f6e636174206 16c6f616420706f707d622f73627b6d61747269782063757272656e746d61747269782065 78636820636f6e6361742050325f7470206d617472697820696e766572746d61747269782 0636f6e63617420616c6f61640d706f707d 622f73657b6d6174726978206173746f7265207365746d61747269787d622f62627b67736 176652050325f747020636f6e636174206e657770617468206d6f7665746f7d622f62637b 6375727665746f7d622f626c0d7b6c696e65746f7d622f62787b636c6f7365706174687d6 22f62707b677361766520656f66696c6c20 67726573746f72657d622f62667b7363616c652031207365746c696e65776964746820737 4726f6b657d622f62650d7b67726573746f72657d622f707b2f67662066616c7365206465 667d6220702f677b2f67662074727565206465667d6220706b7b2f5f7061742f706174206 c6f6164206465662f5f67722f6772206c6f 6164206465667d7b2f5f67720d7b36342e302064697620736574677261797d627d6966656 c736520736b7b2f5f73544d2f73657454784d6f6465206c6f6164206465667d69662f6778 7b2f74672065786368206465667d6220302067782f78367b6d6b7b61762036382067740d7 b66616c73657d69667d69667d622f627073 203820737472696e67206465662f62706d5b38203020302038203020305d6465662f62707 07b6270737d6465662f6f62707b677361766520736574726762636f6c6f72206270732063 6f707920706f700d64757020302067657420382064697620666c6f6f72206376692038206 d756c203120696e64657820322067657420 382064697620666c6f6f72206376692038206d756c203220696e646578203120676574203 82064697620666c6f6f72206376692038206d756c200d38203420696e6465782033206765 7420382064697620666c6f6f72206376692038206d756c7b3220696e64657820382033206 96e6465787b3120696e6465782067736176 65207472616e736c61746520382038207363616c65203820382066616c73652062706d2f6 270700d6c6f616420696d6167656d61736b2067726573746f72657d666f7220706f707d66 6f7220706f7020706f7020706f702067726573746f72657d6220656e642050325f6220706 b20656e647b2f7061747b50325f62206766 7b656e6420706f702073670d50325f62206d6b20656e647b61762036382067747b706f707 d69667d69667d7b2f5f706174206c6f616420656e6420657865637d6966656c73657d6269 6e64206465667d7b2f7061747b50325f6220706f70205f677220656e647d62696e640d646 5667d6966656c73652050325f6220736b20 656e647b2f73657454784d6f64657b50325f622f5f73544d206c6f616420656e642065786 5632050325f622074672064757020302067657b2f5f6772206c6f616420656e6420657865 637d0d7b706f7020656e647d6966656c73657d62696e64206465667d7b2f73657454784d6 f64657b706f702050325f62207467206475 7020302067657b2f5f6772206c6f616420656e6420657865637d7b706f7020656e647d696 6656c73657d62696e640d6465667d6966656c73652050325f6220786b20656e647b50325f 642f5f786c2f786c206c6f6164207075742f786c7b50325f62203220636f70792050325f7 470203420676574206164642050325f7470 20342033202d3120726f6c6c207075740d50325f7470203520676574206164642050325f7 47020352033202d3120726f6c6c207075742f5f786c206c6f616420656e6420657865637d 62696e64206465667d69667d69660d07000000002200bf0022ffffa100c00067333320313 930203120696e646578206e656720312069 6e646578206e6567206d6174726978207472616e736c6174652033203120726f6c6c0d637 57272656e74706f696e74203220636f7079206d6174726978207472616e736c6174652036 203120726f6c6c0d22014001000101a100c00084323537203332312063757272656e74706 f696e74203120696e646578203620696e64 657820737562203420696e646578203920696e64657820737562206469760d3120696e646 578203620696e64657820737562203420696e646578203920696e64657820737562206469 760d6d6174726978207363616c65203131203120726f6c6c0da100c0006f5b20392031207 26f6c6c20636c656172746f6d61726b0d33 203220726f6c6c206d617472697820636f6e6361746d61747269780d65786368206d61747 2697820636f6e6361746d61747269780d2f50325f74702065786368206465660d50325f62 206d6b20656e647b626e7d69660d0700010001220001ff9dffffa10064000a53504e540bb 80004000207000200023000be0021014100 9ea10064000a53504e540bb8000400030900000000000000003100e0002f00ef003e09fff fffffffffffff38a10064000a53504e540bb8000400030900000000000000003100e00040 00ef004f09ffffffffffffffff38a10064000a53504e540bb800040003090000000000000 0003100e0005100ef006009ffffffffffff ffff38a10064000a53504e540bb8000400030900000000000000003100e0006200ef00710 9ffffffffffffffff38a10064000a53504e540bb8000400030900000000000000003100e0 007300ef008209ffffffffffffffff38a10064000a53504e540bb80004000309000000000 00000003100e0008400ef00930700010001 09ffffffffffffffff38a10064000a53504e540bb8000400030900000000000000003100f 0002f00ff003e070002000209ffffffffffffffff38a10064000a53504e540bb800040003 0900000000000000003100f0004000ff004f09ffffffffffffffff38a10064000a53504e5 40bb8000400030900000000000000003100 f0005100ff006009ffffffffffffffff38a10064000a53504e540bb800040003090000000 0000000003100f0006200ff007109ffffffffffffffff38a10064000a53504e540bb80004 00030900000000000000003100f0007300ff008209ffffffffffffffff38a10064000a535 04e540bb800040003090000000000000000 3100f0008400ff0093070001000109ffffffffffffffff38a10064000a53504e540bb8000 40003090000000000000000310100002f010f003e070002000209ffffffffffffffff38a1 0064000a53504e540bb8000400030900000000000000003101000040010f004f09fffffff fffffffff38a10064000a53504e540bb800 0400030900000000000000003101000051010f006009ffffffffffffffff38a10064000a5 3504e540bb8000400030900000000000000003101000062010f007109ffffffffffffffff 38a10064000a53504e540bb8000400030900000000000000003101000073010f008209fff fffffffffffff38a10064000a53504e540b b8000400030900000000000000003101000084010f0093070001000109fffffffffffffff f38a10064000a53504e540bb800040003090000000000000000310110002f011f003e0700 02000209ffffffffffffffff38a10064000a53504e540bb80004000309000000000000000 03101100040011f004f09ffffffffffffff ff38a10064000a53504e540bb8000400030900000000000000003101100051011f006009f fffffffffffffff38a10064000a53504e540bb80004000309000000000000000031011000 62011f007109ffffffffffffffff38a10064000a53504e540bb8000400030900000000000 000003101100073011f008209ffffffffff ffffff38a10064000a53504e540bb8000400030900000000000000003101100084011f009 3070001000109ffffffffffffffff38a10064000a53504e540bb800040002a100c0000b50 325f62206720656e640d070002000209aa55aa55aa55aa553000c60028013c007aa100640 02253504e540cee00020010005600000026 000000560000000000000000000000000000a10064000a53504e540bb800020002a100640 00e53504e540c9e00d800b300d80079a100c0000b50325f62207020656e640da0008c0700 01000109ffffffffffffffff2200d800b3d20071001e00d3007900dd008500d8008500d30 08500d8007900dd008500d80085a0008da1 0064000a53504e540bb800020002a10064000e53504e540c9e00c900b200c9009da0008c2 200c900b2f70071001e00c4009d00ce00a900c900a900c400a900c9009d00ce00a900c900 a9a0008da10064000853504e540cee0000a10064000a53504e540bb800010000a10064001 a53504e540c2600c000b400d300f0000400 02ffffffffffffffffa10064000a53504e540c9400000000a10096000c050000000200000 0000000002c000c00150948656c7665746963610300150d00092e0004000000002bb9cc0b 7570646174652076696577a00097a10064000a53504e540bb800010000a10064001a53504 e540c2600cf00b400e2010100040002ffff ffffffffffffa10064000a53504e540c9400000000a10096000c050000000200000000000 0002a0f107570646174652072656374616e676c65a00097a10064000a53504e540bb8000b 0000a0008ca10064000a53504e540bb800010000a10064001a53504e540c2601260042013 a007900040002ffffffffffffffffa10064 000a53504e540c9400000000a10096000c0500000002000000000000002c0009000306476 56e657661030003280134004709427574742d48656164a00097a10064000a53504e540bb8 0005000207000200020b000800084001260042013a0078a10064000a53504e540bb8000c0 000a0008da10064000a53504e540bb8000b 0000a0008ca10064000a53504e540bb800010000a10064001a53504e540c2600c8003100d c005a00040002ffffffffffffffffa10064000a53504e540c9400000000a10096000c0500 000002000000000000002800d6003606426561766973a00097a10064000a53504e540bb80 00500024000c8002a00dc0060a10064000a 53504e540bb8000c0000a0008da10064000a53504e540bb8000b0000a0008ca10064000a5 3504e540bb8000500030900000000000000004100c9002a00f8005709ffffffffffffffff 48a10064000a53504e540bb8000a0001a10064001253504e540c30ffffffff00000003002 10021a10064000a53504e540c9400010001 0900000000000000003100cf003100f0004fa10064000653504e54623ea0008e900004000 0000300210023000000030021002100cf003100f0004f0000c00000300c000070df39dc30 cc6db630cc7db630cc61b630c73db63000000000000000000000000000000000000000000 0000000c00000780c0000ccdf39dc0ccc6d b638cc7db660cc61b6c0c73db6fc000000000000000000000000000000000000000000000 000c00000780c0000ccdf39dc0ccc6db638cc7db60ccc61b6ccc73db678a0008fa1006400 0a53504e540bb8000c0000a0008da10064000653504e5403e9a00083ff}}\par \pard\plain \s6\qc\fi180\sa240\keep \f20 Figure 2 - Beavis & Butt-Head Update Scenario II\par \pard\plain \qj\fi180\sa240\keep \f20 If the PickActionScript simply calls SetValue on Butt-Head, then once again we'll have the situation where Beavis, Butt-Head, their parent, and all of the children shown in heavy borders will be redrawn.\par \pard \qj\fi180\sa240\keep As before, the work around is to follow the call to SetValue with a call to RefreshViews. The views that get redrawn will be the minimal set \endash Beavis, Butt-Head, their parent, and the 2x3 views in the top-left corner of the grid.\par \pard \qj\fi180\sa240\keep As you can see, there are numerous variations on this theme. They often arise when a view appears in front of other views (like a pop-up menu or a dialog box) and makes changes to other views.\par \pard \qj\fi180\sa240\keep The general principle to take away from all this is that once you're done changing one part of the screen you might consider doing a RefreshViews to prevent one of your ancestors becoming the update view and to keep the update rectangle from getting unnec essarily large.\par \pard \qj\fi180\sa240\keep Don't start sprinkling calls to RefreshView in your code in attempt to improve performanc e. RefreshViews is a fairly expensive call. Calling it excessively will slow down your application. You need to think carefully about how your screen is updating (put some print statements in your ViewDrawScripts) and only call RefreshViews where it makes sense.\par \pard\plain \s255\qj\sb240\sa240\keep \f20\fs36 Filling Views\par \pard\plain \qj\fi180\sa240\keep \f20 Another part of the dirtying mechanism is that when you dirty an unfilled view its closest filled ancestor becomes the update view. Recall that your application's base view is filled. So if no other ancestor is filled, your base view w ill become the update view.\par \pard \qj\fi180\sa240\keep In the simplest case, this means that when you dirty an unfilled view its parent will be redrawn as well as any children that overlap the dirtied view. Figure 3 shows this situation.\par \pard \qc\fi180\sa240\keep {{\pict\macpict\picw224\pich94 0fc7015e00a301bc01831101a00082a10064000a53504e5403e800010000a10064000e535 04e540cd0015e00a301bc018301000a015e00a301bc0183220001ff9dffffa100c0070225 2050322d763136202d20436f7079726967687420313939312053696c69636f6e204265616 36820536f6674776172652c20496e632e0d 75736572646963742f6d64206b6e6f776e7b63757272656e7464696374206d642065717d7 b66616c73657d6966656c73657b62757d69662063757272656e74646963742f50325f6420 6b6e6f776e206e6f747b2f50325f627b50325f640d626567696e7d62696e64206465662f5 0325f642033332064696374206465662075 736572646963742f6d64206b6e6f776e7b63757272656e7464696374206d642065717d7b6 6616c73657d6966656c73652050325f6220647570206475700d2f6d6b2065786368206465 667b6d642f706174206b6e6f776e206d642f7367206b6e6f776e206d642f6772206b6e6f7 76e20616e6420616e647d7b66616c73657d 6966656c73652f706b2065786368206465667b6d640d2f73657454784d6f6465206b6e6f7 76e7d7b66616c73657d6966656c73652f736b206578636820646566206d6b7b6d642f786c 206b6e6f776e7d7b66616c73657d6966656c73652f786b2065786368206465662f627b626 96e64206465667d62696e64206465662f73 617b6d61747269782063757272656e746d61747269782050325f74700d636f6e636174206 16c6f616420706f707d622f73627b6d61747269782063757272656e746d61747269782065 78636820636f6e6361742050325f7470206d617472697820696e766572746d61747269782 0636f6e63617420616c6f61640d706f707d 622f73657b6d6174726978206173746f7265207365746d61747269787d622f62627b67736 176652050325f747020636f6e636174206e657770617468206d6f7665746f7d622f62637b 6375727665746f7d622f626c0d7b6c696e65746f7d622f62787b636c6f7365706174687d6 22f62707b677361766520656f66696c6c20 67726573746f72657d622f62667b7363616c652031207365746c696e65776964746820737 4726f6b657d622f62650d7b67726573746f72657d622f707b2f67662066616c7365206465 667d6220702f677b2f67662074727565206465667d6220706b7b2f5f7061742f706174206 c6f6164206465662f5f67722f6772206c6f 6164206465667d7b2f5f67720d7b36342e302064697620736574677261797d627d6966656 c736520736b7b2f5f73544d2f73657454784d6f6465206c6f6164206465667d69662f6778 7b2f74672065786368206465667d6220302067782f78367b6d6b7b61762036382067740d7 b66616c73657d69667d69667d622f627073 203820737472696e67206465662f62706d5b38203020302038203020305d6465662f62707 07b6270737d6465662f6f62707b677361766520736574726762636f6c6f72206270732063 6f707920706f700d64757020302067657420382064697620666c6f6f72206376692038206 d756c203120696e64657820322067657420 382064697620666c6f6f72206376692038206d756c203220696e646578203120676574203 82064697620666c6f6f72206376692038206d756c200d38203420696e6465782033206765 7420382064697620666c6f6f72206376692038206d756c7b3220696e64657820382033206 96e6465787b3120696e6465782067736176 65207472616e736c61746520382038207363616c65203820382066616c73652062706d2f6 270700d6c6f616420696d6167656d61736b2067726573746f72657d666f7220706f707d66 6f7220706f7020706f7020706f702067726573746f72657d6220656e642050325f6220706 b20656e647b2f7061747b50325f62206766 7b656e6420706f702073670d50325f62206d6b20656e647b61762036382067747b706f707 d69667d69667d7b2f5f706174206c6f616420656e6420657865637d6966656c73657d6269 6e64206465667d7b2f7061747b50325f6220706f70205f677220656e647d62696e640d646 5667d6966656c73652050325f6220736b20 656e647b2f73657454784d6f64657b50325f622f5f73544d206c6f616420656e642065786 5632050325f622074672064757020302067657b2f5f6772206c6f616420656e6420657865 637d0d7b706f7020656e647d6966656c73657d62696e64206465667d7b2f73657454784d6 f64657b706f702050325f62207467206475 7020302067657b2f5f6772206c6f616420656e6420657865637d7b706f7020656e647d696 6656c73657d62696e640d6465667d6966656c73652050325f6220786b20656e647b50325f 642f5f786c2f786c206c6f6164207075742f786c7b50325f62203220636f70792050325f7 470203420676574206164642050325f7470 20342033202d3120726f6c6c207075740d50325f7470203520676574206164642050325f7 47020352033202d3120726f6c6c207075742f5f786c206c6f616420656e6420657865637d 62696e64206465667d69667d69660d070000000022015f00a4ffffa100c00068313633203 33530203120696e646578206e6567203120 696e646578206e6567206d6174726978207472616e736c6174652033203120726f6c6c0d6 3757272656e74706f696e74203220636f7079206d6174726978207472616e736c61746520 36203120726f6c6c0d2201bb01820101a100c00084333837203434342063757272656e747 06f696e74203120696e646578203620696e 64657820737562203420696e646578203920696e64657820737562206469760d3120696e6 46578203620696e64657820737562203420696e646578203920696e646578207375622064 69760d6d6174726978207363616c65203131203120726f6c6c0da100c0006f5b203920312 0726f6c6c20636c656172746f6d61726b0d 33203220726f6c6c206d617472697820636f6e6361746d61747269780d65786368206d617 472697820636f6e6361746d61747269780d2f50325f74702065786368206465660d50325f 62206d6b20656e647b626e7d69660d0700010001220001ff9dffffa10064000a53504e540 bb800040002070002000230015e00a301bc 0120a10064000a53504e540bb80004000309000000000000000031017400b1018300c009f fffffffffffffff38a10064000a53504e540bb80004000309000000000000000031017400 c2018300d109ffffffffffffffff38a10064000a53504e540bb8000400030900000000000 0000031017400d3018300e209ffffffffff ffffff38a10064000a53504e540bb80004000309000000000000000031017400e4018300f 3070001000109ffffffffffffffff38a10064000a53504e540bb800040003090000000000 00000031017400f50183010409ffffffffffffffff38a10064000a53504e540bb80004000 30900000000000000003101740106018301 1509ffffffffffffffff38a10064000a53504e540bb800040003090000000000000000310 18400b1019300c009ffffffffffffffff38a10064000a53504e540bb80004000309000000 000000000031018400c2019300d109ffffffffffffffff38a10064000a53504e540bb8000 4000309000000000000000031018400d301 9300e209ffffffffffffffff38a10064000a53504e540bb80004000309000000000000000 031018400e4019300f309ffffffffffffffff38a10064000a53504e540bb8000400030900 0000000000000031018400f50193010409ffffffffffffffff38a10064000a53504e540bb 80004000309000000000000000031018401 060193011509ffffffffffffffff38a10064000a53504e540bb8000400030900000000000 0000031019400b101a300c009ffffffffffffffff38a10064000a53504e540bb800040003 09000000000000000031019400c201a300d109ffffffffffffffff38a10064000a53504e5 40bb8000400030900000000000000003101 9400d301a300e209ffffffffffffffff38a10064000a53504e540bb800040003090000000 00000000031019400e401a300f309ffffffffffffffff38a10064000a53504e540bb80004 000309000000000000000031019400f501a3010409ffffffffffffffff38a10064000a535 04e540bb800040003090000000000000000 310194010601a3011509ffffffffffffffff38a10064000a53504e540bb80004000309000 00000000000003101a400b101b300c009ffffffffffffffff38a10064000a53504e540bb8 000400030900000000000000003101a400c201b300d109ffffffffffffffff38a10064000 a53504e540bb80004000309000000000000 00003101a400d301b300e209ffffffffffffffff38a10064000a53504e540bb8000400030 900000000000000003101a400e401b300f309ffffffffffffffff38a10064000a53504e54 0bb8000400030900000000000000003101a400f501b3010409ffffffffffffffff38a1006 4000a53504e540bb8000400030900000000 000000003101a4010601b3011509ffffffffffffffff38a10064000a53504e540bb800040 002a100c0000b50325f62206720656e640d070002000209aa55aa55aa55aa5530016600a8 017e00e2a10064002253504e540cee0002001000560000002600000056000000000000000 0000000000000a10064000a53504e540bb8 00020002a10064000e53504e540c9e016c0135016c00e2a100c0000b50325f62207020656 e640da0008c070001000109ffffffffffffffff22016c0135b90071001e016700e2017100 ee016c00ee016700ee016c00e2017100ee016c00eea0008da10064000a53504e540bb8000 20002a10064000e53504e540c9e017e0134 017e011fa0008c22017e0134f70071001e0179011f0183012b017e012b0179012b017e011 f0183012b017e012ba0008da10064000853504e540cee0000a10064000a53504e540bb800 010000a10064001a53504e540c26017501360188017200040002ffffffffffffffffa1006 4000a53504e540c9400000000a10096000c 0500000002000000000000002c000c00150948656c7665746963610300150d00092e00040 0000000280181013b0b7570646174652076696577a00097a10064000a53504e540bb80001 0000a10064001a53504e540c26016301360176018300040002ffffffffffffffffa100640 00a53504e540c9400000000a10096000c05 000000020000000000000028016f013b107570646174652072656374616e676c65a00097a 10064000a53504e540bb8000b0000a0008ca10064000a53504e540bb800010000a1006400 1a53504e540c26016800b1017c00da00040002ffffffffffffffffa10064000a53504e540 c9400000000a10096000c05000000020000 00000000002c000900030647656e65766103000328017600b606426561766973a00097a10 064000a53504e540bb80005000207000200020b0008000840016800aa017c00e0a1006400 0a53504e540bb8000c0000a0008da10064000653504e5403e9a00083ff}}\par \pard\plain \s6\qc\fi180\sa240\keep \f20 Figure 3 - Transparent Beavis Update\par \pard\plain \qj\fi180\sa240\keep \f20 Beavis is a transparent view. When Beavis is dirtied his bounds become the update rectangle and his parent becomes the update view. Beavis, his parent and the three children drawn in heavy borders will be redrawn. \par \pard \qj\fi180\sa240\keep Since Beavis is transparent and overlaps three o f his siblings, all of this redrawing is necessary to update the screen properly. This scenario is somewhat contrived. In practice, you don't normally use overlapping views. However, even if we remove the overlapping views from figure 3 we still end up wit h Beavis and his parent being redrawn when we really only want Beavis to be redrawn.\par The work around is very simple. Give Beavis a fill pattern (anything but fill none). As with calling RefreshViews, some thought is required when deciding which views to gi ve fill patterns. You don't want to give all your views fill patterns because this increases the time it takes to draw them. Only views which you explicitly dirty need to be considered.\par \pard\plain \s255\qj\sb240\sa240\keep \f20\fs36 Grouping Views\par \pard\plain \qj\fi180\sa240\keep \f20 Another way you can help improve your view performance is by grouping your views into container views. Figure 4 shows our Beavis and Butt-Head example with the 4x6 views in the center all grouped together i nside an invisible parent view \endash a plain old clView shown in gray.\par \pard \qc\fi180\sa240\keep {{\pict\macpict\picw125\pich131 0e9d0148019f01cb021c1101a00082a10064000a53504e5403e800010000a10064000e535 04e540cd00148019f01cb021c01000a0148019f01cb021c09aa55aa55aa55aa55220001ff 9dffffa100c00702252050322d763136202d20436f7079726967687420313939312053696 c69636f6e20426561636820536f66747761 72652c20496e632e0d75736572646963742f6d64206b6e6f776e7b63757272656e7464696 374206d642065717d7b66616c73657d6966656c73657b62757d69662063757272656e7464 6963742f50325f64206b6e6f776e206e6f747b2f50325f627b50325f640d626567696e7d6 2696e64206465662f50325f642033332064 696374206465662075736572646963742f6d64206b6e6f776e7b63757272656e746469637 4206d642065717d7b66616c73657d6966656c73652050325f6220647570206475700d2f6d 6b2065786368206465667b6d642f706174206b6e6f776e206d642f7367206b6e6f776e206 d642f6772206b6e6f776e20616e6420616e 647d7b66616c73657d6966656c73652f706b2065786368206465667b6d640d2f736574547 84d6f6465206b6e6f776e7d7b66616c73657d6966656c73652f736b206578636820646566 206d6b7b6d642f786c206b6e6f776e7d7b66616c73657d6966656c73652f786b206578636 8206465662f627b62696e64206465667d62 696e64206465662f73617b6d61747269782063757272656e746d61747269782050325f747 00d636f6e63617420616c6f616420706f707d622f73627b6d61747269782063757272656e 746d6174726978206578636820636f6e6361742050325f7470206d617472697820696e766 572746d617472697820636f6e6361742061 6c6f61640d706f707d622f73657b6d6174726978206173746f7265207365746d617472697 87d622f62627b67736176652050325f747020636f6e636174206e657770617468206d6f76 65746f7d622f62637b6375727665746f7d622f626c0d7b6c696e65746f7d622f62787b636 c6f7365706174687d622f62707b67736176 6520656f66696c6c2067726573746f72657d622f62667b7363616c652031207365746c696 e657769647468207374726f6b657d622f62650d7b67726573746f72657d622f707b2f6766 2066616c7365206465667d6220702f677b2f67662074727565206465667d6220706b7b2f5 f7061742f706174206c6f6164206465662f 5f67722f6772206c6f6164206465667d7b2f5f67720d7b36342e302064697620736574677 261797d627d6966656c736520736b7b2f5f73544d2f73657454784d6f6465206c6f616420 6465667d69662f67787b2f74672065786368206465667d6220302067782f78367b6d6b7b6 1762036382067740d7b66616c73657d6966 7d69667d622f627073203820737472696e67206465662f62706d5b3820302030203820302 0305d6465662f6270707b6270737d6465662f6f62707b677361766520736574726762636f 6c6f722062707320636f707920706f700d64757020302067657420382064697620666c6f6 f72206376692038206d756c203120696e64 657820322067657420382064697620666c6f6f72206376692038206d756c203220696e646 57820312067657420382064697620666c6f6f72206376692038206d756c200d3820342069 6e64657820332067657420382064697620666c6f6f72206376692038206d756c7b3220696 e6465782038203320696e6465787b312069 6e646578206773617665207472616e736c61746520382038207363616c652038203820666 16c73652062706d2f6270700d6c6f616420696d6167656d61736b2067726573746f72657d 666f7220706f707d666f7220706f7020706f7020706f702067726573746f72657d6220656 e642050325f6220706b20656e647b2f7061 747b50325f622067667b656e6420706f702073670d50325f62206d6b20656e647b6176203 6382067747b706f707d69667d69667d7b2f5f706174206c6f616420656e6420657865637d 6966656c73657d62696e64206465667d7b2f7061747b50325f6220706f70205f677220656 e647d62696e640d6465667d6966656c7365 2050325f6220736b20656e647b2f73657454784d6f64657b50325f622f5f73544d206c6f6 16420656e6420657865632050325f622074672064757020302067657b2f5f6772206c6f61 6420656e6420657865637d0d7b706f7020656e647d6966656c73657d62696e64206465667 d7b2f73657454784d6f64657b706f702050 325f622074672064757020302067657b2f5f6772206c6f616420656e6420657865637d7b7 06f7020656e647d6966656c73657d62696e640d6465667d6966656c73652050325f622078 6b20656e647b50325f642f5f786c2f786c206c6f6164207075742f786c7b50325f6220322 0636f70792050325f747020342067657420 6164642050325f747020342033202d3120726f6c6c207075740d50325f747020352067657 4206164642050325f747020352033202d3120726f6c6c207075742f5f786c206c6f616420 656e6420657865637d62696e64206465667d69667d69660d070000000022014901a0ffffa 100c0006834313520333238203120696e64 6578206e6567203120696e646578206e6567206d6174726978207472616e736c617465203 3203120726f6c6c0d63757272656e74706f696e74203220636f7079206d61747269782074 72616e736c6174652036203120726f6c6c0d2201ca021b0101a100c000843534302034353 92063757272656e74706f696e7420312069 6e646578203620696e64657820737562203420696e646578203920696e646578207375622 06469760d3120696e646578203620696e64657820737562203420696e646578203920696e 64657820737562206469760d6d6174726978207363616c65203131203120726f6c6c0da10 0c0006f5b2039203120726f6c6c20636c65 6172746f6d61726b0d33203220726f6c6c206d617472697820636f6e6361746d617472697 80d65786368206d617472697820636f6e6361746d61747269780d2f50325f747020657863 68206465660d50325f62206d6b20656e647b626e7d69660d0700010001220001ff9dffffa 10064000a53504e540bb80004000209ffff ffffffffffff300148019f01cb021ca10064000a53504e540bb8000400030900000000000 0000031016a01ad017901bc09ffffffffffffffff38a10064000a53504e540bb800040003 09000000000000000031016a01be017901cd09ffffffffffffffff38a10064000a53504e5 40bb8000400030900000000000000003101 6a01cf017901de09ffffffffffffffff38a10064000a53504e540bb800040003090000000 00000000031016a01e0017901ef09ffffffffffffffff38a10064000a53504e540bb80004 000309000000000000000031016a01f10179020009ffffffffffffffff38a10064000a535 04e540bb800040003090000000000000000 31016a02020179021109ffffffffffffffff38a10064000a53504e540bb80004000309000 000000000000031017a01ad018901bc09ffffffffffffffff38a10064000a53504e540bb8 0004000309000000000000000031017a01be018901cd09ffffffffffffffff38a10064000 a53504e540bb80004000309000000000000 000031017a01cf018901de09ffffffffffffffff38a10064000a53504e540bb8000400030 9000000000000000031017a01e0018901ef09ffffffffffffffff38a10064000a53504e54 0bb80004000309000000000000000031017a01f10189020009ffffffffffffffff38a1006 4000a53504e540bb8000400030900000000 0000000031017a02020189021109ffffffffffffffff38a10064000a53504e540bb800040 00309000000000000000031018a01ad019901bc09ffffffffffffffff38a10064000a5350 4e540bb80004000309000000000000000031018a01be019901cd09ffffffffffffffff38a 10064000a53504e540bb800040003090000 00000000000031018a01cf019901de09ffffffffffffffff38a10064000a53504e540bb80 004000309000000000000000031018a01e0019901ef09ffffffffffffffff38a10064000a 53504e540bb80004000309000000000000000031018a01f10199020009fffffffffffffff f38a10064000a53504e540bb80004000309 000000000000000031018a02020199021109ffffffffffffffff38a10064000a53504e540 bb80004000309000000000000000031019a01ad01a901bc09ffffffffffffffff38a10064 000a53504e540bb80004000309000000000000000031019a01be01a901cd09fffffffffff fffff38a10064000a53504e540bb8000400 0309000000000000000031019a01cf01a901de09ffffffffffffffff38a10064000a53504 e540bb80004000309000000000000000031019a01e001a901ef09ffffffffffffffff38a1 0064000a53504e540bb80004000309000000000000000031019a01f101a9020009fffffff fffffffff38a10064000a53504e540bb800 04000309000000000000000031019a020201a9021109ffffffffffffffff38a10064000a5 3504e540bb8000b0000a0008ca10064000a53504e540bb800010000a10064001a53504e54 0c2601b001c001c401f700040002ffffffffffffffffa10064000a53504e540c940000000 0a10096000c050000000200000000000000 2c000900030647656e6576610300030d00092e0004000000002801be01c509427574742d4 8656164a00097a10064000a53504e540bb80005000207000200020b000800084001b001c0 01c401f6a10064000a53504e540bb8000c0000a0008da10064000a53504e540bb8000b000 0a0008ca10064000a53504e540bb8000100 00a10064001a53504e540c26014f01af016301d800040002ffffffffffffffffa10064000 a53504e540c9400000000a10096000c05000000020000000000000028015d01b406426561 766973a00097a10064000a53504e540bb80005000240014f01a8016301dea10064000a535 04e540bb8000c0000a0008da10064000a53 504e540bb800040002a100c0000b50325f62206720656e640d09aa55aa55aa55aa5530016 801ab01ab0213a10064000653504e5403e9a00083ff}}\par \pard\plain \s6\qc\fi180\sa240\keep \f20 Figure 4 - Example of Grouping Views\par \pard\plain \qj\fi180\sa240\keep \f20 This grouping helps in a variety of way. For example, it will speed up hit testing. When a tap is made the view hierarchy is searched for the view that contains the point. If a view contains the point, then its children are search to see if any of them contain the poin t. When a view doesn't contain the point, then none of its children are searched.\par \pard \qj\fi180\sa240\keep Without the grouping view, every a tap could require examining as many as twenty-seven views to see if they contain the point (Beavis, Butt-Head, their parent, plus the 4x6 c hildren). With the grouping, taps outside the grouping view cause only a maximum of four views to be examined.\par A similar speed-up occurs for the update process. Recall that the update view's descendants are searched to see if they intersect the update rectangle and therefore, need to be redrawn. If a view does not intersect the update rectangle then none of its chi ldren need to be further examined.\par \pard \qj\fi180\sa240\keep By grouping the 4x6 views together we ensure they won't be tested for redrawing in the update process when the grouping view does not intersect the update rectangle.\par \par }