Re: [gedit-list] plugin statusbar



Il giorno gio, 28/06/2007 alle 12.52 -0300, Nando Vieira ha scritto:
> Hi,
> 
> How can I add a text on my window's status? I checked others plugins
> and they used something like:
> 
> self.statusbar = window.get_statusbar()
> self.context_id = self.statusbar.get_context_id('MyPluginNameStatusbar')
> 
> self.statusbar.pop(self.context_id)
>     if text is not None:
>         self.statusbar.push(self.context_id, text)
> 
> But it looks that my test is being overwritten by others. How do I do
> to add something like Line/Columns status text?

I just tried

>>> s = window.get_statusbar()
>>> id = s.get_context_id('MyPluginNameStatusbar')
>>> s.push(id, 'lalalalalala')

from the python console and it works just fine.

Obviously it writes to the main statubar.

If you want something like the Line/Col message (that is always visbile,
packed on the right) you need to add a widget to the statusbar (note
that GtkStatusbar is a GtkHBox subclass). Not sure how it would look
though, I never tried.


Paolo




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]