![]() |
![]() ![]() |
Step in Source Code![]() |
Now you're going to track down a bug in the source code.
Run also detects and compiles changed files. In this case there are no changes. The Java Applet Viewer is displayed alongside your Cosmo Code window.
Notice that the width of the menu outline is narrower than the menu text. You need to find the location where the menu width is set and make it the correct width. The menu width for this applet changes depending on how wide the menu items are, so you need to step through some code to figure out how the menu width is being set.
But first, setting line numbers is useful when debugging.
Now search for possible locations where the width of the menu is set.
The first match shows a declaration for buttonwidth, an unlikely candidate.
The second match shows a declaration for menuwidth, which is what you are looking for. You can now refine the search by looking for occurrences of menuwidth.
This takes you to the location where the width of the menu is calculated.
A round icon appers in the Annotation column at line 61 to show that a breakpoint has been set.
![]() |
![]() ![]() |
Step in Source Code![]() |
Guide to the Cosmo Code Development Environment
12-96*159