I have already added the listeners and etc, but I can't get the actual open dialog code to work. I think it is something to do with the difference between gtk and Gtk but I literally just started python yesterday. Here is my code as of now:
dialog = Gtk.FileChooserDialog("Open..",
None,
GTK_FILE_CHOOSER_ACTION_OPEN,
(Gtk.STOCK_CANCEL, Gtk.RESPONSE_CANCEL,
Gtk.STOCK_OPEN, Gtk.RESPONSE_OK))
dialog.set_default_response(Gtk.RESPONSE_OK)
When the button is pressed, the console output this:
Traceback (most recent call last):
File "/home/nja/notetaker/notetaker/NotetakerWindow.py", line 61, in on_btn_open_clicked
self.open_file()
File "/home/nja/notetaker/notetaker/NotetakerWindow.py", line 41, in open_file
GTK_FILE_CHOOSER_ACTION_OPEN,
NameError: global name 'GTK_FILE_CHOOSER_ACTION_OPEN' is not defined
Also when GTK_FILE_CHOOSER_ACTION_OPEN is substituted for "0" (Which I believe is the int that constant points to) it works fine but it flags up the same error on Gtk.RESPONSE_CANCEL and Gtk.RESPONSE_OK