Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » CoolBars on Linux-GTK
CoolBars on Linux-GTK [message #447156] Thu, 09 December 2004 09:29 Go to next message
Eclipse UserFriend
Originally posted by: elwis.linuxmail.org

Hello all!

I have a question regading the use of CoolBars (they really are Cool :) on
my Linux-GTK box? it doesn't seem to be very easy to get them to showup? I
did some copy-paste from web-examples, and nope, they aren't there?
(They do however show up on my winmachine?)

Here's simple example, I shout for the createCoolBar() from my
constructor. All that's shown is my fileMenu. I tried commenting that one
out (in case they conflicted) but that didn't help. I also tried to turn
off "Maximize" but nopes.. Out of ideas for now.

private void createCoolBar() {

CoolBar coolbar = new CoolBar(sshell,SWT.NULL);

ToolBar toolbar1 = new ToolBar(coolbar,SWT.FLAT);
ToolItem tItem1_1 = new ToolItem(toolbar1,SWT.PUSH);
tItem1_1.setText("Item1");
ToolItem tItem1_2 = new ToolItem(toolbar1,SWT.PUSH);
tItem1_2.setText("Item2");

CoolItem item1 = new CoolItem(coolbar,SWT.PUSH);
item1.setControl(toolbar1);
Point pt1 = toolbar1.computeSize(SWT.DEFAULT,SWT.DEFAULT);
pt1 = item1.computeSize(pt1.x,pt1.y);
item1.setSize(pt1);

ToolBar toolbar2 = new ToolBar(coolbar,SWT.FLAT);
ToolItem tItem2_1 = new ToolItem(toolbar2,SWT.PUSH);
tItem2_1.setText("Item3");

CoolItem item2 = new CoolItem(coolbar,SWT.PUSH);
item2.setControl(toolbar2);
Point pt2 = toolbar2.computeSize(SWT.DEFAULT,SWT.DEFAULT);
pt2 = item2.computeSize(pt2.x,pt2.y);
item2.setSize(pt2);

}
Re: CoolBars on Linux-GTK [message #447159 is a reply to message #447156] Thu, 09 December 2004 09:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: elwis.linuxmail.org

Editing myself:

noticing that the only way to make them show up is using the .pack()
method. This, will make them useless and ugly though. (tried to use
setSize, but it simply ignored that one, and gave them all the same size
anyway, and kept them invisible)

Guess I better get back to Swing, SWT doesn't play nice with me ;)

Best regards
Stefan
Re: CoolBars on Linux-GTK [message #447203 is a reply to message #447159] Thu, 09 December 2004 12:30 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
There are several SWT examples showing how to use the Coolbar. See:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet20.java?rev=HEAD&a mp;content-type=text/vnd.viewcvs-markup
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet150.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet140.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup


"Stefan "Elwesth
Previous Topic:Table Cell Selection
Next Topic:browser widget on AIX platform
Goto Forum:
  


Current Time: Thu Oct 29 14:46:39 GMT 2020

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

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

Back to the top