#! /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 $combo_box_entry = Gtk2::ComboBoxEntry->new_text;
	
	$combo_box_entry->append_text("Beer");
	$combo_box_entry->append_text("Wine");
	$combo_box_entry->append_text("Whisky");
	$combo_box_entry->append_text("Rum");
	$combo_box_entry->append_text("Cane");
	
	($combo_box_entry->child)->signal_connect('changed' => sub {
		my ($entry) = @_;
		print "I Like ". $entry->get_text."\n";
		
		});
		
	$combo_box_entry->set_active(0);
	
$vbox->pack_start($combo_box_entry,TRUE,TRUE,0);
$vbox->show_all();
return $vbox;
}

