PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
extending GtkSpinButton (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: extending GtkSpinButton
#953
sutterp (User)
Fresh Boarder
Posts: 19
graphgraph
User Offline Click here to see the profile of this user
extending GtkSpinButton 1 Month, 2 Weeks ago Karma: 0  
I try to create a class extending GtkSpinButton using new_with_range.
Code:
class ESpinButton extends GtkSpinButton {
  public function ESpinButton($min, $max, $step) {
    parent::new_with_range($min, $max, $step);
    $this->get_value();
    $this->connect('value-changed', 'cbkSpinDateChange');
  }
}
When I instantiate the class, I get PHP Fatal error: Internal object missing in ESpinButton wrapper in /data/www/jjh/intranet/gtk2/Example/php/mainClass.php on line 25 Using
Code:
class ESpinButton extends GtkSpinButton {
  public function ESpinButton($min, $max, $step) {
    parent::__construct();
    $this->get_value();
    $this->connect('value-changed', 'cbkSpinDateChange');
  }
}
appears to give me the 'old style' spin button. How is it done correctly? Thanks Peter
 
 
Last Edit: 2008/10/07 14:33 By sutterp.
  The administrator has disabled public write access.
#959
kksou (Admin)
Admin
Posts: 391
graph
User Online Now Click here to see the profile of this user
Re:extending GtkSpinButton 1 Month, 2 Weeks ago Karma: 8  
Hi Peter,

No, you cannot use the method GtkSpinButton::new_with_range() when you are extending the GtkSpinButton.

I've written a sample code to show how you it's done:
Sample Code 523: How to extend GtkSpinButton?

Regards,
/kksou
 
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Blog - Forum - Privacy Policy - Contact Us
Copyright © 2006-2008. kksou.com. All Rights Reserved