Re: Fix gtkD api display

2017-08-04 Thread Johnson Jones via Digitalmars-d-learn
On Friday, 4 August 2017 at 23:14:38 UTC, Adam D. Ruppe wrote: On Friday, 4 August 2017 at 21:53:14 UTC, Johnson Jones wrote: When I click on gtk on the link you gave it gives basically an empty page(a single module). Yeah, there is no overview page in the source code... but I can make it cre

Re: Fix gtkD api display

2017-08-04 Thread Gerald via Digitalmars-d-learn
On Friday, 4 August 2017 at 21:54:26 UTC, Johnson Jones wrote: On Friday, 4 August 2017 at 15:24:51 UTC, Gerald wrote: On Friday, 4 August 2017 at 15:08:27 UTC, Mike Wey wrote: [...] Mike I had contributed the makeddox.sh script awhile ago, it generates much nicer documentation then candydoc

Re: Fix gtkD api display

2017-08-04 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 4 August 2017 at 21:53:14 UTC, Johnson Jones wrote: When I click on gtk on the link you gave it gives basically an empty page(a single module). Yeah, there is no overview page in the source code... but I can make it create one automatically. http://dpldocs.info/experimental-docs

Re: Fix gtkD api display

2017-08-04 Thread Johnson Jones via Digitalmars-d-learn
On Friday, 4 August 2017 at 15:24:51 UTC, Gerald wrote: On Friday, 4 August 2017 at 15:08:27 UTC, Mike Wey wrote: Improving the documentation is something i want to do but there are always some more important things to do. Like the Questions/Issues you posted earlier. So unless somebody volun

Re: Fix gtkD api display

2017-08-04 Thread Johnson Jones via Digitalmars-d-learn
On Friday, 4 August 2017 at 13:59:11 UTC, Adam D. Ruppe wrote: On Friday, 4 August 2017 at 02:08:31 UTC, Johnson Jones wrote: https://api.gtkd.org/gtkd/gtk/ApplicationWindow.html So I ran gtkd through my doc generator too http://dpldocs.info/experimental-docs/gtk.ApplicationWindow.Application

Re: Size of D bool vs size of C++ bool

2017-08-04 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/4/17 4:16 PM, Jeremy DeHaan wrote: I'm trying to do some binding code, and I know that C++ bool isn't defined to be a specific size like D's bool. That said, can I assume that the two are the same size on the most platforms? I shudder to think that D may work with a platform that doesn't

Size of D bool vs size of C++ bool

2017-08-04 Thread Jeremy DeHaan via Digitalmars-d-learn
I'm trying to do some binding code, and I know that C++ bool isn't defined to be a specific size like D's bool. That said, can I assume that the two are the same size on the most platforms? The only platforms I'm really interested in are Windows, Linux, OSX, iOS, FreeBSD, Android. The only thi

Re: OT: What causes the Segfault in the following?

2017-08-04 Thread Kagamin via Digitalmars-d-learn
On Friday, 4 August 2017 at 02:38:10 UTC, Andrew Edwards wrote: OK, I was is indeed the problem. I was thinking for some reason that s gets initialized inside nk_color_hex_rgb() Usually C functions don't allocate memory. And when they do, they do it in unique ways, which is a PITA, that's why

Re: BigInt foreach loop

2017-08-04 Thread Stefan Koch via Digitalmars-d-learn
On Friday, 4 August 2017 at 13:09:55 UTC, Steven Schveighoffer wrote: Any foreach range statement like this: foreach(var; A .. B) is treated as if you wrote: for(auto var = A; var < B; ++var) So it's pretty much exactly like what you wrote, just the initializer is different but the result

Re: Fix gtkD api display

2017-08-04 Thread Gerald via Digitalmars-d-learn
On Friday, 4 August 2017 at 15:08:27 UTC, Mike Wey wrote: Improving the documentation is something i want to do but there are always some more important things to do. Like the Questions/Issues you posted earlier. So unless somebody volunteers it won't happen anytime soon. Mike I had contribu

Re: Fix gtkD api display

2017-08-04 Thread Mike Wey via Digitalmars-d-learn
On 04-08-17 03:51, Johnson Jones wrote: https://api.gtkd.org It is difficult to navigate. 1. clicking the documentation on the main site takes it to the gtk.AboutDialog api. That is all it shows, I was confused at first, as I'm sure most people would be. 2. The packages list lists all the p

Re: Issue with template constraints in numeric types

2017-08-04 Thread jmh530 via Digitalmars-d-learn
On Thursday, 3 August 2017 at 12:49:48 UTC, data pulverizer wrote: Hmm ... it looks as the specialization `:` operator is working like the constraint `:` operator and doing convertible at least for the floating point case. Is that right? They're both doing the same thing as far as I know.

Re: Fix gtkD api display

2017-08-04 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 4 August 2017 at 02:08:31 UTC, Johnson Jones wrote: https://api.gtkd.org/gtkd/gtk/ApplicationWindow.html So I ran gtkd through my doc generator too http://dpldocs.info/experimental-docs/gtk.ApplicationWindow.ApplicationWindow.html and I didn't make a top-level package file either..

Re: BigInt foreach loop

2017-08-04 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/4/17 8:49 AM, Q. Schroll wrote: One can do BigInt n = returnsBigInt(); foreach (i; BigInt(0) .. n) { .. } How is this implemented? The code for BigInt is very large and I didn't find it. And is it more efficient than for (BigInt i = 0; i < n; ++i) { .. } Any foreach range

Re: BigInt foreach loop

2017-08-04 Thread Stefan Koch via Digitalmars-d-learn
On Friday, 4 August 2017 at 12:49:30 UTC, Q. Schroll wrote: One can do BigInt n = returnsBigInt(); foreach (i; BigInt(0) .. n) { .. } How is this implemented? The code for BigInt is very large and I didn't find it. And is it more efficient than for (BigInt i = 0; i < n; ++i) { .. } as

BigInt foreach loop

2017-08-04 Thread Q. Schroll via Digitalmars-d-learn
One can do BigInt n = returnsBigInt(); foreach (i; BigInt(0) .. n) { .. } How is this implemented? The code for BigInt is very large and I didn't find it. And is it more efficient than for (BigInt i = 0; i < n; ++i) { .. } as incrementing is a costly operation?

Re: How a class can know the current reference of itself?

2017-08-04 Thread Pippo via Digitalmars-d-learn
On Friday, 4 August 2017 at 09:58:34 UTC, Mike Parker wrote: Your first error is actually this line: callToMyFunction(ref this); You can't use ref in a function call, only in function declarations. But once that's fixed, you've got other errors in the code you've posted -- you've declared ma

Re: How a class can know the current reference of itself?

2017-08-04 Thread Mike Parker via Digitalmars-d-learn
On Friday, 4 August 2017 at 09:58:34 UTC, Mike Parker wrote: Also, class references are *already* references, so you don't need to declare the function parameters as ref. Finally, although this is not an error, @property has no effect on member variables. It only applies to member functions. A

Re: How a class can know the current reference of itself?

2017-08-04 Thread Mike Parker via Digitalmars-d-learn
On Friday, 4 August 2017 at 09:38:59 UTC, Pippo wrote: I'm trying to do something like this: module mylib.classA; class A { @property string myproperty; void function(ref A a) callToMyFunction; void myfunction() { callToMyFunction(ref this); } } module

How a class can know the current reference of itself?

2017-08-04 Thread Pippo via Digitalmars-d-learn
I'm trying to do something like this: module mylib.classA; class A { @property string myproperty; void function(ref A a) callToMyFunction; void myfunction() { callToMyFunction(ref this); } } module myapp; import mylib.classA; int main() { A a = new A

Re: gtkD load images

2017-08-04 Thread Johnson Jones via Digitalmars-d-learn
On Friday, 4 August 2017 at 06:58:00 UTC, Antonio Corbi wrote: On Thursday, 3 August 2017 at 21:06:36 UTC, Johnson Jones wrote: [...] Hi! I load images using Gtk like this (I use gtk under gnu/linux): [...] Thanks! I'm sure it will if it works ;)

Re: gtkD load images

2017-08-04 Thread Antonio Corbi via Digitalmars-d-learn
On Thursday, 3 August 2017 at 21:06:36 UTC, Johnson Jones wrote: On Thursday, 3 August 2017 at 13:12:03 UTC, Mengu wrote: On Thursday, 3 August 2017 at 03:59:40 UTC, Johnson Jones wrote: How can be use gtkD to load images, I assume through gdkpixbuf? While I am getting errors loading images thr