#!/usr/bin/perl -w


use Data::Dumper;
use SimpleGtk2;
use Gtk2 -init;

my $tooltips = Gtk2::Tooltips->new();
$tooltips->enable;

# Toplevel window
my $win = SimpleGtk2->new_window(Type => 'toplevel', Name => 'mainWindow', Title => 'testem-all', Width => 400, Height => 400);

# Frame
$win->add_frame(Name => 'frame1', Position => [5, 5], Size => [390, 390], Title => ' A Frame around ');
#$win->change_font(Name => 'frame1', Font => 'Arial', Style => 'italic');

# Button
$win->add_button(Name => 'closeButton', Position => [310, 350], Size => [80, 40], Title => '_Close', Underline => 1, Tooltip => 'Blafasel');
$win->add_signal_handler('closeButton', 'clicked', sub{Gtk2->main_quit;});
$win->change_font(Name => 'closeButton', Weight => 'bold', Font => 'Monospace', Style => 'italic');

# Label
$win->add_label(Name => 'label1', Position => [10, 20], Title => "A Label.\n"."A new line", Wrapped => 0, Justify => 'left');
$win->change_bg(Name => 'closeButton', Background => 'red');

# Check button
$win->add_check_button(Name => 'checkButton1', Position => [80, 20], Title => 'Check button', Underline => 1, Tooltip => 'This is a checkbox');

# Entry
#$win->add_entry(Name => 'entry1', Position => [10, 70], Size => [100, 20], Title => 'A text field', Tooltip => 'Sabbel suelz');
$win->add_entry(Name => 'entry1', Position => [200, 20], Size => [100, 20], Title => 'A text field', Align => 'right');

# Spin Button
#$win->add_spin_button(Name => 'spin1', Position => [1, 170], Size => [100, 20], Start => 5, Min => 0, Max => 10, Step => 1, Tooltip => 'Thats my Mama');
$win->add_spin_button(Name => 'spin1', Position => [10, 60], Start => 5, Min => 0, Max => 10, Step => 1, Tooltip => 'Thats my Mama', Align => 'right');
#$win->add_spin_button(Name => 'spin1', Position => [10, 170], Start => 5, Min => 0, Max => 10, Step => 1, Tooltip => 'Thats my Mama');
$tooltips->set_tip ($win->get_widget('spin1'), 'Testem All');

# Radio Buttons
$win->add_radio_button(Name => 'radio1', Position => [10, 90], Title => "First", Group => "lol", Active => 1, Tooltip => "1st Lol radio button");
$win->add_radio_button(Name => 'radio2', Position => [10, 110], Title => "_Second", Underline => 1, Group => "lol", Tooltip => "2nd Lol radio button");
$win->add_radio_button(Name => 'radio3', Position => [10, 130], Title => "Third", Group => "lol", Tooltip => "3rd Lol radio button");

# Combo Box
$win->add_combo_box(Name => 'combo1', Position => [100, 60], Data => ['one', 'two', 'three', 'four'], Start => 2, Tooltip => 'Jupem');

$win->show_all();
Gtk2->main;
