Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » label containing unicode copyright sign not shown on certain Motif
label containing unicode copyright sign not shown on certain Motif [message #457975] Fri, 08 July 2005 10:54 Go to next message
exquisitus is currently offline exquisitusFriend
Messages: 211
Registered: July 2009
Senior Member
I have a program with an "About" dialog that contains a copyright notice.
The dialog contains a couple of labels, one of which includes a copyright
symbol, expressed as "\u00a9".

When I run this on Linux/GTK or Win32 or Solaris 5.9 Motif, it works OK, but
on HP-UX11.0 and Solaris 5.8 (both Motif), the label containing the copyright
symbol does not appear at all (i.e. it's not just the symbol that is missing,
or drawn incorrectly). The following example demonstrates this; the dialog
shown has two labels, but only the second appears on the problematic
platforms.

A Swing program that contains a copyright symbol works OK, so I don't think
there's a fundamental problem with Motif. Any ideas what might be wrong?

///// SWT example
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;

public class SWTCopyrightDialog extends Dialog {

protected Object result;

protected Shell shell;

public SWTCopyrightDialog(Shell parent, int style) {
super(parent, style);
}

public SWTCopyrightDialog(Shell parent) {
this(parent, SWT.NONE);
}

public Object open() {
createContents();
shell.open();
shell.layout();
Display display = getParent().getDisplay();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
return result;
}

protected void createContents() {
shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
shell.setSize(500, 375);
shell.setText("SWT Dialog");

final Label label1 = new Label(shell, SWT.NONE);
label1.setText("Here's a copyright : \u00a9");
label1.setBounds(40, 105, 305, 100);

final Label label2 = new Label(shell, SWT.NONE);
label2.setText("Here's some text");
label2.setBounds(40, 205, 305, 100);
//
}

public static void main(String[] args)
{
SWTCopyrightDialog o = new SWTCopyrightDialog(new Shell(Display.getCurrent()));
o.open();
}
}


/// Swing example
import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.Font;
import javax.swing.JDialog;
import javax.swing.JLabel;
public class CopyrightDialog extends JDialog {

public static void main(String args[]) {
try {
CopyrightDialog dialog = new CopyrightDialog();
dialog.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
dialog.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}

public CopyrightDialog() {
super();
setBounds(100, 100, 500, 375);

final JLabel heresACopyrightLabel = new JLabel();
heresACopyrightLabel.setFont(new Font("Monospaced",Font.PLAIN,18));
heresACopyrightLabel.setText("Here's a copyright sign: \u00a9");
getContentPane().add(heresACopyrightLabel, BorderLayout.CENTER);
//
}

}
Re: label containing unicode copyright sign not shown on certain Motif [message #458993 is a reply to message #457975] Thu, 28 July 2005 14:33 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
I've logged https://bugs.eclipse.org/bugs/show_bug.cgi?id=105447 .

Grant

"exquisitus" <nick58@nickoh.com> wrote in message
news:dalm0i$85s$1@news.eclipse.org...
> I have a program with an "About" dialog that contains a copyright notice.
> The dialog contains a couple of labels, one of which includes a copyright
> symbol, expressed as "\u00a9".
>
> When I run this on Linux/GTK or Win32 or Solaris 5.9 Motif, it works OK,
but
> on HP-UX11.0 and Solaris 5.8 (both Motif), the label containing the
copyright
> symbol does not appear at all (i.e. it's not just the symbol that is
missing,
> or drawn incorrectly). The following example demonstrates this; the
dialog
> shown has two labels, but only the second appears on the problematic
> platforms.
>
> A Swing program that contains a copyright symbol works OK, so I don't
think
> there's a fundamental problem with Motif. Any ideas what might be wrong?
>
> ///// SWT example
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.widgets.Dialog;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Label;
> import org.eclipse.swt.widgets.Shell;
>
> public class SWTCopyrightDialog extends Dialog {
>
> protected Object result;
>
> protected Shell shell;
>
> public SWTCopyrightDialog(Shell parent, int style) {
> super(parent, style);
> }
>
> public SWTCopyrightDialog(Shell parent) {
> this(parent, SWT.NONE);
> }
>
> public Object open() {
> createContents();
> shell.open();
> shell.layout();
> Display display = getParent().getDisplay();
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch())
> display.sleep();
> }
> return result;
> }
>
> protected void createContents() {
> shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
> shell.setSize(500, 375);
> shell.setText("SWT Dialog");
>
> final Label label1 = new Label(shell, SWT.NONE);
> label1.setText("Here's a copyright : \u00a9");
> label1.setBounds(40, 105, 305, 100);
>
> final Label label2 = new Label(shell, SWT.NONE);
> label2.setText("Here's some text");
> label2.setBounds(40, 205, 305, 100);
> //
> }
>
> public static void main(String[] args)
> {
> SWTCopyrightDialog o = new SWTCopyrightDialog(new
Shell(Display.getCurrent()));
> o.open();
> }
> }
>
>
> /// Swing example
> import java.awt.BorderLayout;
> import java.awt.event.WindowAdapter;
> import java.awt.event.WindowEvent;
> import java.awt.Font;
> import javax.swing.JDialog;
> import javax.swing.JLabel;
> public class CopyrightDialog extends JDialog {
>
> public static void main(String args[]) {
> try {
> CopyrightDialog dialog = new CopyrightDialog();
> dialog.addWindowListener(new WindowAdapter() {
> public void windowClosing(WindowEvent e) {
> System.exit(0);
> }
> });
> dialog.setVisible(true);
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
>
> public CopyrightDialog() {
> super();
> setBounds(100, 100, 500, 375);
>
> final JLabel heresACopyrightLabel = new JLabel();
> heresACopyrightLabel.setFont(new Font("Monospaced",Font.PLAIN,18));
> heresACopyrightLabel.setText("Here's a copyright sign: \u00a9");
> getContentPane().add(heresACopyrightLabel, BorderLayout.CENTER);
> //
> }
>
> }
Previous Topic:Eclipse Tooltips Style
Next Topic:Listener for display settings
Goto Forum:
  


Current Time: Sat Dec 05 00:48:16 GMT 2020

Powered by FUDForum. Page generated in 0.01946 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top