Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
String int confused
#1
ny help to get the proper syntax regarding zoom. (great confusion in tha family).
Anyone?
lblzoomlvl = customtkinter.CTkLabel(window, width=80, font=("Ariel",16,"bold"),text_color="#0000ff", fg_color="#ffffff", text="")
lblzoomlvl.place(x=1160,y=241)

def cmdinczoom(event):
    #read Text from label lblzoomlvl into an integer variable zoom
    temp = lblzoomlvl["text"]
    zoom =int(temp)
    
    if (zoom<16):
        # add 1 to int variable zoom
        zoom=zoom+1
        # update text on label lblzoomlvl 
        lblzoomlvl.configure(text=zoom)
        # set mouse x,y position
        mouse.position = (32,53)
        # click once with left mouse button
        mouse.click(Button.left,1)
        # update text on lblzzoom by zoom
        lblzoomlvl.configure(text=zoom)
    
btninczoom = customtkinter.CTkButton(window, width=20, height=10, font=("Ariel",20,"bold"), border_color="#add19e", fg_color="#aaaaaa",text_color="#000000", text="+",command=cmdinczoom)
lblzoomlvl.[output]Tk.bind("<Up>",cmdinczoom)
  File "D:\Python311\Lib\tkinter\__init__.py", line 1448, in bind
    return self._bind(('bind', self._w), sequence, func, add)
           ^^^^^^^^^^
AttributeError: 'str' object has no attribute '_bind'. Did you mean: 'find'?
PS C:\Users\jan-e> & D:/Python311/python.exe d:/Python311/Scripts/nye.py
PS C:\Users\jan-e> & D:/Python311/python.exe d:/Python311/Scripts/nye.py
PS C:\Users\jan-e> & D:/Python311/python.exe d:/Python311/Scripts/nye.py
PS C:\Users\jan-e> [/output]bind("<Up>",cmdinczoom)
Reply


Messages In This Thread
String int confused - by janeik - Jul-30-2023, 12:55 PM
RE: String int confused - by Gribouillis - Jul-30-2023, 01:27 PM
RE: String int confused - by deanhystad - Jul-31-2023, 03:15 AM
RE: String int confused - by janeik - Jul-31-2023, 06:49 AM
RE: String int confused - by janeik - Jul-31-2023, 07:51 AM
RE: String int confused - by deanhystad - Aug-01-2023, 06:48 PM
RE: String int confused - by janeik - Aug-02-2023, 12:22 AM
RE: String int confused - by deanhystad - Aug-02-2023, 01:26 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I am confused with the key and value thing james1019 3 1,009 Feb-22-2023, 10:43 PM
Last Post: deanhystad
  confused about string formatting barryjo 7 2,037 Mar-06-2022, 02:03 AM
Last Post: snippsat
  Pandas confused DPaul 6 2,627 Sep-19-2021, 06:45 AM
Last Post: DPaul
  is and '==' i'm confused hshivaraj 6 2,773 Sep-15-2021, 09:45 AM
Last Post: snippsat
  Confused with 'flags' tester_V 10 5,007 Apr-12-2021, 03:03 AM
Last Post: tester_V
  Simple Tic Tac Toe but I'm confused Izith 1 2,231 Sep-26-2020, 04:42 PM
Last Post: Larz60+
  I am really confused with this error. Runar 3 3,055 Sep-14-2020, 09:27 AM
Last Post: buran
  Confused on how to go about writing this or doing this... pythonforumuser 3 2,516 Feb-10-2020, 09:15 AM
Last Post: snippsat
  Dazed and confused... RodNintendeaux 10 7,577 May-28-2017, 01:32 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

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