.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "11_demos\itom\ui\demo_statusbar.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_11_demos_itom_ui_demo_statusbar.py: Statusbar ============ This is a short tutorial about how to use the statusbar .. GENERATED FROM PYTHON SOURCE LINES 6-46 .. code-block:: Python from itomUi import ItomUi from itom import ui import os import inspect class Statusbar(ItomUi): def __init__(self): """get current path and and initialize the GUI""" dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) absPath = os.path.join(dir, "statusbar.ui") ItomUi.__init__( self, absPath, ui.TYPEWINDOW, ui.BUTTONBAR_VERTICAL, {"AcceptRole": "OK", "RejectRole": "Cancel"}, ) @ItomUi.autoslot("") def on_btnAdd_clicked(self): """call the status bar and show the message: Here I am""" self.gui.call("statusBar").call("showMessage", "Here I am") @ItomUi.autoslot("") def on_btnShow_clicked(self): """call the status bar and show the message: I am here for a second. The message will disappear after 1000 ms""" self.gui.call("statusBar").call("showMessage", "I am here for a second", 1000) @ItomUi.autoslot("") def on_btnDelete_clicked(self): """clear the status bar""" self.gui.call("statusBar").call("clearMessage") if __name__ == "__main__": inst = Statusbar() inst.show() # show the gui .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.051 seconds) .. _sphx_glr_download_11_demos_itom_ui_demo_statusbar.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: demo_statusbar.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: demo_statusbar.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: demo_statusbar.zip `