Re: [Java-gnome-developer] how to build reusable components with glade
Brought to you by:
afcowie
From: Joao V. <jvi...@ya...> - 2005-05-29 15:44:29
|
--- Tomasz Mielnik <tmi...@co...> escreveu: > well actually this is what I was afraid of. I think it would be better > to design your "components" in visual tool and then use them. Well, i too think it would be better to design components in a visual tool, but the visual tool is just not ready; patience. I don't know when Glade 3 will be released, but there is Gazpacho, which is based on a pre-Glade3 code, and _maybe_ it can do that: http://gazpacho.sicem.biz/ I've never tried it, maybe i'll do this today. > > But before givin' up I want to ask some GTK gurus here. What for is a > methond > > Window.makeWidget(handle); ? > I thought that using this > > Window.makeWidget(myWidget.getHandle()); > would work? You shouldn't use that method; it's just for internal use (the reason why it's not private/protected/etc is because it may be used by other bindings in other packages). To do what you want you would just instantiate a Widget like you'd do with any Java object. Example: public class MyWidget extends VBox { public MyWidget() { super(); add(new Button("Hello World")); } } then use it: Window win = new Window(WindowType.TOPLEVEL); win.add( new MyWidget() ); Cheers, J.V. __________________________________________________ Converse com seus amigos em tempo real com o Yahoo! Messenger http://br.download.yahoo.com/messenger/ |