Showing message on status bar
use as a status bar. So, I modify this recipe and
make it into a module. (need fgimage.pyd from here)
1 2 # status.py 3 from graphics import * 4 import fgimage 5 __all__ = ["status_on", "status_off"] 6 7 bar = Image.new((119,13)) 8 bgcolor = screenshot().getpixel((0,0))[0] 9 fg = fgimage.FGImage() 10 11 def status_on(message=None): 12 if message is not None: 13 bar.clear(bgcolor) 14 bar.text((0,11), unicode(message), 0xffffff) 15 fg.set(57,30, bar._bitmapapi()) 16 17 def status_off(): 18 fg.unset()
You can use it easily this way
1 2 >>> from status import * 3 >>> status_on('Hello world') # show it 4 >>> status_off() # hide it 5 >>>
See a screenshot.