You can find the default Dashboard widgets in /Library/Widgets. They are written using JavaScript, so it's pretty easy to access the code. For example if you right-click on the Stocks widget and choose "Show Package Contents" you will find a file called "Stocks.js" inside the bundle that contains the logic behind the widget.
On line 1319 of that file there is a function called "addOrSelectItem".
Aside from defining variables, the first thing that function does is check to see whether you are trying to add an existing stock (line 1321), if you are then it just selects the existing stock in the UI. However if you are adding a new stock the next thing it does is check if there are less than 20 stocks (line 1323), if there are less than 20 then it adds the new one. If there are already 20 stocks then it does nothing.
Simplified code below. The comments are Apple's comments. Clearly having more than 20 stocks is not "correct". :)
function addOrSelectItem () {
var index = symbolAlreadyInSet(lastValidEntry.symbol);
if (index < 0) {
// make sure we have the correct number of items
if (allTheData.length < 20) {
...
}
} else {
// select the item that is already there.
...
}
}
In theory someone could make a copy of that Stocks.wdgt file, open it up, change that single line in a text editor to allow more than 20 stocks and save it. Obviously distributing that modified version would be a bad thing, but modifying a copy for your own personal use shouldn't be a problem.
If you do create your own version you might need to kill the Dashboard process for it to notice the changes. Just select it in Activity Monitor and Quit it, it'll automatically relaunch.
![Demonstrating Stocks widget with more than 20 stocks](https://i.stack.imgur.com/3bweU.png)
The solution is you need to click the (i) ("Info") button in the upper right of the widget before you click on the "Add" button.
If not an explicit bug, this is certainly a major usability issue, but only is an issue when adding the first clock (otherwise the "Add" button doesn't show up until you press Info). I had run into this as well and couldn't figure it out for months. Finally poked around at it more just now and finally figured it out.
Best Answer
You can choose whatever cities you like as long as there are four of them :-)
Just click on city name you want to replace, choose new one using Search field or use drop-down list in pop-up window. Your new choice will be displayed instead of Apple default.