I am trying to convert a python2 pyGTK program (Comix) to GTK3 python3 program.
I am not really familiar with GTK also for what does this mean about my understanding of the original program's logic. Anyway I have found a point where this function appears:
pixbuf = GdkPixbuf.Pixbuf.new_from_file(os.path.join(icon_path, '16x16/comix.png'))
gtk.window_set_default_icon(pixbuf)
and it throws an error reporting:
AttributeError: 'gi.repository.Gtk' object has no attribute 'window_set_default_icon'
I have tried to find the equivalent function in GTK3 but to no avail. The function that causes the problem is the latter one (gtk.window_set_default_icon()
).
So, how can I write this snippet in GTK3 in python3?
I think you misunderstand the function call. It is actually the window you call the function on. Example:
window = Gtk.Window()
window.set_default_icon(pixbuf)