On 5/29/05, Calle Erlandsson <[EMAIL PROTECTED]> wrote:
> I don't really get the hang on how to use them... I think the reference
> lack information on this area :(
> Can somebody help me?
> I want a gtk.FileChooserDialog that i can get a list of URI's from.
> How do I construct one?

dialog = gtk.FileChooserDialog(_('Choose Sound'), 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)

                filter = gtk.FileFilter()
                filter.set_name(_('All files'))
                filter.add_pattern('*')
                dialog.add_filter(filter)

                filter = gtk.FileFilter()
                filter.set_name(_('Wav Sounds'))
                filter.add_pattern('*.wav')
                dialog.add_filter(filter)
                dialog.set_filter(filter)

                file = os.path.join(os.getcwd(), file)
                dialog.set_filename(file)
                file = ''
                response = dialog.run()
                        if response != gtk.RESPONSE_OK:
                                 print 'be'
                        file = dialog.get_filename()
                        if os.path.exists(file):
                                  print 'boo'
                dialog.destroy()

adjust to your needs
-- 
Nikos Kouremenos | Jabber ID: [EMAIL PROTECTED] | http://members.hellug.gr/nkour
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to