• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to add a new widget to a child component of a custom SWT widget

 
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am trying my hand at creating some custom widgets in SWT. One of my custom widgets wraps a Composite widget. If, when creating a child of the custom widget, e.g. Button, Text, etc., the child is created as child of the custom widget. I would like all child widgets to created as children of the wrapped Composite widget. In other words, no child widget should be created as a child of the custom widget; all child widgets may only be children of the Composite widget. The custom widget works fine in all other respects. As a workaround I have created a method named getWidget which I invoke to get a reference to the proper parent object when creating a Button, Text, etc. I would like to be able pass a reference to the custom widget directly to the constructors of Button, Text, etc. just like any other widget but I do not see how this might be done. Note that my custom widget does subclass Composite. Is this possible? Any suggestions would be appreciated. Thanks!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic