1
#!/usr/local/bin/perl -w
5
# $Id: newclass.pl,v 1.2 1998/05/20 08:38:12 eserte Exp $
8
# Copyright (C) 1997,1998 Slaven Rezic. All rights reserved.
9
# This program is free software; you can redistribute it and/or
10
# modify it under the same terms as Perl itself.
12
# Mail: eserte@cs.tu-berlin.de
13
# WWW: http://user.cs.tu-berlin.de/~eserte/
22
@MyHistEntry::ISA = qw(Tk::Frame);
23
Construct Tk::Widget 'MyHistEntry';
25
{ my $foo = $Tk::FireButton::INCBITMAP;
26
$foo = $Tk::FireButton::DECBITMAP; }
31
my $e = $f->Component(SimpleHistEntry => 'entry');
32
my $binc = $f->Component( FireButton => 'inc',
33
-bitmap => $Tk::FireButton::INCBITMAP,
34
-command => sub { $e->historyUp },
37
my $bdec = $f->Component( FireButton => 'dec',
38
-bitmap => $Tk::FireButton::DECBITMAP,
39
-command => sub { $e->historyDown },
42
$f->gridColumnconfigure(0, -weight => 1);
43
$f->gridColumnconfigure(1, -weight => 0);
45
$f->gridRowconfigure(0, -weight => 1);
46
$f->gridRowconfigure(1, -weight => 1);
48
$binc->grid(-row => 0, -column => 1, -sticky => 'news');
49
$bdec->grid(-row => 1, -column => 1, -sticky => 'news');
51
$e->grid(-row => 0, -column => 0, -rowspan => 2, -sticky => 'news');
54
(-repeatinterval => ['CHILDREN', "repeatInterval",
55
"RepeatInterval", 100 ],
56
-repeatdelay => ['CHILDREN', "repeatDelay",
57
"RepeatDeleay", 300 ],
61
$f->Delegates(DEFAULT => $e);
69
my $top = new MainWindow;
74
$b2 = $top->MyHistEntry(-textvariable => \$bla,
75
-repeatinterval => 30,
79
my($w, $s, $added) = @_;
81
$lb2->insert('end', $s);
86
$lb2 = $top->Scrolled('Listbox', -scrollbars => 'osoe'
91
# my $autodestroy_text = "Autodestroy in " . $seconds . "s\n";
92
# $top->Label(-textvariable => \$autodestroy_text,
94
# $top->repeat(1000, sub { if ($seconds <= 0) { $top->destroy }
96
# $autodestroy_text = "Autodestroy in " . $seconds
100
$top->Button(-text => 'Exit',
101
-command => sub { $top->destroy },