Skip navigation.
 
mlRe: Drawing views
FROM : Erik Buck
DATE : Fri Jun 02 20:16:38 2006

It is hard for me to state this delicately, but there has been a rash of ultra-novice questions that are easily answered by working through the most introductory Cocoa tutorials, reading the available on-line and on hard disk documentation, or reading any of the nice Cocoa Programming books available at the book store and Amazon.  A certain base level of knowledge is needed before any framework can be used effectively.
 
  We all want people to experience success using Cocoa and, we provide a volunteer community to help ensure that success.  However, people need to do at least the minimal research on their own to get any real value from a forum like this.
 
  I can’t be certain what the poser even wants to do because he never told us.  He may just be asking how to place his custom view in a scroll view so that his view will not be resized if the window is too small to display all of his view at once.  If so, see Iinterface builder's "Make subviews of" from the Layout menu, and then choose Scroll View. ...
 
  For the time being, I will just assume the poster doesn’t understand what a view is, how views resize, and how to draw inside a custom view.
 
  As it happens, Amazon's sample chapter from one of my favorite books includes an ultra short and ultra simple tour of Interface Builder including automatic view re-sizing.
  http://www.amazon.com/gp/product/0672322307/ref=ase_stepwisecom-20/104-3297616-1770350?n=283155&tagActionCode=stepwisecom-20
 
  Use the “excerpt” link on Amazon’s web page to read the excerpt starting on page 43 of the sample chapter.
 
  Additionally, I recommend that the poster start a new interface in Interface Builder.  Drag a single custom view from the palette and place the custom view in a window.  Use the size mode of Interface Builder's inspector to configure the custom view resizing behavior the way he wants it.
 
  Then realize that there is absolutely no difference between what he just did and what he can do with any Cocoa view including his own custom view. 
 
  Apple’s “Building a Text Editor in 15 Minutes” tutorial shows what the poster a lot of basic Interface Builder techniques including resizing behaviors: http://developer.apple.com/documentation/Cocoa/Conceptual/TextArchitecture/Tasks/TextEditor.html
 
  For yet another explanation of resizing views, See “Repositioning and Resizing Views”
  http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaViewsGuide/WorkingWithAViewHierarchy/chapter_4_section_6.html
 
 
  When it comes to drawing,  the poster needs to read and understand how to use -drawRect:
  I recommend in the "Views and Drawing" and “Coordinate Systems” sections.
  http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaDrawingGuide/index.html

Related mailsAuthorDate
mlDrawing views Livio Jun 1, 18:25
mlRe: Drawing views Joshua Pennington Jun 1, 19:25
mlRe: Drawing views Livio Jun 2, 11:12
mlRe: Drawing views Erik Buck Jun 2, 20:16