I use Python3.6 with gi.repository. Indeed I have created a Gtk.Entry that the user must fill in. This field is followed by a button. I would like to recover the value of the Gtk.Entry when the user clicks on the button. For my part I have created a signal, and when the user clicks on the button, I get the text from the Gtk.entry. however I would like to use this value in the rest of the code and not only in the function of the signal. please give me the right approach to do what I want. here is my signal
# definition du signal pour entrer
def on_button1_nombre_mise(self, widget):
nombre = 0
try:
nombre = int(self.entry.get_text())
self.label.set_text("Tapez maintenant le montant de votre mise : ")
except ValueError:
self.label.set_text("Vous n'avez pas saisi de nombre")
print("Vous n'avez pas saisi de nombre")
if nombre < 0 or nombre > 49:
self.label.set_text("Votre n'est pas compris entre 0 et 49.")
else:
self.input = nombre