kenyatta
2002.07.16, 07:06 PM
I'm working in Project Builder v 1.1.1 (Dec 2001 Developer Tools), it's a great help because I can find the definition to a whole bunch of functions. The following code I grabbed from a the Hello Tutorial, SillyBalls, and Chapter 1 example from K.J. Bricknell.
I wanted to take apart the code into something simpler so I would be able to understand it. I was able to use 2 function calls and I got the simple program that terminates as soon as the mouse is pressed down. The program displays a new window. That's it.
Then I tried to get fancy and add (SillyBalls code ) couldn't make it happen.
I then tried to draw 1 oval and couldn't make that happen.
Then I tried to draw a string, change the window's content color and title,
niether worked.
At least the program still was able to build successfully with a plain old window.
Anybody think they can help? And is this possible without creating a nib reference or WIND resource?
void doPreliminaries(void) {
MoreMasterPointers(32);
InitCursor();
}
void DrawWindow() {
WindowRef myWindow;
RGBColor wColor;
wColor.red = 0x0;
wColor.green = 0x0;
wColor.blue = 0x0;
SetRect(&windRect,50,50,600,600);
myWindow = NewCWindow(nil, &windRect, "\pWindow Test", true, zoomDocProc, (WindowRef) -1, true, 0);
SetPort( GetWindowPort(myWindow) );
SetWTitle( myWindow, "\p MY WINDOW TEST ");
SetWindowContentColor ( myWindow, &wColor);
}
:confused: hmm . . .
I wanted to take apart the code into something simpler so I would be able to understand it. I was able to use 2 function calls and I got the simple program that terminates as soon as the mouse is pressed down. The program displays a new window. That's it.
Then I tried to get fancy and add (SillyBalls code ) couldn't make it happen.
I then tried to draw 1 oval and couldn't make that happen.
Then I tried to draw a string, change the window's content color and title,
niether worked.
At least the program still was able to build successfully with a plain old window.
Anybody think they can help? And is this possible without creating a nib reference or WIND resource?
void doPreliminaries(void) {
MoreMasterPointers(32);
InitCursor();
}
void DrawWindow() {
WindowRef myWindow;
RGBColor wColor;
wColor.red = 0x0;
wColor.green = 0x0;
wColor.blue = 0x0;
SetRect(&windRect,50,50,600,600);
myWindow = NewCWindow(nil, &windRect, "\pWindow Test", true, zoomDocProc, (WindowRef) -1, true, 0);
SetPort( GetWindowPort(myWindow) );
SetWTitle( myWindow, "\p MY WINDOW TEST ");
SetWindowContentColor ( myWindow, &wColor);
}
:confused: hmm . . .