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

Add "rehint()" on the background of the widget after changing font size [Core] [Cocoa] #176

Dayof opened this issue Jun 7, 2017 · 4 comments


None yet
5 participants
Copy link

commented Jun 7, 2017

To reproduce this error I made this code .

The following image shows the a normal behavior of a Label, with the Font size modified, inside of a Box:


And in the next image shows the a bad behavior of a Label, with the Font size modified, inside of a Box and this Box is inside of a SplitContainer:


After applying a test_status.rehint() the size of the Label adjust as should it be:


This method (rehint()) should be activated on Toga background after change a Labels Font, without forcing the user worry about this.


This comment has been minimized.

Copy link

commented Feb 12, 2018

Hi! I'd be interested in taking a look at this issue, if it still needs to be done?


This comment has been minimized.

Copy link

commented Mar 8, 2018

AttributeError: 'Label' object has no attribute 'set_font'
Am receiving this error upon running the code


This comment has been minimized.

Copy link

commented Jan 21, 2019

@Dayof @freakboy3742 I am facing the same problem as @Donyme. set_font is implemented in
But not in
As far as I can work out this is where the import is from and hence it is throwing an AttributeError. Is this an implementation that this project has moved on from, or is it missing? As I am new to this codebase I am not able to work it out. Could anyone point me in the right direction, if this is still an issue?


This comment has been minimized.

Copy link

commented Jan 21, 2019

@mav-erick It's entirely expected that the core widget doesn't have a set_font method. The core widget has a font property; altering that attribute calls set_font on the backend. My guess is that it's the property setter that needs the rehint call.

(This is a general pattern in Toga - the front end exposes the "most Pythonic" API it can; the backend then defines specific "do X" APIs to implement that frontend design)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.