Bug 393919 - [GTK 3] Text alignment inside GtkLabel is invalid
Summary: [GTK 3] Text alignment inside GtkLabel is invalid
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.3 M4   Edit
Assignee: Alexander Kurtakov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 340067
  Show dependency tree
 
Reported: 2012-11-08 15:09 EST by Anatoly Spektor CLA
Modified: 2012-11-16 10:56 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anatoly Spektor CLA 2012-11-08 15:09:05 EST
When you pass to the label SWT.RIGHT, SWT.LEFT or SWT.CENTER in GTK2 it aligns Label properly, when you run same code with GTK3, it aligns label incorrectly.

To test it:

1.Open HelloWorld2.java
2. Change label constructor to this:
    	Label label = new Label (shell, SWT.RIGHT);

  When you run with GTK2: label/imabe is aligned to the right
  When you run with GTK3: it still aligned  to the left


 My Findings:

 Label.createHandle  line:

 if you change line: 		

handle = gtk_box_new (OS.GTK_ORIENTATION_HORIZONTAL, false, 0);

 to

handle = OS.gtk_hbox_new(false, 0);

It works with both GTK2 and GTK3.

If you change orientation to Vertical:

handle = gtk_box_new (OS.GTK_ORIENTATION_VERTICAL, false, 0);

it seems to work too.

Possible causes: sizing of widgets ? incorrect packing in gtk_box_new ?
Comment 2 Alexander Kurtakov CLA 2012-11-08 16:25:03 EST
Marking as fixed.