View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Questions on Sp2002 P2 Milestone

Ask questions on P2 here...

Where and when do we delcare our teams?

Keith McDermott

On the Team Declaration Page, of course. Go ahead and make a page for your groups once the details are decided (name, members, paradigms, preferred shades of green/maroon, plus anything else interesting). You should really have your team by the time the second milestone is due, seeing as it is the first group milestone. There is a post about this on the announcments page as well. Shaggz

That's Fall 2002 Announcements page :-)

If you're going to be technical about it, then yes. Shaggz

We have 13 buildings and the grade sheet says that they are each worth 2% for a total of 26%. However, Cent. Research Building is on there twice? Also, was it intentional to make P2 worth 110%, because you have the sections 15%,25%10% and 60% = 110%? Also, is the UML for P2 only supposed to be our design for P2 or for our whole design for future projects? I believe the former but would like clarification. Brian Pashel

Actually, the subrequirements of the 60% portion add up to 62%, so it's my guess that 24% is intended for the buildings (so subtract the extraneous crb, as far as I know there's only one of them on this campus). About the 110% total, I'm not sure, but an answer will be coming along fairly soon. In the meantime, do your best! Then maybe you'll have a 110 or 100. =) If you'll notice, P3 is the time to design for the rest of the milestones (although you'll probably be making changes to your design after that anyway, as you get into the later milestones and realize you have a better/more reasonable way of thinking about your system and the world in which it resides). Now, this doesn't mean that your P2 design should neglect future elaboration, but rather if you come up with a sound design now, you may not have to modify it much to add new elements to your world. Shaggz

Actually, the problem was that Mark can't add :-). It's now fixed – sorry! Mark Guzdial

what are the directions for forming a group web page? Do we just add the names to the text box on the group sign up page then we can edit our web page or what?

Daniel Combiths

nevermind...I read the help page

Daniel Combiths

excellent! Shaggz

My group is having problem on displaying the building image and its name. We are using performAction to make the button clickable. However, when the button is clicked, nothing pops up. How do we make something pops up after the button has been clicked? David Tang

.You'll note that I've just extended the deadline on P2 to Feb. 12. That coincides with the midterm, which is bad, but we haven't done enough UI for y'all to have this done next Thursday. The issue that you're describing, David (WHERE ARE THOSE ASTERISKS?!?), is that you have to set the Model, too. Which we'll be talking about today. Mark Guzdial.

We tried to delete SketchMorph but we got error. Please help us!

Here is our code:

gtMap := HTTPSocket httpGif: ''.

mySketch:= SketchMorph.

(mySketch withForm: gtMap) openInWorld.

mySketch delete.

Chi Ha

When you execute mySketch _ SketchMorph, you're not making an instance of a SketchMorph. Rather, mySketch now points directly to the class SketchMorph. #delete is a message that instances of Morph (and subclasses thereof) understand. The class Morph doesn't understand #delete, and neither does the class Sketchmorph, as Sketchmorph doesn't define its' own implementation of #delete, but rather inherits it from Morph. Also, when you execute (mySketch withForm: gtMap) openInWorld, you're sending a message to mySketch (which still points to SketchMorph), who understands #withForm:, and returns a new instance of SketchMorph. You then send that object (an instance of SketchMorph) the message #openInWorld, which it understands (also inherited from Morph). This object is the one that shows up on your screen, not mySketch. SO, if you wanted to send #delete to somebody, you could send it to the morph on the screen, which would understand the message perfectly.

gtMap := HTTPSocket httpGif: ''.

mySketch := SketchMorph withForm: gtMap.

mySketch openInWorld.

mySketch delete.

If you understand the difference between this code and the above, you're on the right track. Shaggz

Nice one, Shaggz! Mark Guzdial

It's interesting that the original code got so far as it did. To see why, rename "mySketch" to "classForSketches". This ability to manipulate classes is very powerful, but use it with discretion: thou art squishy and intuitive but the icy computer cares not. Lex Spoon

Do you see what happens when clases are objects? A messy situation all around. However, the question is raised: which came first, the object or the class? (insert drum roll here) Shaggz

does your design for this project have to match up with what you actually wrote.. we wrote the design but since then weve kinda changed what we did.. should we change the design to reflect these changes or leave as is? Dennis Cook

If you have a class that you make instances of, and those instances each open a sketchmorph or window, is there anyway to for one instance to close all the windows, even if created by a seperate instance? Brian Pashel

Design should reflect code changes. You can certainly build connections so that instances know of each others' sketchmorphs. Mark Guzdial

Is it OK if the picture of the building pops up, just by pointing at

the building on the map or do we have to click the building to get the pop-up ? Deepak.

I'm pretty sure that the description says "clicking". Mark Guzdial

This is specifically for Lex, but does anyone know how to give a morph focus with code (not by clicking on it)? Us

Dear Us in CyberVille,

Most morphs follow wherever the mouse points. SystemWindows, however, do have a notion of a single "active" window, or "top window" you might say. Look through class SystemWindow and there are various commands for dealing with it. Alternatively, don't use SystemWindows.... -Lex Spoon

Here'y my deal: We have our map load in a window and then add buttons with graphics to this map. We were trying to set it up like the clock example on p. 135-140 but when we add the processEvents method, it kinda screws up. If you don't call the processEvents method, it displays the map and all the building graphics fine, but when we use processEvents, it seems to enter into a loop before the graphics pop up. I then right click and a couple seconds later the graphics pop if the loop in processEvents had precedence over the code that was called before it. I'm kinda baffled and this sounds wierd, so any help is appreciated. oops

Like I said in class, DO NOT USE THE PROCESSEVENTS CODE. The Clock UI examples were for demonstration only – to show you what is ALREADY INSIDE A UI TOOLKIT. If you have your event loop running, Morphic's can't run, and things won't appear. Mark Guzdial

Ok, general squeak question,

Is there a way to view all the currently initialized variables? not the process browser, but maybe a memory map like? ( i recently had the squeak vm segfault from memory even though gkrellm wasnt reporting more than about 75% memory usage. (i surmise ist was a memory problem because squeak had been running slow and complained about space twice.))

If there is such a thing in squeak then i would be appreciative if you would enlighten me, as i think i have too much stuff floating around that the garbage collector doesnt see.(thats the conclusion when my 233 runs squeak faster then my 733.

Brian Byrne

Do "self halt" anywhere you want in the code. All variables on the stack are now available to you in the debugger. (You might also choose "Do" from the World menu and see if any of those are useful to you.) Mark Guzdial

For P2, do we turn in our assignement on our teampage, or does one member turn in the assignment on one of the individual pages? I looked on the turnin link, and there were no team pages there, although the turnin info says to go to that link.

John LaBanca


don't put your code on this coweb- there will spaces for your teams on the cs2340turnin swiki soon hopefully Webb

I'm a bit confused on how to add a morph (in my case, a pluggablebutton) into a SketchMorph. It seems like there is no way to add morphs in a sketchmorph, indicating the position of the morphs. I've tried doing this on a SystemWindow, but I can only give it the frame. Even after I added a button into a SystemWindow, the attributes (in my case, the color) of the button are ignored.

It seems like a better way of doing this project is to just create the object using pluggablebuttons and a systemwindow with a picture in it. But obviously, we can't do that because we have to create new GTCampusMap objects. I'm just curious, is there a way to save an object as a class? I've tried using the subclass, but it only created a new subclass of the SystemWindow.


I don't think that you can addMorph to a SketchMorph, though you can try it. I don't understand why you can't use SystemWindows, though. GTCampusMap objects can be anything you want, and you can catch the messages sent to it however you want. You're also welcome to use RectangleMorphs as a good object for stuffing things in. Mark Guzdial

The alumni campus map does not show the address for the French building, building number 30. Does anyone know what it is?

Justin Kennedy


The address for French building is:

Duc Ngo

Will we be tested on P1 functionality? I know that the idea is to extend P1, but if we just started over, how important is it to implement the routes?

Meghan Byrne

Nope, not for P2. Mark Guzdial

Ok, its closing in on the deadline and the turnin page still hasnt been updated with teams (as of this post 5pmm sunday).

What are we supposed to do for turnin?

Brian Byrne

It's going up tonight. Mark Guzdial

Okay, Here is my problem. When I try to put my Map (an image morph) into a System window

(win := SystemWindow labelled: 'Map'.

win model: self.

win addMorph: self.

), this is within the initlize function, when i do this, The morph does not open correctly in the windo, and whenever i click on the window, my cursor disappears, and I have to restart squeak.

I tried doing this another way by not putting it in a systemWindow, but when I do this, when i Add the button, It only gets added at the top corner of the map, because I cannot find a way to add the button on the morph at a specific coords (self addMorph: myButton)

Any hints on how to fix one of those two problems? Preferably the second... Chase Peeler

I don't really see what could be causing cursor to disappear and such, but once you get your map added into the SystemWindow morph you can adjust its position however you want. hmm map is imageMorph, what happens if you take out "win model: self"?? Webb

Here is the problem. Our map is displayed as a sketch morph. Once you click on the icons on the map, the buiding info is shown in a System Window with the picture. However, the System Window does not trap any of the mouse events. I believe that since there is an infinite event loop in the map, which is listening to all the mouse clicks, the System Window is unable to trap the mouse events. Is there anyway, we can shift the focus to the system window so that it can respond to mouse clicks and other events.

Jai Kejriwal

Check out some method in SystemWindow called 'activate' I think. Might help. I think there are various other methods for bringing a SystemWindow to the front and putting it in focus. Marco Rogers

if the building view is a SystemWindow then it should be responding normally unless you explicitly take away its predefined event handling ( like clicking on the close button or click-and-drag ). If you're trying to do something special with it then you might want to subclass it and override mouseDown: and things like this. My other guess is that you are really wanting to handle the events with submorphs or other objects contained in the SystemWindow, and so the SystemWindow is "trapping" just fine but not your target object. any luck? Webb

Can anyone tell me the best method for displaying and undisplaying a SystemWindow? Right now I'm using delete and openInWorld everytime but this seems wrong somehow. Anyone got a better way? Marco Rogers

.Folks, SystemWindows don't catch mouse events. Remember – we talked about this in class. The World tells the Hands to process events. If the events are working differently, YOU'RE processing the events somewhere. But in any case, you don't HAVE to use SystemWindows AT ALL! Just use plain ole Morphs – they work great! But whatever you do, UNDERSTAND WHAT YOU DO. Setting win model: self without knowing who self is can be dangerous... Mark Guzdial.

In the P2 project description it says:

"The user should be able to dismiss (close) the name and picture, ..."

Does this mean that the name and picture are to be closed and opened together, or the name can be closed and the picture can remain showing?

Patrick Duffy
this is something you have to decide between. If it looks like a bug is in your code where the names are floating around and not closing like they probably should, then I'd say its trouble. however you may have something different set up that looks nice and makes sense - then depending on the grader's descretion - they'll probably think it makes sense and looks nice too and allow it. (I'd say the same for the mouseOver vs mouseClick - realize that you are gambling when you violate the milestone specifications though). whew~ Webb

Two Questions:
1) For the name of the building, will the label of a system window with the building name in it suffice?
10% for a good usable UI.
26% Pops up (1) pictures and (2) names for each of the buildings
How does it look? Is it a good way to present the information to a new user? Does having the name in the title work, or do you tend to completly miss it when you look at the window? These are the types of questions you need to ask. Its hard to tell how well your suggestion works to solve the problem without seeing it. If your user is looking around wondering what the building name is, it will not do. If its really clear, it will suffice. Sami Deen

2.) How do you change the size that a SystemWindow is when it opens?
Chase Peeler

Here is an easy way out: Once the system window is open try something like mySystemWindow extent: x@y. Sami Deen

My question deals with turnin. I am assuming that the TA's want a project. But how do you we make our project save the images that we use in our programs? Or do we just save the project file and our images into a zip file and upload that to the page?
Brian Pashel

Follow the same guidlines as for milestone 1. Heads up: try this out. Rename a .pr file to a .zip file and open it. See what you're turning it. Then rename it as a .pr Sami Deen

Link to this Page