Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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. 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

share|improve this question

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 =
    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")
share|improve this answer

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

share|improve this answer
Why the -1 Rating?? – Dai Trying Feb 24 '14 at 10:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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