#! /usr/bin/perl -w

use strict;
use Gtk2 '-init';
use Glib qw/TRUE FALSE/; 


 
#standard window creation, placement, and signal connecting
my $window = Gtk2::Window->new('toplevel');
$window->signal_connect('delete_event' => sub { Gtk2->main_quit; });
$window->set_border_width(5);
$window->set_position('center_always');

#this vbox will return the bulk of the gui
my $vbox = &ret_vbox();

#add and show the vbox
$window->add($vbox);
$window->show();

#our main event-loop
Gtk2->main();


sub ret_vbox {

my $vbox = Gtk2::VBox->new(FALSE,5);

	my $cb = Gtk2::ComboBox->new_text;
	
	$cb->append_text("Select a band:");
	$cb->append_text("Beatles");
	$cb->append_text("Ten Years After");
	$cb->append_text("Bad Finger");
	$cb->append_text("Gravy Train");
	$cb->append_text("Family");
	$cb->append_text("Spirit");
	$cb->signal_connect('changed' => \&cb_changed);
	$cb->set_active(0);
	
$vbox->pack_start($cb,TRUE,TRUE,0);

$vbox->show_all();
return $vbox;
}

sub cb_changed {

	my ($cb) = @_;
	
	if($cb->get_active){
	
	print "Right on Man, ".$cb->get_active_text." is a cool band\n"; 
	}
}