Talk:Hello world/Graphical: Difference between revisions

From Rosetta Code
Content added Content deleted
(Obj C: does it work?!)
Line 5: Line 5:
:I changed the description. Is that more clear? --[[User:Mwn3d|Mwn3d]] 17:00, 27 October 2008 (UTC)
:I changed the description. Is that more clear? --[[User:Mwn3d|Mwn3d]] 17:00, 27 October 2008 (UTC)
::I guess. But since there are multiple different ways to output the message, I think it should be mentioned in each implementation, where and how the message will appear. --[[User:PauliKL|PauliKL]] 09:19, 28 October 2008 (UTC)
::I guess. But since there are multiple different ways to output the message, I think it should be mentioned in each implementation, where and how the message will appear. --[[User:PauliKL|PauliKL]] 09:19, 28 October 2008 (UTC)

==Objective-C==

This is the second fragment of Obj-C code that I try to run without success!! :) First, it is not a complete example (copy-pasting and simply compiling won't work...). Ok, I could try to complete the code... I obtained

<pre>#import <AppKit/AppKit.h>

int main()
{
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
[alert setMessageText: @"Goodbye, World!"];
[alert runModal];
}</pre>

After "several" effort about understanding a NXConstantString vs NSConstantString problem, I succeeded compiling it with

<pre>
gcc -lobjc -fconstant-string-class=NSConstantString _box.m -lgnustep-gui -lgnustep-base -o box
</pre>

but running it, I obtain:

<pre>2008-12-09 15:39:11.749 box[9570] autorelease called without pool for object (80cf8c0) of class NSAlert in thread <NSThread: 0x8081690>
Segmentation fault
</pre>

Ok this is not a place for debugging or what, but shouldn't the given codes work properly?! It seems not to work. --[[User:ShinTakezou|ShinTakezou]] 14:42, 9 December 2008 (UTC)

Revision as of 14:42, 9 December 2008

Graphical console?

What is a graphical console? I thought a console is always text mode.
It seems that, again, there are many interpretations of what the task means, because of the vague task specification.
--PauliKL 09:31, 27 October 2008 (UTC)

I changed the description. Is that more clear? --Mwn3d 17:00, 27 October 2008 (UTC)
I guess. But since there are multiple different ways to output the message, I think it should be mentioned in each implementation, where and how the message will appear. --PauliKL 09:19, 28 October 2008 (UTC)

Objective-C

This is the second fragment of Obj-C code that I try to run without success!! :) First, it is not a complete example (copy-pasting and simply compiling won't work...). Ok, I could try to complete the code... I obtained

#import <AppKit/AppKit.h>

int main()
{
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
[alert setMessageText: @"Goodbye, World!"];
[alert runModal];
}

After "several" effort about understanding a NXConstantString vs NSConstantString problem, I succeeded compiling it with

gcc -lobjc -fconstant-string-class=NSConstantString  _box.m -lgnustep-gui -lgnustep-base -o box

but running it, I obtain:

2008-12-09 15:39:11.749 box[9570] autorelease called without pool for object (80cf8c0) of class NSAlert in thread <NSThread: 0x8081690>
Segmentation fault

Ok this is not a place for debugging or what, but shouldn't the given codes work properly?! It seems not to work. --ShinTakezou 14:42, 9 December 2008 (UTC)