Skip to content

Commit bbf5152

Browse files
author
mdc
committed
BF: Load icon using path in 'prefs'
1 parent 5be85f5 commit bbf5152

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

psychopy/visual/backends/glfwbackend.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"""
1515

1616
from __future__ import absolute_import, print_function
17-
import sys
17+
import sys, os
1818
import numpy as np
19-
from psychopy import logging, event
19+
from psychopy import logging, event, prefs
2020
from psychopy.tools.attributetools import attributeSetter
2121
from .gamma import createLinearRamp
2222
from .. import globalVars
@@ -45,7 +45,8 @@
4545
'hresize': glfw.create_standard_cursor(glfw.HRESIZE_CURSOR),
4646
'vresize': glfw.create_standard_cursor(glfw.VRESIZE_CURSOR)}
4747
# load window icon
48-
# _WINDOW_ICON_ = Image.open('psychopy/monitors/psychopy.ico')
48+
_WINDOW_ICON_ = Image.open(
49+
os.path.join(prefs.paths['resources'], 'psychopy.png'))
4950

5051

5152
class GLFWBackend(BaseBackend):
@@ -286,7 +287,7 @@ def __init__(self, win, *args, **kwargs):
286287
share=share_context)
287288

288289
# set the window icon
289-
#glfw.set_window_icon(self.winHandle, 1, _WINDOW_ICON_)
290+
glfw.set_window_icon(self.winHandle, 1, _WINDOW_ICON_)
290291

291292
# The window's user pointer maps the Python Window object to its GLFW
292293
# representation.

0 commit comments

Comments
 (0)