Apple Newton Utilities User's Guide Page 105

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 104
CHAPTER 3
Views
About Views 3-21
IMPORTANT
Many views need no ll pattern, so you may be inclined to set the
ll pattern to “none” when you create such a view. However, it’s
best to ll the view with white, if the view may be explicitly
dirtied (in need of redrawing) and if you don’t need a transparent
view. This increases the performance of your application because
when the system is redrawing the screen, it doesn’t have to update
views behind those lled with a solid color such as white.
However, don’t ll all views with white, since there is some small
overhead associated with lls; only use this technique if the view
is one that is usually dirtied.
Also, note that the application base view always appears opaque,
as do all child views of the root view. That is, if no ll is set for
the application base view, it automatically appears to be lled
with white.
The view format attributes are listed and described in Table 2-5 (page 2-13) in the
Newton Programmers Reference.
Custom Fill and Frame Patterns 3
Custom ll and custom view frame patterns are set for a view by using the
vfCustom flag, as shown in Table 2-5 (page 2-13) in the Newton Programmer’s
Reference, and by using following two slots:
viewFillPattern
Sets a custom ll pattern that is used to ll the view.
viewFramePattern
Sets a custom pattern that is used to draw the frame lines
around the view, if the view has a frame.
You can use custom ll and frame patterns by setting the value of the
viewFillPattern and viewFramePattern slots to a binary data structure
containing a custom pattern. A pattern is simply an eight-byte binary data structure
with the class
'pattern.
You can use this NewtonScript trick to create binary pattern data structures “on
the y”:
DefineGlobalConstant('myPat,SetLength(SetClass(Clone
("\uAAAAAAAAAAAAAAAA"),'pattern), 8));
This code clones a string, which is already a binary object, and changes its class to
'pattern. The string is specified with hexadecimal character codes whose binary
representation is used to create the pattern. Each two-digit hex code creates one
byte of the pattern.
Page view 104
1 2 ... 100 101 102 103 104 105 106 107 108 109 110 ... 941 942

Comments to this Manuals

No comments