#M2Sprint problem
4 messages in this thread
I'm having a problem setting up a window in a custom screen that uses a
font other than the system default. I'm using M2Sprint. When the TextAttr
pointer in the NewScreen structure is NIL, everything's OK. But when I plug
in the address of my TextAttr structure (ROMFont or DiskFont) the drag bar
of the window gets drawn about 5 times as thick as it should. It's only
"hot" in the area you'd expect, but the bar extends far down into the
window. It doesn't matter whether WindowDrag is specified in the
WindowFlags{} or not; if it's not specified, it just draws a thick bar with
no drag pattern. I'm sure it's not the font, as I've tried both the font I
want and the normal topaz.font, and I've also done this exact same process
in C successfully with the font I want. The font is being set properly
since the screen and window titles are in the specified font.
Has this problem been reported before, and is there a fix? If not, and
you don't plan on fixing it yourself, please tell me where it is in the
library source and I'll fix it myself. I need the capability of specifying
a particular font for the custom screen, and I'm _not_ prepared to lay out
another hundred dollars or so for another compiler. Thanks …
Harry
Harry,
I have used both M2Sprint and Benchmark extensively and I can safely tell
you, there ain't much wrong with either package.
I sure wish AG would get those V2.0 mods out though. 😉
The next message to you will be a short prog I whipped up to demonstrate
how to open a custom screen/window and SetFont() to a new font. Just
capture it, clip out the garbage, compile and link (with RT). It's pretty
self-documenting, but if you have any further questions, just ask away.
Harry,
Your problem wasn't too difficult. What happened is that you were
attempting to pass a TextAttr RECORD to a procedure.
PROCEDURE InitScreenData(VAR sp: ScreenPtr; ta: TextAttr);
This isn't too good. You have to pass the address of the RECORD, not
the RECORD itself. You can do this in one of two ways…
PROCEDURE InitScreenData(VAR sp: ScreenPtr; ta: TextAttrPtr);
PROCEDURE InitScreenData(VAR sp: ScreenPtr; VAR ta: TextAttrPtr);
The first is preferred (I guess by me). The second way (using the
VAR) is technically correct. It is a "variable parameter" and the
address of the argument is passed to the procedure.
David Czaya
David –
Thanks. See my Email reply … Guess I've been using C too long and
forgot about structures on temporary subroutine stacks 8^).
I still don't know why your sample works on 1.0 and not on 1.1 (on my
system). I watch the compiles carefully, and nothing fails (I delete _all_
lnk and sym files before I start so nothing works accidentally). I guess
I'll give them a call tomorrow. Thanks again for the help.
Harry