Python Forum
pygtk2, how to disconnect all callback of widget or window event ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pygtk2, how to disconnect all callback of widget or window event ?
#1
hello, i want disconnect all event callbacks, for exemple button.alldisconnect("clicked") method.
this method disconnects all callback of clicked event. is there any class method or function for do this?
thanks for your helps
Reply
#2
I doubt it. Each widget is a separate instance of it's class, which means each has it's own bindings
for events. It would be very unlikely that all instances would have a universal unset.
That being said, it would be possible (though difficult, and I think you'd have to write your own) to do so by walking the children of the main widget,
for example root in tkinter.

Removing all binding on a particular widget should be easy, just search for and remove all bind and command statements.

But first, please provide enough information to properly answer the question.
Since there at least 4 relatively common graphics packages in use, it is necessary to know what you are using.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Interaction between Matplotlib window, Python prompt and TKinter window NorbertMoussy 3 471 Mar-17-2024, 09:37 AM
Last Post: deanhystad
  [Tkinter] Tkinter callback exception Ben123 2 531 Feb-17-2024, 06:03 PM
Last Post: deanhystad
  [Tkinter] What can the event.widget reference be used for? Knickers 4 2,429 Aug-26-2021, 02:17 PM
Last Post: Knickers
  [Tkinter] moniter which widget triggerd event catlessness 5 2,382 Mar-07-2020, 01:38 AM
Last Post: Larz60+
  [Tkinter] Mouse click event not working on multiple tkinter window evrydaywannabe 2 3,744 Dec-16-2019, 04:47 AM
Last Post: woooee
  tkinter window and turtle window error 1885 3 6,698 Nov-02-2019, 12:18 PM
Last Post: 1885
  GUI freezes while executing a callback funtion when a button is pressed abi17124 5 7,470 Jul-10-2019, 12:48 AM
Last Post: FullOfHelp
  [matpltlib]Basic question about callback function schniefen 3 3,198 May-20-2019, 09:47 PM
Last Post: Yoriz
  Unable to return value from callback function of a button in Python Tkinter nilaybnrj 4 20,768 Aug-05-2018, 11:01 PM
Last Post: woooee
  Launch pdf and close on delete window event ashtona 6 5,624 Mar-22-2018, 03:04 PM
Last Post: ashtona

Forum Jump:

User Panel Messages

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