I’m a beginner developer in Gtk and also in Python. I’m trying to create a gtk.StatusIcon displaying a text string in place of a icon. How can I accomplish this with PixBuf, or any other way?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is possible – two ideas come to mind:
a.) Use an offscreen GtkLabel and then call
gdk_pixbuf_get_from_drawable (gtk_widget_get_snapshot (label))(a GdkPixmap is a GdkDrawable.) This will do an XGetImage to get pixels from the X server.b.) Or you could use Cairo to draw text to the pixbuf – this is the technique that was used for the keyboard status icon in GNOME: http://blogs.gnome.org/sudaltsov/category/general/