Of course I meant glist: dc.l 0 or glist: ds.l 1. It's a long time since I wrote assembler and I was quite tired yesterday.
CreateContext just allocates a dummy Gadget for you to start the Gadget chain. It puts the pointer into both, gad and glist (talking about gad as the return value in register D0). You then use gad as the "previous gadget" pointer in NewGadget. NewGadget will put the new gadget's pointer into gad->NextGadget and return it so you can use it again as "previous gadget" pointer in the next NewGadget call.
In the end you have in gad the pointer to the gadget created by the last NewGadget call (which is for no use from now on) and in glist a pointer to the first gadget which you can use in OpenWindow or AddGList. You also give the glist pointer to FreeGadgets in the end.
Regarding the calculator, it does exactly what you described and it is usual behaviour. I will explain again, why:
The zoom gadget exchanges the current window coordinates and an internaly stored alternate set of coordinates. The initial alternate coordinates are set during OpenWindow. If the application does not set the alternate coordinates, they will match the window's coordinates.
Calculator does not give alternate coordinates. So open Calculator and press the zoom gadget: nothing happens. Move or resize the window, then press zoom: Calculator moves and sizes to the old position. Press zoom again: Calculator returns to the new position.
Now let's take Workbench. Workbench gives its drawers alternate positions when opening. Open Ram Disk and press zoom. It will become a small window in the top left edge. Press zoom again and it will return to the initial size.
Another example is the shell window. When zoom pressed for the first time, the window will fill the whole screen. But move and resize the zoomed window and pressing the zoom gadget will swap between two sizes and positions.
That's how it is documented and how it works. People will probably hate you if you change this behaviour. The Windows' way of doing things is not the only one.
Perhaps it might be interesting to patch OpenWindow to check whether alternate coordinates are given and if not to supply some (probably filling the screen). This might improve Calculator's behaviour. But zooming Calculator does not make sense in my opinion. It just zooms the buttons. I never felt the need to resize the calculator window.
Bye,
Thomas