CTabItem change foreground when tab was selected [message #463182] |
Fri, 28 October 2005 16:03 |
Eclipse User |
|
|
|
Originally posted by: murley.murley.murley
Hi,
I have severals CTabItem in my gui. Now i want do something like eclipse
edior:
When the CTabItem is selected, the foreground color change to white (that
mean i want the word of selected CTabItem change to white in color). While
the other un-selected CTabItem foreground is black in color.
---------------------------------------
| tab1 | tab2 | tab3 |
---------------------------------------
If i click 'tab1', the color of 'tab1' will change to white color.
Therefore i write following code...
CTabFolder tabFolder = new CTabFolder(shell, SWT.BORDER);
// create 3 CTabItem..
CTabItem item1 = xxx
CTabItem item2 = xxx
CTabItem item3 = xxx
tabFolder.addSelectionListener(new SelectionListener(){
public void widgetSelected(SelectionEvent event){
tabFolder.setForeground(new Color(display, 255, 255, 255));
}
public void widgetDefaultSelected(SelectionEvent event){
widgetSelected(event);
}
});
But it not works...
Thanks in advance
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02734 seconds