I'm a Python beginner, I installed quickly, I wrote a "quickly tutorial" in terminal and I did all the steps before at:

"However, the application is not complete. There are a few things left for you to do:"

All the next steps aren't finished yet because when I use open dialog and select one of the files saved, the content of the file isn't showed on "textview1", Why? Only is deleted the content written. Before if was used without dialog works great.

SaveDialog.py work great.

-def on_mnu_new_activate(self, widget, data=None) don't work neither.

-If I use the bold lines by the others don't work.

###def open_file(self, widget, data=None):
def on_mnu_open_activate(self, widget, data=None):

###def save_file(self, widget, data=None):
def on_mnu_save_activate(self, widget, data=None):

To view the code, go to the link above, unrar the archive, install "quickly" if you don't have it yet, place inside on jotty directory, then put "quickly run", "quickly edit", "quickly design", depending what do you want to do.

Code - problematic code with OpenDialog implemented.

Code-part1 - works OK, but without OpenDialog.

Acces to the two codes here

I need principally that OpenDialog function work great.

ADVANCE -> Go to the last message here


im use

def on_openclicked(self, widget):
    dialog = Gtk.FileChooserDialog("Please choose a file", self, Gtk.FileChooserAction.OPEN,(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.OK))
    dialog.set_default_size(100, 50)


    response = dialog.run()
    if response == Gtk.ResponseType.OK:
        print "Open clicked"
        print "File selected: " + dialog.get_filename()
    elif response == Gtk.ResponseType.CANCEL:
        print "Cancel clicked"


def add_filters(self, dialog):

    filter_py = Gtk.FileFilter()
    filter_py.set_name("Text files")

    filter_any = Gtk.FileFilter()
    filter_any.set_name("Any files")

Go to your OpenDialog.py and in the @property selected_file section change the returned row to File.

  • Why the -1 Rating?? – Dai Trying Feb 24 '14 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.