Forum Navigation
You need to log in to create posts and topics.

Re: [Q] drawing in colour...

Posted by: David.Cottrell <David.Cottrell@...>

On Thu, 11 Dec 1997 11:02 AM, Mel Patrick <mailto:mel@intergate.bc.ca>
wrote:
> Okay I have to be doing something wrong. According to Inside Mac when I
> set

I can't see what is wrong with your code. here is how I change colours
using a colour popup menu.

(Of course you set the colour before you change the colour patch drawn in
the popup FN).

Help any?

'=========================================
'the following functions draw the appropriate
'icons in each of the pop-up menues.
'=========================================
LOCAL FN colorPopUp
DIM patchRect.8

'draw the colour patch
CALL RGBFORECOLOR(#@gmRec)

CALL PENNORMAL
CALL SETRECT(patchRect,137,7,209,19)
CALL PAINTRECT(patchRect)
END FN

LOCAL FN setColour
mHndl& = FN installPop (_ColorMenu)
LONG IF mHndl&
CALL GETITEM(mHndl&,1,t$)
gmRec.red = VAL(t$)

CALL GETITEM(mHndl&,2,t$)
gmRec.green = VAL(t$)

CALL GETITEM(mHndl&,3,t$)
gmRec.blue = VAL(t$)

FN deletePop(mHndl&)
END IF

END FN
'=========================================

------------------------------------------------------------------
Dr David Cottrell James Cook University

All unconventional spellings that you might notice in the above are
intentional, and are just part of a living dynamic language.
------------------------------------------------------------------