Frameworks are sometimes described by the phrase upside down library. To see why, note that in a conventional programming language the unit of reuse is a procedure. A procedure sits below the code written by the programmer. Thus, the new code for an application is the controlling part of the application, although it may call subroutines from a library.
A framework, on the other hand, is just the reverse. The reused code is the controller. It sits on top, and provides the overall structure and control for an application. By means of inheritance a programmer can redefine the meaning of various routines, such as a mouse down routine. These child classes are subordinate to the framework. Thus, the user supplied code sits below the framework code.