Leser: 1
|< 1 2 >| | 13 Einträge, 2 Seiten |
Quoteerror:Not a HASH reference at C:/Perl/site/lib/Tk/Help.pm line 152.
Tk::Error: Not a HASH reference at C:/Perl/site/lib/Tk/Help.pm line 152.
Tk::Widget::Callback at C:/Perl/site/lib/Tk/Widget.pm line 1149
Tk::HList::Button1 at C:/Perl/site/lib/Tk/HList.pm line 186
<Button-1>
(command bound to event)
error:Not a HASH reference at C:/Perl/site/lib/Tk/Help.pm line 152.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use Tk;
use Tk::Help;
my $main = MainWindow->new(-title => "My Application");
$main->configure(-menu => my $menubar = $main->Menu);
my $filemenu = $menubar->cascade(-label => "~File",
-tearoff => 0);
my $helpmenu = $menubar->cascade(-label => "~Help",
-tearoff => 0);
$filemenu->command(-label => "E~xit",
-command => sub{$main->destroy});
$helpmenu->command(-label => "~Help Contents",
-command => sub{showhelp()});
MainLoop;
1;
sub showhelp {
@helparray = ([{-title => "My Application",
-header => "My Application Help",
-text => "This is a description of my application for the help."}],
[{-title => "Section 1",
-header => "\n\nSection 1 Help",
-text => ""},
{-title => "1st Feature",
-header => "The 1st Feature",
-text => "This is the text describing the 1st feature of section 1."},
{-title => "2nd Feature",
-header => "The 2nd Feature",
-text => "This is the text describing the 2nd feature of section 1."}],
[{-title => "Section 2",
-header => "\n\nSection 2 Help",
-text => ""},
{-title => "1st Feature",
-header => "The 1st Feature",
-text => "This is the text describing the 1st feature of section 2."},
{-title => "2nd Feature",
-header => "The 2nd Feature",
-text => "This is the text describing the 2nd feature of section 2."}]);
my $help = $main->Help(
-title => "My Application - Help",
-variable => \@helparray);
}
-browsecmd => sub{populatedetails(@_);},
#Kein Kommentar+2008-08-03 12:39:36--bei der direkten referenzierung werden die parameter übergeben, wenn du jedoch erst eine anonyme subroutine erstellst (mit 'sub'), dann werden die parameter an die anonyme sub übergeben, nicht jedoch an die populatedetails()-funktion.
1 2 3 4 5
sub foo { &bar } sub bar { print "bar(@_)" } foo(23,24); __END__ bar(23 24)
pq+2008-08-03 12:56:10--was macht denn folgender code bei der 5.10er version:
Code (perl): (dl )1 2 3 4 5sub foo { &bar } sub bar { print "bar(@_)" } foo(23,24); __END__ bar(23 24)
Dubu+2008-08-04 00:41:39--"This is perl, v5.10.0 built for i486-linux-gnu-thread-multi ..."
QuoteHabe die Perlversion v5.10.0 (MSWin32-x86-multi-thread) von ActiveState (ActivePerl) mit Tk 804.028 für Windows XP SP3 auf einem Quadcore von Intel.
|< 1 2 >| | 13 Einträge, 2 Seiten |