Perl Programmer/Consultant
Remote System Administrator
Free Software
... contact me
  while ($making_other_plans) { life(); }
  location('ipsstb', 'perl_programming');

 For Web Designers 2022-08-28 03:06:16 UTC Mail Delivery Problems? 

Sunday, February 03 2013

Curses::UI::Notebook Page Delete Bug, Part Two

Just a while ago I wrote about a bug in Curses::UI::Notebook delete_page. Well, shucks, I found another. This one will puke up the error The notebook already has a page named... whatever previously used and then deleted name you've chosen.

This bug manifests itself as widget (page) objects not actually being removed from the UI::Curses::Container object by UI::Curses::Notebook. The page/tab disappears but the object itself hangs around, so if you try to reuse the name your application dies. To duplicate:

There's more ...

→ committed: 2/3/2013 01:56:00

[ / perl_programming] permanent link

Comments: 0    Trackbacks: 0


Curses::UI::Notebook Delete Page Bug

The Problem: Curses::UI::Notebook delete_page() crashes the application.


  use strict;
  use Curses::UI;

  my $ui = Curses::UI->new();

  my $win = $ui->add('win1', 'Window',
    -border => 0,
    -y      => 0,
    -bfg    => 'blue',

  my $notebook = $win->add(undef, 'Notebook');

  my $p1 = $notebook->add_page('Page 1');
  $p1 -> add(undef, 'Label',
    -x    => 1,
    -y    => 1,
    -text => "This is Page One",

  my $p2 = $notebook->add_page('Page 2');
  $p2 -> add(undef, 'Label',
    -x    => 1,
    -y    => 1,
    -text => "This is Page Two",

  # Now the fun part:
    sub {
  # What we expect to happen is that five seconds into runtime, the
  # currently active page will disappear.
  # What ACTUALLY happens is that the application crashes.

  $ui->set_binding( sub { $ui->mainloopExit() }, "\cQ" );


Never mind the use of the undocumented features set_timer() and delete_timer() for now. I'll 'splain 'em momentarily. They're very handy. I'm a source code reading fool but if you haven't seen it yet I'll save you the bother. First, though:

There's more ...

→ committed: 2/2/2013 19:03:50

[ / perl_programming] permanent link

Comments: 0    Trackbacks: 0

Save the Net

Creative Commons License

Project Honeypot Member

September 2022
Mon Tue Wed Thu Fri Sat Sun
27 28 29 30    

By Month:

By category:


Served to at 03:06:16 GMT on Wednesday, September 28, 2022.