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

Timed messages in StatusBar #522

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
8 changes: 6 additions & 2 deletions pyface/ui/qt4/action/status_bar_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from pyface.qt import QtGui


from traits.api import Any, Bool, HasTraits, List, Property, Str
from traits.api import Any, Bool, HasTraits, Int, List, Property, Str


class StatusBarManager(HasTraits):
Expand All @@ -38,6 +38,9 @@ class StatusBarManager(HasTraits):
# Whether the status bar is visible.
visible = Bool(True)

# Number of millisecond to display new messages for [default: indefinitely]
message_duration = Int

# ------------------------------------------------------------------------
# 'StatusBarManager' interface.
# ------------------------------------------------------------------------
Expand Down Expand Up @@ -126,4 +129,5 @@ def _show_messages(self):
# decide to put all but the first message into separate widgets. We
# probably also need to extend the API to allow a "message" to be a
# widget - depends on what wx is capable of.
self.status_bar.showMessage(" ".join(self.messages))
self.status_bar.showMessage(" ".join(self.messages),
msecs=self.message_duration)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think duration in seconds would be better. That is what pyface.timer uses.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.