Re: [Plib-users] Problem with setLabel, weirdness ensues.
Brought to you by:
sjbaker
From: Fay J. F Dr C. U. 46 S. <joh...@eg...> - 2008-06-11 19:30:13
|
Cory, That is indeed weird. I will contact you separately about it. John F. Fay Technical Fellow Jacobs Technology TEAS Group 850-883-1294 -----Original Message----- From: pli...@li... [mailto:pli...@li...] On Behalf Of cory barton Sent: Wednesday, June 11, 2008 2:28 PM To: pli...@li... Subject: [Plib-users] Problem with setLabel, weirdness ensues. I am trying to use the the set label command: and I am having weird problems. something like this works: puObject->setLabel( "label" ); this fails: char txt[ PUSTRING_MAX ]; ... //kp slider kp_slider = new puSlider ( 100, 60, 200, TRUE ); kp_slider->setMinValue( GAIN_MIN ); kp_slider->setMaxValue( GAIN_MAX ); kp_slider->setValue( ( float ) aileron_pid->get_kp() ); //set value to aileron gains since roll is selected by default sprintf( txt, "Kp: %.3f", aileron_pid->get_kp() ); //format label kp_slider->setLabel( txt ); the label comes out like: *****>*****0****** ***** but I can make it work by adding an unused variable?! this works: //unused variable bbb char bbb[ PUSTRING_MAX ]; //if I remove this setLabel() fails! char txt[ PUSTRING_MAX ]; ... //kp slider kp_slider = new puSlider ( 100, 60, 200, TRUE ); kp_slider->setMinValue( GAIN_MIN ); kp_slider->setMaxValue( GAIN_MAX ); kp_slider->setValue( ( float ) aileron_pid->get_kp() ); //set value to aileron gains since roll is selected by default sprintf( txt, "Kp: %.3f", aileron_pid->get_kp() ); //format label kp_slider->setLabel( txt ); I also cannot set the label in the callback function. Please help. Cory ------------------------------------------------------------------------ - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ plib-users mailing list pli...@li... https://lists.sourceforge.net/lists/listinfo/plib-users |