This part of the app is actually easier to program than Part 1 because fewer elements are involved. Let’s start by creating the core feature: pinning a location. When the Pin_Location_Button is clicked, we want to do two things: copy the Current Location text to the Pinned Location display and save it in TinyDB.
Drag a TinyDB component into the Designer, if you have not already done so.
Assemble the click event handler for the Pin_Location_Button (see Figure 10.25).