[pygtk] display a notification near of the trayicon

Khiraly khiraly123 at gmx.net
Thu Oct 19 01:32:41 WST 2006

I try to launch to your example code, but I cant figure out this line:
ty= readr.trayicon

Can you explain me what is 'readr' and where should i create it?

Thank you very much!

2006. 10. 18, szerda keltezéssel 18.08-kor Danni Moiseyev ezt írta:
> Hey Khirly, i managed to do the same thing some days ago.
> I used gtk.StatusIcon what i basicly did is a POPUP window that is
> unmanged by the WM so it wont show up in the task bar, i used the
> gtk.StatusIcon.get_geometry() for the cordinets (X,Y) of the
> statusicon, from there is very easy work with gtk.Window, here is a
> snippt:
>             window = gtk.Window(type=gtk.WINDOW_POPUP);
>             label = gtk.Label("Balloon!!");
>             eventbox = gtk.EventBox()
>             eventbox.set_events (gtk.gdk.BUTTON_PRESS_MASK)
>             eventbox.connect("button-press-event",self.close_balloon)
> # close balloon is for closing the balloon, the status icon is kept in
> self.trayicon so it could be used in the whole class 
>             eventbox.add(label)
>             window.add(eventbox);    
>             ty= readr.trayicon
>             a,rect,c =ty.get_geometry();  #getting the X,Y into rect
>             window.move(rect.x,abs(rect.y-(ty.get_size()+5))) # this
> is a little hack cause you can't get the toolbar width, so it might
> hide some pixels of the toolbar that the trayicon is packed into it.
>             gobject.timeout_add(3000, window.destroy) # simple timeout
> to close the balloon after 3 secs
>             window.show_all();  
> hope it will help ya.
> PS. this is pygtk 2.10 only! if you don't have it in your repo's try
> checking testing repository(for instance Archlinux got pygtk2.10 in
> testing).
> Cheers, danni.
> On 10/18/06, Khiraly <khiraly123 at gmx.net> wrote:
>         Hi!
>         I want to write an application which can display near of the
>         trayicon a
>         notification mini-window (no window decoration but more
>         powerful as the
>         gtk.Tooltips(), ie I need multiple line, bold an italic text
>         to display, and a button) 
>         The idea is writing an application (dictionary), which display
>         the
>         translation of the current selection (so its enough to select
>         a word in
>         any application and the translation just showing up in the top
>         of the 
>         display)
>         Any idea how to achieve this?
>         Pretty much the same as the Azureus torrent client
>         notification
>         messages. (just that is in java using swt, and I need python
>         using
>         pygtk)
>         Thanks in advance! 
>         Khiraly
>         _______________________________________________
>         pygtk mailing list   pygtk at daa.com.au
>         http://www.daa.com.au/mailman/listinfo/pygtk
>         Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

More information about the pygtk mailing list