Python Forum
[Tkinter] Take the variable of a cursor class
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Take the variable of a cursor class
#1
Hello, i try diffrent things beffor call your help but that doesn't work.
I would like to get the x value in my main code.
from tkinter import*
class CursseurBrightness(Frame):
    def __init__(self):
        Frame.__init__(self)
        def updateLabel(x):
            lab.configure(text='Curent value = ' + str(x))
        winCurs = Tk()
        Scale(winCurs,length=250,orient=HORIZONTAL,label ='Exposition :',troughcolor='dark grey',sliderlength=20,showvalue=10,from_=0,to=20,tickinterval=1,command=updateLabel).pack()
        lab=Label(winCurs)
        lab.pack()
        

cursBright=CursseurBrightness()
cursBright.mainloop()
brightness_factor0to20=cursBright

while True:


    print(brightness_factor0to20)
thanks for your help Wall
Reply


Messages In This Thread
Take the variable of a cursor class - by delcencen - Feb-12-2023, 02:24 PM
RE: Take the variable of a cursor class - by Yoriz - Feb-12-2023, 03:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I pass a variable to another class, especially in this situation? Jionni 4 8,122 Feb-21-2021, 02:40 PM
Last Post: deanhystad
  Getting a variable from one class to another class menator01 6 3,239 Apr-26-2020, 04:36 PM
Last Post: Larz60+
  Updating a variable within a class MC2020 2 2,637 Apr-17-2020, 11:31 AM
Last Post: MC2020
  [Tkinter] Finding out what's under the cursor sabresong 3 2,772 Mar-28-2020, 02:52 PM
Last Post: sabresong
  [Tkinter] Update variable between class/frame edwin6938 6 4,619 Nov-22-2019, 08:13 AM
Last Post: edwin6938
  [Tkinter] Modifications on cursor Zyxcel314 3 3,035 Jun-04-2018, 04:36 PM
Last Post: Larz60+
  [Tkinter] Problem of cursor force_tranquille 0 2,146 May-07-2018, 09:20 AM
Last Post: force_tranquille
  [Tkinter] Scroll at cursor position lollo 4 6,296 Jan-31-2018, 11:33 PM
Last Post: lollo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020