WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: [PHP-BUG] Bug #54236 [NEW]: GtkNotebook does not always remove pages

[PHP-BUG] Bug #54236 [NEW]: GtkNotebook does not always remove pages

by php-bugs :: Rate this Message:

| View in Thread

From:            
Operating system: Ubuntu 10.4 32bit
PHP version:      5.3.5
Package:          PHP-GTK related
Bug Type:         Bug
Bug description:GtkNotebook does not always remove pages

Description:
------------
I can't find any documentation regarding how gtk+ handles notebook page
removal; if the page indexes are meant to be re-ordered on page removal
this bug is bogus.



Pages are not always removed if you call GtkNotebook::remove_page(), and
whether they are removed or not seems dependant upon the order in which the
pages were appended / removed, see the below example. If the line to remove
the 3rd page is moved from the last page to be removed to the first the
below test case finishes successfully, in it's current configuration
however it fails without error.





Test script:
---------------
<?php





        function removed(GtkNotebook $notebook, GtkWidget $child, $index) {

                echo "tab index $index removed\n";

        }



        $window = new GtkWindow();

        $window->set_size_request(400, 400);



        $notebook = new GtkNoteBook();

       

        $notebook->connect("page-removed", 'removed');



        $vbox = new GtkVbox();

        $vbox->add(new GtkLabel('tab contents'));

        $tab1Index = $notebook->append_page($vbox, new GtkLabel('Tab1'));

       

        $vbox = new GtkVbox();

        $vbox->add(new GtkLabel('tab contents'));

        $tab2Index = $notebook->append_page($vbox, new GtkLabel('Tab2'));

       

        $vbox = new GtkVbox();

        $vbox->add(new GtkLabel('tab contents'));

        $tab3Index = $notebook->append_page($vbox, new GtkLabel('Tab3'));

       

        $vbox = new GtkVbox();

        $vbox->add(new GtkLabel('tab contents'));

        $tab4Index = $notebook->append_page($vbox, new GtkLabel('Tab4'));



        $window->add($notebook);



        $notebook->remove_page($tab2Index);

        $notebook->remove_page($tab1Index);

        $notebook->remove_page($tab3Index);





        $window->show_all();

        Gtk::main();

Expected result:
----------------
All three pages of the notebook should be removed & the page-removed signal
should fire three times.

Actual result:
--------------
Only the first two pages are removed with two page-removed signals fired,
the third removal fails silently.

--
Edit bug report at http://bugs.php.net/bug.php?id=54236&edit=1
--
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=54236&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=54236&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=54236&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=54236&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54236&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=54236&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=54236&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=54236&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=54236&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=54236&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=54236&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=54236&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=54236&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=54236&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54236&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54236&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=54236&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=54236&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=54236&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=54236&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=54236&r=mysqlcfg


--
PHP-GTK Development Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

 « Return to Thread: [PHP-BUG] Bug #54236 [NEW]: GtkNotebook does not always remove pages