Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Title setting on MacOS #330

Open
thenamangoyal opened this issue Nov 13, 2021 · 2 comments
Open

Title setting on MacOS #330

thenamangoyal opened this issue Nov 13, 2021 · 2 comments

Comments

@thenamangoyal
Copy link

Describe the bug

Unable to set title using title(). Leads to following error

py36/lib/python3.6/site-packages/glfw/__init__.py", line 68, in <lambda>
    _to_char_p = lambda s: s.encode('utf-8')
AttributeError: 'bytes' object has no attribute 'encode'
ERROR: Invoking <bound method Sketch.on_timer of <Sketch (Glfw) at 0x7fb444bfcda0>> for Event
ERROR: Invoking <bound method Sketch.on_timer of <Sketch (Glfw) at 0x7fb444bfcda0>> repeat 2
ERROR: Invoking <bound method Sketch.on_timer of <Sketch (Glfw) at 0x7fb444bfcda0>> repeat 4
ERROR: Invoking <bound method Sketch.on_timer of <Sketch (Glfw) at 0x7fb444bfcda0>> repeat 8
ERROR: Invoking <bound method Sketch.on_timer of <Sketch (Glfw) at 0x7fb444bfcda0>> repeat 16
ERROR: Invoking <bound method Sketch.on_timer of <Sketch (Glfw) at 0x7fb444bfcda0>> repeat 32
ERROR: Invoking <bound method Sketch.on_timer of <Sketch (Glfw) at 0x7fb444bfcda0>> repeat 64
ERROR: Invoking <bound method Sketch.on_timer of <Sketch (Glfw) at 0x7fb444bfcda0>> repeat 128
ERROR: Invoking <bound method Sketch.on_timer of <Sketch (Glfw) at 0x7fb444bfcda0>> repeat 256
ERROR: Invoking <bound method Sketch.on_timer of <Sketch (Glfw) at 0x7fb444bfcda0>> repeat 512

To Reproduce

from p5 import *

def setup():
    title("hellow")
    size(800,600)

def draw():
    pass

run()

System information:

  • p5 release (version number or latest commit): 0.7.1
  • Python version: 3.6
  • Operating system: MacOS
@github-actions
Copy link
Contributor

Thank you for submitting your first issue to p5py

@thenamangoyal
Copy link
Author

The only workaround seems setting builtins.title before running

Following works

from p5 import *

def setup():
    # title("hellow")
    size(800,600)

def draw():
    pass

builtins.title = "hellow"
run()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant