Tue 10 Jul 2007 11:31:38 AM UTC, comment #3:
I just tested and both of these lines work perfectly:
[txt setStringValue: [arr description]];
[txt setObjectValue: arr];
I will decline this bug report. What is strange is that GNUstep is not able to report properly what is going wrong. When trying to show an alert panel with the doesNotRecognizeSelector: message the text cell falls over as the arguments cannot be handled as text. This leads to a very strange output. But this is an unrelated issue:
Array2TxtFld.app/Array2TxtFld: Uncaught exception NSGenericException, reason: Glyph generation was triggered for a layout manager while the text storage it was attached to had unprocessed editing. This is not allowed. Glyph generation may be triggered only at points where calls to -beginEditing and -endEditing are balanced.
Program received signal SIGABRT, Aborted.
[Switching to Thread -1222420800 (LWP 20612)]
0xb7ee8410 in ?? ()
(gdb) bt
#0 0xb7ee8410 in ?? ()
#1 0xbf89ee18 in ?? ()
#2 0x00000006 in ?? ()
#3 0x00005084 in ?? ()
#4 0xb7639060 in raise () from /lib/libc.so.6
#5 0xb763a801 in abort () from /lib/libc.so.6
#6 0xb78d0b66 in _terminate () at NSException.m:686
#7 0xb78d0d3b in _NSFoundationUncaughtExceptionHandler (exception=0x8220ce0)
at NSException.m:710
#8 0xb78d14a2 in -[NSException raise] (self=0x8220ce0, _cmd=0xb7ed23e8)
at NSException.m:841
#9 0xb7dd5842 in -[GSHorizontalTypesetter layoutGlyphsInLayoutManager:inTextContainer:startingAtGlyphIndex:previousLineFragmentRect:nextGlyphIndex:numberOfLineFragments:] (self=0xa108c30, _cmd=0xb7ed0a28, layoutManager=0xa10b190,
textContainer=0xa10b330, glyphIndex=0, previousLineFragRect=
{origin = {x = 0, y = 0}, size = {width = 0, height = 0}},
nextGlyphIndex=0xbf89f18c, howMany=0) at GSHorizontalTypesetter.m:1258
#10 0xb7dce45b in -[GSLayoutManager(LayoutHelpers) _doLayout] (
self=0xa10b190, _cmd=0xb7ed0a38) at GSLayoutManager.m:1596
#11 0xb7dce67a in -[GSLayoutManager(LayoutHelpers) _doLayoutToContainer:] (
---Type <return> to continue, or q <return> to quit---
self=0xa10b190, _cmd=0xb7ed0a48, cindex=0) at GSLayoutManager.m:1660
#12 0xb7dd004c in -[GSLayoutManager(layout) usedRectForTextContainer:] (
self=0xa10b190, _cmd=0xb7e945c0, container=0xa10b330)
at GSLayoutManager.m:2200
#13 0xb7d2288d in cache_lookup_attributed_string (string=0x8127438,
hasSize=0, size={width = 0, height = 0}, useScreenFonts=1)
at NSStringDrawing.m:345
#14 0xb7d232b0 in -[NSAttributedString(NSStringDrawing) size] (
self=0x8127438, _cmd=0xb7e34c20) at NSStringDrawing.m:500
#15 0xb7c33956 in -[NSCell cellSize] (self=0x81147c8, _cmd=0xb7e2a588)
at NSCell.m:1796
#16 0xb7c197e5 in -[NSBox(Private) calcSizesAllowingNegative:] (
self=0x81bf730, _cmd=0xb7e2a4b0, aFlag=0 '\000') at NSBox.m:669
#17 0xb7c168ba in -[NSBox setContentView:] (self=0x81bf730, _cmd=0xb7e2a490,
aView=0x827aa80) at NSBox.m:254
#18 0xb7c16104 in -[NSBox initWithFrame:] (self=0x81bf730, _cmd=0xb7e1bbd8,
frameRect={origin = {x = 0, y = 95}, size = {width = 362, height = 2}})
at NSBox.m:90
#19 0xb7be5854 in -[GSAlertPanel _initWithoutGModel] (self=0x810ba60,
_cmd=0xb7e1bba8) at NSAlert.m:392
---Type <return> to continue, or q <return> to quit---
#20 0xb7be488d in -[GSAlertPanel init] (self=0x810ba60, _cmd=0xb7e1bfd0)
at NSAlert.m:245
#21 0xb7bea6b1 in -[GSExceptionPanel init] (self=0x810ba60, _cmd=0xb7e1bed0)
at NSAlert.m:1710
#22 0xb7bea3ee in GSRunExceptionPanel (title=0xa17c0c0, exception=0xa17c110,
defaultButton=0x81644b8, alternateButton=0x0, otherButton=0x81097a8)
at NSAlert.m:1676
#23 0xb7bf6b98 in _NSAppKitUncaughtExceptionHandler (exception=0xa17c110)
at NSApplication.m:122
#24 0xb78d1497 in -[NSException raise] (self=0xa17c110, _cmd=0xb7af7b98)
at NSException.m:832
#25 0xb78d0f60 in +[NSException raise:format:arguments:] (self=0xb7af7640,
_cmd=0xb7af7b80, name=0xb7af73bc, format=0xb7b08f2c,
argList=0xbf89f80c "h\023��R櫷�d��@v��A\016\215��d��R櫷�����\221\020\bX\n\022\bd�\211�U�\220�X\n\022\b�\231��\210�wI\233��\031")
at NSException.m:753
#26 0xb78d0e98 in +[NSException raise:format:] (self=0xb7af7640,
_cmd=0xb7b098f0, name=0xb7af73bc, format=0xb7b08f2c) at NSException.m:739
#27 0xb790f379 in -[NSObject doesNotRecognizeSelector:] (self=0x8120a58,
_cmd=0xb7b099e8, aSelector=0xb7add788) at NSObject.m:1672
|
Tue 10 Jul 2007 09:13:37 AM UTC, original submission:
I have an OpenStep application ported to GNUstep. During port I found a bug in setStringValue: method of NSTextField.
Example:
id arr = [[NSArray alloc] initWithObjects: @"a", @"b", nil];
id txt = [[NSTextField alloc] initWithFrame: NSMakeRect(5, 37, 200, 28)];
[txt setStringValue: arr];
This crash on NSException, but in OpenStep it shows "(a, b)" string in NSTextField. I have attached some example.
|