Generic window icon function
I made a function to set the window icon, rather than doing it only when the window is constructed.
This commit is contained in:
parent
1136e3f4af
commit
3de6e94db1
|
@ -17,6 +17,7 @@ prefs = libsaria.prefs
|
||||||
|
|
||||||
win = ocarina.get_window(prefs["window_size"])
|
win = ocarina.get_window(prefs["window_size"])
|
||||||
ocarina.set_window_title(ocarina.__vers__)
|
ocarina.set_window_title(ocarina.__vers__)
|
||||||
|
ocarina.set_window_icon("images/ocarina.png")
|
||||||
|
|
||||||
ocarina.add_tab("Playlist", collection.Playlist())
|
ocarina.add_tab("Playlist", collection.Playlist())
|
||||||
ocarina.add_tab("Library", collection.Library())
|
ocarina.add_tab("Library", collection.Library())
|
||||||
|
|
|
@ -79,3 +79,8 @@ get_window = get_window_once
|
||||||
def set_window_title(text):
|
def set_window_title(text):
|
||||||
window = get_window()
|
window = get_window()
|
||||||
window.set_title(text)
|
window.set_title(text)
|
||||||
|
|
||||||
|
def set_window_icon(path):
|
||||||
|
if libsaria.path.exists(path):
|
||||||
|
window = get_window()
|
||||||
|
window.set_icon_from_file(path)
|
||||||
|
|
|
@ -31,7 +31,6 @@ def init(size):
|
||||||
mask = gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_DROP
|
mask = gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_DROP
|
||||||
dnd_list = [("text/uri-list", 0, TARGET_TYPE_URI_LIST)]
|
dnd_list = [("text/uri-list", 0, TARGET_TYPE_URI_LIST)]
|
||||||
window.drag_dest_set(mask, dnd_list, gtk.gdk.ACTION_COPY)
|
window.drag_dest_set(mask, dnd_list, gtk.gdk.ACTION_COPY)
|
||||||
window.set_icon_from_file("images/ocarina.png")
|
|
||||||
|
|
||||||
window.resize(size[0], size[1])
|
window.resize(size[0], size[1])
|
||||||
window.show()
|
window.show()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user