Re: constraints attribute doesn't work for menubar

[email protected] Mon, 22 Aug 2005 17:56:31 +0200
Newsgroups gmane.comp.embedded.carlsbad-cubes
Organization http://freemail.web.de/
Message-ID <[email protected]>
Hello Vitali,

this sounds sensible and useful to me. Allthough the constraints of a menu bar seems to be not used *that* much (or this would have been discovered earlier) I would like to integrate it.

Wolf, any objections?

Frank

List for Users of Carlsbad Cubes' Technologies and Products <[email protected]> schrieb am 22.08.05 17:06:49:
> 
> Hello,
> 
> specifying constraints attribute for menubar tag doesn't have any affect.
> here is the possible fix for the problem. Parser.addChild method
> should be modified like this:
> 
>       //  Set a JMenuBar for JFrames, JDialogs, etc.
>       //
>       if (component instanceof JMenuBar) {
>         try {
>           Method m = parent.getClass().getMethod("setJMenuBar", new
> Class[]{JMenuBar.class});
>           m.invoke(parent, new Object[]{component});
>         } catch (NoSuchMethodException e) {
> !                       if (constrains == null) {
> !                               parent.add(component);
> !                       }
> !                       else {
> !                               parent.add(component, constrains);
> !                       }
>         } catch (Exception e) {
>           // intentionally empty
>         }
> 
> Regards,
> Vitali
> 
> _______________________________________________
> Forum mailing list
> [email protected]
> http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com