#Intuition/C
4 messages in this thread
Hi, I have a C/Intuition programming question. I have a boolen gadget on a
widow. The user presses the gadget. My code sees the press and reacts to
it. So far, so good. I want a message to come to the window when he presses
this gadget. How do I get my message to his window? I know that PRINTF oly
sends the message to the original CLI that the program was started from, so
that is't the answer. I assume that some type of IntuiText struct has to be
used but how do I work the variable that contains my response into a
IntuiText structure?? Can someone show me some source for this type of
thing? THere are very few Inutition/C examples in the libraries, I'm sorry
to say. Thanks for any and all help. Regards, Al Saveriano
Al, here is a snippet of code that should do it
char *string = "I am a string";
struct RastPort *rp; /* set to windows RastPort */
SetAPen ( rp, 1 ); /* set the color of the text */
SetBPen ( rp, 0 ); /* set the color of the background behind the text */
SetDrMd ( rp, JAM2 );
Move ( rp, x, y ); /* Move in the rastport to the coordinates you want
*/
Text ( rp, string, strlen (string) ); /* write the string out */
and thats all it takes to write a string, (I'm assuming you've opened
GfxBase and IntuitionBase).
Any questions?
Kev – "Outside of a dog, a book is Man's best friend."
"Inside of a dog, its too dark to read!" – Groucho Marx
Kevin, Thanks very much for the code. I'll give it a shot. Regards, – al
saveriano –
No problem, Al. Hope it works for you!
Kev – "Outside of a dog, a book is Man's best friend."
"Inside of a dog, its too dark to read!" – Groucho Marx