Re: tables cells and views
Re: tables cells and views
- Subject: Re: tables cells and views
- From: Ondra Cada <email@hidden>
- Date: Sun, 28 Apr 2002 19:28:46 +0200
On Sunday, April 28, 2002, at 07:14 , nicolas berloquin wrote:
If you just want a list view that uses subviews instead of cells, you
can create it yourself. (Hint: -addSubview and -removeFromSuperview.)
You'll have to write your own logic to manage the layout of the subviews,
but that should be a straightforward exercise. You might see a cost in
performance, but maybe not.
you're right on the point, why not have a class that handles everything
like a tableview/columnview does, BUT has nsviews inside it ?
Since a) almost nobody needs it, and b) of those who do, vast majority is
wrong ;)
You mentioned wanting buttons within each cell, so it's not just a
matter of rendering. You also want the buttons to behave properly in
response to clicks and drags.
exaclty, and I'd have to write this myself.... ;-(
Which is, I guess, an exercise for twenty minutes or so. Perhaps ten.
You might want to submit your wish to Apple in a bug report
<http://bugreport.apple.com>. Questions on specializing NSCell behavior
appear again and again on these mailing lists. Maybe Apple could add
something to Cocoa (if only more documentation and/or examples) to make
this simpler or more obvious.
(are all lists only text or simple images ?)
No, but very many are. NSCell provides a lightweight mechanism for
these extremely common cases. Meanwhile, it is completely possible in
Cocoa to achieve what you want, though not as trivially as you might
have liked.
here's an example you might have already seen: a list of downloading
files in a web application. You may want more than just text in your
table, you'd have the filename,
a progress indicator, and maybe a button to stop/pause the download....
and this is not a far-fetched example...
This is a very example for a plain NSTableView, containing columns with
icon, name, progress (cell) and perhaps even a button (cell) if you really
want to, but I would argue that there should be *ONE* stop button, which
would stop the selected (or all the selected) task(s).
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.