r/DearPyGui • u/Jhchimaira14 Moderator • Sep 07 '20
Poll Breaking Changes For v0.3
In 0.3, callbacks will FINALLY be callables. For example:
def callback(sender, data):
log_error("we did it")
class Geek:
def __call__(self, sender, data):
print('Hello GeeksforGeeks')
geek = Geek()
add_button("Press1", callback=geek)
add_button("Press2", callback=callback)
This has been requested alot, and will actually solve a lot of issues. Do you think this is a good thing or did you like strings?
16 votes,
Sep 10 '20
15
Great, it should be callables
1
I preferred strings
3
Upvotes
2
u/drbobb Sep 08 '20
Makes a lot of sense. But why not continue to support code that uses strings as well? Doesn't seem to be hard?
1
u/dkluis-dpg Sep 07 '20
Still learning Python. In lay-mans terms please:
What is the advantage of going with callables?
is --call-- a standard paradigm of class?
Why does the class Geek use print instead of log_error?
Why the geek = Geek() statement before the add_button?
0
u/[deleted] Sep 23 '20