Mercurial > projects > dwt-samples
diff dwtexamples/controlexample/CustomControlExample.d @ 65:a84ba4d1820f
restructure the dsss.conf and resources
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 11 Apr 2008 21:15:36 +0200 |
parents | 5c244d50e532 |
children |
line wrap: on
line diff
--- a/dwtexamples/controlexample/CustomControlExample.d Fri Apr 11 17:45:55 2008 +0200 +++ b/dwtexamples/controlexample/CustomControlExample.d Fri Apr 11 21:15:36 2008 +0200 @@ -27,17 +27,22 @@ import dwtexamples.controlexample.StyledTextTab; import dwtexamples.controlexample.Tab; -version( CUSTOM_CONTROL_EXAMPLE_MAIN ){ - void main(){ +public class CustomControlExampleFactory : IControlExampleFactory { + CustomControlExample create(Shell shell, char[] title) { + Stdout.formatln( "The CustomControlExample: still work left" ); Stdout.formatln( "warning in Control:setBounds() line=695 gtk_widget_size_allocate()" ); Stdout.formatln( "Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 15" ); Stdout.formatln( "for the CTabFolder widget. Params are OK. Further bugtracking needed." ); Stdout.formatln( "please report problems" ); - CustomControlExample.main( null ); + + auto res = new CustomControlExample( shell ); + shell.setText(ControlExample.getResourceString("custom.window.title")); + return res; } } + public class CustomControlExample : ControlExample { /** @@ -62,21 +67,4 @@ new StyledTextTab (this) ]; } - - /** - * Invokes as a standalone program. - */ - public static void main(char[][] args) { - Display display = new Display(); - Shell shell = new Shell(display); - shell.setLayout(new FillLayout()); - CustomControlExample instance = new CustomControlExample(shell); - shell.setText(getResourceString("custom.window.title")); - setShellSize(instance, shell); - shell.open(); - while (! shell.isDisposed()) { - if (! display.readAndDispatch()) display.sleep(); - } - instance.dispose(); - } }