digitalmars.D.dwt - Compiling the hello world example fails (2)
- Anton Alexeev (21/21) Sep 09 2013 Ubuntu 13.04, x86
- Jacob Carlborg (12/31) Sep 09 2013 Ok, to avoid that you can I think you add a colon before the library
- Anton Alexeev (7/15) Sep 11 2013 Manually linking worked for me, thanks!
- DLearner (4/22) Sep 11 2013 DWT and SWT follow the same API, so just google SWT for
- Jacob Carlborg (16/18) Sep 11 2013 The official API reference for SWT is here:
- Anton Alexeev (13/13) Sep 12 2013 OK, thanks for the links!
- Jacob Carlborg (7/19) Sep 12 2013 SWTResourceManager is not part of the standard SWT. It's seems to be a
- Anton Alexeev (3/30) Sep 12 2013 Thanks a lot! One more question: how do I work with events?
- Anton Alexeev (8/8) Sep 12 2013 Found out how to handle events:
- Jacob Carlborg (8/16) Sep 12 2013 Yes, that's the standard SWT/Java way. You should be able to use a
- Anton Alexeev (1/1) Sep 12 2013 Is there no Browser module in DWT?
- Jacob Carlborg (7/8) Sep 12 2013 No, unfortunately the browser package never got ported properly. I think...
- Anton Alexeev (4/10) Sep 13 2013 So if there is no Browser module, how can I display some HTML in
- Jacob Carlborg (5/6) Sep 14 2013 I don't know. You can always try and finish the port if you really need
- Anton Alexeev (3/8) Sep 15 2013 I think it's to hard for me now
- Jacob Carlborg (5/6) Sep 14 2013 You could use whatever API Gtk provides to render HTML. What you would
Ubuntu 13.04, x86 I've followed this instruction: https://github.com/d-widget-toolkit/dwt Everything was ok, no errors. Then I've tried to compile hello world: $ dmd test.d -I/home/virtualbox/dwt/imp -J/home/virtualbox/dwt/org.eclipse.swt.gtk.linux.x86/res -L-L/home/virtualbox/dwt/lib -L-lorg.eclipse.swt.gtk.linux.x86 -L-ldwt-base /usr/bin/ld: cannot find -lorg.eclipse.swt.gtk.linux.x86 /usr/bin/ld: cannot find -ldwt-base collect2: ошибка: выполнение ld завершилось с кодом возврата 1 --- errorlevel 1 With -L--verbose flag: http://pastebin.com/9tavXU96 There you can see that the linker tries to find liborg.eclipse.swt.gtk.linux.x86.a and not just org.eclipse.swt.gtk.linux.x86, so I've added "lib" to the file names and got this: http://pastebin.com/dVzzXqS6 Any help?
Sep 09 2013
On 2013-09-09 20:15, Anton Alexeev wrote:Ubuntu 13.04, x86 I've followed this instruction: https://github.com/d-widget-toolkit/dwt Everything was ok, no errors. Then I've tried to compile hello world: $ dmd test.d -I/home/virtualbox/dwt/imp -J/home/virtualbox/dwt/org.eclipse.swt.gtk.linux.x86/res -L-L/home/virtualbox/dwt/lib -L-lorg.eclipse.swt.gtk.linux.x86 -L-ldwt-base /usr/bin/ld: cannot find -lorg.eclipse.swt.gtk.linux.x86 /usr/bin/ld: cannot find -ldwt-base collect2: ошибка: выполнение ld завершилось с кодом возврата 1 --- errorlevel 1 With -L--verbose flag: http://pastebin.com/9tavXU96 There you can see that the linker tries to find liborg.eclipse.swt.gtk.linux.x86.a and not just org.eclipse.swt.gtk.linux.x86, so I've added "lib" to the file namesOk, to avoid that you can I think you add a colon before the library name when linking: -L-l:<lib> Where <lib> is the library linking. The build script should be changed to append prepend "lib" to the library names.and got this: http://pastebin.com/dVzzXqS6 Any help?Crap, it seems you need to manually link with the system libraries. They're located in this array: https://github.com/d-widget-toolkit/dwt/blob/master/build.d#L101 Hope that solves it. Sorry for the inconvenience. -- /Jacob Carlborg
Sep 09 2013
Manually linking worked for me, thanks! One more question: where can I find documentation and some examples how to work with DWT? I don't even have an idea how to load an image as an icon. There is "Shell.setImage(Image image)" method but how can I create an Image-object? _____ I wanted to run away from Java, but it still haunts me :(and got this: http://pastebin.com/dVzzXqS6 Any help?Crap, it seems you need to manually link with the system libraries. They're located in this array: https://github.com/d-widget-toolkit/dwt/blob/master/build.d#L101 Hope that solves it. Sorry for the inconvenience.
Sep 11 2013
On Wednesday, 11 September 2013 at 21:16:55 UTC, Anton Alexeev wrote:DWT and SWT follow the same API, so just google SWT for documentationManually linking worked for me, thanks! One more question: where can I find documentation and some examples how to work with DWT? I don't even have an idea how to load an image as an icon. There is "Shell.setImage(Image image)" method but how can I create an Image-object? _____ I wanted to run away from Java, but it still haunts me :(and got this: http://pastebin.com/dVzzXqS6 Any help?Crap, it seems you need to manually link with the system libraries. They're located in this array: https://github.com/d-widget-toolkit/dwt/blob/master/build.d#L101 Hope that solves it. Sorry for the inconvenience.
Sep 11 2013
On 2013-09-12 03:57, DLearner wrote:DWT and SWT follow the same API, so just google SWT for documentationThe official API reference for SWT is here: http://www.eclipse.org/swt/javadoc.php There's a bunch of snippets here: http://www.eclipse.org/swt/snippets/ Some of which are already ported to D: https://github.com/d-widget-toolkit/org.eclipse.swt.snippets You should already have these if you're cloned the DWT repository correctly. If you need any D related help, like threads, IO, delegates or similar please continue asking here. There are a couple of differences/extension in DWT. http://dsource.org/projects/dwt/wiki/DiffToOriginal "Package and Module renames" isn't true anymore. I guess I should add this list to Github. -- /Jacob Carlborg
Sep 11 2013
OK, thanks for the links! First noob question: I need an icon for the window. The Shell class has a method setImage(Image image). In Java there is a SWTResourceManager available: shell.setImage(SWTResourceManager.getImage("/home/virtualbox/favicon.png")); I've looked around a bit in *.di files and found an Image and an ImageLoader classes. Maybe it could work but I don't know how to create a Java String... ImageLoader imageLoader = new ImageLoader(); Image image = new Image(); image.init_(imageLoader.load("/home/virtualbox/favicon.png")); shell.setImage(image);
Sep 12 2013
On 2013-09-12 12:31, Anton Alexeev wrote:OK, thanks for the links! First noob question: I need an icon for the window. The Shell class has a method setImage(Image image). In Java there is a SWTResourceManager available: shell.setImage(SWTResourceManager.getImage("/home/virtualbox/favicon.png")); I've looked around a bit in *.di files and found an Image and an ImageLoader classes. Maybe it could work but I don't know how to create a Java String... ImageLoader imageLoader = new ImageLoader(); Image image = new Image(); image.init_(imageLoader.load("/home/virtualbox/favicon.png")); shell.setImage(image);SWTResourceManager is not part of the standard SWT. It's seems to be a part of WindowBuilder. Here's an example of how to set the icon of a window: http://www.java2s.com/Tutorial/Java/0280__SWT/Setleftuppercornerimage.htm That site contains many other SWT tutorials as well. -- /Jacob Carlborg
Sep 12 2013
On Thursday, 12 September 2013 at 11:23:51 UTC, Jacob Carlborg wrote:On 2013-09-12 12:31, Anton Alexeev wrote:Thanks a lot! One more question: how do I work with events?OK, thanks for the links! First noob question: I need an icon for the window. The Shell class has a method setImage(Image image). In Java there is a SWTResourceManager available: shell.setImage(SWTResourceManager.getImage("/home/virtualbox/favicon.png")); I've looked around a bit in *.di files and found an Image and an ImageLoader classes. Maybe it could work but I don't know how to create a Java String... ImageLoader imageLoader = new ImageLoader(); Image image = new Image(); image.init_(imageLoader.load("/home/virtualbox/favicon.png")); shell.setImage(image);SWTResourceManager is not part of the standard SWT. It's seems to be a part of WindowBuilder. Here's an example of how to set the icon of a window: http://www.java2s.com/Tutorial/Java/0280__SWT/Setleftuppercornerimage.htm That site contains many other SWT tutorials as well.
Sep 12 2013
Found out how to handle events: class DisposeListenerImpl:DisposeListener{ public void widgetDisposed(DisposeEvent e) { writeln("Disposed"); } } shell.addDisposeListener(new DisposeListenerImpl); Is this the right way?
Sep 12 2013
On 2013-09-12 19:28, Anton Alexeev wrote:Found out how to handle events: class DisposeListenerImpl:DisposeListener{ public void widgetDisposed(DisposeEvent e) { writeln("Disposed"); } } shell.addDisposeListener(new DisposeListenerImpl); Is this the right way?Yes, that's the standard SWT/Java way. You should be able to use a delegate as well. See: https://github.com/d-widget-toolkit/org.eclipse.swt.gtk.linux.x86/blob/master/src/org/eclipse/swt/widgets/Listener.d#L103 The same exist for Runnable as well: http://www.dsource.org/projects/dwt/wiki/DiffToOriginal#ThingsaddedorchangedinDWT: -- /Jacob Carlborg
Sep 12 2013
On 2013-09-12 18:56, Anton Alexeev wrote:Is there no Browser module in DWT?No, unfortunately the browser package never got ported properly. I think it was ported at some time, but only for Linux. It also depends on an additional external library. I can always try at compile and see what happens. -- /Jacob Carlborg
Sep 12 2013
On Friday, 13 September 2013 at 06:27:05 UTC, Jacob Carlborg wrote:On 2013-09-12 18:56, Anton Alexeev wrote:So if there is no Browser module, how can I display some HTML in my app?Is there no Browser module in DWT?No, unfortunately the browser package never got ported properly. I think it was ported at some time, but only for Linux. It also depends on an additional external library. I can always try at compile and see what happens.
Sep 13 2013
On 2013-09-13 21:50, Anton Alexeev wrote:So if there is no Browser module, how can I display some HTML in my app?I don't know. You can always try and finish the port if you really need to display HTML. -- /Jacob Carlborg
Sep 14 2013
On Saturday, 14 September 2013 at 10:45:42 UTC, Jacob Carlborg wrote:On 2013-09-13 21:50, Anton Alexeev wrote:I think it's to hard for me nowSo if there is no Browser module, how can I display some HTML in my app?I don't know. You can always try and finish the port if you really need to display HTML.
Sep 15 2013
On 2013-09-13 21:50, Anton Alexeev wrote:So if there is no Browser module, how can I display some HTML in my app?You could use whatever API Gtk provides to render HTML. What you would use if you weren't using DWT. -- /Jacob Carlborg
Sep 14 2013