[skinlf-dev] Custom buttons in titlebar

Zsombor <[email protected]> Sun, 05 Jun 2005 03:07:02 +0200
Newsgroups gmane.comp.java.skinlf.devel
Message-ID <1117933622.20567.11.camel@localhost>
Hi !

 I've extended the skinlf with the ability to handle custom buttons in
the title bar, because i have to put a new 'Dock' button to the window.
If there is no objections against, I will go ahead and commit my patch.
After the patch applied the developer can do the following to create a
custom button:
1, put the following to the kde.themerc :
 [Window Button Layout]
 ButtonA=Dock
 ButtonAEnabled=no
 ButtonAAlign=1
 ButtonB=Dock2
 ButtonBEnabled=yes
 ButtonBAlign=0
 
2, from the code: 
 JButton button = WindowUtils.getWindowButton(myFrame, "Dock");
 // button is not null, if : 
 //   1, the currently used theme defined a "Dock" button
 //   2, the myFrame already visible.  
 if (button!=null) {
	button.addActionListener(...);
 }

And that's all. 

BR
 Zsombor