change the "X" icon for an app - Xwindows
This is a discussion on change the "X" icon for an app - Xwindows ; I am using KDE 3.5 on Fedora 5. I have a Perl/Tk app that I wish to give its
own icon rather than the standard "X" icon that (I guess) my theme provides
as a default. How do I do ...
-
change the "X" icon for an app
I am using KDE 3.5 on Fedora 5. I have a Perl/Tk app that I wish to give its
own icon rather than the standard "X" icon that (I guess) my theme provides
as a default. How do I do that? Thanks!
-
Re: change the "X" icon for an app
On Sep 26, 6:43*pm, Jerome wrote:
> I am using KDE 3.5 on Fedora 5. I have a Perl/Tk app that I wish to give its
> own icon rather than the standard "X" icon that (I guess) my theme provides
> as a default. How do I do that? Thanks!
Use the icon_pixmap field of the XWMHints variable passed to
XSetWMHints()
--
Fred Kleinschmidt
-
Re: change the "X" icon for an app
Jerome wrote:
> I am using KDE 3.5 on Fedora 5. I have a Perl/Tk app that I wish to give its
> own icon rather than the standard "X" icon that (I guess) my theme provides
> as a default. How do I do that? Thanks!
>
This is how I managed it in Object Pascal.
const
IconBitmapWidth = 16;
IconBitmapHeight = 16;
IconBitmapBits: packed array[1..32] of Byte = (
$00, $00, $78, $07, $08, $09, $38, $09, $08, $07, $08, $01,
$08, $01, $00, $00, $00, $00, $98, $74, $a4, $24, $84, $24,
$b4, $24, $a4, $24, $18, $73, $00, $00);
....and then the actual code...
var
IconPixmap: TPixmap;
WMHints: PXWMHints;
IconPixMap := XCreateBitmapFromData(fpgApplication.Display,
FWinHandle, @IconBitmapBits, IconBitmapWidth, IconBitmapHeight);
WMHints := XAllocWMHints;
WMHints^.icon_pixmap := IconPixmap;
WMHints^.flags := IconPixmapHint;
XSetWMProperties(fpgApplication.Display, FWinHandle, nil, nil, nil, 0,
nil, WMHints, nil);
I hope that helps.
Regards,
- Graeme -
__________________________________________________ _____
fpGUI - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/