[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Drawing in a Color Window with MacPerl



In order to learn how to use the Mac Toolbox with MacPerl, I am currently
trying to open a color window and draw a patterned circle in it. Here is my code:

#!perl -w

use Mac::Events;
use Mac::Windows;
use Mac::QuickDraw;
use Mac::Fonts;

$color = blueColor;

$love = new Pattern q{
			        .XX.XX..
			        X..X..X.
			        X.....X.
			        .X...X..
			        ..X.X...
			        ...X....
			        ........
			        ........
};

$portR = new Rect 0, 0, 100, 100;

$win = NewCWindow $bounds, "Hello World!", 1, documentProc, 1;

if ($win) {

# Routine QuickDraw
SetPort($win);
ForeColor($color);
PenPat($love);
PaintOval($portR);

sleep(3);

DisposeWindow($win);

}

Questions:

1) What is the equivalent of PaintOval(myWindow^.portRect) in MacPerl (i.e.,
How do you get a pointer to the portRect in MacPerl)?

2) How can I make my own colors using 3 RGB values, instead of using constants
such as blueColor, whiteColor, etc?

3) How can I make my circle last (it currently disappears almost immediately)?

4) How do you manage window events in MacPerl when not using MacWindow?

Any help would be appreciated.


Philippe de Rochambeau

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch