[Israel.pm] perl/tk warnings

Shlomi Bakish shlomi at il.marvell.com
Sun Apr 25 03:42:22 PDT 2004


Sorry, this is the error I get :


Tk::Error: bad window path name "<page_name>" at app.pl line 595, 
<sum_file> line 91.
  Tk callback for raise
  [\&main::__ANON__]
  Tk callback for .toplevel.frame2.button1
  Tk::__ANON__ at 
/usr/local/tools/perl/5.8.3/lib/site_perl/5.8.3/PA-RISC2.0/Tk.pm line 225
  Tk::Button::butUp at 
/usr/local/tools/perl/5.8.3/lib/site_perl/5.8.3/PA-RISC2.0/Tk/Button.pm 
line 111

Shlomi


Hi

First I'd like to apologize for giving a link to an illegal site, I
wasn't aware of that, I just used google to find answers.
Now - I found the solution to my problem, while seeking answer to a
different problem:
The problem was that I added 'pack' after the add('page') method, no
need for that. After removing it - it's ok.

My new problem - I'm trying to use the command 'raise' on a noteboook
widget, I get the error:

page <page_name> does not exist at
/usr/local/tools/perl/5.8.3/lib/site_perl/5.8.3/PA-RISC2.0/Tk/Widget.pm
line 313

While I used delete insead of raise with the same page name - it's
deleted ok, which means the page exists.

The line I wrote:

$files_nb->raise("page_name");

any clue ?

Shlomi

Shlomi Bakish wrote:

> Hi
>
> This is a reduced version of my code, which gives the same warning. 
> (Loosing Tk::Frame=HASH(0x40325df4))
>
> Thanks
>    Shlomi
>
> #!/usr/local/bin/perl
> use Tk;
> use Tk::NoteBook;
> local $mw = MainWindow->new;
> $mw->geometry("150x150+20+50");
>
> &buttons();
> MainLoop;
>
> sub buttons(){
> $mw->Button(-text=>"try me !",
>        -command =>sub{&add("stam");})
>        ->pack();
> return;
> }
>
>   sub add_rem_selected(){
>    my $elem = $_[0];
>    &add_file($elem);
>   }
> sub add(){
>    my $file = shift;
>    unless (Exists($files_nb)){
>    $files_w  = $mw->Toplevel();
>      $files_w->geometry("150x150+40+60");
>    $files_nb = $files_w->Scrolled('NoteBook')
>    ->pack(
>    -fill=>'both',
>    -expand=>'1');
>
>    $files_nb->add($file,-label=>$file)
>    ->pack();
>    return;
>    }
> }
>
> Offer Kaye wrote:
>
>>>  Hi
>>>
>>> I am new here, I work with perl and perl/tk, I estimate my knowledge as
>>> not so great as compared to most of you.
>>>
>>>   
>>
>>
>> Don't be so sure... :)
>>
>>  
>>
>>> I hope I can get some help with perl/tk (running in hp-ux, but also
>>> solaris).
>>> I have a gui application that let's you select files from a list, then
>>> open a new window with a notebook widget, where
>>> each file you selected gets a separate page, and some data from that
>>> file is displayed in it.
>>> During the opening of the notebook pages I get these message (even
>>> without -w switch, one line per file:
>>> Loosing Tk::Frame=HASH(0x40536918)
>>>
>>>   
>>
>>
>> Beats me... could be a bug in Tk::Frame? If no one else answers, try
>> emailing a Perl/Tk specific mailing list or news group, or perhaps the
>> author of the module.
>>
>>  
>>
>>> Now, on the opened window I placed an exit button, when I press it, the
>>> application ends, but I get this :
>>> page <last page name> does not exist at app.pl line 303
>>>
>>>   
>>
>>
>> You're trying to access something which doesn't exist. Bad boy! ;-)
>> Perhaps it is some sort of out-of-bounds error (since you say you get 
>> the
>> last page name in the message)? Check your variables and make sure you
>> aren't trying to access something which doesn't exist. I'm sorry, but
>> without seeing the code I can't be any more specific.
>>
>>  
>>
>>> any ideas ?
>>> If you need, I can quote some of the code, just tell me what you 
>>> need to
>>> see.
>>>
>>> Thanks
>>>  Shlomi
>>>
>>>   
>>
>>
>> -- 
>> Offer Kaye
>> _______________________________________________
>> Perl mailing list
>> Perl at perl.org.il
>> http://www.perl.org.il/mailman/listinfo/perl
>>
>>
>>  
>>
>
>







More information about the Perl mailing list