![]() |
![]() ![]() |
Examine Data ![]() |
Run the program and step to see where the errors is occurring.
The Applet Viewer appears and when the breakpoint is reached, line 61 is highlighted and a right-facing arrow is displayed in the Annotation column,
You are using the Step Over button to avoid stepping into the code that generates the width of the menu items. As you step through the source code, you can evaluate each variable by selecting it. If the variable is in scope, after a brief delay a popup window appears displaying the current variable value.
curlen | 58 |
menulinks | an array of four instances of QMenuLink |
These values tell you that the length of the current instance of QMenuLink (the current menu item) is 58.
The variable menuwidth gets set to 58, the width of the current menu item. Notice that line 68 sets menuwidth to 10. This is the problem. This line of code should be adding 10 to the width of the widest menu item.
this.menuwidth += 10;
![]() |
![]() ![]() |
Examine Data ![]() |
Guide to the Cosmo Code Development Environment
12-96*160