0

I have a button in my code:

self.add_bt = Gtk.Button()
self.add_bt.set_label(_("Choose from computer"))


vbox.pack_start(self.add_bt, False, False, 0)

I want to include FileChooser function on clicking this button.

dlg = Gtk.FileChooserDialog()
dlg.show()

What I am trying to do is, on clicking the button labelled "Choose from computer" I want the browse window to open. Then get the added file included in place of current image.

1 Answer 1

1

Do you mean something like:

self.add_bt.connect("clicked", self.on_add_bt_clicked)

def on_add_bt_clicked(self, button):
    dlg = Gtk.FileChooserDialog()
    dlg.show()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.