Bug 561592 - GTK3 Checkbox with label cut-off
Summary: GTK3 Checkbox with label cut-off
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.15   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-30 14:27 EDT by Pascal Muetschard CLA
Modified: 2020-03-30 14:27 EDT (History)
0 users

See Also:


Attachments
Screenshot of the snippet (3.03 KB, image/png)
2020-03-30 14:27 EDT, Pascal Muetschard CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Muetschard CLA 2020-03-30 14:27:03 EDT
Created attachment 282278 [details]
Screenshot of the snippet

Consider the below snippet. When run, the two checkboxes should be identical, however, the second one has its label cut off. It appears to be the order in which the checkbox's checked state and label are set. If the label is set first, all is OK, if, however, the check state is set first, the label gets cut off.

This is with R-4.15-202003050155 (version 4.924)

Snippet:

  public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setLayout(new GridLayout(1, false));
    Button b1 = new Button(shell, SWT.CHECK);
    b1.setText("Hello World");
    b1.setSelection(true);

    Button b2 = new Button(shell, SWT.CHECK);
    b2.setSelection(true);
    b2.setText("Hello World");

    shell.pack();
    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
    display.dispose();
  }