• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Drawing views
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing views


  • Subject: Re: Drawing views
  • From: Erik Buck <email@hidden>
  • Date: Fri, 2 Jun 2006 11:16:38 -0700 (PDT)

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

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Double-click/Return/Enter in NSTableView
  • Next by Date: Re: 2nd fullscreen window and keyboard input
  • Previous by thread: Re: Drawing views
  • Next by thread: Re: NSDocument - preventing incomplete document from being saved
  • Index(es):
    • Date
    • Thread