Community
Participate
Working Groups
The combo boxes placed in the editor toolbar for the ecorediag editor get set to 1 pixel wide. Walked through it with Bogdan, but a SWT.SEPARATOR toolitem called with toolItem.setWidth(223) seems to get its width reset on the parent (ToolBar) relayout(). The ToolItem.getBounds() returns a width of 1. Something similar to this can be seen in Snippet58 if the combo/toolitem code sets the control first and the width second. combo.select(1); combo.pack (); sep.setControl (combo); sep.setWidth (combo.getSize ().x); PW
See also bug 378847 PW
The behavior of the snippet is correct: when setControl is called with the combo, the toolbar sizes it to the size of the separator (which has not been set yet). The separator should be sized before setting the control (or the combo getSize needs to run before it gets hammered). But this is not the cause of this bug. ToolItem does not call gtk_widget_size_allocate after calling set_size_request, which is needed when setting a new size on a handle. Attaching a patch...
Created attachment 216971 [details] Patch for ToolItem
Patch released to master, 4.2 maintenance and 3.8 maintenance.