X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=submit%2Fgtktest.pl;h=43334826d3b5f406ce38fbcfcc602533d2ec21e3;hb=3043ffa0cb666e509d5b07e479ead4792fbf722d;hp=6347d0c4d9a102e997a19fc5410d6238baa8a1d2;hpb=a04bf84819469a5f1387ccf3f9ca7a6ea25d6a3b;p=eval.git diff --git a/submit/gtktest.pl b/submit/gtktest.pl index 6347d0c..4333482 100755 --- a/submit/gtktest.pl +++ b/submit/gtktest.pl @@ -11,6 +11,8 @@ sub timer { } Glib::Timeout->add(5000, \&timer); +my $cursor = Gtk2::Gdk::Cursor->new('watch'); + my $window = Gtk2::Window->new ('toplevel'); my $b1 = Gtk2::Button->new ('Quit'); @@ -23,6 +25,7 @@ my $box = Gtk2::HBox->new(); $box->pack_start_defaults($b1); $box->pack_start_defaults($b2); $box->pack_start_defaults($b3); +$box->set_border_width(5); my $bb = Gtk2::Button->new ('Brum!'); $bb->signal_connect (clicked => sub { @@ -31,6 +34,7 @@ $bb->signal_connect (clicked => sub { $dialog->signal_connect (response => sub { $_[0]->destroy }); $dialog->show_all; }); +#$bb->set_sensitive(0); my $store = Gtk2::ListStore->new('Glib::Uint', 'Glib::String'); for (my $i=0; $i<10; $i++) { @@ -44,6 +48,15 @@ my $col = Gtk2::TreeViewColumn->new_with_attributes("Int", $rend, "text", 0); $tree->append_column($col); $col = Gtk2::TreeViewColumn->new_with_attributes("String", $rend, "text", 1); $tree->append_column($col); +$tree->set_headers_visible(0); + +my $lay = Gtk2::ScrolledWindow->new; +$lay->set_policy("automatic", "automatic"); +$lay->add($tree); +$lay->set_border_width(5); + +my $frame = Gtk2::Frame->new("A list"); +$frame->add($lay); my $sel = $tree->get_selection; $sel->set_mode('single'); @@ -53,21 +66,28 @@ $sel->signal_connect(changed => sub { print "Selected $val\n"; }); -my $lay = Gtk2::ScrolledWindow->new; -$lay->set_policy("automatic", "automatic"); -$lay->add($tree); - my $lab = Gtk2::Label->new; $lab->set_markup("Welcome to the Cave"); +my $bar = Gtk2::Statusbar->new; +my $barctx = $bar->get_context_id('xyzzy'); +$bar->push($barctx, "Ready"); + my $bbox = Gtk2::VBox->new(); -$bbox->pack_start_defaults($lab); -$bbox->pack_start_defaults($box); -$bbox->pack_start_defaults($lay); -$bbox->pack_start_defaults($bb); +$bbox->pack_start($lab, 0, 0, 0); +$bbox->pack_start($box, 0, 0, 0); +$bbox->pack_start($frame, 1, 1, 0); +$bbox->pack_start($bb, 0, 0, 0); +$bbox->pack_start($bar, 0, 0, 0); $window->signal_connect ("delete-event" => sub { Gtk2->main_quit }); -$window->set ("title" => "Brum"); +$window->set_title("Brum"); +$window->set_wmclass("submit", "Submit"); +$window->set_default_size(320, 400); $window->add ($bbox); $window->show_all; + +#$window->window->set_cursor($cursor); +#$window->window->set_cursor(undef); + Gtk2->main;