question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Icons for tutorial 2 not being picked up

See original GitHub issue

Describe the bug Unzipping the icons file as pointed to by https://toga.readthedocs.io/en/latest/tutorial/tutorial-2.html does not lead to the icons being picked up:

WARNING: Can't find icon icons/brutus; falling back to default icon
WARNING: Can't find icon icons/cricket-72.png; falling back to default icon
WARNING: Can't find icon icons/brutus; falling back to default icon        
WARNING: Can't find icon icons/brutus; falling back to default icon        

To Reproduce Steps to reproduce the behavior:

  1. Go to https://toga.readthedocs.io/en/latest/tutorial/tutorial-2.html
  2. Copy over the code from the tutorial
  3. Unzip https://toga.readthedocs.io/en/latest/_downloads/d3cc510fb784d45459de5a897e8b91b2/icons.zip
  4. Move the icons directory to where your code is kept

Expected behavior The new icons to be picked up.

Environment:

  • Operating System: Windows 10
  • Python version: Python 3.8.3
  • Software versions:
    • Briefcase:
    • Toga: 0.3.0.dev22

Additional context Poking around with the code suggests that there’s potentially two problems. One is the brutus icon is named brutus.icns and not brutus.ico. The second issue is that factory.paths.app in taga.icons.Icon.bind() is pointing at not where the app code is but site-packages/toga.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
freakboy3742commented, Sep 7, 2020

@bsanderson1981 It depends which icon you’re loading, and the platform you’re on. It looks like you’re on Linux (which uses png format by default for icons); on Linux, Toga will look for the app icon as resources/{app_name}-72.png - so, in the case of tutorial 3, it will look for resources/tutorial-72.png. It will look for the folder relative to the folder where the app itself is defined.

The boxes tutorial (which is Tutorial 2 - I presume that was a typo) also loads some additional icons (the brutus and cricket references). I haven’t run tutorial 2 on Linux for a while, so it’s possible something has gotten out of alignment.

0reactions
bsanderson1981commented, Sep 8, 2020

I have not been able to get the default icons from tutorial [You put the box inside another box]…to show up. Even putting them in same directory as default toga.ico.
cricket72-png

I was looking at icon.py see if I can debug it for my setup.
sorry not more helpful but 3 month into python myself…

I did find that if you rename toga.ico to anything else. tutorial will not run… lots of run errors in terminal…

terminal errors when you rename resource/toga.ico:::::

raise FileNotFoundError( FileNotFoundError: Can’t find icon resources/toga

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “/usr/lib/python3.8/pathlib.py”, line 713, in str return self._str AttributeError: _str

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “/home/bsanderson11/Documents/DevHub/code/toga/venv/lib/python3.8/site-packages/toga_gtk/app.py”, line 93, in gtk_startup self.interface.startup() File “/home/bsanderson11/Documents/DevHub/code/toga/venv/lib/python3.8/site-packages/toga/app.py”, line 411, in startup self.main_window = MainWindow(title=self.formal_name, factory=self.factory) File “/home/bsanderson11/Documents/DevHub/code/toga/venv/lib/python3.8/site-packages/toga/app.py”, line 25, in init super().init( File “/home/bsanderson11/Documents/DevHub/code/toga/venv/lib/python3.8/site-packages/toga/window.py”, line 42, in init self._impl = getattr(self.factory, self._WINDOW_CLASS)(interface=self) File “/home/bsanderson11/Documents/DevHub/code/toga/venv/lib/python3.8/site-packages/toga_gtk/window.py”, line 37, in init self.create() File “/home/bsanderson11/Documents/DevHub/code/toga/venv/lib/python3.8/site-packages/toga_gtk/app.py”, line 31, in create toga_App.app.icon.bind(self.interface.factory) File “/home/bsanderson11/Documents/DevHub/code/toga/venv/lib/python3.8/site-packages/toga/icons.py”, line 61, in bind self._impl = self.DEFAULT_ICON.bind(factory) File “/home/bsanderson11/Documents/DevHub/code/toga/venv/lib/python3.8/site-packages/toga/icons.py”, line 61, in bind self._impl = self.DEFAULT_ICON.bind(factory) File “/home/bsanderson11/Documents/DevHub/code/toga/venv/lib/python3.8/site-packages/toga/icons.py”, line 61, in bind self._impl = self.DEFAULT_ICON.bind(factory) [Previous line repeated 970 more times] File “/home/bsanderson11/Documents/DevHub/code/toga/venv/lib/python3.8/site-packages/toga/icons.py”, line 41, in bind full_path = { File “/home/bsanderson11/Documents/DevHub/code/toga/venv/lib/python3.8/site-packages/toga/icons.py”, line 42, in <dictcomp> size: self._full_path( File “/home/bsanderson11/Documents/DevHub/code/toga/venv/lib/python3.8/site-packages/toga/icons.py”, line 80, in _full_path if icon_path.exists(): File “/usr/lib/python3.8/pathlib.py”, line 1383, in exists self.stat() File “/usr/lib/python3.8/pathlib.py”, line 1189, in stat return self._accessor.stat(self) File “/usr/lib/python3.8/pathlib.py”, line 720, in fspath return str(self) File “/usr/lib/python3.8/pathlib.py”, line 715, in str self._str = self._format_parsed_parts(self._drv, self._root, File “/usr/lib/python3.8/pathlib.py”, line 695, in _format_parsed_parts return drv + root + cls._flavour.join(parts[1:]) RecursionError: maximum recursion depth exceeded while calling a Python object

Read more comments on GitHub >

github_iconTop Results From Across the Web

Icons Not Showing Correctly in Windows 10 Search FIX [Tutorial]
Icons Not Showing Correctly in Windows 10 Search FIX [ Tutorial ]Run: ms-settings:easeofaccess-displaySome Windows 10 users have been ...
Read more >
How to Fix Icons Not Showing on Taskbar in Windows 10 ...
How to Fix Icons Not Showing on Taskbar in Windows 10 [ Tutorial ]Sometimes you may find that your System Tray Notification Area...
Read more >
Use PERFECT ICONS for your game! | Unity tutorial - YouTube
Download Core to create games for FREE: https://bit.ly/Core-CocoCode🎁 Support me and DOWNLOAD Unity project: ...
Read more >
Aesthetic iPhone Trend Tutorial (Minimal Icons) - YouTube
iOS 14 Custom Icons Step By Step Tutorial - Aesthetic iPhone Trend Tutorial (Minimal Icons ). 264K views 2 years ago.
Read more >
How to Change or Create Desktop Icons for Windows - YouTube
Let's see, whether our selected icon has changed or not. 12. At the bottom taskbar, click on the File Explorer to open it....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found