discuss-gnustep
[Top][All Lists]
Advanced

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

Re: [Gnustep-cvs] r29010 - in /libs/gui/trunk: ChangeLog Headers/AppKit/


From: Wolfgang Lux
Subject: Re: [Gnustep-cvs] r29010 - in /libs/gui/trunk: ChangeLog Headers/AppKit/NSCell.h Source/NSActionCell.m Source/NSCell.m
Date: Sun, 15 Nov 2009 23:08:26 +0100

Fred Kiefer wrote:

Wolfgang Lux schrieb:
Author: wlux
Date: Sat Nov 14 23:15:31 2009
New Revision: 29010

URL: http://svn.gna.org/viewcvs/gnustep?rev=29010&view=rev
Log:
Fix NSActionCell implementation so that -setObjectValue: and
-setStringValue: have an effect while the cell is edited.

Modified:
    libs/gui/trunk/ChangeLog
    libs/gui/trunk/Headers/AppKit/NSCell.h
    libs/gui/trunk/Source/NSActionCell.m
    libs/gui/trunk/Source/NSCell.m

I have a problem with this change. With this the NSForm test in GSTest
now starts to flicker when editing a form cell. It works fine for the
first cell on the window, which doesn't belong to a form.

Chapeau! I had to look twice before I noticed the flicker.

Could you please explain the motivation of this change and perhaps
together we may come up with a better way to achieve the same goal.

The problem I attempted to fix is that [cell setStringValue:...] did
not have an effect while the cell is edited. The argument of the
message is saved to the respective cell attributes, but the field
editor was not updated.

Now for the screen flicker in NSFormCell. The problem is that for some
reason I do not understand, the NSForm repeatedly redraws the edited
form cell while it is active. While the cell is redrawn it calls the
cell's -attributedStringValue method to read the string to be drawn in
the cell. This method now calls -validateEditing on its control view,
which in turn writes back the string to the cell with -setStringValue:
(I've attached a backtrace at the bottom of this mail). This had no
observable effect up to now, but now causes the screen flicker as
-setStringValue: updates the field editor.

Now I think that NSForm should not draw the contents of the edited cell
in the first place; this should be the business of the field editor.
Incidentally, I have seen a similar effect for an NSTextField as I had
commented out the following code in NSControl's -drawRect: method.

  if ([self currentEditor] != nil)
    {
      [_cell setControlView: self];
      return;
    }

I hope this is enough input for you to track down this issue further.

Cheers
Wolfgang

Breakpoint 3, -[NSActionCell setStringValue:] (self=0x3765d98, _cmd=0x1411a74, aString=0x3748b08) at NSActionCell.m:238
238       [super setStringValue: aString];
#0 -[NSActionCell setStringValue:] (self=0x3765d98, _cmd=0x1411a74, aString=0x3748b08) at NSActionCell.m:238 #1 0x01182274 in -[NSMatrix validateEditing] (self=0x37c61b8, _cmd=0x13ff4d0) at NSMatrix.m:3809 #2 0x0100fdc8 in -[NSActionCell attributedStringValue] (self=0x3765d98, _cmd=0x1405d20) at NSActionCell.m:163 #3 0x010aa368 in -[NSCell(PrivateMethods) _drawAttributedString] (self=0x3765d98, _cmd=0x140d800) at NSCell.m:2743 #4 0x011342f8 in -[NSFormCell _drawAttributedString] (self=0x3765d98, _cmd=0x1405d58) at NSFormCell.m:396 #5 0x010a3b6c in -[NSCell drawInteriorWithFrame:inView:] (self=0x3765d98, _cmd=0x1405d80, cellFrame={origin = {x = 76, y = 3}, size = {width = 159, height = 15}}, controlView=0x37c61b8) at NSCell.m:1962 #6 0x010a3fe4 in -[NSCell drawWithFrame:inView:] (self=0x3765d98, _cmd=0x13ff528, cellFrame={origin = {x = 0, y = 0}, size = {width = 240, height = 21}}, controlView=0x37c61b8) at NSCell.m:2006 #7 0x010109b8 in -[NSActionCell drawWithFrame:inView:] (self=0x3765d98, _cmd=0x140d7f8, cellFrame={origin = {x = 0, y = 0}, size = {width = 240, height = 21}}, controlView=0x37c61b8) at NSActionCell.m:326 #8 0x01134264 in -[NSFormCell drawWithFrame:inView:] (self=0x3765d98, _cmd=0x140d67c, cellFrame={origin = {x = 0, y = 0}, size = {width = 240, height = 21}}, controlView=0x37c61b8) at NSFormCell.m:386 #9 0x01132218 in -[NSForm drawCellAtIndex:] (self=0x37c61b8, _cmd=0x140d684, index=0) at NSForm.m:392 #10 0x0113229c in -[NSForm drawCellAtRow:column:] (self=0x37c61b8, _cmd=0x1411784, row=0, column=0) at NSForm.m:398 #11 0x01178824 in -[NSMatrix drawRect:] (self=0x37c61b8, _cmd=0x140d664, rect={origin = {x = 0, y = 0}, size = {width = 240, height = 21}}) at NSMatrix.m:2044 #12 0x011320c0 in -[NSForm drawRect:] (self=0x37c61b8, _cmd=0x14208f8, rect={origin = {x = 0, y = 0}, size = {width = 240, height = 21}}) at NSForm.m:381 #13 0x012abd3c in -[NSView displayRectIgnoringOpacity:inContext:] (self=0x37c61b8, _cmd=0x14208e8, aRect={origin = {x = 0, y = 0}, size = {width = 240, height = 21}}, context=0x376b128) at NSView.m:2428 #14 0x012ab950 in -[NSView displayRectIgnoringOpacity:] (self=0x37c61b8, _cmd=0x14208d8, aRect={origin = {x = 0, y = 0}, size = {width = 240, height = 21}}) at NSView.m:2374 #15 0x012ab3d4 in -[NSView displayIfNeededInRectIgnoringOpacity:] (self=0x37c61b8, _cmd=0x14208c8, aRect={origin = {x = 0, y = 0}, size = {width = 240, height = 121}}) at NSView.m:2306 #16 0x012ab604 in -[NSView displayIfNeededInRectIgnoringOpacity:] (self=0x375fa48, _cmd=0x14208c8, aRect={origin = {x = 0, y = 0}, size = {width = 240, height = 121}}) at NSView.m:2331 #17 0x012ab604 in -[NSView displayIfNeededInRectIgnoringOpacity:] (self=0x375f598, _cmd=0x14208c8, aRect={origin = {x = 0, y = 0}, size = {width = 254, height = 147}}) at NSView.m:2331 #18 0x012ab604 in -[NSView displayIfNeededInRectIgnoringOpacity:] (self=0x376e408, _cmd=0x14208c8, aRect={origin = {x = 0, y = 0}, size = {width = 254, height = 157}}) at NSView.m:2331 #19 0x012ab604 in -[NSView displayIfNeededInRectIgnoringOpacity:] (self=0x37eecb8, _cmd=0x14208c8, aRect={origin = {x = 0, y = 0}, size = {width = 274, height = 381}}) at NSView.m:2331 #20 0x012ab604 in -[NSView displayIfNeededInRectIgnoringOpacity:] (self=0x376dcf8, _cmd=0x14208c8, aRect={origin = {x = 0, y = 0}, size = {width = 274, height = 403}}) at NSView.m:2331 #21 0x012ab1b8 in -[NSView displayIfNeededInRect:] (self=0x376dcf8, _cmd=0x14208c0, aRect={origin = {x = 0, y = 0}, size = {width = 274, height = 403}}) at NSView.m:2284 #22 0x012aafb4 in -[NSView displayIfNeeded] (self=0x376dcf8, _cmd=0x1421ac8) at NSView.m:2266 #23 0x012c7470 in -[NSWindow displayIfNeeded] (self=0x33eb378, _cmd=0x14214d8) at NSWindow.m:2305 #24 0x012ba79c in -[NSWindow(GNUstepPrivate) _handleAutodisplay] (self=0x33eb378, _cmd=0x14214f0) at NSWindow.m:166 #25 0x012ba8c4 in +[NSWindow(GNUstepPrivate) _handleAutodisplay:] (self=0x1436f60, _cmd=0x1421500, bogus=0x0) at NSWindow.m:195 #26 0x01fd7c60 in -[NSObject performSelector:withObject:] (self=0x1436f60, _cmd=0x21a6a7c, aSelector=0x1421500, anObject=0x0) at NSObject.m:1822 #27 0x0202e974 in -[GSRunLoopPerformer fire] (self=0x379a618, _cmd=0x21a6b3c) at NSRunLoop.m:113 #28 0x02030c4c in -[NSRunLoop(Private) _checkPerformers:] (self=0x33ce888, _cmd=0x21a6c54, context=0x33cfd88) at NSRunLoop.m:487 #29 0x020341a0 in -[NSRunLoop acceptInputForMode:beforeDate:] (self=0x33ce888, _cmd=0x21a6c9c, mode=0x21a6d30, limit_date=0x33ee5a8) at NSRunLoop.m:1136 #30 0x02034d80 in -[NSRunLoop runMode:beforeDate:] (self=0x33ce888, _cmd=0x1423984, mode=0x21a6d30, date=0x33d0cb8) at NSRunLoop.m:1270 #31 0x012f2370 in -[GSDisplayServer(EventOps) getEventMatchingMask:beforeDate:inMode:dequeue:] (self=0x3335468, _cmd=0x34b36f0, mask=4294967295, limit=0x33d0cb8, mode=0x21a6d30, flag=1 '\001') at GSDisplayServer.m:1002 #32 0x0343bb68 in -[XGServer(X11Ops) getEventMatchingMask:beforeDate:inMode:dequeue:] (self=0x3335468, _cmd=0x140132c, mask=4294967295, limit=0x33d0cb8, mode=0x21a6d30, flag=1 '\001') at XGServerEvent.m:2546 #33 0x0103db00 in DPSGetEvent (ctxt=0x3335468, mask=4294967295, limit=0x33d0cb8, mode=0x21a6d30) at ../Headers/Additions/GNUstepGUI/ GSDisplayServer.h:188 #34 0x0103ee38 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (self=0x332e538, _cmd=0x140156c, mask=4294967295, expiration=0x33d0cb8, mode=0x21a6d30, flag=1 '\001') at NSApplication.m:2145 #35 0x0103c0bc in -[NSApplication run] (self=0x332e538, _cmd=0x13ff38c) at NSApplication.m:1524 #36 0x01009fd8 in NSApplicationMain (argc=2, argv=0xbfffe740) at Functions.m:74
#37 0x00002690 in gnustep_base_user_main ()
#38 0x020138ec in main (argc=2, argv=0xbfffe740, env=0xbfffe74c) at NSProcessInfo.m:921







reply via email to

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