How to I set which side the numbers go on in a scale using tkinter on python? -


I am using the scale in the tanker and I have two scales next to each other. I want to go to the upper part.

This is the code I am using:

  # import from IMPORTS tkinter * import time #USER INPUT user = input ("Please enter your username") time.sleep (0.4) pass_ = imput ("Please enter your password") time.sleep (0.6) #definitions #STUFF master = Tk () #LEFT left = scale (master, from_ = 0, to = 24 9, Lb = 550, width = 25, tickirtilal = 152, slider_length = 30) left.pack () left.set (152) left.grid (line = 0, column = 3) # right = scale (master, from_ = 0, To = 24 9, length = 550, width = 25, titillation = 152, slider_length = 30) correct. () Shikset (152) right. Send grid (line = 0, column = 6) # button button = (master, text = "send to bot", command = send) send.pack () Send. Grid (line = 15, column = 4) # RUIN canvas menloof ()   

I want to put the numbers to the right and numbers on the left on the right scale and left to keep the number on the left (set by default)

The way the coding is not ending, definitions are not done!

Thank you

I do not think the widget that appears on the number however, You can customize the widget's showview attribute to close the default label, and variable for attribute IntVar () < / code> You can assign slider value externally, and update a label widget, which you can add to the value of the slider change anywhere Can be:

  master = Tk () leftValue = IntVar () # to keep rightValue IntVars = IntVar () = value of scales left = Scale = Scale (Master, from_ = 0 , = 24 9, variable = left valve, show value = 0) left sekel .set (152) right scale = scale (master, by_ = 0, to = 24 9, variable = right value, showview = 0) right scale .Set (152) left label = label (master, textual = left value) #Labels that will correct updates label = label (master, textual = right value) #intervar Labels left as slider with CSS. Grid (line = 0, column = 0) leftScale.grid (line = 0, column = 1) right labels. Grid (line = 0, column = 3) right scale. Grid (line = 0, column = 2) Mainlope ()   

Of course, the label slider will not work as a change, if you really need that functionality, then you can use the frame Find a way to create a subclass, and change the geometry of a label as a variation in the value of the slider.

EDIT: As a note, you should not mix packs and grids in your code. All those widgets should be controlled by just one geometry manager.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -