Jump to content

PB170

6502
  • Content Count

    84
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

347 profile views
  1. Huge thanks for your effort and for looking into it! Interesting to read about the results of your test. At first it felt like great news if the error was indeed in the code and easily fixed. However… when trying it out on my machine, the updated code doesn't change anything Very confusing this … The code is indeed Apple's sample code. Moreover, it seems to work just fine on my setup. It appears that the statusRect gets restored with each new call to the module, so changing it in the meantime doesn't seem to do any harm (well, at least not on my machine …). This far I've basically been debugging my code by simply printing any problematic variables out on the screen. Below is a video of a modified version of the module that displays 1) the result from the SBTrackSlider() function as stored in the sliderSetting variable, 2) the values of four members of the statusRect, 3) the ticks value passed to the function 4) another instance of the result from the function, stored in a local variable inside the HandleMouseClick() function (where SBTrackSlider() is called), and 5) a counter that's increased before and after the function, just to keep track of things. The display is updated both before and after the SBTrackSlider() function is called, as well as during update calls to the module (in the DrawCurrentIcon() function). I've added two 1 second delays after the SBTrackSlider() function ends, just to be able to see the update after the function. After the first update/delay, I set all members of the rect variable to 0. As you can see, they revert to the correct values with the next call to the module. Here's a brief description of what you see in the video: First click: Making a setting on the slider returns a negative value (–131). After the SBTrackSlider() function ends, the statusRect values are all set to 0 in the code, and then immediately restored during the next call to the module. Second click: Making a new setting returns another negative value. (Since the value of the sliderSetting is out of range after the first call, I reset it to 0 in the code before calling the function to have the menu appear.) Third click: A quick click (mouse down/up) makes the SBTrackSlider() return the value '2'. Fourth click: Now, when making a setting on the slider, the value returned is correct. Fifth click: The value returned from the function is negative again. Video.m4v I also activated Macsbug and typed in the commands you used (without understanding exactly what they do or if they are applicable with my setup, at this point), and the result looks all right: Any further ideas about what to make of all this…? To me is still seems like the bug is in the Control Strip software, since the module works properly under Mac OS 9, and the few changes I made to the code seem to be okay. But I really have know idea… Very odd that we are getting different results when testing it. I really wish I could get this to work properly. By the way, what setup are you doing your test on?
  2. Haha Well, while I like the thought of it, the company that brags about having having 90-ish percent of their users on their latest OS and do all they can get away with to improve that number, would probably ditch bug reports about anything older than the second latest version unless it's critical. And you know, if it's humor, it's got to be market oriented. Anyone with any thoughts about the the past in their head are probably not retired, but fired But maybe I'm being too pessimistic. Anyway, glad to hear you enjoy the thread! I had a feeling maybe it was getting a bit too specific to be of general interest
  3. Oh, it's buggy alright After having a first look at MacsBug, I played around a bit with a version of the control strip module that sets the initial value to "0" if the previously returned value is out of range (not using of MacsBug at this point) and discovered that if the module is just clicked on very quickly (without bringing up the slider (not possible every time) ), it returns the value "2". After that the slider works properly one time (positive values in the range specified). Bringing the slider up again a second time (now with a positive value passed as the initial value) makes the handle on the slider appear outside of the slider (makes sense, I guess…). Setting it to a new value makes it go back to negative values. However, if no new setting is made, the value returned appears to decrease by 2 and 3 alternately for each click, until it reaches "0". That is, unless the starting value is odd, in which case it appears to decrease by 4 the first time… Also, if it's clicked on again after "2" is returned, it returns "−1" and then does so for all of the following clicks. All of this seem to occur only when the initial value is positive. Getting around this would involve patching the Control Strip software, I imagine. So odd that this bug isn't mentioned anywhere in the developer documentation… Surely, I can't be the first one to try out the slider function…? Here's a version of the module that displays the value of the sliderSetting variable in place of the icon in Apple's example, and works as described above. Module2.sit
  4. Thank you very much, and thanks for the tip! I include a corrected version of the project here. By the way, first step taken: Control Strip test.sit
  5. Like I said, I just missed it when I went back to Apple's example for my post here – it's been initialized properly throughout all my tests It's initialized to 0 during the initialization call to the module after the global variables are allocated. Regarding the globals, is this level of error checking necessary? Isn't it enough to check if the allocation was successful, like it's done in the program, as long as the values are initialized properly? Would you mind having a look at what happens when SBTrackSlider() is called while the code is running? If so, I can upload a version with the proper initialization included. Otherwise, I guess this could be a good point for me to get familiar with Macsbug (Though I still lean towards this being a bug in the Control Strip software.) By the way, I have had the initial value for the slider continuously set to 0 during all of my testing, since the slider won't appear when the value is less than 0.
  6. Wow, cool to hear that you worked at Apple in the 90's! Must have been fascinating. Well… all I can do at this point is trust the examples provided although I try my best to fully understand how they work. Thank you for the instructions on Macsbug. Very helpful, once I get started with it (have yet to install it ). I'm a little bit familiar with assembly and the inner workings of CPU's in general (on a broad level – haven't done any actual coding), so that shouldn't be too difficult to learn I think. I included the full project in my post earlier Thank you for helping out!
  7. I haven't had the time to delve into Think C's debugger or Macsbug yet so I'm currently not using them (still a beginner…), but it's definitely on the top of my list of things to learn more about. But the code is straight from Apple's example, so I assume everything is set up properly. Regarding your first point, I realize now that I forgot to initialize sliderSetting to 0 when I went back and modified Apple's example. It is however initialized properly in all of my previous tests, with the same result. moduleRect is provided by the Control Strip software, so that shouldn't be a problem I think. And sliderSetting is only used where SBTrackSlider() is called. Would you mind taking a closer look at the call to SBTrackSlider() for me, if it's not too much trouble? By the way, as I understand it, Think C's debugger cannot be used with code resources like this, where the code is only running when called by the Control Strip software. It it easy to do with Macsbug?
  8. Hmm… I discovered just now that while the module with the slider that I included in the archive works more than the first time a selection is made in Mac OS 9 just like in my previous tests, it stops working after playing around with the slider for a while. However, if I change the ticksOnSlider parameter from 53 (the value I used in the file in the archive) back to 32 (which is what I've been using in my test up till now), it seems to work properly in OS 9 again. Don't know what to make of this… Probably a good idea to have someone look at my code…
  9. Thank you! To reduce the potential for error to a minimum, I've gone back to the original code from Apple ("Control Strip Sample", included in the Control Strip development kit) and just added the code for the slider (and commented out Apple's code for the pop up menu). The original project was made for MPW, and is more recent than Think C 5, so I had to make the following modifications to have it compile with Think C 5: • Compile the ControlStripSample.r resource file with SARez so that it can be recognized by Think C 5 • Replace the "icons.h" file included with Think C 5 with the more recent one included with Think C 7 Here's an excerpt of the code, with my changes highlighted: And here's Apple's documentation about the slider routine: And finally, a .sit file with Apple's original project, and my modified version: Control Strip test.sit
  10. Thanks for the links! I've been learning to program with the mac toolbox for quite a while now but I've been completely unaware of the existence of that magazine. What a wonderful resource! Programming on classic Mac OS suddenly feels like a much less disconnected endeavor Thanks! Unfortunately, and surprisingly, there's not a single instance of the phrase "control strip" in any of the issues… After my previous post, I started to download some of the Apple Developer Connection CDs, which I also learned about quite recently. The Control Strip development kit appears for the first time in the Jan '96 issue, and also in the issue from Oct '98 – with the same version, and the same technical note. One would think the problem with the slider would have been covered by then… Very odd. Perhaps I'm the first one to try it…? Or maybe there's something wrong with my setup, or my code. But I can't see what that would possibly be… I've tried it with System 7.1.1 , System 7.5.3 and System 7.6. All return the same negative values, and on Mac OS 9 it works just fine. If the values were just constant, perhaps I could remap them to the actual setting. Obviously a very convoluted way of doing it, but… Do tell me if you have any other ideas.
  11. I just discovered that if the control strip is aligned to the very bottom of the screen, or one pixel above, the pop up menu appears correctly. If it’s located more than one pixel above, the menu appears as in the video. Obviously some kind of bug. Unfortunately, all versions of the Control Strip that I’ve tried (1.1, from the development kit, and 1.3.1 from System 7.5 and System 7.6) behave in the same way, so I’m kind of out of 68k versions to try I guess what I’m primarily looking for now is some mention of these issues in some developer documentation or version history from the time, and possibly some ideas about how to get around them.
  12. The values returned are negative, sometimes apart from the first time a selection is done, when they occasionally are positive but mostly negative and always different from the following selections (should be positive), which first had me believe it had something to do with unmatching data types. But the values decrease exponentially, and are also somewhat random (mostly constant, but sometimes change unpredictability between restarts) (again, only on System 7 – it all works fine on OS 9). For example, selecting “52” in a 0–52 range might yield “–137” (or occasionally “52”) the first time a selection is done, and then “–131” after that. Selecting “1” might yield “–2”, “5” “–12” and so on. Selecting “0” always returns 0. With a smaller range, the values returned are correspondingly smaller. As soon as a negative value/setting is stored, the Control Strip refuses to display the menu. When I made the tests in the beginning of April, I recall the values also adding up, but I’m not entirely sure about that now, and I’m unable to repeat the behavior. Regarding the volume control strip module, what’s interesting is that it uses a slider in OS 9 but a pop up menu in System 7
  13. The code that I'm using is just a copy of the code for the sample control strip provided in Apple's Control Strip development kit. It too uses a function provided by the control strip environment (SBTrackPopupMenu). The only thing I've changed is the number of items in the MENU resource. I just tried moving it over to OS 9, and the problem remains there, so if it's a bug it wasn't fixed. But like I wrote, I vaguely recall seeing this behavior in outer places, though I'm not sure about it. The function call looks like this: menuItem = SBTrackPopupMenu(statusRect, gb->configMenu); where menuItem is a short, statusRect is the module's display area, and configMenu a MenuHandle for the MENU to be displayed, all unchanged from Apple's sample.
  14. All of the functionality is provided by the Control Strip extension / control panel, I believe (all functions prefixed with "SB" (short for "Status bar", which was the Control Strip's original name), as described in the Control Strip documentation). Also, the slider appears correctly. It's just that the values that it returns makes no sense (unless the module is moved over to OS 9, where it works correctly). My issue with the pop up menu is the long empty region that appears above the values when it first appears, as shown in the video.
  15. No brilliant old school programmers who can help me out here, or point me in the right direction? I would prefer if it was possible to get the slider to work, but if it's actually a bug, and it's difficult to get around, making the popup menu appear correctly would be okay too. Right now I'm stuck, so I'm thankful for any input I can get
×