PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
can't set sensitive "true" for buttons (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: can't set sensitive "true" for buttons
#763
edryan (User)
Fresh Boarder
Posts: 19
graphgraph
User Offline Click here to see the profile of this user
can't set sensitive "true" for buttons 2 Months, 2 Weeks ago Karma: 0  
hi,
i got three buttons set its sensitivity to false(so buttons are now disabled), i saw already the tutorial on interactive searching...now i want to enable those buttons when row on the tree view is selected..

i got here a sample button..
Code:
$button = new GtkButton('Button');
$button->set_sensitive(false);

//Now i got this function, im not sure if its right...hehhe
function on_select(){
   //Some codes here for data display after selection
   //Output some array
   $data = array($id,$fname,$lname....);
   //I just check here if selected row is empty or not...

   if(!(empty($data[0]))){
       $button->set_sensitive(true);
       //But get some error like "Undefined function set_sensitive on a non-object on line 123
   }
}
any help is appreciated...tnx guyz
 
  The administrator has disabled public write access.
#794
kksou (Admin)
Admin
Posts: 391
graph
User Online Now Click here to see the profile of this user
Re:can't set sensitive "true" for buttons 2 Months, 1 Week ago Karma: 8  
There's not enough clue to figure out what might be wrong.

If the buttons were not set sensitive, it simply means your line "$button->set_sensitive(true)" is not called at all.

So you might want to check the following:

1) Is on_select() being called at all?

2) Check what is in $data[0]

3) Is $button->set_sensitive(true) being called at all?

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