How to Display Date and Time in the active window title?

Rainer Wirtz rainer.wirtz at gmx.de
Thu Feb 3 17:53:30 GMT 2005


Am Donnerstag, 3. Februar 2005 13:29 schrieb Markus Tacker:
> Thomas McGuire wrote:
> > Not possible. Only way to do this is to modify the source code, but
> > you have to be a programmer with C++ and KDE knowledge to do this.
>
>    Sigh. Expected that.
>    I hoped there was a way with dcop to get the Window witch has the
>    focus and change its title.

Well, when you start kdcop and poke around a bit you will find that many 
(not all) apps have an interface "mainwindow" or 
"<appname>-MainWindow#1". These interfaces have methods "bool 
isActiveWindow()",  "QString caption()" and "void setCaption(QString 
caption)".

There's a (c++) function DCOP::findObject() which allows you to use 
wildcards to find out which application and which interface is 
answering with "true" to the call to "bool isActiveWindow".
So, IMO it is possible *without* modifying kde. It does not look however 
as if this DCOP::findObject() can be called from a script using dcop, 
but a small C++ program should do what you want. I don't really know, 
but maybe kdebindings will enable you to use some scripting language to 
do this.

Rainer
___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.




More information about the kde mailing list