Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007
Discussion 3 - G. Stepanov
Part 1 - In detail, describe a problem that you experienced in Squeak. What was the problem? Why did it happen? How did you eventually overcome this problem?
I had a morph that extended PluggableTextMorph. Well, PluggableTextMorph uses a TextMorph inside it and that's where it captures keystrokes, not in the PluggableTextMorph (at least not when you're typing in the text field). I wanted some of the default behavior to not happen when I typed, so I was trying to figure out what was causing it. To do so, I commented out a part of the code here and there and checked if anything changed (squeak's still pretty cryptic to me in a lot of places).
At one point, I commented out the following line in TextMorph's keyStroke:
"self handleInteraction: [editor readKeyboard] fromEvent: evt."
This line is what causes what you typed to appear and/or do the action you specify (basically any key stroke, such as accept, undo, cut). Well TextMorph's used in a lot of places: Transcripts, Workspace, Debugger, even the Browser, the actual pane where I was typing to modify the function - so now I couldn't change it back because when I tried to erase the comment quotes to make the function revert to what it was before, it wouldn't accept any input! At first I thought squeak crashed yet again, but I could still click on things with the mouse and things would work, so I realized what was happening and used the mouse/menus to cut the "s out and accept the changes (and that's not exactly the most natural thing for a unix user to do). I'm just glad I didn't disable mouse input before that, as well.
So conclusion: save your work before you mess with default squeak code (or better yet, avoid messing with it in the first place) =)
I like Courtland Goodson's discussion because I like knowing I'm not alone ;) He did the same thing I did, but he quit squeak w/o saving to revert to normal. I didn't want to do that because I'd made a lot of changes and didn't want to lose them. Thinking back, though, I could've just quit and filed in the "recently logged changes"... yet again...
I think I've experienced Amro Mousa's problem, as well. Though I'm not sure if that was the problem (I never quite figured it out, just scrapped what I was trying to do), I had squeak constantly crashing on me as soon as I tried to create my object and no matter what I did seemed to fix it. Since I didn't find the solution, I'll keep an eye out for the super call to make sure I don't do that (again?).
Links to this Page