Ubuntu: Problems related with spin buttons



Question:

So, I have an important problem related with spin buttons in Python/GTK3. I'm trying to create a spin button in my project, Virtuam, and it seems to work... but with a bug which blocks the +/- toogles.

Without clicking

Clicking

Also, strangely, I can manually change the spin box value... :/

With the value changed

I've installed it in a virtual machine, and it haves the same problem.

Running from Lubuntu in a VM

It worked well before, and if I try to remove the source and download a commit which worked, I still have problems. What should I do? Is it a GTK bug, or it's my fault? In the last case, what's wrong: the script (vui.py) or the interface (assistant.glade)?

You can download the latest commit at lp:virtuam/trunk


Solution:1

You have to set the increment. You can do that by using the set_increments() method of the spinbutton:

spinbutton.set_increments(1.00, 5.00)  

That will set it to increment by 1 when left clicking the -/+ and by 5 when middle clicking the -/+.


Solution:2

  • Click the spin button and go to its properties menu on the right
  • There you can see a property called adjustment just below spin button's name. spin Button Properties

  • To the right of the adjustments there is a button with "...", click it

  • On the dialogue box that appear click new
  • A new item adjustments would have appeared on the widgets enter image description here

  • Click it and its properties you can adjust step increment, max value, min value etc. etc.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »