Small fix for CellRendererSpinButton



Just figured out a solution to my last problem ( custom CellRendererSpinButton doesn't update the value if you use mouse-only input ).

Add the following inside the START_EDITING sub:

---

 $spin_button -> signal_connect(focus_out_event => sub {
$spin_button -> update();
   $cell -> signal_emit(edited => $path, $spin_button -> get_value());
});

---

This also lessons the infuriating behaviour of the spinbutton to drop all changes if you stop scrolling ( with the mouse ) and then start scrolling again in quick succession ( gets interpreted as a double-click ). I don't know about everyone else, but when I use spin buttons, I hold it down to spin rapidly for a while, then when I get closer to the value I want, I use quick little hits of the spin button to get to the final value. If I did this, the spinbutton used to revert to the original value ... now it just updates to the current value and then destroys itself. You can then click in it again and start off from where you where. Not perfect, but better.

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak nusconsulting com au
website: http://www.nusconsulting.com.au
Title: CanIt Vote for ID 92092

The following links have been inserted by the NUS Consulting internal spam filter and are for NUS Consulting staff only
Spam
Not spam
Forget previous vote


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]