Answer the question
In order to leave comments, you need to log in
Getting the widget id
There is a GTK application whose interface is represented by XML generated in Glade.
How can I find out the id of the widget in which the event occurred by an event (for example, pressing a button in the Entry)?
entry.get_name() - returns "GtkEntry"
Code example:
...
def __init__(self):
...
self.builder.connect_signals({
'on_entry1_insert_text': self.entryInsert,
'on_entry2_insert_text': self.entryInsert
})
...
def entryInsert(self, entry, text, length, position):
...
print entry.get_name() #выдает GtkEntry
...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question