title: Using lambda function to connect buttons in a calculator program and show values after entering
body: <p>So I am trying to work with the lambda function to connect the buttons of my calculator with a function. Here is some of my code:</p>
  
  <pre><code>button1 = Gtk.Button(label = "1")
  lambda event: self.button_clicked(event, "1"), button1
  vbox.pack_start(button1 ,True, True, 0)
  vbox.pack_end(button1,True,True,0)
  self.add(button1)
  </code></pre>
  
  <p>So I basically want to calculate two numbers when they are clicked but before that I want to to display them in the entry of course. But when I click <code>button1</code> for example it doesn't get displayed in the text entry. That's basically the problem I need to solve. I think that the button_clicked function should work with all the ifs. That is basically my problem.</p>
  
  <pre><code>def button_clicked(self, value):
      if (value != None):
          if (value != "="):
              # Add something to the text
              self.entry.set_text(self.entry.get_text() + str(value))
          else:
              # Evaluate the text
              self.result = eval(self.entry.get_text())
              self.entry.set_text(self.result)
      else:
          # Clear the text
          self.entry.set_text("")
  </code></pre>
  
  <p>Am I using the lambda function the right way? And if not how can I change the code?</p>