Is the Tkinter .bind method muted in PSP scripts?

Moderator: Kathy_9

Post Reply
migf1
Posts: 485
Joined: Fri Apr 03, 2020 3:09 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Is the Tkinter .bind method muted in PSP scripts?

Post by migf1 »

I get an AttributeError: 'NoneType' object has no attribute 'bind' error when trying...

Code: Select all

        link1 = Label(self,
            text = "Corel USER to USER Web Board",
            fg="blue", cursor="hand2",
            justify = CENTER
        ).pack( anchor=W, side=TOP, padx=8, pady=2 )
        link1.bind("<Button-1>", lambda e: CallbackLink1("https://forum.corel.com/viewforum.php?f=56"))
Good Unofficial PaintShop Pro Tutorials: Creation CasselMake Shop ProHEC Image EditingLeviFiction PSP Basics
(plus my own Gimp & Stuff)
migf1
Posts: 485
Joined: Fri Apr 03, 2020 3:09 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Re: Is the Tkinter .bind method muted in PSP scripts?

Post by migf1 »

Seems like bind() is muted for label widgets. Just tried it with an entry widget and it works.
Good Unofficial PaintShop Pro Tutorials: Creation CasselMake Shop ProHEC Image EditingLeviFiction PSP Basics
(plus my own Gimp & Stuff)
migf1
Posts: 485
Joined: Fri Apr 03, 2020 3:09 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Re: Is the Tkinter .bind method muted in PSP scripts?

Post by migf1 »

It works for labels too, the problem was the widget packing in one statement. As soon as a I made it a separate statement, the binding works...

Code: Select all

        link1 = Label(self,
            text = "Corel USER to USER Web Board",
            fg="blue", cursor="hand2",
            justify = CENTER
        )
        link1.pack( anchor=W, side=TOP, padx=8, pady=2 )
        link1.bind("<Button-1>", lambda e: self.CallbackLink1("https://forum.corel.com/viewforum.php?f=56"))

Good Unofficial PaintShop Pro Tutorials: Creation CasselMake Shop ProHEC Image EditingLeviFiction PSP Basics
(plus my own Gimp & Stuff)
Post Reply