• 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
Subclasses in projectbuilder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Subclasses in projectbuilder


  • Subject: Subclasses in projectbuilder
  • From: Bishop <email@hidden>
  • Date: Sat, 3 Nov 2001 17:18:50 +0100

Hi, I want to move over to Cocoa development and I'm having trouble getting started first of all i know nothing about obj-C, and only a little java but I'm fluent in C,C++ but I still think my best choice would be Java, any comments on this.

Here is the REAL question:
I create an subclass of NSScrollView, HexScrollView (in IB) and I assign a CustomView to be of this type (Hex...). After some trouble I figured that I needed a constructor to get it running, I fixed this but nothing draws in the window. To me it seems that a subclass should behave as the superclass if I don't modify it (All the constructor does is call super(frame); ). Why does it not behave like an NSScrollView. I added a drawRect function and managed to draw a rectangle around the frame.
This is what the code looks like:
public class HexScrollView extends NSView {

protected int bla;

public HexScrollView(NSRect frame)
{
super(frame);
bla = 2;
}

/*public void drawRect(NSRect frame)
{
NSGraphics.frameRectWithWidth(frame, (float)bla);
}
*/
} (if it is of any help)

Why doesn't the custom view act as a NSScrollView from start what am I doing wrong.
Thanx Bishop
--
Codito, ergo sum


  • Follow-Ups:
    • Re: Subclasses in projectbuilder
      • From: Markus Hitter <email@hidden>
  • Prev by Date: Newbie Graphics Question
  • Next by Date: Re: XML Parsing
  • Previous by thread: Re: Newbie Graphics Question
  • Next by thread: Re: Subclasses in projectbuilder
  • Index(es):
    • Date
    • Thread