change the "X" icon for an app

This is a discussion on change the "X" icon for an app within the Xwindows forums, part of the Tools category; 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) ...

Go Back   Unix Linux Forum > Technologies & Tools > Tools > Xwindows

FixUnix.com - Unix Linux Forums

Unix Content Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-26-2008, 09:43 PM
Default 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!

Reply With Quote
  #2  
Old 09-29-2008, 10:26 AM
Default 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
Reply With Quote
  #3  
Old 09-30-2008, 02:29 AM
Default 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/

Reply With Quote
Reply

Thread Tools


All times are GMT -5. The time now is 12:53 AM.

In an effort to better serve ads to our visitors, cookies are used on Fixunix.com. For more information, check out our Privacy Policy.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Ad Management by RedTyger