You can use Ksnapshot. If you need to capture pull down menus you can
use xwd in a script with a sleep delay as in:
sleep 5
xwd -root -out output_file.xwd
convert output_file.xwd output_file.png
rm fred.xwd
Start the script then pull down your menu and wait 5 seconds. If you
want to capture a specific window instead of the entire screen you can
use -name windowname or -id windowid instead of -root. The "convert"
command is part of ImageMagick. If you don't have that you can use
something else to convert it (don't ask me what, I have ImageMagick ;-)
Jan