Re: NSPopupButton in NSTableView column header
Re: NSPopupButton in NSTableView column header
- Subject: Re: NSPopupButton in NSTableView column header
- From: Keith Blount <email@hidden>
- Date: Fri, 13 May 2005 11:09:56 -0700 (PDT)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Hello,
I had the same problem - I have a text view with a
header bar above it just like in Xcode. There are
three main programs I have come across that do this -
Xcode, BBEdit and DevonThink, and I spent some time
looking at each to try to figure out how they did it.
At first I went SA Dev's route and wrote a custom
class that drew a 1-pixel wide graded picture across
the whole view and calculated where all the controls
should be placed. This was a lot of work, as it
essentially emulated NSTableHeaderView.
I eventually changed from that route to the DevonThink
route (on the basis that DT is a pretty solid program,
so if it works for them it could work for me), which
is pretty much what you describe - just using a table
view for its header view and placing popup buttons in
it. This works well and involves much less code and
means you don't have to reinvent the wheel (although
SA Dev's solution is probably "cleaner" in that you
don't end up using a whole table view just for its
header view).
I described my solution, including a custom
KBPopUpTableHeaderCell class for placing popup buttons
in a table header, here:
http://www.cocoabuilder.com/archive/message/cocoa/2005/4/16/133285
You can download the arrows image here:
http://www.rumramruf.com/KBPopUpArrows.tif
HTH.
Cheers,
Keith
On May 13, 2005, at 1:27 AM, Duncan Campbell wrote:
> Hi folks.
>
> I'm trying to make a graded toolbar (like the one in
XCode that has
> the arrows for navigating bettween documents, and
the popupbutton
> listing the current open documents).
>
> I have put an NSTableView on my form, set columns to
0 and then
> added an NSPopupButton through code - which works
great. However, I
> would like the lines on either side of the popup so
I am wondering
> if perhaps I should add the NSPopupButton to a
column header instead.
>
> Does anyone have any sample code of how this can be
done?
>
> Cheers.
>
>
> Duncan Campbell
Discover Yahoo!
Find restaurants, movies, travel and more fun for the weekend. Check it out!
http://discover.yahoo.com/weekend.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