[GOODIE]MenuBarMorph - Squeak 3.1 v2 - bug fix

Tim Rowledge tim at sumeru.stanford.edu
Thu Jul 19 22:38:18 UTC 2001


"Jim Benson" <jb at speed.net> is widely believed to have written:

> Here is an update to the MenuBarMorph.

OK, I finally got around to actually trying to use this code.
Pretty good generally (ask ex-exoboxers what level of praise that is :-)
but I found one really strange bug and I _think_ I fixed it.

When adding a menubar to a SystemWindow (I know, I know, crappy UI
paradigm but customers are really bad about that sort of thing. Some of
them actually claim to like Windows) the menubar would appear in a
sensible place but then jump to the top left corner if the window was
occluded and the raised again. Using the halo move would make it redraw
'correctly'!

As an example, try:-
|win menu menuBar|
win _ SystemWindow new.
menuBar _ MenuBarMorph new.
menu _ MenuMorph new.
menu title: 'File'.
menu add: 'Blah' action: #blah.
menuBar append: (MenuBarItemMorph fromMenuMorph: menu). "note rather
convoluted assembly message -could be improved"
win addMorph: menuBar fullFrame: (LayoutFrame fractions: (0 at 0 corner:
1 at 0) offsets:(0 at 0 corner: 0@ menuBar height)).
win openInWorld

My putative fix is to remove (from MenuBarMorph>initialize) the line
{self setToAdhereToEdge: #topLeft} but I really wouldn't want to claim
that it is a complete fix.

tim

-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Useful random insult:- Doesn't have two neurons to rub together.





More information about the Squeak-dev mailing list