Graphics Reference
In-Depth Information
Listing 7-2 demonstrates the implementation of these button actions.
LISTING 7-2
Control Buttons Implementation
- ( IBAction )togglePlayback:( id )sender;{
if ( [movie rate] != 0.0 )
[movie stop ];
else
[movie play];
}
- ( IBAction )stepBack:( id )sender;
{
[ movie stepBackward ];
[ self updateSlider : nil ];
}
- ( IBAction )stepForward:( id )sender;
{
[ movie stepForward ];
[ self updateSlider : nil ];
}
- ( IBAction )goToBeginning:( id )sender;
{
[ movie gotoBeginning ];
[ self updateSlider : nil ];
}
- ( IBAction )goToEnding:( id )sender;
{
[ movie gotoEnd ];
[ self updateSlider : nil ];
}
These actions are connected to buttons
we created in Interface Builder. Figure
7-1 shows a screenshot of the basic
control buttons.
FIGURE 7-1
Playback Control Buttons
When you run the project, notice that
the buttons we added to the window in
Interface Builder are not visible. The problem is that the buttons are obscured by the
movie layer (meaning, the buttons are behind the movie). To bring the buttons to the
 
Search WWH ::




Custom Search