January 29
Thanks for all the kind words, guys.

Yeah, dub is a sticking point for me and I'm gonna have to get past it. I just have so much on my plate ATM that I don't wanna take the time to dig into it again for fear of falling behind on something else.

But I will get to it at some point.


January 29
On Tuesday, 29 January 2019 at 20:53:53 UTC, Ron Tarrant wrote:
> On Friday, 25 January 2019 at 22:17:06 UTC, WebFreak001 wrote:
>
> I think dub is a lot more beginner friendly and
>> easier to setup + users will probably want to add some dependencies in the future of their app.
>
> LOL! Not my experience with dub, but I take your point.
>
> I haven't actually gone back to try dub again. I have a mental block when it comes to json files. Don't know why, it's just there.

hey it's easy, you can also use SDL! :p

dub.sdl:
name "my-awesome-gtk-app"

dependency "gtk-d" version="~>3.8.5"



... and that's it already actually. It will compile everything in the "source" folder and add the dependencies with it.

And well you will have to add DLLs and stuff like you would need to with pure dmd, gtk-d doesn't ship any DLLs.
January 29
On Saturday, 26 January 2019 at 16:53:18 UTC, Antonio Corbi wrote:
> On Friday, 25 January 2019 at 21:16:59 UTC, Ron Tarrant wrote:
> When I started using Gtkd I gathered several tutorials[1][2] (they are old) and more recently found this project[3] from Carlos Soriano which covers meson + flatpak.
> Hope they are good for you.
>
> Antonio
>
> [1] https://sites.google.com/site/gtkdtutorial/
> [2] http://britseyeview.com/software/articles/gsgtkd.html
> [3] https://gitlab.com/csoriano/GtkDApp

Thanks, Antonio. I'll take a look.
January 29
On Tuesday, 29 January 2019 at 21:13:17 UTC, WebFreak001 wrote:

> hey it's easy, you can also use SDL! :p
>
> dub.sdl:
> name "my-awesome-gtk-app"
>
> dependency "gtk-d" version="~>3.8.5"
>
>
>
> ... and that's it already actually. It will compile everything in the "source" folder and add the dependencies with it.
>
> And well you will have to add DLLs and stuff like you would need to with pure dmd, gtk-d doesn't ship any DLLs.

Okay, so I create a file, name it dub.sdl and put this in it:

name "my-awesome-gtk-app"

dependency "gtk-d" version="~>3.8.5"

And this goes in the same folder as the code file. And then... what? I type: dub?

Just for the record, this is completely different from what I was reading before about this dub stuff.
January 29
On Tuesday, 29 January 2019 at 20:58:08 UTC, Ron Tarrant wrote:
> Thanks for all the kind words, guys.
>
> Yeah, dub is a sticking point for me and I'm gonna have to get past it. I just have so much on my plate ATM that I don't wanna take the time to dig into it again for fear of falling behind on something else.
>
> But I will get to it at some point.

After many years of using CodeBlocks, late last year I forced myself to use a Visual Code / Dub workflow. It has it's pros and cons, but I do enjoy the extensions that are available Visual Code for the D language.

Jordan
January 29
On Tuesday, 29 January 2019 at 21:47:06 UTC, Ron Tarrant wrote:
> On Tuesday, 29 January 2019 at 21:13:17 UTC, WebFreak001 wrote:
>
>> hey it's easy, you can also use SDL! :p
>>
>> dub.sdl:
>> name "my-awesome-gtk-app"
>>
>> dependency "gtk-d" version="~>3.8.5"
>>
>>
>>
>> ... and that's it already actually. It will compile everything in the "source" folder and add the dependencies with it.
>>
>> And well you will have to add DLLs and stuff like you would need to with pure dmd, gtk-d doesn't ship any DLLs.
>
> Okay, so I create a file, name it dub.sdl and put this in it:
>
> name "my-awesome-gtk-app"
>
> dependency "gtk-d" version="~>3.8.5"
>
> And this goes in the same folder as the code file. And then... what? I type: dub?
>
> Just for the record, this is completely different from what I was reading before about this dub stuff.

yeah just put it in your project folder, not the source folder, so it looks like this:

source/
   app.d
   some_other_file.d
dub.sdl

then you just run `dub` in the folder with dub.sdl

A minor "limitation" can be that the files must follow their filenames as modulenames more strictly (otherwise weird errors could happen if you add `module bar;` in foo.d for example)
January 29
Am 29.01.19 um 22:47 schrieb Ron Tarrant:
> And this goes in the same folder as the code file. And then... what? I type: dub?

The code file should be in a subfolder called "source". This is customizable, but this is the default. So the folder structure should look something like this:

├── dub.sdl
└── source
    └── app.d

By default, if there is a source file called "app.d" or "main.d", dub will assume that your application is an exectuable and build it accordingly (if targetType is not explicitly set to something else in your dub.json or dub.sdl file).

If you don't want to have a source file named like that, you will need
to tell dub explicitly to build an executable (if that is what you want)
by adding the line
```
targetType "executable"
```
to your dub.sdl.

The easiest way to actually see how the basic folder structure should look like is to simply call `dub init` in an empty folder. This will interactively set up a basic project in that directory. During the interactive process, you can set some properties for your project, e.g. if you want to use a dub.sdl or dub.json file, add dependencies, choose the name of the project etc. It really works in a straightforward way.

To actually build the project, simply run `dub build` from the project's root folder. this will create a binary in the projects root folder with the name specified in the dub.sdl file.

You can also run the project directly after compiling by running `dub run` (or simply just `dub`, which does the same thing) from the projects root folder.

All of this assumes that dub is actually installed and available on your PATH.

January 30
On 29.01.19 22:47, Ron Tarrant wrote:
> On Tuesday, 29 January 2019 at 21:13:17 UTC, WebFreak001 wrote:
> 
>> hey it's easy, you can also use SDL! :p
>>
>> dub.sdl:
>> name "my-awesome-gtk-app"
>>
>> dependency "gtk-d" version="~>3.8.5"
>>
>>
>>
>> ... and that's it already actually. It will compile everything in the "source" folder and add the dependencies with it.
>>
>> And well you will have to add DLLs and stuff like you would need to with pure dmd, gtk-d doesn't ship any DLLs.
> 
> Okay, so I create a file, name it dub.sdl and put this in it:
> 
> name "my-awesome-gtk-app"
> 
> dependency "gtk-d" version="~>3.8.5"
> 
> And this goes in the same folder as the code file. And then... what? I type: dub?
> 
> Just for the record, this is completely different from what I was reading before about this dub stuff.
Yes. Its as simple as:

(dmd-2.084.0)~/tmp >  mkdir gtkdtest
(dmd-2.084.0)~/tmp >  cd gtkdtest/
(dmd-2.084.0)~/t/gtkdtest >  dub init
Package recipe format (sdl/json) [json]: sdl
Name [gtkdtest]:
Description [A minimal D application.]: A minimal GTKD application.
Author name [....]:
License [proprietary]:
Copyright string [....]:
Add dependency (leave empty to skip) []: gtk-d
Adding dependency gtk-d ~>3.8.5
Add dependency (leave empty to skip) []:
Successfully created an empty project in '/...../tmp/gtkdtest'.
Package successfully created in .
(dmd-2.084.0)~/t/gtkdtest >

pasteing a simple gtkd hello world into source/app.d

and then run

(dmd-2.084.0)~/t/gtkdtest > dub run

I was surprised how simple it is nowadays even in osx.

kind regards,
christian
January 30
On Tue, 29 Jan 2019 21:13:17 +0000, WebFreak001 wrote:
> dub.sdl:
> name "my-awesome-gtk-app"
> 
> dependency "gtk-d" version="~>3.8.5"

Might I recommend instead:

    dependency "gtk-d" version="3.8.5"

This depends on gtk-d 3.8.5 and only that version. If there is a breaking change in 3.8.6 despite semantic versioning, your code keeps working.

In libraries, I prefer using ~> to give more freedom to people depending on my code. But in applications, that isn't a concern. May as well only allow the code to be built with the versions of your dependencies that you've actually tested.
January 30
On Saturday, 26 January 2019 at 16:53:18 UTC, Antonio Corbi wrote:
> [1] https://sites.google.com/site/gtkdtutorial/
> [2] http://britseyeview.com/software/articles/gsgtkd.html
> [3] https://gitlab.com/csoriano/GtkDApp

Took a look this morning. I'd come across the Brit's Eye View articles, but not the others. As I'm about to write something on menus, these will definitely come in handy.

Thanks, Antonio.
1 2 3 4