Bug #54236 [Opn->Bgs]: GtkNotebook does not always remove pages

[email protected] Sat, 12 Mar 2011 15:09:16 +0100 (CET)
Newsgroups php.gtk.dev
Message-ID <[email protected]>
Edit report at http://bugs.php.net/bug.php?id=54236&edit=1

 ID:                 54236
 Updated by:         [email protected]
 Reported by:        ptlis at ptlis dot net
 Summary:            GtkNotebook does not always remove pages
-Status:             Open
+Status:             Bogus
 Type:               Bug
 Package:            PHP-GTK related
 Operating System:   Ubuntu 10.4 32bit
 PHP Version:        5.3.5
 Block user comment: N
 Private report:     N

 New Comment:

This is entirely controlled "upstream"

That is the gtk+ libraries decide how this is handled - if you think
this is a bug in the gtk libraries please head to gtk.org and file a bug
there

Thanks!


Previous Comments:
------------------------------------------------------------------------
[2011-03-12 13:27:56] ptlis at ptlis dot net

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 this bug report at http://bugs.php.net/bug.php?id=54236&edit=1