1 # Qt I/O for DCT, by Shiar
3 # just fiddling, long way from working
4 # 1.12.0 200411032045 - test
15 push @{$hook{init}}, sub {
16 $main = new MainWindow;
17 $main->Label(-text=>"test")->pack;
18 ReadMode 3; # cbreak mode
22 } # restore terminal on quit
24 # $set{height} = $LINES-2 if $LINES>=3;
25 # $set{width} = $COLS if $COLS;
29 push @{$hook{showerror}}, sub {
36 ReadKey; # wait for confirm
37 1 while defined ReadKey(-1); # clear key buffer
41 push @{$hook{showstack}}, sub {
42 my $box = $main->Listbox(
44 -width => -1, # shrink to fit
50 $box->insert('end', "$_: ".showval($stack[$_], $set{base}));
53 $box->pack(-side => 'left', -fill => 'both', -expand => 'yes');
55 # addstr($set{height}-$_, 1, "$_: ".showval($stack[$_], $set{base}));
58 # clrtoeol($set{height}-@stack, 1);
61 push @{$hook{showall}}, sub {
63 # addstr($set{height}+1, 0, "> "); # prompt
64 $main->Label(-text=>"> ")->pack;
67 push @{$hook{showentry}}, sub {
68 $main->Label(-text=>$_[0])->pack;
69 # addstr($set{height}+1, 2, $_[0]);
76 my $a = Qt::Application;
77 my $hello = Qt::PushButton("Hello World!", undef);
79 $a->setMainWidget($hello);
83 my $in = $main->Entry(-width=>10);
88 onkey($_) for split //, $in->get;
97 # my $key = ReadKey; # wait for user input
98 # if ($key eq chr 27) {
99 # $key .= $_ while defined ($_ = ReadKey(-1)); # read additional keys
100 # } # escape sequence
108 title => "qt output",