Re: Not able to add columns to a NSTable
Re: Not able to add columns to a NSTable
- Subject: Re: Not able to add columns to a NSTable
- From: Chris Hanson <email@hidden>
- Date: Tue, 27 Jan 2004 02:54:32 -0600
On Jan 27, 2004, at 12:32 AM, Amit Sadana wrote:
NSTableView *myTableView = [[NSTableView alloc] init];
[myTableView initWithFrame:myRect];
This is nonsensical. You're allocating an NSTableView, initializing it
with a bogus -init, and then sending it -initWithFrame:. Also, since
the table view is going to be added to your view, you should
autorelease it immediately. In other words:
NSTableView *myTableView = [[[NSTableView alloc]
initWithFrame:myRect] autorelease];
NSTableColumn *tc1 = [[NSTableColumn alloc]
initWithIdentifier:name1];
NSTableColumn *tc2 = [[NSTableColumn alloc]
initWithIdentifier:name2];
Since you're going to add these to the table, you should autorelease
them as soon as you create them.
NSTableColumn *tc1 = [[[NSTableColumn alloc]
initWithIdentifier:name1] autorelease];
NSTableColumn *tc2 = [[[NSTableColumn alloc]
initWithIdentifier:name2] autorelease];
I'm not sure why it's not showing up when you add it to your view. Are
you sure its frame is in the correct place in its superview's
coordinate system?
Is there a way you can create more of your interface using Interface
Builder, and just load it and wire it up at run-time instead of
creating it on the fly? There are times when you need to do so, but
most of the time you don't when working with Cocoa.
-- Chris
--
Chris Hanson <email@hidden>
bDistributed.com, Inc.
Outsourcing Vendor Evaluation
Custom Mac OS X Development
Cocoa Developer Training
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
- Prev by Date:
Re: NSURLDownload step by step
- Next by Date:
Rép : [APP IDEA] Desktop Background Scripting Hello, GeekTool does the four points youare exposing :-) (http://projects.tynsoe.org/geektool/) You can use shell script to replace applescripts you talked about, and you can use osascript command in shell script to execute applescripts. By the way, I don't know if this is the right place to discuss those kind of things :-) Le 25 janv. 04, à 05:19, Nebagakid a écrit : I have posted this in many places: The App would be a way to script the background picture to show information: 1. Display a stock price with a background color to correspond if the stock went up (green) or down (red). 2. Show the current iTunes song with album artwork. 3. Maybe change the desktop picture (or color) depending on the time of day. 4. Download images from a gallery and show them on the desktop. It is sort of like Konfabulator for just the Desktop Background. It is easier, though, because there would be no need to design a GUI. Maybe it could use CSS and XML to arrange stuff? I am not a programmer, but I am an idea person, and I would love to see this idea come to life. So, now, I guess I have some more ideas, graphically. Because, right now, you have another app coming that would compete against Konfabulator, by Panic named Stattoo. So, you could script it to do some basic transitions for when information changes. Like, you could have it do a wipe or a dissolve. You can have objects spin. The text would be anti-aliased, so it would look really great. There would be universal variables that would be standard, such as background (color or transparent), and the name of the "scriptlet." You would start out by writing a script. The most basic thing would be a simple applescript that would be like "set thisVariable to "hello" and then you would have specify some CSS code to say where you would want it. So "#thisVariable" would be made to be centered along the desktop, of course you would say what font-family, font-size, and color you want. then write "set desktop to rgb(0,0,0) And then, when the thing is run, you will see "hello" on a desktop centered. From there, the limits are endless, just like the number of konfabulator widgets. But (BUT!) this program is free for any developer who makes a good script. Is anyone else interested in this? I would like to get this made :) -DCohen < http://dco1.com/ > _______________________________________________ cocoa-dev mailing list | email@hidden Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev Do not post admin requests to the list. They will be ignored. -- Yann Bizeul - yann at tynsoe.org http://projects.tynsoe.org/
- Previous by thread:
Not able to add columns to a NSTable
- Next by thread:
Spinning progress indicator
- Index(es):