On Aug 8, 2005, at 2:58 PM, John Finlay wrote:

Steve Langer wrote:

Hi --

I'm trying to use a gtk.HScale widget to select integer values, so I use HScale.set_digits(0). However, I also don't want the widget to display its value, because the value is also displayed in an accompanying gtk.Entry. But if I use HScale.set_draw_value(False), the set_digits(0) doesn't work anymore!HScale.get_value() returns non-integers. Am I doing something wrong, or is this a bug?

Neither - it's a feature. Just round and int the return value in your signal handler.

Then it's a documentation bug. The set_digits description doesn't say anything about requiring set_draw_value:

The set_digits() method sets the "digits" property to the value specified by digits. The value of digits specifies the number of decimal places that are displayed in the value. The value of the adjustment is also rounded off to this number of digits, so the retrieved value matches the value the user sees.

Thanks for the response.

 -- Steve


--
-- EMail: [EMAIL PROTECTED] Phone: (301) 975-5423 -- -- WWW: http://math.nist.gov/mcsd/Staff/SLanger/ Fax: (301) 990-4127 -- -- Mail: NIST; 100 Bureau Drive -- Stop 8910; Gaithersburg, Md 20899-8910 --

-- "I don't think this will work. That's why it's science." -- -- Naomi Langer, 17 Feb 2003 --

_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to