[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A few more newbie questions
From: |
German Arias |
Subject: |
Re: A few more newbie questions |
Date: |
Wed, 4 Apr 2012 12:56:03 -0600 |
2012/4/4, Omar Campos <megathodik@gmail.com>:
> Hi all,
>
> Now that I've read some of the introductory tutorials, I started to
> develop my first GNUStep app. Nothing too complicated, of course. In
> working on it, I've come up to a few doubts. Your input will be of great
> help.
>
> 1. Nicola Pero's tutorial on NSButton teaches how to replace a window's
> content rect with a NSButton. While this fits the purposes of the tutorial,
> I wanted to add more than one control to the window. But I was unable to
> find a way to make -addSubview work on NSWindow (it seems that it is a
> subclass of NSResponder and not of NSView). So what I did was that I used
> an NSBox and set it as the NSWindow's content rect.
//Get the content view of the window
//By default the conten view is an NSView object
NSView *view = [window contentView];
//Then add your buttons
[view addSubview: buttonOne];
[view addSubview: buttonTwo];
......
[buttonOne release];
[buttonTwo release];
......
> Now I can add more
> controls to the window. Is there an alternate way to do this? Also, is
> there a way to remove an NSBox's title? I tried to use -setTitle:@"", but I
> still get a blank space where the title is supposed to be.
Use:
[box stTitlePosition: NSNoTitle];
>
> 2. What exactly is the NSResponder class for? I think it was to do with
> event handling.
Right.
>
> 3. The tutorials tell me to use the "openapp" command to execute my app. Is
> there a reason why I couldn't invoke the application's executable directly?
> Also, I've found that if I do "make install", I can execute the application
> without "openapp". It seems "make install" copies the necessary app files
> into folders where they can be found in the environment. Will this affect
> me somehow when I try to create an app installer?
The openapp tool is needed if you use the gnutep layout. But by
default gnustep use the FHS layout, so you don't need the openapp
tool.
>
> Thanks for any info, as always.
>
> SIncerely,
> Omar
>