Portál AbcLinuxu, 31. října 2025 15:21
class FileSelector(Gtk.VBox):
	def __init__(self):
		
		Gtk.Box.__init__(self)
		
		self.label = Gtk.Label("Select image")
		self.pack_start(self.label, False, True, 0)
		
		dialog = Gtk.FileChooserWidget("Please choose a file", 5,
			Gtk.FileChooserAction.OPEN,
			(Gtk.ResponseType.OK))
		dialog.connect("file-activated", self.files_selected, dialog.get_filename())
		self.pack_start(dialog, False, True, 0)
	def files_selected(self, widget, data):
		print (data)
Problém je že mi to vypisuje stále iba:
None None NoneĎakujem za radu :)
 15.1.2016 18:47
wamba             | skóre: 38
             | blog: wamba
        15.1.2016 18:47
wamba             | skóre: 38
             | blog: wamba
            
        files_selected, asi by mělo být něco jako self.files_selected(dialog.get_filename()),
u takových dotazů je nejlepší dát spustitelný kód, aby případný odpovídající si to mohl otestovat 
            
        Tiskni
            
                Sdílej:
                 
                 
                 
                 
                 
                 
            
    
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.