Modified: trunk/programs/ide/lib/ide_notebook.class.php (113 => 114)
--- trunk/programs/ide/lib/ide_notebook.class.php 2007-01-11 22:19:51 UTC (rev 113)
+++ trunk/programs/ide/lib/ide_notebook.class.php 2007-01-11 22:40:27 UTC (rev 114)
@@ -10,11 +10,17 @@
public function append_page($child, $label, $has_close = true){
$tab = new GtkHBox();
if ($has_close) {
- $button = $this->new_tab_button('',$child);
- //$button->set_size_request(22,22);
+ $event_box = new GtkEventBox();
+ $event_box->add(
+ $button = GtkImage::new_from_stock(
+ Gtk::STOCK_CLOSE,
+ Gtk::ICON_SIZE_MENU)
+ );
+ $event_box->show();
+ $button->show();
+ $event_box->connect('button_press_event', array($this, 'close_page'), $child);
$tab->pack_start($label);
- $tab->pack_start($button);
- //$button->connect_simple('clicked', array($this,'close_page'),$child);
+ $tab->pack_start($event_box);
}else{
$tab->pack_start($label);
}
@@ -22,22 +28,6 @@
return parent::append_page($child,$tab);
}
- protected function new_tab_button($text, $child){
- $hbox = new GtkHbox();
- $hbox->pack_start($label = new GtkLabel($text)); $label->show();
- $event_box = new GtkEventBox();
- $event_box->add(
- $button = GtkImage::new_from_stock(
- Gtk::STOCK_CLOSE,
- Gtk::ICON_SIZE_MENU)
- );
- $hbox->pack_start($event_box);
- $event_box->show();
- $button->show();
- $event_box->connect('button_press_event', array($this, 'close_page'), $child);
- return $hbox;
- }
-
public function close_page($child){
$id = $this->page_num($child);
$this->remove_page($id);