+ $main = new Gtk2::Window('toplevel');
+ my $scr = $main->get_screen;
+ $scr_width = $scr->get_width;
+ $scr_width = 700 if $scr_width > 700;
+ $scr_height = int ($scr->get_height * 0.66);
+ $main->set_default_size($scr_width, $scr_height);
+ $main->signal_connect('delete_event', sub { Gtk2->main_quit; });
+
+ # the main vbox
+ my $vbox = new Gtk2::VBox(0, 1);
+ $main->add($vbox);
+
+ my $menutree = [
+ _File => {
+ item_type => '<Branch>',
+ children => [
+ _Quit => {
+ callback => sub { Gtk2->main_quit; },
+ callback_action => 1,
+ accelerator => '<ctrl>Q',
+ }
+ ],
+ },
+ _Screens => {
+ item_type =>'<Branch>',
+ children => [
+ _Dx => {
+ item_type => '<CheckMenuItem>',
+ callback => sub { set_win(\$wantdx, $@)},
+ },
+ _Announce => {
+ item_type => '<CheckItem>',
+ callback => sub { set_win(\$wantann, $@)},
+ },
+ _Chat => {
+ item_type => '<CheckItem>',
+ callback => sub { set_win(\$wantchat, $@)},
+ },
+ _WWV => {
+ item_type => '<CheckItem>',
+ callback => sub { set_win(\$wantwwv, $@)},
+ },
+ _WCY => {
+ item_type => '<CheckItem>',
+ callback => sub { set_win(\$wantwcy, $@)},
+ },
+ ],
+ },
+
+ _Help => {
+ item_type => '<Branch>',
+ children => [
+ _About => {
+ callback_action => 9,
+ },
+ ],
+ },
+
+ ];
+
+ my $menu = Gtk2::SimpleMenu->new(menu_tree => $menutree, default_callback => \&def_menu_callback, user_data => $user);
+ $vbox->pack_start($menu->{widget}, 0, 1, 0);
+
+
+ # a paned hbox is packed as the bottom of the vbox
+# my $bhpane = Gtk2::HPaned->new;
+# $vbox->pack_end($bhpane, 1, 1, 0);
+
+ # now create the lh and rh panes
+# my $lhvpane = Gtk2::VPaned->new;
+# my $rhvpane = Gtk2::VPaned->new;
+# $bhpane->pack1($lhvpane, 1, 0);
+# $bhpane->pack2($rhvpane, 1, 0);
+
+
+ # The command list
+# my $lhvbox = Gtk2::VBox->new(0, 1);
+ $cmd = Screen::List->new(fields => [
+ RxTime => 'tt',
+ Information => 'ttlong',
+ ],
+ size => [$scr_width, $scr_height * 0.66],
+ );
+ $vbox->pack_start($cmd->widget, 1, 1, 0);
+
+
+ # callsign and current date and time
+ my $hbox = new Gtk2::HBox;
+ my $calllabel = new Gtk2::Label($call);
+ my $date = new Gtk2::Label(cldatetime(time));
+ $date->{tick} = Glib::Timeout->add(1000, \&updatetime, $date);
+ $hbox->pack_start( $calllabel, 0, 1, 0 );
+ $hbox->pack_end($date, 0, 1, 0);
+ $vbox->pack_start($hbox, 0, 1, 0);
+ $vbox->pack_start(Gtk2::HSeparator->new, 0, 1, 0);
+
+ # the bottom handler
+ $bot = new Gtk2::Entry;
+ $bot->set_editable(1);
+ $bot->signal_connect('activate', \&bothandler);
+ $bot->can_default(1);
+ $vbox->pack_end($bot, 0, 1, 0);
+# $lhvpane->pack2($lhvbox, 1, 0);
+ $bot->grab_default;
+
+ #
+ #
+ #
+
+ #
+ # The announce list
+ $annwin = new Gtk2::Window('toplevel');
+ $ann = Screen::List->new(fields =>[
+ RxTime => 'tt',
+ From => 'tt',
+ To => 'tt',
+ Announcement => 'ttlesslong',
+ ],
+ hint => 1,
+ frame => 'Announcements',
+ size => [$scr_width * 0.85, $scr_height * 0.25],
+ );
+ $annwin->add($ann->widget);
+# $annwin->show_all;
+
+ # The announce list
+ $chatwin = new Gtk2::Window('toplevel');
+ $chat = Screen::List->new(fields =>[
+ RxTime => 'tt',
+ From => 'tt',
+ To => 'tt',
+ Chat => 'ttlesslong',
+ ],
+ hint => 1,
+ frame => 'Chat',
+ size => [$scr_width * 0.85, $scr_height * 0.25],
+ );
+ $chatwin->add($chat->widget);
+# $annwin->show_all;
+
+ # DX window
+ $dxwin = new Gtk2::Window('toplevel');
+ $dx = Screen::List->new(fields => [
+ 'RxTime' => 'tt',
+ 'QRG' => 'qrg',
+ 'DX Call' => 'tt',
+ 'Grid' => 'tt',
+ 'Remarks' => 'ttshort',
+ 'By' => 'tt',
+ 'Grid' => 'tt',
+ 'TxTime' => 'tt',
+ ],
+ policy => [qw(never automatic)],
+ hint => 1,
+ frame => "DX Spots",
+ maxsize => 500,
+ size => [$scr_width * 0.9, $scr_height * 0.25],
+ );
+# $rhvpane->pack1($dx->widget, 1, 0);
+ $dxwin->add($dx->widget);
+# $dxwin->show_all;
+
+ # The wwv list
+ $wwvwin = new Gtk2::Window('toplevel');
+ # my $rhvbox = Gtk2::VBox->new(0, 1);
+ $wwv = Screen::List->new( fields =>[
+ RxTime => 'tt',
+ From => 'tt',
+ SFI => 'int',
+ A => 'int',
+ K => 'int',
+ Remarks => 'ttshort',
+ Hour => 'tt'
+ ],
+ hint => 1,
+ policy => ['never', 'automatic'],
+ frame => 'WWV Data',
+ );
+ $wwvwin->add($wwv->widget);
+# $wwvwin->show_all;
+
+# $rhvbox->pack_start($wwv->widget, 1, 1, 0);
+
+ # The wcy list
+ $wcywin = new Gtk2::Window('toplevel');
+ $wcy = Screen::List->new(fields => [
+ RxTime => 'tt',
+ From => 'tt',
+ K => 'int',
+ ExpK => 'int',
+ A => 'int',
+ R => 'int',
+ SFI => 'int',
+ SA => 'tt',
+ GMF => 'tt',
+ Aurora => 'tt',
+ Hour => 'tt'
+ ],
+ hint => 1,
+ policy => ['never', 'automatic'],
+ frame => 'WCY Data',
+ );
+
+# $rhvbox->pack_start($wcy->widget, 1, 1, 0);
+# $rhvbox->set_size_request($scr_width * 0.45, $scr_height * 0.33);
+# $rhvpane->pack2($rhvbox, 1, 0);
+ $wcywin->add($wcy->widget);
+# $wcywin->show_all;