Little offtopic

Hi all.
May anyone to recommend tutorial on programming Mac OS X GUI without
Interface Builder/nib files? Sorry for this offtopic - but maybe
somebody had the same tasks
I made a small game and want to show the license agreement window before
the SDL engine start. As I see - I have to create window, add text view,
add buttons and run event loop. What I need - a little tutorial :slight_smile:

Thank you :slight_smile:

Hi-

Might I ask what you have against using IB and nibs?On 2 Jun 2009, at 15:28, Dmytro Bogovych wrote:

Hi all.
May anyone to recommend tutorial on programming Mac OS X GUI without
Interface Builder/nib files? Sorry for this offtopic - but maybe
somebody had the same tasks
I made a small game and want to show the license agreement window
before the SDL engine start. As I see - I have to create window, add
text view, add buttons and run event loop. What I need - a little
tutorial :slight_smile:

Thank you :slight_smile:


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

-------------- next part --------------
A non-text attachment was scrubbed…
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2663 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090602/0ba9bab2/attachment.bin

Well first you can just let the SDL engine start I think, so that you don’t
have to run your own event loop.

Creating window and adding text view into it programmatically are pretty
simple and straightforward, here is a simplified example:

NSWindow *window;
window = [[NSWindow alloc] initWithContentRect: NSMakeRect(0, 0,

width, height)
styleMask: NSTitledWindowMask |

NSMiniaturizableWindowMask |
NSClosableWindowMask |
NSResizableWindowMask
backing: NSBackingStoreBuffered
defer: NO];
[window setTitle: @“Blahblah”];
[window makeKeyAndOrderFront: nil];

NSTextView *view = [[NSTextView alloc] initWithFrame:

NSMakeRect(0, 0, width, height)];
[[window contentView] addSubview: view];
[window makeFirstResponder: view];

  • JiangOn Tue, Jun 2, 2009 at 10:28 PM, Dmytro Bogovych wrote:

May anyone to recommend tutorial on programming Mac OS X GUI without
Interface Builder/nib files? Sorry for this offtopic - but maybe somebody
had the same tasks
I made a small game and want to show the license agreement window before the
SDL engine start. As I see - I have to create window, add text view, add
buttons and run event loop. What I need - a little tutorial :slight_smile:

May you advice me - how to add buttons Agree / Disagree?

Jjgod Jiang wrote:> On Tue, Jun 2, 2009 at 10:28 PM, Dmytro Bogovych wrote:

May anyone to recommend tutorial on programming Mac OS X GUI without
Interface Builder/nib files? Sorry for this offtopic - but maybe somebody
had the same tasks
I made a small game and want to show the license agreement window before the
SDL engine start. As I see - I have to create window, add text view, add
buttons and run event loop. What I need - a little tutorial :slight_smile:

Well first you can just let the SDL engine start I think, so that you don’t
have to run your own event loop.

Creating window and adding text view into it programmatically are pretty
simple and straightforward, here is a simplified example:

NSWindow *window;
window = [[NSWindow alloc] initWithContentRect: NSMakeRect(0, 0,

width, height)
styleMask: NSTitledWindowMask |

NSMiniaturizableWindowMask |
NSClosableWindowMask |
NSResizableWindowMask
backing: NSBackingStoreBuffered
defer: NO];
[window setTitle: @“Blahblah”];
[window makeKeyAndOrderFront: nil];

NSTextView *view = [[NSTextView alloc] initWithFrame:

NSMakeRect(0, 0, width, height)];
[[window contentView] addSubview: view];
[window makeFirstResponder: view];

  • Jiang

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Nothing. Just do not understand how to deal in the case of pure SDL
application.
I studied tutorials but it is not understandable for me now :frowning: I
understand how to deal with them if main window is created from NIB.
But do not understand how to work with NIB file and non-main window…
(main window is under SDL control now)

So I try to switch to plain Objective-C - I do not need too much
functionality…

Alastair Lynn wrote:> Hi-

Might I ask what you have against using IB and nibs?

On 2 Jun 2009, at 15:28, Dmytro Bogovych wrote:

Hi all.
May anyone to recommend tutorial on programming Mac OS X GUI without
Interface Builder/nib files? Sorry for this offtopic - but maybe
somebody had the same tasks
I made a small game and want to show the license agreement window
before the SDL engine start. As I see - I have to create window, add
text view, add buttons and run event loop. What I need - a little
tutorial :slight_smile:

Thank you :slight_smile:


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org



SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I think that Jjgod Jiang told all you need to know. For actual buttons
just look at the Application Kit Framework Reference.On Tue, Jun 2, 2009 at 1:46 PM, Dmytro Bogovych wrote:

May you advice me - how to add buttons Agree / Disagree?

Jjgod Jiang wrote:

On Tue, Jun 2, 2009 at 10:28 PM, Dmytro Bogovych wrote:

May anyone to recommend tutorial on programming Mac OS X GUI without
Interface Builder/nib files? Sorry for this offtopic - but maybe somebody
had the same tasks
I made a small game and want to show the license agreement window before
the
SDL engine start. As I see - I have to create window, add text view, add
buttons and run event loop. What I need - a little tutorial :slight_smile:

Well first you can just let the SDL engine start I think, so that you
don’t
have to run your own event loop.

Creating window and adding text view into it programmatically are pretty
simple and straightforward, here is a simplified example:

NSWindow *window;
window = [[NSWindow alloc] initWithContentRect: NSMakeRect(0, 0,
width, height)
styleMask: NSTitledWindowMask |

NSMiniaturizableWindowMask |
NSClosableWindowMask |
NSResizableWindowMask
backing: NSBackingStoreBuffered
defer: NO];
[window setTitle: @“Blahblah”];
[window makeKeyAndOrderFront: nil];

NSTextView *view = [[NSTextView alloc] initWithFrame:
NSMakeRect(0, 0, width, height)];
[[window contentView] addSubview: view];
[window makeFirstResponder: view];

  • Jiang

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hi,On Wed, Jun 3, 2009 at 4:46 AM, Dmytro Bogovych wrote:

May you advice me - how to add buttons Agree / Disagree?

Like this:

NSButton *button = [[NSButton alloc] initWithFrame: NSMakeRect(10,

10, 50, 20)];
[button setTitle: @“Agree”];
[view addSubview: button];

You may need to adjust the width/height in the first line.

For other parameters, you can check the Button Programming Guide [1]
and NSButton Class Reference [2].

  • Jiang

[1] http://developer.apple.com/documentation/Cocoa/Conceptual/Button/index.html
[2] http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/
NSButton_Class/Reference/Reference.html