Part 10a

Gtk File Chooser Dialog

Creating the Glade File

  1. Start by creating a simple Glade GUI with a window and a vertical box with 2 items. Add a menu to the top, a label in the bottom one. Save the glade file as gtk10.glade.

    Your project should look like this now.

    images/gtk-10-01.png
  2. Next add the on_window1_destroy Handler to the window1 GtkObject destroy handler.

  3. Next change the names of some of the menu items so they make sense:

    1. Change imagemenuitem1 to file_new

    2. Change imagemenuitem2 to file_open

    3. Change imagemenuitem3 to file_save

    4. Change imagemenuitem4 to file_save_as

    5. Change imagemenuitem5 to file_quit

      Your project should look like this now.

      images/gtk-10-02.png
  4. Next add handlers to each GtkMenuItem activate signal for each menu item we changed above and save the glade file. Your project should look like this now.

    images/gtk-10-03.png

Comments

Even though Glade has a File Chooser Dialog I find it easier to create the GTK File Chooser Dialog in Python.