Re: Compiling the hello world example fails (2)

2013-09-15 Thread Anton Alexeev
On Saturday, 14 September 2013 at 10:45:42 UTC, Jacob Carlborg 
wrote:

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.


I think it's to hard for me now


Re: Communication between Java and D application

2013-09-15 Thread Anton Alexeev
I meant that the programs are running. So there is a runnung 
program in D and a running program in Java. What is the best way 
to communicate between them?


Re: Compiling the hello world example fails (2)

2013-09-13 Thread Anton Alexeev
On Friday, 13 September 2013 at 06:27:05 UTC, Jacob Carlborg 
wrote:

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.


So if there is no Browser module, how can I display some HTML in 
my app?


Re: Adding libraries to an executable

2013-09-13 Thread Anton Alexeev
So, nobody can give an easy answer how to statically link the 
libraries with the executable and I have yo use Bin2D?


Communication between Java and D application

2013-09-13 Thread Anton Alexeev
I have a method in a D program which I want to call from a Java 
program. What is the best way to do this?


Re: Compiling the hello world example fails (2)

2013-09-12 Thread Anton Alexeev
On Thursday, 12 September 2013 at 11:23:51 UTC, Jacob Carlborg 
wrote:

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.

Thanks a lot! One more question: how do I work with events?


Re: Compiling the hello world example fails (2)

2013-09-12 Thread Anton Alexeev

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?



Re: Adding libraries to an executable

2013-09-12 Thread Anton Alexeev

On Thursday, 12 September 2013 at 01:16:28 UTC, Mike Parker wrote:

On 9/12/2013 6:20 AM, Anton Alexeev wrote:
On Tuesday, 10 September 2013 at 11:06:04 UTC, Jacob Carlborg 
wrote:

On 2013-09-10 11:04, Anton Alexeev wrote:


Can be but not libphobos2


Link statically with it, which is does by default. Just 
compile with:


dmd -L-lcurl test.d


The point is:
http://pastebin.com/0VkYgFix


Apparently you need to install the libcurl dev package. The 
linker can't find libcurl.a.


I've installed libcurl4-openssl-dev 7.29.0-1ubuntu3.1 before I 
asked for help here. Else I can't even compile with that command: 
dmd -L-lphobos2 -L-lcurl test.d


Re: Adding libraries to an executable

2013-09-12 Thread Anton Alexeev
On Thursday, 12 September 2013 at 11:30:05 UTC, Jacob Carlborg 
wrote:

On 2013-09-12 12:14, Anton Alexeev wrote:

I've installed libcurl4-openssl-dev 7.29.0-1ubuntu3.1 before I 
asked for
help here. Else I can't even compile with that command: dmd 
-L-lphobos2

-L-lcurl test.d


How does your dmd.conf file look like?


;
; dmd.conf file for dmd
;
; dmd will look for dmd.conf in the following sequence of 
directories:

;   - current working directory
;   - directory specified by the HOME environment variable
;   - directory dmd resides in
;   - /etc directory
;
; Names enclosed by %% are searched for in the existing 
environment and inserted

;
; The special name %@P% is replaced with the path to this file
;

[Environment]

DFLAGS=-I/usr/include/dmd/phobos 
-I/usr/include/dmd/druntime/import -L-L/usr/lib/i386-linux-gnu 
-L-L/usr/lib/x86_64-linux-gnu -L--no-warn-search-mismatch 
-L--export-dynamic


Re: Adding libraries to an executable

2013-09-11 Thread Anton Alexeev
On Tuesday, 10 September 2013 at 11:06:04 UTC, Jacob Carlborg 
wrote:

On 2013-09-10 11:04, Anton Alexeev wrote:


Can be but not libphobos2


Link statically with it, which is does by default. Just compile 
with:


dmd -L-lcurl test.d


The point is:
http://pastebin.com/0VkYgFix


Re: Adding libraries to an executable

2013-09-10 Thread Anton Alexeev
On Tuesday, 10 September 2013 at 07:02:17 UTC, Jacob Carlborg 
wrote:

On 2013-09-06 23:31, Anton Alexeev wrote:
I've written a program which uses curl library. So on a PC 
without curl
the program will not work until you install the library. Is 
there a way

to put the curl library in the executable?


On Linux, doesn't all distributions ship with libcurl by 
default? For Windows I found this:

Can be but not libphobos2



Re: Adding libraries to an executable

2013-09-09 Thread Anton Alexeev
On Friday, 6 September 2013 at 22:31:52 UTC, Jonathan M Davis 
wrote:

On Friday, September 06, 2013 23:31:57 Anton Alexeev wrote:

I've written a program which uses curl library. So on a PC
without curl the program will not work until you install the
library. Is there a way to put the curl library in the 
executable?


Statically link it.

- Jonathan M Davis


Sorry for being noob but how I can do it?


Re: Adding libraries to an executable

2013-09-07 Thread Anton Alexeev
On Friday, 6 September 2013 at 22:31:52 UTC, Jonathan M Davis 
wrote:

On Friday, September 06, 2013 23:31:57 Anton Alexeev wrote:

I've written a program which uses curl library. So on a PC
without curl the program will not work until you install the
library. Is there a way to put the curl library in the 
executable?


Statically link it.

- Jonathan M Davis


How can I do that? I have compiled my program with this command: 
dmd -L-lphobos2 -L-lcurl test.d



Excuse me for that dumb question but I'm really new to compiled 
languages. I've written some code in Java but it's not the same.


Adding libraries to an executable

2013-09-06 Thread Anton Alexeev
I've written a program which uses curl library. So on a PC 
without curl the program will not work until you install the 
library. Is there a way to put the curl library in the executable?