discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Introduce me to NSTableView


From: Chris B. Vetter
Subject: Re: Introduce me to NSTableView
Date: Thu, 5 Jun 2003 17:28:41 -0700

On Fri, 6 Jun 2003 03:03:25 +0300
Christopher Culver <crculver@users.sourceforge.net> wrote:
[...]
> This does not, however, result in a visible NSTableView in my 
> application window. What more must I do?

Create a GSVbox as your window's "main" view, and use a GSHbox to
arrange the "inner" objects, that is, an NSScrollView that contains your
NSTableView.

> Must I manually add a column to the table view? If so, how?

  [...create your NSTableView 'mytable'...]

  {
    NSTableColumn *column = nil;

    // create it
    column = [[NSTableColumn alloc] initWithIdentifier: @"Foobar"];

    // not editable but resizable
    [column setEditable: NO];
    [column setResizable: YES];

    // add it to the table
    [mytable addTableColumn: column];

    // balance alloc/init
    [column release];
  }

> NSTableView seems to be one of the more difficult GUI objects for 
> Openstep newbies (in Cocoa forums I see a lot of puzzlement about it).
> It'd be really cool to have an NSTableView tutorial for GNUstep.

I wonder, however, why you want to create the UI by hand instead of
using GORM... After all GSV/Hbox are specific to GNUstep. So porting
your app to, say OSX, will be a bit more difficult.

If you really want to create it by hand, you might want to take a look
at the source to Terminal.app, especially the preferences contain a
couple of NSTableViews.

-- 
Chris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]