Hi,

can't find a solution for the following problem:

Can't call method "new_tk__text" without a package or object reference at test.pl line 50.

use strict; use Cwd; use warnings; use Tkx; Tkx::package_require('img::png'); my $main = Tkx::widget->new("."); my $title = "hello world"; my$version = "1.12"; $main->g_wm_title($title); # initialized window size (width x height) $main->g_wm_geometry("720x970"); #720x970 $main->g_wm_resizable( 1, 1 ); # resizable in x- and y-direction (x +,y) #my $img_icon = $main->Photo(-file=>'H:\daten\aktuelle Version!\Search +InLogfiles\img\logo_ux.png'); my $ux_logo_path = 'H:\daten\aktuelle Version!\SearchInLogfiles\img\lo +go_ux.ico'; Tkx::wm_iconbitmap($main, -default => "$ux_logo_path"); my $message_box_toplevel = $main->new___toplevel(); $message_box_toplevel->g_wm_title("Messages of $title"); # create message box in new window #my $message_box_toplevel = $main->Toplevel( -title => "Messages of $t +itle", ); # print $message_box_toplevel; #$message_box_toplevel->Icon(-image=>$img_icon); # disable closing message box -> message box will only be closed, if m +ain window will be closed $message_box_toplevel->g_wm_protocol( 'WM_DELETE_WINDOW', sub { return +; } ); # message box has two frames (top and bottom) my $f_message_top = $message_box_toplevel->new_frame()->g_pack( -side => 'top', -expand => 1, -fill => 'both', ); my $f_message_bottom = $message_box_toplevel->new_frame()->g_pack( -side => 'top', -expand => 0, -fill => 'both', ); # widgets of message box my $message_box = $f_message_top->new_tk__text( -wrap => 'none', -widt +h => 50, -height => 20 ); my $yscr_msg = $f_message_top->new_ttk__scrollbar( -command => [$messa +ge_box, 'yview'], -orient => 'vertical', ); my $xscr_msg = $f_message_top->new_ttk__scrollbar( -command => [$messa +ge_box, 'xview'], -orient => 'horizontal', ); my $message_button1 = $f_message_bottom->new_ttk__button( -text => ' S +ave ', -command => \&save_message_box ); my $message_button2 = $f_message_bottom->new_ttk__button( -text => ' S +ave As ... ', -command => \&save_as_message_box ); my $message_button3 = $f_message_bottom->new_ttk__button( -text => ' C +lear ', -command => \&clear_message_box ); $message_box->configure( -yscrollcommand => [ $yscr_msg, 'set' ] ); $message_box->configure( -xscrollcommand => [ $xscr_msg, 'set' ] ); #pack widgets of message box $yscr_msg->g_pack( -side => 'right', -expand => 0, -fill => 'y', ); $xscr_msg->g_pack( -side => 'bottom', -expand => 0, -fill => 'x', ); $message_box->g_pack( -side => 'left', -expand => 1, -fill => 'both', +); $message_button1->g_pack( -side => 'left' ); $message_button2->g_pack( -side => 'left' ); $message_button3->g_pack( -side => 'left' ); #redirect STDOUT and STDERR into message box tie *STDOUT, ref $message_box, $message_box; tie *STDERR, ref $message_box, $message_box; # some info for the user print "$title\n"; print "Version $version\n"; # MainLoop; # <STDIN>; # get date and print it to the message box my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = l +ocaltime(time); $year += 1900; $mon = $mon + 1; my $date = sprintf( "%02s.%02s.%04s-%02s:%02s:%02s ", $mday, $mon, $ye +ar, $hour, $min, $sec, ); print "$date\n"; print "---------------------------------------------\n\n"; Tkx::MainLoop();
Could anyone help me?

In reply to cant call method new_tk__text by oip

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.