Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31430 > unrolled thread

Fwd: system tray or notification area in python

Started byDaniel Fetchinson <fetchinson@googlemail.com>
First post2012-10-16 22:39 +0200
Last post2012-10-19 14:00 +0300
Articles 6 — 3 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Fwd: system tray or notification area in python Daniel Fetchinson <fetchinson@googlemail.com> - 2012-10-16 22:39 +0200
    Re: Fwd: system tray or notification area in python Christian Gollwitzer <auriocus@gmx.de> - 2012-10-16 23:56 +0200
      Re: Fwd: system tray or notification area in python Daniel Fetchinson <fetchinson@googlemail.com> - 2012-10-17 09:49 +0200
        Re: Fwd: system tray or notification area in python Christian Gollwitzer <auriocus@gmx.de> - 2012-10-17 10:02 +0200
          Re: system tray or notification area in python Daniel Fetchinson <fetchinson@googlemail.com> - 2012-10-17 13:49 +0200
    Re: Fwd: system tray or notification area in python Anssi Saari <as@sci.fi> - 2012-10-19 14:00 +0300

#31430 — Fwd: system tray or notification area in python

FromDaniel Fetchinson <fetchinson@googlemail.com>
Date2012-10-16 22:39 +0200
SubjectFwd: system tray or notification area in python
Message-ID<mailman.2296.1350420001.27098.python-list@python.org>
>> Hi folks,
>>
>> I'm using a stand alone window manager without gnome or kde or any
>> other de. But I still would like to have a system tray or notification
>> area and so far used stalonetray for this. Stalonetray is written in C
>> and is a GTK application, works all right but sometimes it doesn't.
>> For instance if it is killed and restarted icons don't come back, etc,
>> etc, there are some quirks.
>>
>> So I thought I would write a brand new stand alone system tray or
>> notification area in python. I guess I need to use gtk bindings or
>> some such but don't really know what my options are.
>>
>> Where would I start something like this?
>> Any pointers would be greatly appreciated!
>>
> Why not look at the source code of the current app your using to get
> an idea how that application accomplishes said task?

I actually did that already it's using the C bindings of gtk.
You might ask you I'm not modifying the code in order to achieve what
I want, well, the answer is that I'd much rather prototype something
like this in python than work immediately with gtk from C.

But I have zero experience with gui programming in python. So any
pointers would be much appreciated how to implement a system tray in
python. Gtk is I guess just one option, one could use other stuff from
python but I wouldn't know what the simplest approach is.

Cheers,
Daniel


> You could always use raw X11 libs but leveraging something like Gtk or
> Qt/KDE would probably be much easier.



-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown



-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown

[toc] | [next] | [standalone]


#31436

FromChristian Gollwitzer <auriocus@gmx.de>
Date2012-10-16 23:56 +0200
Message-ID<k5kl6n$ia1$1@dont-email.me>
In reply to#31430
Am 16.10.12 22:39, schrieb Daniel Fetchinson:
>>> Hi folks,
>>> So I thought I would write a brand new stand alone system tray or
>>> notification area in python. I guess I need to use gtk bindings or
>>> some such but don't really know what my options are.
>>>
>>> Where would I start something like this?
>>> Any pointers would be greatly appreciated!
>>>
>> Why not look at the source code of the current app your using to get
>> an idea how that application accomplishes said task?
>
> I actually did that already it's using the C bindings of gtk.

I think you are mistaken - if its this one:
	http://stalonetray.sourceforge.net/

I had a quick look into the sources, it does not use gtk at all, it uses 
low level X11 calls. Programming in this way is very tedious.

> But I have zero experience with gui programming in python. So any
> pointers would be much appreciated how to implement a system tray in
> python. Gtk is I guess just one option, one could use other stuff from
> python but I wouldn't know what the simplest approach is.

I'm not sure it is even possible. "Usual" GUI applications just need to 
request certain features from their window manager such as the setting 
the program icon or requesting a certain position on the screen. That is 
what is implemented in the usual toolits like Tk, QT, and gtk.

A window manager, on the other hand, must be able to recieve and 
interpret these messages. For a system tray, they are described here:

http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.3.html

I have not studied the whole interface of the aforementioned toolkits, 
but I suspect that there is no way around writing low level Xlib code in 
order to recieve these messages.

Don't take it wrong, but when you write that you have no experience with 
GUI programming, I'd start another projet first - I think you will have 
a tough way to succeed with this project.

	Christian

[toc] | [prev] | [next] | [standalone]


#31483

FromDaniel Fetchinson <fetchinson@googlemail.com>
Date2012-10-17 09:49 +0200
Message-ID<mailman.2332.1350460151.27098.python-list@python.org>
In reply to#31436
>>>> Hi folks,
>>>> So I thought I would write a brand new stand alone system tray or
>>>> notification area in python. I guess I need to use gtk bindings or
>>>> some such but don't really know what my options are.
>>>>
>>>> Where would I start something like this?
>>>> Any pointers would be greatly appreciated!
>>>>
>>> Why not look at the source code of the current app your using to get
>>> an idea how that application accomplishes said task?
>>
>> I actually did that already it's using the C bindings of gtk.
>
> I think you are mistaken - if its this one:
> 	http://stalonetray.sourceforge.net/

Yes, that's it.

> I had a quick look into the sources, it does not use gtk at all, it uses
> low level X11 calls. Programming in this way is very tedious.

Sorry, you are right. I was mixing things up, I just remembered it was
gtk, apparently it's not.

>> But I have zero experience with gui programming in python. So any
>> pointers would be much appreciated how to implement a system tray in
>> python. Gtk is I guess just one option, one could use other stuff from
>> python but I wouldn't know what the simplest approach is.
>
> I'm not sure it is even possible. "Usual" GUI applications just need to
> request certain features from their window manager such as the setting
> the program icon or requesting a certain position on the screen. That is
> what is implemented in the usual toolits like Tk, QT, and gtk.

That is my impression as well, tk, qt, etc, won't be good for this
task but I thought there are some sort of X bindings in python that
will make writing low level X applications in python possible. For
instance a system tray :)

> A window manager, on the other hand, must be able to recieve and
> interpret these messages. For a system tray, they are described here:
>
> http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.3.html
>
> I have not studied the whole interface of the aforementioned toolkits,
> but I suspect that there is no way around writing low level Xlib code in
> order to recieve these messages.

Right, but nobody wrote Xlib bindings for python?

> Don't take it wrong, but when you write that you have no experience with
> GUI programming, I'd start another projet first - I think you will have
> a tough way to succeed with this project.

I certainly wouldn't start with Xlib in C, but if python bindings
would be available that would make life much easier.

Cheers,
Daniel


> 	Christian
> --
> http://mail.python.org/mailman/listinfo/python-list
>


-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown

[toc] | [prev] | [next] | [standalone]


#31484

FromChristian Gollwitzer <auriocus@gmx.de>
Date2012-10-17 10:02 +0200
Message-ID<k5lone$reg$1@dont-email.me>
In reply to#31483
Am 17.10.12 09:49, schrieb Daniel Fetchinson:
>>>>> So I thought I would write a brand new stand alone system tray or
>>>>> notification area in python. I guess I need to use gtk bindings or
>>>>> some such but don't really know what my options are.
>>>>>
>>>>> Where would I start something like this?
>>>>> Any pointers would be greatly appreciated!
>>>>>
>>>> Why not look at the source code of the current app your using to get
>>>> an idea how that application accomplishes said task?
>>>
>>> I actually did that already it's using the C bindings of gtk.
>>
>> I think you are mistaken - if its this one:
>> 	http://stalonetray.sourceforge.net/
>
> Yes, that's it.
>
>> I had a quick look into the sources, it does not use gtk at all, it uses
>> low level X11 calls. Programming in this way is very tedious.
>
> Right, but nobody wrote Xlib bindings for python?

Erm, Google is your friend: "python xlib" turns up

	http://python-xlib.sourceforge.net/

as well as

	http://plwm.sourceforge.net/

which is pretty close to what you are trying to do.

>> Don't take it wrong, but when you write that you have no experience with
>> GUI programming, I'd start another projet first - I think you will have
>> a tough way to succeed with this project.
>
> I certainly wouldn't start with Xlib in C, but if python bindings
> would be available that would make life much easier.
>

Everything is easier in python:) because usually python libs are 
designed with OO and ease of use in mind. Beware that this will be much 
tougher than using gtk&friends.

	Christian

[toc] | [prev] | [next] | [standalone]


#31495

FromDaniel Fetchinson <fetchinson@googlemail.com>
Date2012-10-17 13:49 +0200
Message-ID<mailman.2340.1350474568.27098.python-list@python.org>
In reply to#31484
>>>>>> So I thought I would write a brand new stand alone system tray or
>>>>>> notification area in python. I guess I need to use gtk bindings or
>>>>>> some such but don't really know what my options are.
>>>>>>
>>>>>> Where would I start something like this?
>>>>>> Any pointers would be greatly appreciated!
>>>>>>
>>>>> Why not look at the source code of the current app your using to get
>>>>> an idea how that application accomplishes said task?
>>>>
>>>> I actually did that already it's using the C bindings of gtk.
>>>
>>> I think you are mistaken - if its this one:
>>> 	http://stalonetray.sourceforge.net/
>>
>> Yes, that's it.
>>
>>> I had a quick look into the sources, it does not use gtk at all, it uses
>>> low level X11 calls. Programming in this way is very tedious.
>>
>> Right, but nobody wrote Xlib bindings for python?
>
> Erm, Google is your friend: "python xlib" turns up
>
> 	http://python-xlib.sourceforge.net/
>
> as well as
>
> 	http://plwm.sourceforge.net/
>
> which is pretty close to what you are trying to do.

Great, thanks a lot!

>>> Don't take it wrong, but when you write that you have no experience with
>>> GUI programming, I'd start another projet first - I think you will have
>>> a tough way to succeed with this project.
>>
>> I certainly wouldn't start with Xlib in C, but if python bindings
>> would be available that would make life much easier.
>>
>
> Everything is easier in python:) because usually python libs are
> designed with OO and ease of use in mind. Beware that this will be much
> tougher than using gtk&friends.

I guess so :) But it's a good excuse to get familiar with X :)

Cheers,
Daniel


> 	Christian
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>


-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown

[toc] | [prev] | [next] | [standalone]


#31737

FromAnssi Saari <as@sci.fi>
Date2012-10-19 14:00 +0300
Message-ID<vg34nlqpvz0.fsf@coffee.modeemi.fi>
In reply to#31430
Daniel Fetchinson <fetchinson@googlemail.com> writes:

> But I have zero experience with gui programming in python. So any
> pointers would be much appreciated how to implement a system tray in
> python. Gtk is I guess just one option, one could use other stuff from
> python but I wouldn't know what the simplest approach is.

Well, when I went to download stalonepanel, SourceForge said I might be
interested in PyPanel as well. Which is a "lightweight panel/taskbar
written in Python and C for X11 window managers." It includes a system
tray. Fairly old though but I suppose it could be a start? Apparently it
uses python-xlib.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web