Re: Introduction and request for help

2020-03-10 Thread Ron Tarrant via Digitalmars-d-learn

On Monday, 9 March 2020 at 22:48:35 UTC, Kendell wrote:


Hey Everyone,

I'm a new D developer and therefore new to Gtkd.


So far I've had no problems building this project with DUB. 
However I want to move over to meson so that I can build it for 
flatpak. I am finding that I am unable to build with meson.


Hi Kendell,

If I may be so bold... Welcome to the D forum. I also saw your 
post over on the GtkD forum. I didn't want you to think 
everyone's ignoring you, but...


I can't help you, but sometimes when someone (in this case, me) 
jumps in with an initial reply, it attracts more attention to a 
thread.


Mike, the guy who moderates the GtkD forum may be quite busy ATM 
which may be why he didn't reply.


Here's hoping someone will notice your plea.


Just a Reminder...

2020-02-24 Thread Ron Tarrant via Digitalmars-d-learn
In case you thought the GtkDcoding blog announcements have 
stopped, I just want to let you know that starting with #0101, 
they'll be made in the Announce sub-forum from now on. This is 
where they were originally supposed to be made, but because I got 
the wrong end of the stick last year, I ended up making them here 
in Learn.


My new year's resolution was to move them back to where they 
belong and thus, all future GtkDcoding blog announcements will be 
made in Announce. (So far, I seem to be remembering to do them 
there!)


And here are links to the last two so you don't have to go 
searching:


https://forum.dlang.org/thread/cyukzsyegremxoalz...@forum.dlang.org
https://forum.dlang.org/thread/hqwdxbwgtxcgjwtra...@forum.dlang.org

I apologize for any inconvenience or misunderstanding this may 
have caused.


Re: GtkD crash

2020-02-22 Thread Ron Tarrant via Digitalmars-d-learn

On Friday, 21 February 2020 at 13:36:58 UTC, mark wrote:

I thought that onChangeState was never called before the Label 
was constructed


That's one of the 'features' (wink wink) of GtkD. It's possible 
to call the function as a class function (uninstantiated, in 
other words) or as an object function (instantiated). There are 
times when it's handy to have either at your disposal.



Now it works.

Thanks!





Re: GtkD crash

2020-02-21 Thread Ron Tarrant via Digitalmars-d-learn

On Friday, 21 February 2020 at 08:55:43 UTC, mark wrote:


statusLabel.setText(message); // BUG


Where is statusLabel instantiated?

Other than that, I see nothing wrong here.



Re: GtkD on Windows: notes + question

2020-02-11 Thread Ron Tarrant via Digitalmars-d-learn

On Sunday, 9 February 2020 at 13:28:59 UTC, mark wrote:
I found a much easier way to get GtkD working on windows than 
that described in 
https://gtkdcoding.com/2019/01/11/-introduction-to-gtkDcoding.html


Just FYI...

I don't use dub because I don't have time to understand its 
foibles well enough to steer new D coders through the maze. 
Besides that, using tools like dub separates one from the process.


Up to you, though, of course.


Re: How to compile with GtkD

2020-02-09 Thread Ron Tarrant via Digitalmars-d-learn

On Sunday, 9 February 2020 at 11:52:19 UTC, mark wrote:


right now I want to start on Linux and I'm stuck.

Maybe this will help...

https://gtkdcoding.com/2019/03/31/x0002-gtkd-in-a-linux-environment.html


GtkDcoding Featured Coder Program

2020-02-01 Thread Ron Tarrant via Digitalmars-d-learn
Everybody knows what I’ve been doing with GtkD for the last 
year—writing blog posts. But what about all of you? What projects 
are you working on using GtkD? What finished applications do you 
have that use GtkD? Or maybe you’re still in the planning stages.


I’d like to start a new series of posts on GtkDcoding wherein I 
interview you and we talk about the coding projects you’re 
involved in and how GtkD figures into it.


No matter what stage you’re at, drop me a line at 
gtkdcod...@gmail.com and let’s talk.




Re: books for learning D

2020-01-31 Thread Ron Tarrant via Digitalmars-d-learn

On Wednesday, 29 January 2020 at 11:57:14 UTC, Jan Hönig wrote:


I am also curious. Where can i find the revised book.


Sorry for the delay, guys. I thought I'd posted the link earlier. 
Here it is:


http://ddili.org/ders/d.en/index.html


Blog Post #0100: SFX - Button Interactions II

2020-01-28 Thread Ron Tarrant via Digitalmars-d-learn
Today marks the 100th post on the GtkDcoding blog where we 
continue with Button interactions. You can find it here: 
https://gtkdcoding.com/2020/01/28/0100-sfx-button-interactions-ii-color-font-shape.html


After today, I'll be on hiatus from the blog and posts may be 
sporadic.


Re: Blog Post #0099: A Special Request

2020-01-23 Thread Ron Tarrant via Digitalmars-d-learn

On Thursday, 23 January 2020 at 12:43:24 UTC, Antonio Corbi wrote:

Yes, it uses 'sed' to get 'constants.d' from 'constants.d.in' 
at configuration time.


So you can write your own 'constants.d' with the appropiate 
values for UIDIR and DATADIR and delete/comment the the 
preBuildCommands in dub.sdl.


This is beginning to sound like it's beyond the scope of the blog.


Re: Blog Post #0099: A Special Request

2020-01-23 Thread Ron Tarrant via Digitalmars-d-learn
On Thursday, 23 January 2020 at 14:10:37 UTC, Ferhat Kurtulmuş 
wrote:



Actually I have just tried this with gtkd and working:

button1.bindProperty("sensitive", entry1, "sensitive", 
GBindingFlags.DEFAULT);


That's pretty cool, Ferhat. I'll add this to the todo list.



Re: Blog Post #0099: A Special Request

2020-01-23 Thread Ron Tarrant via Digitalmars-d-learn
On Thursday, 23 January 2020 at 09:27:45 UTC, Ferhat Kurtulmuş 
wrote:


I want this button disabled so that user cannot spawn another 
thread while the first one is on duty.


This is actually the subject of an up-coming post which is 
scheduled to go live on Feb. 25, 2020. It uses setSensitive() 
rather than bindProperty(), but it has the same effect.


Re: Blog Post #0099: A Special Request

2020-01-23 Thread Ron Tarrant via Digitalmars-d-learn

On Thursday, 23 January 2020 at 08:33:39 UTC, Antonio Corbi wrote:


https://gitlab.com/amcorbi/dmaurerrose

I think this is somewhat related to what te OP was asking for.


I'm confused. I was the OP, so I'm not sure who you're referring 
to.


Assuming you are on GNU/Linux, a simple 'dub run' is all you 
have to do to make it compile and run.


On Windows, `dub run` yielded the following output:

Performing "debug" build using C:\D\dmd2\windows\bin\dmd.exe for 
x86_64.
gtk-d:gtkd 3.9.0: target for configuration "library" is up to 
date.
gtk-d:gstreamer 3.9.0: target for configuration "library" is up 
to date.
gtk-d:peas 3.9.0: target for configuration "library" is up to 
date.

gtk-d:sv 3.9.0: target for configuration "library" is up to date.
gtk-d:vte 3.9.0: target for configuration "library" is up to date.
maurerrose-d ~master: building configuration "application"...
Running pre-build commands...
source/constants.d.in was unexpected at this time.
Command failed with exit code 1: if [ source/constants.d.in -nt 
source/constants.d ]; then sed -e 
's#topdir#D:\temp\dmaurerrose-master#' source/constants.d.in > 
source/constants.d; fi




Re: Blog Post #0099: A Special Request

2020-01-23 Thread Ron Tarrant via Digitalmars-d-learn

On Thursday, 23 January 2020 at 08:33:39 UTC, Antonio Corbi wrote:


https://gitlab.com/amcorbi/dmaurerrose

I think this is somewhat related to what te OP was asking for.


I'm confused. I was the OP, so I'm not sure who you're referring 
to.


Assuming you are on GNU/Linux, a simple 'dub run' is all you 
have to do to make it compile and run.


On Windows, `dub run` yielded the following output:

Performing "debug" build using C:\D\dmd2\windows\bin\dmd.exe for 
x86_64.
gtk-d:gtkd 3.9.0: target for configuration "library" is up to 
date.
gtk-d:gstreamer 3.9.0: target for configuration "library" is up 
to date.
gtk-d:peas 3.9.0: target for configuration "library" is up to 
date.

gtk-d:sv 3.9.0: target for configuration "library" is up to date.
gtk-d:vte 3.9.0: target for configuration "library" is up to date.
maurerrose-d ~master: building configuration "application"...
Running pre-build commands...
source/constants.d.in was unexpected at this time.
Command failed with exit code 1: if [ source/constants.d.in -nt 
source/constants.d ]; then sed -e 
's#topdir#D:\temp\dmaurerrose-master#' source/constants.d.in > 
source/constants.d; fi




Re: Blog Post #0099: A Special Request

2020-01-22 Thread Ron Tarrant via Digitalmars-d-learn

On Wednesday, 22 January 2020 at 15:29:44 UTC, Jan Hönig wrote:


Yes something in that manner.
I am not familiar with GTK, i have done a few things in QT.
I am mainly interested in the information passing.
When i make some change to the input || hit enter || hit the 
button, the scene will change accordingly.


For a more satisfying example, you could have a ball on one 
line. Below that you have a horizontal slider. Whenever you 
move the slider, the ball on the line will move accordingly.


Would you be able to do a quick sketch/rough drawing of this? 
Perhaps before and after drawings? I wanna make sure I understand 
exactly what you're looking for. I don't know if this forum will 
allow images, so perhaps we could switch over to email 
(gtkdcod...@gmail.com) so you can attach them.


Re: Blog Post #0099: A Special Request

2020-01-22 Thread Ron Tarrant via Digitalmars-d-learn
On Wednesday, 22 January 2020 at 09:18:51 UTC, Ferhat Kurtulmuş 
wrote:


Another useful tutorial would be something using bindProperty 
and/or bindPropertyWithClosures. Once I used bindProperty with 
vala, but I think there is no any example to do it with gtkd.


I found a bindProperty() function in gobject/ObjectG.d. Is this 
what you're referring to?




Re: Blog Post #0099: A Special Request

2020-01-22 Thread Ron Tarrant via Digitalmars-d-learn

On Tuesday, 21 January 2020 at 22:12:10 UTC, Antonio Corbi wrote:

On Tuesday, 21 January 2020 at 22:06:30 UTC, Ron Tarrant wrote:



Do you still have the Maurer Rose example?


I had to look this up. I'd never heard of it before. That being 
said...



Do you think it could fit this kind of example?


When I say "demo" I'm talking about examples of how to do various 
GTK GUI stuff rather than mathematical exercises. Trying to do 
this mathematical/drawing exercise, I'd be waaay out of my 
element. The few simple math/draw examples I did in Cairo (posts 
#0057 to #0064) is about my limit as far as math goes.


However, I can point you at this repository of Java examples: 
https://github.com/iabin/Maurer-Rose/tree/master/src


Using the methods outlined in the posts I've listed, you should 
be able to port it over from Java to D. I'm not a mathematician, 
so I wouldn't be of much help.


I wish you the best of luck on this endeavour.


Re: Blog Post #0099: A Special Request

2020-01-21 Thread Ron Tarrant via Digitalmars-d-learn

On Tuesday, 21 January 2020 at 18:57:47 UTC, Jan Hönig wrote:


I would also like to request a future blog post about animation.
I know you have done that in the past, but i am thinking of 
some animation triggered by user input (say a button, or some 
text field, which provides parameters for a circle).


Just to make sure I know exactly what you want...

- the user inputs parameters for a circle - I'm assuming size, 
position, perhaps the fraction of the circle (half, quarter, 
two-thirds, whatever)

- the user then clicks a button and that draws the circle.

Is that more or less what you're after?



Re: Blog Post #0099: A Special Request

2020-01-21 Thread Ron Tarrant via Digitalmars-d-learn

On Tuesday, 21 January 2020 at 18:57:47 UTC, Jan Hönig wrote:
Hi Ron. Your blog is great. I have saved it for the future. (I 
know it from reddit).

Glad you like it.


I would also like to request a future blog post about animation.
I know you have done that in the past, but i am thinking of 
some animation triggered by user input (say a button, or some 
text field, which provides parameters for a circle).


Okay. I'll see what I can come up with. Lead time is 2-3 months, 
just so you're aware.


Blog Post #0099: A Special Request

2020-01-21 Thread Ron Tarrant via Digitalmars-d-learn
Today's post was requested by Joel Christensen, how to have one 
button affect another. You can find it here: 
https://gtkdcoding.com/2020/01/21/0099-sfx-button-interactions-i-text-labels.html


Blog Post #0098: More HeaderBar Stuff

2020-01-14 Thread Ron Tarrant via Digitalmars-d-learn
Wanna know how to rearrange the contents of your HeaderBar? Or 
add extra widgets to that same HeaderBar? Then come on over to 
the GtkD Coding Blog and have a read: 
https://gtkdcoding.com/2020/01/14/0098-headerbar-more.html




Re: books for learning D

2020-01-13 Thread Ron Tarrant via Digitalmars-d-learn

On Monday, 13 January 2020 at 10:28:48 UTC, mark wrote:

I'm just starting out learning D.

Andrei Alexandrescu's "The D Programming Language" is 10 years 
old, so is it still worth getting? (I don't know how much D has 
changed in 10 years.)


Actually, Andrei's book has been updated a few times over the 
years since first being published. The latest version says this 
on the copyright page:


D version: 2.081.1
Book revision: 2018-10-17

So, it's really only about 14 months old.


Blog Post #0097: The HeaderBar

2020-01-07 Thread Ron Tarrant via Digitalmars-d-learn

When is a Titlebar not a Titlebar? When it's a HeaderBar.

Today's post starts an examination of the HeaderBar and it's 
capabilities. You can find it here: 
https://gtkdcoding.com/2020/01/07/0097-headerbar.html


Re: Project setup for DUB

2020-01-04 Thread Ron Tarrant via Digitalmars-d-learn

On Wednesday, 1 January 2020 at 13:19:20 UTC, Andre Pany wrote:

In addition to that, there are different ways how you can 
contribute to Dub:


- enhancing the dub help on code.dlang.org


Does anyone know dub well enough to do this? :)


Re: How to use ResizerWidget in Dlangui app..?

2020-01-01 Thread Ron Tarrant via Digitalmars-d-learn

On Monday, 30 December 2019 at 23:32:37 UTC, ShadoLight wrote:

dragging with the left mouse button does nothing.


Window window = Platform.instance.createWindow("DlangUI 
example", null);


I'm not familiar with this toolkit, but my guess is that you 
didn't pass in a `flags` value and therefore you aren't using the 
appropriate overload of the createWindow() function to achieve 
what you're after.


The following is from the DLangUI GitHub site 
(https://github.com/buggins/dlangui/wiki/Getting-Started). Take a 
look at the third argument:


Window createWindow(
dstring windowCaption, // window caption
Window parent, // parent window, pass null for main 
(first) window.
uint flags = WindowFlag.Resizable, // various flags - bit 
fields from WindowFlag enum values

uint width = 0,// initial window width
uint height = 0// initial window height
);




Re: Blog Post #0096: Hardware III - Keyboard and Mouse

2020-01-01 Thread Ron Tarrant via Digitalmars-d-learn

On Wednesday, 1 January 2020 at 02:30:10 UTC, bauss wrote:


Happy new year and thank you for your gtkd blogs :)


Thanks, bauss. And you're welcome. :)


Blog Post #0096: Hardware III - Keyboard and Mouse

2019-12-31 Thread Ron Tarrant via Digitalmars-d-learn
This week's post wraps up the year by looking at how to access 
keyboard and mouse events through the hardware Seat. You'll find 
it here: 
https://gtkdcoding.com/2019/12/31/0096-hardware-iii-keyboard-pointer.html


Have a happy New Year, everybody. May 2020 put things into 
perspective for us all.


Re: Finding position of a value in an array

2019-12-30 Thread Ron Tarrant via Digitalmars-d-learn

On Monday, 30 December 2019 at 19:39:04 UTC, mipri wrote:

You can definitely do it:

  $ rdmd --eval 'int a, b, c; [, , 
].countUntil().writeln'

  2

But you need to have an array of pointers.


Thanks, mipri. Got it sorted. Here's a working proof...

```
import std.stdio;
import std.algorithm;
import std.conv;

void main(string[] args)
{
MyObject[] objectArray;
MyObject newObject;
MyObject findPointer;
long index;

int lastObjectID = 7;
int foundObjectIndex;

for(int i; i < 12; i++)
{
lastObjectID++;
newObject = new MyObject(lastObjectID);
objectArray ~= newObject;

if(i is 5)
{
findPointer = newObject;
}
}

for(int i; i < objectArray.length; i++)
{
		writeln("object: ", cast(MyObject*)objectArray[i], ", ID: ", 
objectArray[i].objectID);

}

index = objectArray.countUntil(findPointer);
	writeln("findPointer: ", findPointer, ", at address: ", 
cast(MyObject*)findPointer, " is a MyObject pointer in the 
objectArray with an index of ", index, ", address: ", 
cast(MyObject*)objectArray[index], ", ID: ", 
objectArray[index].objectID);


} // main()


class MyObject
{
int objectID;

this(int ordinal)
{
objectID = ordinal;

} // this()

} // class MyObject

```



Re: Finding position of a value in an array

2019-12-30 Thread Ron Tarrant via Digitalmars-d-learn

On Monday, 30 December 2019 at 19:46:50 UTC, Ron Tarrant wrote:


Thanks, mipri. Got it sorted. Here's a working proof...


Forgot to show the output:

object: 17B0A831000, ID: 8
object: 17B0A831020, ID: 9
object: 17B0A831060, ID: 10
object: 17B0A831080, ID: 11
object: 17B0A8310A0, ID: 12
object: 17B0A8310C0, ID: 13
object: 17B0A8310E0, ID: 14
object: 17B0A831100, ID: 15
object: 17B0A831120, ID: 16
object: 17B0A831140, ID: 17
object: 17B0A831160, ID: 18
object: 17B0A831180, ID: 19
findPointer: find_in_array_object.MyObject, at address: 
17B0A8310C0 is a MyObject pointer in the objectArray with an 
index of 5, address: 17B0A8310C0, ID: 13


Re: Finding position of a value in an array

2019-12-30 Thread Ron Tarrant via Digitalmars-d-learn

On Monday, 30 December 2019 at 19:08:27 UTC, Ron Tarrant wrote:

I'm not trying to convert, just wade through an array of 
pointers to find a specific pointer using searchUntil().


** that should read: countUntil(), not searchUntil() *

Turns out I was getting too complicated. countUntil() works on 
object references as well, even if printing object references to 
a shell doesn't seem to differentiate between them.


Re: Finding position of a value in an array

2019-12-30 Thread Ron Tarrant via Digitalmars-d-learn
On Monday, 30 December 2019 at 17:12:26 UTC, MoonlightSentinel 
wrote:


D disallows implicit conversion from integers to pointers and 
hence they cannot be compared. You would need to explicitly 
cast your ulong to an appropriate pointer type


I'm not trying to convert, just wade through an array of pointers 
to find a specific pointer using searchUntil().


I mean, it's not a big deal if I can't do it. Adding an ID 
property and searching on that is just as effective and likely 
just as efficient.


Re: Finding position of a value in an array

2019-12-30 Thread Ron Tarrant via Digitalmars-d-learn

On Monday, 30 December 2019 at 14:41:55 UTC, mipri wrote:


What's your code? 'find_in_array_object.MyObject' doesn't look
like a pointer.


It's an array of objects... or, what it's trying to be, an array 
of object pointers.


Re: Finding position of a value in an array

2019-12-30 Thread Ron Tarrant via Digitalmars-d-learn
On Sunday, 29 December 2019 at 09:44:18 UTC, MoonlightSentinel 
wrote:



int i = a.countUntil(55);



I was trying to do this with an array of pointers, but I get an 
error (which suggests to me that I don't know what data type a 
pointer is):


find_in_array_object.d(25): Error: cannot cast expression 
newObject of type find_in_array_object.MyObject to ulong
find_in_array_object.d(34): Error: template 
std.algorithm.searching.countUntil cannot deduce function from 
argument types !()(MyObject[], ulong), candidates are:

C:\D\dmd2\windows\bin\..\..\src\phobos\std\algorithm\searching.d(768):std.algorithm.searching.countUntil(alias pred 
= "a == b", R, Rs...)(R haystack, Rs needles) if (isForwardRange!R && (Rs.length > 0) && 
(isForwardRange!(Rs[0]) == isInputRange!(Rs[0])) && is(typeof(startsWith!pred(haystack, needles[0]))) && 
(Rs.length == 1 || is(typeof(countUntil!pred(haystack, needles[1..__dollar])
C:\D\dmd2\windows\bin\..\..\src\phobos\std\algorithm\searching.d(856):
std.algorithm.searching.countUntil(alias pred = "a == b", R, N)(R haystack, N needle) 
if (isInputRange!R && is(typeof(binaryFun!pred(haystack.front, needle)) : bool))
C:\D\dmd2\windows\bin\..\..\src\phobos\std\algorithm\searching.d(915):
std.algorithm.searching.countUntil(alias pred, R)(R haystack) if (isInputRange!R 
&& is(typeof(unaryFun!pred(haystack.front)) : bool))

It's not a ulong? Have I forgotten so much?


Re: What kind of Editor, IDE you are using and which one do you like for D language?

2019-12-30 Thread Ron Tarrant via Digitalmars-d-learn

On Sunday, 29 December 2019 at 21:25:44 UTC, Adam D. Ruppe wrote:
My experience is IDEs are just different, not necessarily 
better or worse. Just different enough that people used to one 
find the others difficult to learn.


Amen, hear-hear, and all that. I thought it was just me.


Re: Finding position of a value in an array

2019-12-29 Thread Ron Tarrant via Digitalmars-d-learn
On Sunday, 29 December 2019 at 09:44:18 UTC, MoonlightSentinel 
wrote:

On Sunday, 29 December 2019 at 08:31:13 UTC, mipri wrote:
On Sunday, 29 December 2019 at 08:26:58 UTC, Daren Scot Wilson 
wrote:



int i = a.countUntil!(v => v == 55);
assert(i == 2);


A predicate isn’t required, countUntil accepts single elements:

int i = a.countUntil(55);


I was just about to go looking for something like this. Thanks, 
guys.


Re: [OT] What kind of Editor, IDE you are using and which one do you like for D language?

2019-12-28 Thread Ron Tarrant via Digitalmars-d-learn

On Tue, Dec 24, 2019 at 10:18:49AM +, Russel Winder via

Surely a hardcore retro guy would be using vi not vim?


On Tuesday, 24 December 2019 at 17:52:20 UTC, H. S. Teoh wrote:
Haha, well, a *real* hardcore retro guy would be using a 
magnet, a pin, and a *really* steady hand, to flip individual 
bits on an exposed harddisk platter to create the executable in 
the filesystem directly, one bit at a time.


Of course, one could also just use emacs:


You guys crack me up. :)


Re: What kind of Editor, IDE you are using and which one do you like for D language?

2019-12-26 Thread Ron Tarrant via Digitalmars-d-learn

On Thursday, 26 December 2019 at 10:32:10 UTC, Andre Pany wrote:

I am not sure wheter you talk about the same issue but the 
explorer view was also the only reason VSC was totally unusable 
for me. The lack of file/folder icons really questionable.

Recently I found out that it is possible to configure them.


Interesting. I'll have to look into that. Thanks, Andre.


Re: What kind of Editor, IDE you are using and which one do you like for D language?

2019-12-26 Thread Ron Tarrant via Digitalmars-d-learn

On Wednesday, 25 December 2019 at 13:32:45 UTC, Mike Parker wrote:

For a while, typing in VS Code was clunky compared to Sublime. 
I gave it a spin every couple of months to see how it was 
shaping up and eventually I stopped noticing the difference.


Ah! Good to know. Thanks, Mike. Once they add a proper file 
explorer sidebar, I may switch.


Re: What kind of Editor, IDE you are using and which one do you like for D language?

2019-12-25 Thread Ron Tarrant via Digitalmars-d-learn

On Sunday, 22 December 2019 at 17:20:51 UTC, BoQsc wrote:
What kind of editor/IDE are you using and which one do you like 
the most?


I was using PSPad up until a few months ago when I realized 
Notepad++ (finally) has a 64-bit version of the Explorer plugin. 
With custom GtkD syntax highlighting for both, it was Notepad++'s 
ability to show me my working system directory in a sidebar on 
start-up that got me to switch. PSPad will show it, but only 
after I manually switch from project view.




Re: What kind of Editor, IDE you are using and which one do you like for D language?

2019-12-25 Thread Ron Tarrant via Digitalmars-d-learn

On Tuesday, 24 December 2019 at 16:43:06 UTC, Mike Parker wrote:
But now that VS Code's

performance is within my tolerance range


Just curious what you mean by this, Mike.


Re: Blog Post #0095: Hardware II - Full Monitor Report

2019-12-24 Thread Ron Tarrant via Digitalmars-d-learn

On Tuesday, 24 December 2019 at 10:23:34 UTC, Russel Winder wrote:


You have to love GTK+, GtkD, and D. :-)


Too true, Russell. :)


Happy Winter Solstice (*).


(*) Or whatever winter solstice related holiday works for you. 
:-)


Right back at ya, sir.


Blog Post #0095: Hardware II - Full Monitor Report

2019-12-24 Thread Ron Tarrant via Digitalmars-d-learn
If you liked last week's post, this one will knock your socks 
off. Wanna know (programmatically) which monitor your application 
window is on? Here's how to find out: 
https://gtkdcoding.com/2019/12/24/0095-hardware-ii-full-monitor-report.html


Blog Post #0094: Addressing Hardware

2019-12-17 Thread Ron Tarrant via Digitalmars-d-learn
Today's post starts a new series (note the nifty Airport icon) on 
hardware. We start with an overview, and then look at monitors. 
You can find it right here: 
https://gtkdcoding.com/2019/12/17/0094-hardware-i-monitors.html


Blog Post #93: Window Stats - An Alternate Way to Gather Info

2019-12-10 Thread Ron Tarrant via Digitalmars-d-learn
Today's post takes a different approach to gathering the same 
info we've been working with over the last two posts. It's right 
here: 
https://gtkdcoding.com/2019/12/10/0093-window-stats-iii-alt.html


Blog Post #92: Window Stats - Size and Maximize

2019-12-03 Thread Ron Tarrant via Digitalmars-d-learn
Today, we carry on looking at Window stats and how we can prepare 
to preserve them. You'll find it here: 
https://gtkdcoding.com/2019/12/03/0092-window-stats-ii-size.html


Blog Post #91: Where's My Window?

2019-11-26 Thread Ron Tarrant via Digitalmars-d-learn
Today's post was inspired by a reader request, even though it 
wasn't specifically requested. It's about finding a Window's 
position and can be found here: 
https://gtkdcoding.com/2019/11/26/0091-window-stats-i-position.html


I'd also like to take this opportunity to announce that my 
posting schedule is changing. Starting today, and for the next 
while, posts will be made once per week. Other demands on my time 
during the holidays and for the foreseeable future has made this 
necessary. Thank you for your patience and understanding.


Blog Post #90: Reader Requests

2019-11-22 Thread Ron Tarrant via Digitalmars-d-learn
Readers Peter Pinkness (over on the GtkD Forum) and GreatSam4Sure 
(the D Forum) requested coverage of some techniques for centering 
a GTK Window and decorating a Window with a custom icon. That's 
what today's post is about: 
https://gtkdcoding.com/2019/11/22/0090-titlebar-icons.html


Also, I made an announcement early in the week in the Announce 
sub-forum which you may or may not have seen: 
https://forum.dlang.org/thread/gfrxelrpjjiyfbtzw...@forum.dlang.org


Blog Post #89: Nodes-n-noodles, Part VIII - It's Alive! (2)

2019-11-19 Thread Ron Tarrant via Digitalmars-d-learn
And finally, you get to see a moveable node in action... right 
here: 
https://gtkdcoding.com/2019/11/19/0089-nodes-viii-its-alive-2.html


Not that this is the end of the Nodes-n-noodles series. Not by a 
long shot. We'll be back a few weeks from now with noodles 
connecting nodes and all that jazz.


Oh, my. Can't wait. :)


Blog Post #88: Nodes-n-noodles, Part VII - It's Alive! (1)

2019-11-15 Thread Ron Tarrant via Digitalmars-d-learn
Okay, time to prepare for moving that node... and it all starts 
with this: 
https://gtkdcoding.com/2019/11/15/0088-nodes-vii-its-alive.html


Blog Post #87: Nodes-n-noodles, Part VI - Defining Hot Spots

2019-11-12 Thread Ron Tarrant via Digitalmars-d-learn

Sorry I'm late today...

Carrying on with the Nodes-n-noodles series, today we define the 
hot spots for the drag bar and the in/out terminals. You can find 
it here: 
https://gtkdcoding.com/2019/11/12/0087-nodes-vi-hotspots.html


Blog Post #86: Nodes-n-noodles, Part V - The Drawing Routines

2019-11-08 Thread Ron Tarrant via Digitalmars-d-learn
Today's post doesn't just continue our look at Nodes-n-noodles 
(here's the link: 
https://gtkdcoding.com/2019/11/08/0086-nodes-v-node-drawing-routines.html) it's also a milestone for the GtkDcoding Blog... I've been accepted into the GitHub Sponsors program which means readers can now show their appreciation by supporting my efforts. Just click on the heart icon at the bottom of any post.




Re: Blog Post #74: Cairo IX - Doodle a Noodle

2019-11-06 Thread Ron Tarrant via Digitalmars-d-learn

On Friday, 27 September 2019 at 13:44:54 UTC, Ron Tarrant wrote:

You can find part one here: 
https://gtkdcoding.com/2019/09/27/0074-cairo-doodle-a-noodle.html


Due to code reorganization, the above link is now:

https://gtkdcoding.com/2019/09/27/0074-nodes-i-doodle-a-noodle.html


Re: Blog Post #75: Cairo X - Noodling with the Mouse

2019-11-06 Thread Ron Tarrant via Digitalmars-d-learn

On Tuesday, 1 October 2019 at 09:58:42 UTC, Ron Tarrant wrote:
Here's the second installment of the Nodes-n-noodles coverage 
in which we get the mouse involved: 
https://gtkdcoding.com/2019/10/01/0075-cairo-x-mouse-noodle.html


Because of code reorganization, the above link is now:

https://gtkdcoding.com/2019/10/01/0075-nodes-ii-mouse-noodle.html


Re: Blog Post #76: Nodes and Noodles, Part II

2019-11-06 Thread Ron Tarrant via Digitalmars-d-learn

On Sunday, 6 October 2019 at 23:15:43 UTC, Ron Tarrant wrote:

On Sunday, 6 October 2019 at 23:00:51 UTC, Zekereth wrote:

Here's the correct URL 
https://gtkdcoding.com/2019/10/04/0076-app-01-iii-noodles-and-mouse-clicks.html


Great tutorial(s)! Thanks!


LOL! Thanks, Zekereth.


Because of code reorganization, the above link should now be:

https://gtkdcoding.com/2019/10/04/0076-nodes-iii-noodles-and-mouse-clicks.html


Blog Post #85: Nodes-n-noodles, Part IV - A Node from a DrawingArea

2019-11-06 Thread Ron Tarrant via Digitalmars-d-learn

A day late, but here we are...

Diving back into the Nodes-n-noodles series, we look at how to 
build a moveable node from a DrawingArea. You can find it here: 
https://gtkdcoding.com/2019/11/05/0085-nodes-iv-node-drawing.html


Re: GtkDcoding Blog Interruption

2019-11-05 Thread Ron Tarrant via Digitalmars-d-learn

On Tuesday, 5 November 2019 at 12:31:04 UTC, Ron Tarrant wrote:

Until I can resolve this, please bear with me. I'll keep you 
all updated of any progress.


I've been in touch with GitHub support and they're in a yellow 
alert situation, meaning (I assume) that service for all sites 
hosted on GitHub Pages will be degraded until that's cleared up.




GtkDcoding Blog Interruption

2019-11-05 Thread Ron Tarrant via Digitalmars-d-learn
My apologies. I'm experiencing a technical problem with the GtkD 
Coding Blog site. Today's post has been uploaded, but the site 
isn't being updated properly, so the new page isn't available. 
Everything works fine locally, so for the moment, I'm stumped.


Until I can resolve this, please bear with me. I'll keep you all 
updated of any progress.




Blog Post #84: Notebook, Part VIII - Child Widgets

2019-11-01 Thread Ron Tarrant via Digitalmars-d-learn
For the final instalment in the Notebook series, we take a look 
at accessing the contents of child widgets: 
https://gtkdcoding.com/2019/11/01/0084-notebook-viii-child-widgets.html


Re: Gtkd and libgtksourceview

2019-10-31 Thread Ron Tarrant via Digitalmars-d-learn

On Thursday, 31 October 2019 at 11:47:41 UTC, Mike Wey wrote:

girtod can be found here: 
https://github.com/gtkd-developers/gir-to-d


It's a tool that generates a D Binding from GObject 
Introspection files, if you use the GTK installer from the gtkd 
website or msys2 the needed introspection (.gir) files should 
be installed on your system.


Running the command above in the root of the GtkD project, will 
regenerate the source based on the gir files found on your 
system.


The last two options passed to girtod are for backwards 
compatibility with older version of GtkD, and aren't needed for 
new bindings.


And technically you could also run: "girtod -i GSource-3.0.gir" 
and it will create a "out" directory with a GtkSourceview 
binding that should be fairly complete.


Okay, thanks, Mike. I'll try to set aside some time next week to 
dig into this.


Re: Gtkd and libgtksourceview

2019-10-31 Thread Ron Tarrant via Digitalmars-d-learn

On Wednesday, 30 October 2019 at 22:26:41 UTC, Mike Wey wrote:


---
girtod -i src --use-runtime-linker --use-bind-dir
---


Hmmm... I'll need more information, I'm afraid. I Googled, but 
I'm not finding any instructions for building these DLLs.


Re: Gtkd and libgtksourceview

2019-10-30 Thread Ron Tarrant via Digitalmars-d-learn

On Wednesday, 30 October 2019 at 18:00:24 UTC, Mike Wey wrote:

GtkSourceview was updated to 4.x in GtkD version 3.9.0, so any 
older version should work with GtkSourceview 3.


Welcome back, Mike...

The latest Windows runtime available on the GtkD downloads page 
installs libgtksourceview-3.0-1.dll, not the 4.0 version, so I 
suspect the Linux libraries may be out of step, too.


If you need Sourceview 3 in the newer version of GtkD you could 
replace `file: GtkSource-4.gir` with `file: GtkSource-3.0.gir` 
in `src/APILookupSourceView.txt` and then run `make generate` 
(requires girtod) and you should have a up to date binding for 
Sourceview 3.


Just for the record, this doesn't work on Windows. I made the 
change in APILookupSourceView.txt and re-ran Build.d, but 
sourceview/gsv/c/functions.d still shows:


version (Windows)
static immutable LIBRARY_GSV = ["libgtksourceview-4-0.dll"];
else version (OSX)
static immutable LIBRARY_GSV = ["libgtksourceview-4.0.dylib"];
else
static immutable LIBRARY_GSV = ["libgtksourceview-4.so.0"];



Re: Gtkd and libgtksourceview

2019-10-30 Thread Ron Tarrant via Digitalmars-d-learn
On Wednesday, 30 October 2019 at 14:48:23 UTC, bioinfornatics 
wrote:


so which version should I used to be compatible with 
libgtksourceview-3 (I use centos 7)


When Mike Wey gets back in town (any day now) he should be able 
to provide a solution that's less of a kludge.


Re: Gtkd and libgtksourceview

2019-10-30 Thread Ron Tarrant via Digitalmars-d-learn
On Wednesday, 30 October 2019 at 14:48:23 UTC, bioinfornatics 
wrote:


I tried the latest gtkd release and it try to open dynamically 
libgtksourceview-4.so.0 however  I have only 
libgtksourceview-3.so.1


On Windows, I had to change a line in 
C:\D\dmd2\src\sourceview\gsv\c\functions.d from:


static immutable LIBRARY_GSV = ["libgtksourceview-4.0.dll"];

to:

static immutable LIBRARY_GSV = ["libgtksourceview-3.0-1.dll"];


Assuming the sourceview/gsv/c/functions.d exists on Linux as 
well, a similar change should help.


However, you will also, very likely, have to look for a folder in 
generated/ called:


"sourceview"

and copy it and its contents to:

dmd2/src/

And I have no idea where you'll find the dmd2/src/ folder on 
Linux. But, assuming you can find it, this may get you up and 
running.


Let me know how it goes.


Blog Post #83: Notebook, Part VII - All Signals

2019-10-29 Thread Ron Tarrant via Digitalmars-d-learn
This post looks at a handful of Notebook signals, how they're 
triggered, and what they can be used for. We also go over the 
keyboard shortcuts used by the GTK Notebook. You'll find it all 
here: 
https://gtkdcoding.com/2019/10/29/0083-notebook-vii-notebook-all-signals.html


Blog Post #82: Notebook, Part VI - Add and Remove Tabs

2019-10-25 Thread Ron Tarrant via Digitalmars-d-learn
More fun with Notebooks, adding and removing tabs willy-nilly: 
https://gtkdcoding.com/2019/10/25/0082-notebook-vi-add-remove-tabs.html


Blog Post #81: Notebook, Part V - Customized Tabs, Part III

2019-10-22 Thread Ron Tarrant via Digitalmars-d-learn
Today we wrap up the customized tabs discussion as we look at the 
drawing routines. It's here: 
https://gtkdcoding.com/2019/10/22/0081-notebook-v-custom-tabs-iii.html


Re: Meta question - what about moving the D - Learn Forum to a seperate StackExchange platform?

2019-10-18 Thread Ron Tarrant via Digitalmars-d-learn
On Friday, 18 October 2019 at 07:35:21 UTC, Martin Tschierschke 
wrote:
I very often end with a solution found on one of the 
StackExchange forums like > StackOverflow or AskUbuntu etc.


I have found that StackExchange does often have answers, but I 
can't say I like asking questions on there, especially if the 
question is almost-the-same-but-not-the-same as a question asked 
earlier. In cases like this, I've been told that the previous 
answer applies to my question, even when it doesn't.


In one instance, a moderator closed my question without reading 
the details in order to find out that, no, it's not the same 
question at all... and then refuse to reopen the question when I 
point this out.


So, although I'll continue to use StackExchange as an historical 
resource, I would rather not depend on it for getting answers to 
new questions.




Blog Post #80: Notebook, Part IV - Customized Tabs, Part II

2019-10-18 Thread Ron Tarrant via Digitalmars-d-learn
Here's the second instalment of the customized tabs discussion. 
May it bring you peace and joy. 
https://gtkdcoding.com/2019/10/18/0080-notebook-iv-custom-tabs-ii.html




Re: several types in one Array ?

2019-10-17 Thread Ron Tarrant via Digitalmars-d-learn

On Thursday, 17 October 2019 at 14:45:24 UTC, Mil58 wrote:

Hi all...
Does exist (or not?) a way to create array with several types 
(as in Python)


You actually have at least three options for handling mixed data:

```
// Three ways to handle mixed data

import std.stdio;
import std.typecons;
import std.variant;

struct Result
{
string itemName;
int quantity;
bool needIt;

} // struct Result


class GroceryItem
{
private:
bool _needIt;
int _quantity;
string _itemName;

public:
this(string itemName, int quantity, bool needIt)
{
_itemName = itemName;
_quantity = quantity;
_needIt = needIt;

} // this()


Variant getVariant()
{
		return(cast(Variant)tuple(_itemName, _quantity, _needIt)); // 
use with a Variant return type


} // getVariant()


Tuple!(string, int, bool)getTuple()
{
		return(tuple(_itemName, _quantity, _needIt)); // use with a 
Tuple!(string, int, bool) return type


} // getTuple()


Result getStruct()
{
Result result = {_itemName, _quantity, _needIt};

return(result);

} // getStruct()


void set(bool needIt)
{
_needIt = needIt;

} // set()

} // class GroceryItem


void main(string[] args)
{
GroceryItem[] groceryList;

GroceryItem item1 = new GroceryItem("Paper Towels", 1, true);
groceryList ~= item1;
GroceryItem item2 = new GroceryItem("Bread", 2, true);
groceryList ~= item2;
GroceryItem item3 = new GroceryItem("Butter", 1, false);
groceryList ~= item3;
GroceryItem item4 = new GroceryItem("Milk", 1, true);
groceryList ~= item4;
GroceryItem item5 = new GroceryItem("Potato Chips", 3, false);
groceryList ~= item5;
GroceryItem item6 = new GroceryItem("Pickles", 4, true);
groceryList ~= item6;

writeln("Returning variants...");

foreach(groceryItem; groceryList)
{
writeln(groceryItem.getVariant());
}

writeln();
writeln("Returning tuples...");

foreach(groceryItem; groceryList)
{
writeln(groceryItem.getTuple());
}

writeln();
writeln("Returning structs...");

foreach(groceryItem; groceryList)
{
writeln(groceryItem.getStruct());
}

} // main()

```


Re: Blog Post #79: Notebook, Part III - Customized Tabs, Part I

2019-10-16 Thread Ron Tarrant via Digitalmars-d-learn
On Wednesday, 16 October 2019 at 07:46:42 UTC, Antonio Corbi 
wrote:



Hope this helps.


Thanks, Antonio. I'll check this out.

I'll work up a demo based on this stuff and put it in the 
gtkdcoding queue.


Re: Blog Post #79: Notebook, Part III - Customized Tabs, Part I

2019-10-15 Thread Ron Tarrant via Digitalmars-d-learn

On Tuesday, 15 October 2019 at 14:00:32 UTC, WebFreak001 wrote:

thank you so much for these tutorials! I love how they are 
progressing.


Thanks, WebFreak001.

Small, simple and concise topics with good images, nice 
drawings, and most importantly, paragraphs explaining the logic 
along with the code.


I am also fan of your consistent style of the website and the 
tutorial images. Keep up the great work on these tutorials! 
They are a great resource showing people how to easily do great 
GUIs in D and will surely attract a lot of people.


Those are some very kind words. Thank you very much.

Could you maybe do a tutorial how to use Glade with D in the 
future?


I'll put this on my todo list. How could I turn you down after 
the preamble you wrote? :)


there are 2 dub packages to generate D code from the forms 
files. (one very new one with nice explanations and one that is 
a year old with a bit less documentation)


Do you have links for these?


Re: Permission to Use Comments?

2019-10-15 Thread Ron Tarrant via Digitalmars-d-learn

On Monday, 14 October 2019 at 15:36:44 UTC, Jesse Phillips wrote:

Pretty sure since this is a public forum, legally you just need 
to reference your sources (if even that). Asking permission is 
just polite.


Well, yes and no. According to the FTC (U.S.) and the Federal 
Competition Bureau (Canada) it's best to get permission in 
written form, even if it's email or on a public forum, no matter 
what the source of the comments. It's polite, yes, but it also 
removes ambiguity.



I don't say anything good, but you're free to use mine.


:)  Why, thanks, Jesse.



Re: Permission to Use Comments?

2019-10-15 Thread Ron Tarrant via Digitalmars-d-learn

On Tuesday, 15 October 2019 at 14:33:27 UTC, Russel Winder wrote:

Not I. I am happy for comments I make regarding GtkDCoding on 
this email list to be used above my name on the GtkDCoding 
website.


Thanks, Russel.



Re: Blog Post #77: Notebook, Part I

2019-10-15 Thread Ron Tarrant via Digitalmars-d-learn

On Wednesday, 9 October 2019 at 03:13:48 UTC, GreatSam4sure wrote:

Is there any way to detect the size of my screen using gtkd? So 
that incan calculate the size of my screen and center my window 
on the screen using move(x, y).


I was distracted last time I replied to this thread and so 
overlooked the obvious.


This is actually very simple to do. Add this to your Window or 
MainWindow constructor:


Window.setPosition(WindowPosition.CENTER);

That's it.

Here's a full example, so you can see it in its natural habitat: 
https://github.com/rontarrant/gtkDcoding/blob/master/001_window/window_001_11_centered.d


Blog Post #79: Notebook, Part III - Customized Tabs, Part I

2019-10-15 Thread Ron Tarrant via Digitalmars-d-learn

Well, if that title isn't confusing, I'm not doing my job right.

Today's post starts a three-part mini-series within the Notebook 
series on building customized tabs in a DrawingArea. There's a 
ton of stuff to go over; that's why it's in three parts.


Anyway, the fun begins right here: 
https://gtkdcoding.com/2019/10/15/0079-notebook-iii-custom-tabs-i.html




Permission to Use Comments?

2019-10-14 Thread Ron Tarrant via Digitalmars-d-learn

Hi all,

I've been thinking about how to take GtkDcoding to the next level 
and one idea is to use (favourable) comments made here on the 
forum to help promote the blog.


So, since I'm not clear on copyright law and how it affects forum 
posts, I decided to ask...


1) Does anyone know how copyright laws stand regarding reuse of 
comments on a forum?


2) Does anyone object to me quoting them for promotional purposes?



Re: Blog Post #0043 - File Dialog IX - Custom Dialogs (2 of 3)

2019-10-13 Thread Ron Tarrant via Digitalmars-d-learn

On Monday, 17 June 2019 at 07:09:33 UTC, BoQsc wrote:


Aw man, your content have. "© Copyright 2019 Ron Tarrant"


I just noticed this response, otherwise I would have responded 
sooner.


The copyright only covers the text, not the code. I'll see about 
getting a lack-of-copyright notice together to put at the top of 
each code file.


I hope that puts your mind at ease.



Re: Blog Post #77: Notebook, Part I

2019-10-12 Thread Ron Tarrant via Digitalmars-d-learn
On Saturday, 12 October 2019 at 16:34:01 UTC, Carsten Schlote 
wrote:



Nice work, Ron!


Thanks, Carsten.

I'm just converted some of you examples into dub based 
projects, and compiled and run them a normal intel PC and a 
Raspberry. As a prerequisite I had to install the following on 
a Raspian Lite installation (from a NOOP sdcard, no GUI)


Well, that's pretty cool.

Ever considered to provide such dub based examples on 
GitHub/GitLab/... for easy access?


Yup! It's coming. Also, module-based stuff.

Such source examples could be very helpful for GTK newbies. And 
dub projects should work on Windows as well.


Yup, absolutely.




Re: GtkD ListG Howto?

2019-10-11 Thread Ron Tarrant via Digitalmars-d-learn

On Friday, 11 October 2019 at 20:40:25 UTC, mipri wrote:


I get the segfault to go away with

  ListG list = new ListG(null);

which is usage you can find in APILookupGLib.txt


Ah! Thanks, mipri. I didn't think to read through the unit tests.


GtkD ListG Howto?

2019-10-11 Thread Ron Tarrant via Digitalmars-d-learn

Hi all,

I'm trying to add an icon list to a GTK Window using 
setIconList(), but what the function expects is a ListG of 
Pixbufs.


The way I understand it, I have to instantiate the Pixbufs, build 
a ListG of void pointers to the Pixbufs, and pass that to 
setIconList().


Here is how I assume this process would play out:

```

Pixbuf airportImage1, airportImage2, airportImage3, airportImage4;
void * image1, image2, image3, image4;

airportImage1 = new Pixbuf("images/airport_25.png");
airportImage2 = new Pixbuf("images/airport_35.png");
airportImage3 = new Pixbuf("images/airport_60.png");
airportImage4 = new Pixbuf("images/airport_100.png");
image1 = 
image2 = 
image3 = 
image4 = 

ListG listG = null;

listG = listG.append(image1);
listG = listG.append(image2);
listG = listG.append(image3);
listG = listG.append(image4);

setIconList(listG);

```

But this, although it compiles, just dies when it hits all those 
append() statements.


Would someone please tell me where I'm going off track?




Blog Post #78: Notebook, Part II

2019-10-11 Thread Ron Tarrant via Digitalmars-d-learn
Continuing the series on the GTK Notebook, we look at multiple 
tabs, reordering tabs, and stuffing images into tabs. Exciting 
stuff, no?


Here it is: 
https://gtkdcoding.com/2019/10/11/0078-notebook-ii-multiple-tabs.html




Re: Blog Post #77: Notebook, Part I

2019-10-09 Thread Ron Tarrant via Digitalmars-d-learn

On Wednesday, 9 October 2019 at 03:13:48 UTC, GreatSam4sure wrote:


Good works


Thanks, GreatSam4sure.

Is there any way to detect the size of my screen using gtkd? So 
that incan calculate the size of my screen and center my window 
on the screen using move(x, y).


I had a quick look into this and there is no straightforward 
solution, so I can't give you an immediate answer. It would be 
easier to explain with a demo, so I'll need some time to work one 
up. I've put it on my to-do list.


Besides can you convert all your posts to a pdf that is easily 
downloadable for those with little internet access?


I've been thinking about an ebook based on the blog, something 
that would start with installing a development environment, go 
into how to organize and write each part of an application, and 
end with how to distribute the finished product. It's in very 
early stages ATM, but I'm open to any suggestions you (or anyone 
else) may have for how to make it as useful as possible.




Blog Post #77: Notebook, Part I

2019-10-08 Thread Ron Tarrant via Digitalmars-d-learn
Today starts a new series on the Notebook widget. Over the next 
few weeks, we'll dig in deep, looking at single-tab and 
multiple-tab demos, customizing the look of the actual tabs, 
adding and removing tabs... a whole ton of stuff. Sounds like 
fun, right?


Come on over and check it out: 
https://gtkdcoding.com/2019/10/08/0077-notebook-i-basics.html


Re: Blog Post #76: Nodes and Noodles, Part II

2019-10-06 Thread Ron Tarrant via Digitalmars-d-learn

On Sunday, 6 October 2019 at 23:00:51 UTC, Zekereth wrote:

Here's the correct URL 
https://gtkdcoding.com/2019/10/04/0076-app-01-iii-noodles-and-mouse-clicks.html


Great tutorial(s)! Thanks!


LOL! Thanks, Zekereth.


Re: Blog Post #75: Cairo X - Noodling with the Mouse

2019-10-05 Thread Ron Tarrant via Digitalmars-d-learn

On Friday, 4 October 2019 at 20:56:31 UTC, Greatsam4sure wrote:

Pls sir can you make a pdf of the tutorials. that can be easily 
downloaded once and for all. So that I need to be online. Not 
everybody have cheap internet.


That's an interesting idea, but it would mean a lot of extra time 
and effort, so it would be nice to be compensated. Do you think 
it's better to ask for a set fee or donations?




Re: Blog Post #76: Nodes and Noodles, Part II

2019-10-04 Thread Ron Tarrant via Digitalmars-d-learn

On Friday, 4 October 2019 at 11:36:52 UTC, Ron Tarrant wrote:
Here's the second instalment of the Nodes-n-noodles series 
wherein noodle drawing on a DrawingArea is now complete. You 
can find it here: 
http://localhost:4000/2019/10/04/0076-cairo-xi-noodles-and-mouse-clicks.html


Beg pardon. That should be "the third instalment," not "the 
second."


Blog Post #76: Nodes and Noodles, Part II

2019-10-04 Thread Ron Tarrant via Digitalmars-d-learn
Here's the second instalment of the Nodes-n-noodles series 
wherein noodle drawing on a DrawingArea is now complete. You can 
find it here: 
http://localhost:4000/2019/10/04/0076-cairo-xi-noodles-and-mouse-clicks.html


Blog Post #75: Cairo X - Noodling with the Mouse

2019-10-01 Thread Ron Tarrant via Digitalmars-d-learn
Here's the second installment of the Nodes-n-noodles coverage in 
which we get the mouse involved: 
https://gtkdcoding.com/2019/10/01/0075-cairo-x-mouse-noodle.html


Re: Packaging and Distributing Dlang Applications with GtkD Dependency?

2019-09-28 Thread Ron Tarrant via Digitalmars-d-learn

On Saturday, 28 September 2019 at 08:52:36 UTC, Jordi Sayol wrote:

On Bebian/Ubuntu/Linux Mint, You have "d-apt" 



This sounds so appropriate for a D application. :)

If you static links your d program, you don't need any package 
from it at runtime.
But if you dynamic links it, you've runtime libraries for GtkD 
"libgtkd3-nn" and TkD "libtkd-nn" on "d-apt".
"nn" on library name should be replaced with the DMD major 
version (without initial zero).

i.e. For the last DMD version, "libgtkd3-88" or "libtkd-88".


Thank you for filling in some blanks for me.


Re: Packaging and Distributing Dlang Applications with GtkD Dependency?

2019-09-28 Thread Ron Tarrant via Digitalmars-d-learn
On Saturday, 28 September 2019 at 02:15:42 UTC, Hossain Adnan 
wrote:



For Linux there are 3 new options:

(things omitted)
There are tutorials for using all of those three online, but 
not specific to Dlang. But if you use the Meson build system 
there are plenty of tutorials available.


Thanks Hossian. This helps a lot.


Re: Packaging and Distributing Dlang Applications with GtkD Dependency?

2019-09-28 Thread Ron Tarrant via Digitalmars-d-learn
On Friday, 27 September 2019 at 12:42:56 UTC, Jacob Carlborg 
wrote:


For macOS you should distribute a GUI application for end users 
as an application bundle [1]. That's basically a directory 
containing a specific structure. Any dependencies and resources 
like libraries (GTK), images and so on should be bundled inside 
the application bundle. Then package the application bundle 
inside an archive, ideally a Disk Image (DMG) [2]. The 
application would be completely self contained and the user can 
install it by dragging it to the Application directory.


There might be some specific documentation how to bundle a GTK 
application on macOS. I found this [3], don't know if it's good 
or not.


Ideally the application should be distributed on the Mac App 
Store. But that requires a developer account that costs money. 
It also has some restrictions that distribution outside of the 
Mac App Store doesn't have. If you cannot distribute using the 
Mac App Store the next best thing is to notarize the 
application (also requires a paid developer account, as far as 
I can see) before distributing it. Otherwise the user will get 
a dialog complaining that the application is from an unknown 
developer and the user need to explicitly go into System 
Preferences to allow it.


[1] 
https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/1123i-CH101-SW1


[2] https://en.wikipedia.org/wiki/Apple_Disk_Image
[3] https://gitlab.gnome.org/GNOME/gtk-mac-bundler

--
/Jacob Carlborg


Excellent, Jacob. Thanks for all that.


Blog Post #74: Cairo IX - Doodle a Noodle

2019-09-27 Thread Ron Tarrant via Digitalmars-d-learn
Because at this point we've covered almost every widget GtkD has 
to offer, today we're taking a departure from that to do 
something non-standard.


Nodes-n-noodles are becoming more popular as UI elements, so this 
is the beginnings of how we can get this paradigm working in GtkD.


You can find part one here: 
https://gtkdcoding.com/2019/09/27/0074-cairo-doodle-a-noodle.html




Re: Packaging and Distributing Dlang Applications with GtkD Dependency?

2019-09-26 Thread Ron Tarrant via Digitalmars-d-learn
On Thursday, 26 September 2019 at 10:10:20 UTC, bioinfornatics 
wrote:


I prefer to use meson a builder tool (same category tool as 
Make, CMake ...)

doc: https://mesonbuild.com/Dlang-module.html

Is better as it ease the packaging for fedora, debian, ubuntu 
and so on ...


This is good to know. Thank you, bioinfornatics.


Re: Packaging and Distributing Dlang Applications with GtkD Dependency?

2019-09-26 Thread Ron Tarrant via Digitalmars-d-learn

On Thursday, 26 September 2019 at 16:30:39 UTC, Andre Pany wrote:

Dub is a tool for developers, I understand your requirements 
that you want target end customers of your applications. 
Therefore dub is the wrong tool for this job.


To be more precise, gtkd is a wrapper for GTK. Gtkd is not 
interesting in this context, but the dependency on gtk. On 
windows you have the possibility to either publish your 
application with GTK dlls or to run gtk setup routine as part 
of your application setup routine or just say in your readme 
that the customer needs to run GTK setup on there own.


On posix (linus, macos) of course you can also say in your 
readme that the customer should run apt-get ... to install gtk 
(here I do not have much knowledge on packaging).


Kind regards
Andre


Excellent. That's exactly what I needed to know, Andre. Thanks 
very much.


Re: Looking for a Simple Doubly Linked List Implementation

2019-09-25 Thread Ron Tarrant via Digitalmars-d-learn

On Monday, 23 September 2019 at 22:40:41 UTC, Ali Çehreli wrote:

So, what was it then? Append to an array, sort it, and be 
happy? :)


Ali


Hi, Ali,

It turns out that the GTK Notebook has its own built-in mechanism 
for tracking tabs. Two things got me going down the wrong road on 
this:


1) the fact that Notebook.appendPage() returns an ever-increasing 
index each time a page is added, and

2) trying to quit caffeine.

I chased my tail for a full week (seriously: a full week!) trying 
to come up with a way to track tabs. Then I got tired of doing 
face-plants on my desk, took up coffee again, and solved it in 
three hours.


The moral of the story is: don't quit coffee until you have 
nothing left to contribute to this world. :)


Re: Packaging and Distributing Dlang Applications with GtkD Dependency?

2019-09-25 Thread Ron Tarrant via Digitalmars-d-learn
On Wednesday, 25 September 2019 at 13:52:48 UTC, bioinfornatics 
wrote:


I think I misunderstood your need but are lo looking for dub 
tool with its repository https://code.dlang.org/


I don't think so, but I could be wrong. I tried reading up on 
dub, but got lost in the docs, so I really don't understand what 
all it can do.




Re: Packaging and Distributing Dlang Applications with GtkD Dependency?

2019-09-25 Thread Ron Tarrant via Digitalmars-d-learn

On Wednesday, 25 September 2019 at 12:32:58 UTC, a11e99z wrote:


so u need installers/installation program
https://en.wikipedia.org/wiki/List_of_installation_software

well, a long-long time ago I used InstallShield & Wix Toolset 
for Windows only.


I'll check those out. Thanks.


Re: Packaging and Distributing Dlang Applications with GtkD Dependency?

2019-09-25 Thread Ron Tarrant via Digitalmars-d-learn

On Wednesday, 25 September 2019 at 11:50:58 UTC, a11e99z wrote:
On Wednesday, 25 September 2019 at 11:46:04 UTC, Ron Tarrant 
wrote:

Hi y'all,

I've been Googling how to do this, but coming up with nothing 
definitive. Are there any articles for how to do this for:


Windows?
Linux?
other UNIX-alike OSs?


UPX?
https://en.wikipedia.org/wiki/UPX
https://linux.die.net/man/1/upx


Thanks for the reply, alle99z. Sorry for my badly-phrased 
question, I think I need to clarify...


What I'm looking for is a system for bundling dlang apps and 
their dependencies for distribution to end users. Hopefully, this 
bundler will:


- install the app in an appropriate place (like C:\Program 
Files\,
- install libraries/dependencies (such as GtkD) also in an 
appropriate place,
- make any modifications to the system PATH that may be necessary 
for the app to run, and
- handle any other roadblocks that will keep the user from using 
the app.


Whether this is an actual pre-existing application bundler or 
just a list of instructions I can follow so I can end up with a 
distributable one-click-does-it-all (on Windows, at least) 
package.


Similarly, on Linux or other UNIX-alikes, a breakdown of how to 
use apt or something similar to do the same so the user can (for 
instance) just do:


apt-get  

to install.


Packaging and Distributing Dlang Applications with GtkD Dependency?

2019-09-25 Thread Ron Tarrant via Digitalmars-d-learn

Hi y'all,

I've been Googling how to do this, but coming up with nothing 
definitive. Are there any articles for how to do this for:


Windows?
Linux?
other UNIX-alike OSs?



Blog Post #73: The Frame, Part II

2019-09-24 Thread Ron Tarrant via Digitalmars-d-learn
Today we cover how to decorate the Frame... or UN-decorate it. 
Frames can be turned off or dressed up with CSS. To find out 
more, follow this link: 
https://gtkdcoding.com/2019/09/24/0073-frame-part-ii.html


  1   2   3   4   >