[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Proposal to fix NSCell issue
From: |
Markus Hitter |
Subject: |
Re: [PATCH] Proposal to fix NSCell issue |
Date: |
Thu, 1 Apr 2004 09:18:31 +0200 |
Am 01.04.2004 um 03:03 schrieb Quentin Mathé:
Apple has added -performClick: to NSCell ...
... and to NSButtonCell and NSControl. On 10.3.3, Three (similar)
descriptions are available. For reference, the one for NSControl:
- (void)performClick:(id)sender
Can be used to simulate a single mouse click on the receiver. sender
is ignored. This method calls performClick: on the receiver's cell
with the sender being the control itself. Raises an exception if the
action message cannot be successfully sent.
... but this is impossible to implement without large modifications on
NSMatrix for example
That's strange since all these classes support clicking by the user
already. At worst you whould have to sythesize an MouseDown event.
Then Alex and me have thought it would better to deprecate NSCell
-performClick: method in favor of a more NSCellish method like
performClickWithFrame:inView: which follows the NSCell philosophy like
drawInteriorWithFrame:inView:.
In opposite to some drawing, a mouse click is and always will be
related to a single pixel/coordinate. So, which frame whould you pass
in there?
For the coordinate, NSButtons/NSControls don't make a difference
_where_ they are clicked. So, this information is obsolete.
The view you want it obviously the topmost view at this coordinate. No
need to pass it in, either. It's always the receiver's view, btw.
I still think also that -performClick in NSCell (like Apple) or in
NSButtonCell (like OpenStep spec.) is a design error.
As you probably agree, a method to simulate a mouse click is very
convenient if you want to do something programmatically what the user
could do with his mouse as well.
Here I reassert this is the reason to deprecate it in favor of
performClickWithFrame:inView:
Hmm. Incomatibilities just because other methods in these classes take
additional arguments as well?
Enjoy the sun,
Markus
P.S.: NSCell has only one single method wich takes a view:
- (void)editWithFrame:(NSRect)aRect inView:(NSView *)controlView
editor:(NSText *)textObj delegate:(id)anObject event:(NSEvent
*)theEvent
... aRect must be the rectangle used for displaying the NSCell.
theEvent is the NSLeftMouseDown event. ...
... so, redundant information?
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/
- Re: [PATCH] Proposal to fix NSCell issue,
Markus Hitter <=