#!/usr/bin/python

"""The following script shows a window with two icons as content.

With Gtk 3.13.3 it shows:

[non symbolic, symbolic]

with 3.12 it shows:

[symbolic, symbolic]
"""

from gi.repository import Gtk, GLib, Gio

def get_symbolic_image_with_fallback():
    name = "media-playback-start"
    symbolic_name = name + "-symbolic"
    gicon = Gio.ThemedIcon.new_from_names([symbolic_name, name])
    return Gtk.Image.new_from_gicon(gicon, Gtk.IconSize.DIALOG)

def get_symbolic_image_only():
    name = "media-playback-start"
    symbolic_name = name + "-symbolic"
    gicon = Gio.ThemedIcon.new_from_names([symbolic_name])
    return Gtk.Image.new_from_gicon(gicon, Gtk.IconSize.DIALOG)

w = Gtk.Window()
b = Gtk.Box()
b.pack_start(get_symbolic_image_with_fallback(), False, False, 0)
b.pack_start(get_symbolic_image_only(), False, False, 0)
w.add(b)
w.show_all()
w.connect("delete-event", Gtk.main_quit)
GLib.unix_signal_add(0, 2, Gtk.main_quit)
Gtk.main()
