Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!asuvax!noao!arizona!naucse!rlm From: rlm@naucse.cse.nau.edu (Rich Muller) Newsgroups: comp.sys.mac.programmer Subject: MDEF Help needed Keywords: Why won't PenPat() work ? Message-ID: <3518@naucse.cse.nau.edu> Date: 24 Mar 91 22:47:55 GMT Organization: Northern Arizona University, Flagstaff AZ Lines: 58 Well, this one is either very subtle or very obvious, but I can't see it. I'm writing a simple custom MDEF which should present a menu in the form of five rectangles, each filled in with a differnt Pattern. The mechanics of the MDEF work fine: the menu appears, the rectangles are presented, they invert as the user scans down the list, they flash when selected, it returns the right item number. But!! The rectangles, instead of being drawn with a standard Pattern, appear with something which looks vaguely like Arabic script. Here's the section of the MDEF code which draws the menu: case mDrawMsg: r.top = menuRectPtr->op + MMARG/2 r.left = menuRectPtr->left + MMARG; r.bottom = r.top + MHEIGHT; r.right = r.left + MWIDTH; for (i = 1; i <= NITEMS; i++) { PenPat(dkGray); PaintRect(&r); PenNormal(); OffsetRect(&r, 0, MHEIGHT + MMARG); } break; The line PenPat(dkGray) is provided here for illustration only: this should produce NITEMS identical rectangles filled with the dkGray pattern, but instead it produces five identical squiggly-filled Rects. What's the problem? Other drawing operations in/on the rect r work fine: I can frame it, fill it with no pattern, fill it with a color (but not an RGBColor if that's a clue!) and draw text in it. Does the Window Manager grafPort have special characteristics -- that's where menus get drawn? e-mail reply is probably best, unless someone thinks this is of general interest. Thanks. Lots. Rich Muller rlm@naucse.cse.nau.edu -- Rich Muller Flagstaff, AZ rlm@naucse.cse.nau.edu 602/526-2865 rmuller@hampvms.bitnet