Search results

  1. Crutch

    ThinkC QuadWindows - going a bit beyond [Study Group 1] with event detection

    Final observation: there is only one QD global randSeed for your whole A5 world. You don’t need to set it for all 4 GrafPorts. So just one GetDateTime(&randSeed) or randSeed = TickCount() will do.
  2. Crutch

    ThinkC QuadWindows - going a bit beyond [Study Group 1] with event detection

    Problem #1 - you are getting those residual lines because your line-drawing loop “erases” the old lines by drawing them using penmode patXor. However when you change colors, your FillRect() call instantly erases all the old lines. So when you later ”erase” all of the oldest lines one at a time...
  3. Crutch

    ThinkC [Study Group 1] Drawing on the Macintosh

    I posted in the other thread an easier way to find out if the user mouses over a window (of course, taking action when the user just mouses over a window without clicking would be nonstandard behavior). WaitNextEvent() also lets you pass in a ‘mouseRgn’ parameter which will toss you back a...
  4. Crutch

    ThinkC QuadWindows - going a bit beyond [Study Group 1] with event detection

    It looks like you are just trying to check if the user moused over a window? You already know how to do that … call FindWindow(). It’s not just for mouse clicks! Point p; WindowPtr w; GetMouse(&p); LocalToGlobal(&p); if (FindWindow(p, &w) == inContent) { if (w == firstWindow) ...
  5. Crutch

    ThinkC [Study Group 1] Drawing on the Macintosh

    Yeah but not including ANSI would generate a link error, not an illegal instruction. Theory: @pretzelFTW you have “generate 68020 code” checked in your project settings dialog but are running on a Plus. So you are getting a MULS.L instruction in your generated code, which is a valid 68020...
  6. Crutch

    ThinkC [Study Group 1] Drawing on the Macintosh

    You can absolutely multiply a long and a short. No casting is required. Something fishy is happening there. Would you mind running Source—>Disassemble on this code and posting the result for that small main() function?
  7. Crutch

    ThinkC [Study Group 1] Drawing on the Macintosh

    By the way you don’t need GetFNum here. The font manager defines constants for all the classic Apple fonts. Just TextFont(monaco) will do. If not available it will indeed fail over to Geneva.
  8. Crutch

    What I've received as of late...

    The sad Mac will not pass on its own. If you see a sad Mac, you are done.
  9. Crutch

    ThinkC [Study Group 1] Drawing on the Macintosh

    @atariorbit You have spotlighted something that I’ve always found a little awkward in coming up a Mac “configs” type dialog … there is actually no (supported) way to change a static text item to editable text and back. I always thought this feature should exist. (Clicking a static text item to...
  10. Crutch

    ThinkC [Study Group 1] Drawing on the Macintosh

    Suggestion: If you want to share code for thoughts or feedback just linking the .c text file would be helpful and allow more people to instantly take a look while using their phone, iPad etc.
  11. Crutch

    What I've received as of late...

    Memory check occurs before the happy Mac. The happy Mac is happy in part because he passed his memory check. On original Macs the screen has a dark background with a white closely spaced diagonal pattern during this time. On an SE/30 the screen is 50% gray, but with no happy Mac icon.
  12. Crutch

    ThinkC [Study Group 1] Drawing on the Macintosh

    Nice setup! If you aren’t already, you can use GetFontInfo() to obtain text line height for a font and advance the appropriate amount rather than storing each line’s position in a constant. FontInfo fInfo; short lineHeight; ... GetFontInfo(&fInfo); lineHeight = fInfo.ascent + fInfo.descent +...
  13. Crutch

    ThinkC [Study Group 1] Drawing on the Macintosh

    Right, like I said many apps just passed screenBits.bounds to GrowWindow as the sizeRect. But that was an app’s choice, nothing in the Toolbox prevented making windows extend all the way to MAXINT. (It was admittedly really useless to do so in the days before multiple screens!)
  14. Crutch

    ThinkC [Study Group 1] Drawing on the Macintosh

    One more small thing for those following along: the last line here actually doesn’t compile. (“Value has no members” error in THINK C.) “->” has precedence over “*” so to get the desired element you need to force the dereference to occur before the struct access, which you can do with...
  15. Crutch

    ThinkC [Study Group 1] Drawing on the Macintosh

    Yes, I agree the Finder does that - I am just clarifying it’s not a Window Manager restriction per se, the Finder is simply telling the Window Manager to do that. In one’s own application you can make the sizeRect as big as you like! (And the issue is caused by the Finder [or other apps]...
  16. Crutch

    ThinkC [Study Group 1] Drawing on the Macintosh

    I don’t think this is quite right — _GrowWindow take a sizeRect as a parameter that lets applications pass in arbitrary min and max sizes for the drag outline. Historically most apps (as Inside Macintosh recommended) passed in screenBits.bounds or something similar for the max size, resulting...
  17. Crutch

    ThinkC [Study Group 1] Drawing on the Macintosh

    @BFEXTU nice explanation — but you need to lose that semicolon there.
  18. Crutch

    Best Way to Show Image Full Screen (without menu bar)

    As I pointed out in the thread linked above, HyperCard can do it. Pull up a card, paste your picture into it, open the message box (Cmd-M), type “hide menubar”. Quoting myself, in response to a question about how one then hides the mouse cursor...
  19. Crutch

    ThinkC [Study Group 0] Getting your Development Environment Setup & Hello, World!

    From memory THINK C 4 (a perfectly good system, as a THINK C 5 … don’t worry too much about the version number really) will run beautifully on a Mac Plus. Give it a try!