Skip to content

(ENHANCEMENT?) how to create rumps.window() that has scrollable text area? #223

@dwightmulcahy

Description

@dwightmulcahy

So this might be an "enhancement request" based on looking at the code...

So I am adding "Show Logs" to a menubar app I created with rumps.

This is what I get.

Image

The window is created like this

...
         window = rumps.Window(
            message="Application Log",
            title=f"{APP_NAME} App Log",
            default_text=log_content,
            ok='Close',
            dimensions=(700, 300)
         )
         window._alert.window().setLevel_(constants.APPKIT_NSFLOATINGWINDOWLEVEL)  # type: ignore
         window.run()
...

rumps creates the window like this

class Window(object):
...
    def __init__(...
...
        self._alert = NSAlert.alertWithMessageText_defaultButton_alternateButton_otherButton_informativeTextWithFormat_(
...

seems that the NSTextView needs to be inside an NSScrollView.

https://stackoverflow.com/questions/25979294/nstextview-in-nsalert-has-no-scrollbars

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions