On Saturday, 22 May 2021 at 03:14:35 UTC, cc wrote:
Oops, disregard this. I had an error in my imports.😓
It does in fact work in @safe.
I should add as an aside then that there is an issue of errors
from the body of a toString template not being displayed, and
instead the template being sile
On Saturday, 22 May 2021 at 03:07:10 UTC, cc wrote:
Ahh, in that case it would appear formattedWrite isn't @safe at
all. Looks like you have to stick with put()?
```d
@safe void toString(W)(ref W writer) if (isOutputRange!(W,
char)) {
//writer.formattedWrite!("FOO:%s", x); // fails
On Friday, 21 May 2021 at 16:53:48 UTC, drug wrote:
21.05.2021 18:28, cc пишет:
On Friday, 21 May 2021 at 14:19:03 UTC, newbie wrote:
Thank you, and formatValue?
formattedWrite should handle this.
```d
@safe struct Foo {
int x = 3;
void toString(W)(ref W writer) if (isOutputRange!(
On Friday, 21 May 2021 at 22:37:34 UTC, Alain De Vos wrote:
Next code format a string and prints it.
But I want the formatted string stored in a string
```
//Decimal place separator %,
writefln!"%,s"(123456789);
//123,456,789
```
std.format.format
Next code format a string and prints it.
But I want the formatted string stored in a string
```
//Decimal place separator %,
writefln!"%,s"(123456789);
//123,456,789
```
On 21-05-2021 12:35, Alain De Vos wrote:
What is the advised function to use instead of
gtk.Widget.Widget.addOnDraw ?
```
this()
   { addOnDraw(&drawCallback);}
```
Change the `Context` passed to the drawCallback to a `Scoped!Context`
only the non scoped overload is deprecated.
```
bo
On Friday, 21 May 2021 at 14:19:03 UTC, newbie wrote:
Thank you, and formatValue?
formattedWrite should handle this.
```d
@safe struct Foo {
int x = 3;
void toString(W)(ref W writer) if (isOutputRange!(W, char)) {
writer.formattedWrite("Foo(%s)", x);
}
}
On Friday, 21 May 2021 at 13:59:13 UTC, drug wrote:
21.05.2021 16:45, newbie пишет:
I am following
https://wiki.dlang.org/Defining_custom_print_format_specifiers, why sink and formatValue are not @safe? What are the best practice for toString in safe code? Thank you
sink is obsolete now, use W
21.05.2021 16:45, newbie пишет:
I am following
https://wiki.dlang.org/Defining_custom_print_format_specifiers, why sink
and formatValue are not @safe? What are the best practice for toString
in safe code? Thank you
sink is obsolete now, use W(riter)
```D
import std.range : isOutputRange;
vo
I am following
https://wiki.dlang.org/Defining_custom_print_format_specifiers,
why sink and formatValue are not @safe? What are the best
practice for toString in safe code? Thank you
I found something,
https://api.gtkd.org/gdk.Event.Event.getCoords.html
21.05.2021 15:39, Alain De Vos пишет:
I'll have a look at that website.
With this code I capture the mouse press event
```
this()
{
addEvents(GdkEventMask.BUTTON_PRESS_MASK);
addOnDraw(&drawCallback);
addOnButtonPress(&onButtonPress);
}
```
```
public bool onButtonPress(Event event, Widget wid
I'll have a look at that website.
With this code I capture the mouse press event
```
this()
{
addEvents(GdkEventMask.BUTTON_PRESS_MASK);
addOnDraw(&drawCallback);
addOnButtonPress(&onButtonPress);
}
```
```
public bool onButtonPress(Event event, Widget widget)
{
writeln("Button pressed");
retur
On Friday, 21 May 2021 at 12:28:36 UTC, Alain De Vos wrote:
On a gtkd drawingarea I want to capture the mouse-pressed event
and get the coordinates of the pointer on the area.
I have
```
addEvents(GdkEventMask.BUTTON_PRESS_MASK);
```
Maybe I must add a signal-handler ?
Not a gtk user, but mayb
On a gtkd drawingarea I want to capture the mouse-pressed event
and get the coordinates of the pointer on the area.
I have
```
addEvents(GdkEventMask.BUTTON_PRESS_MASK);
```
Maybe I must add a signal-handler ?
What is the advised function to use instead of
gtk.Widget.Widget.addOnDraw ?
```
this()
{ addOnDraw(&drawCallback);}
```
16 matches
Mail list logo