Re: is there a way to output formatted text following the locale settings ?

2021-05-28 Thread someone via Digitalmars-d-learn

On Saturday, 29 May 2021 at 02:59:43 UTC, Paul Backus wrote:

D warns for format specifiers that do not conform to the C99 
standard, and the `'` flag character is not part of C99. GCC 
gives a similar warning with `-Wall -pedantic`:


Crystal clear !


Re: is there a way to output formatted text following the locale settings ?

2021-05-28 Thread Paul Backus via Digitalmars-d-learn

On Saturday, 29 May 2021 at 02:26:57 UTC, someone wrote:

```d
   core.stdc.stdio.printf("%'d", intAmount); /// Deprecation: 
format specifier `"%'"` is invalid ... but it works: 1,234,567 
as specified in my locale :)

```


D warns for format specifiers that do not conform to the C99 
standard, and the `'` flag character is not part of C99. GCC 
gives a similar warning with `-Wall -pedantic`:


```
$ gcc -Wall -pedantic -o example example.c
example.c: In function ‘main’:
example.c:5:9: warning: ISO C does not support the ''' printf 
flag [-Wformat=]

  printf("%'d\n", 123456789);
 ^~~
```


Re: is there a way to output formatted text following the locale settings ?

2021-05-28 Thread someone via Digitalmars-d-learn

On Wednesday, 26 May 2021 at 00:40:30 UTC, Paul Backus wrote:
In that case, you will want to use the C library functions from 
[`core.stdc.stdio`][1].


```d
import core.stdc.stdio;
import core.stdc.locale;

import std.stdio;

void main (

) {

   core.stdc.locale.setlocale(LC_ALL, "");

   int intAmount = 1234567;

   core.stdc.stdio.printf("%'d", intAmount); /// Deprecation: 
format specifier `"%'"` is invalid ... but it works: 1,234,567 as 
specified in my locale :)


}
```

But I can't use writeln() formatted with the ' character to get 
on what's defined on my locale.


PS: Previously I stated the backtick, I was wrong, the format 
specifier to get what's on the locale is the single quote, sorry 
for that.


Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread someone via Digitalmars-d-learn

On Thursday, 27 May 2021 at 17:04:07 UTC, Alain De Vos wrote:
Let's also not forget other languages have problems with 
gui-toolkits.
For instance, gtk-ada binding has memory leaks. gtk-crystal 
binding is broken.
I would like to see a binding to wxwidgets which is a very cool 
toolkit.


It seems to me the bindings are the symptoms and not the causes: 
the problem, to my humble opinion, is that for whatever reasons, 
we have a **lot** of toolkits trying to reinvent powder over and 
over. In Windows/Mac there's no problem since more-or-less they 
have standard controls, and anyone not using them is because they 
bypass them pursuing multi-platform support. In the nixes is more 
complicated since there were never standard/unified 
controls/guidelines. There are people who thinks diversity is a 
plus and there others stating standardization is the way forward. 
Like it or not, that is we have on the nixes.


Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread someone via Digitalmars-d-learn

On Saturday, 29 May 2021 at 00:57:51 UTC, Marcone wrote:

Win32Api. You can use resEdit to create your resource GUI. Work 
only for Windows. Here is my program created with Dlang and 
Win32Api GUI:   
https://sourceforge.net/projects/direct-http-tunnel/


Thanks a lot for your info :) !

I want you to know that I am replying to myself on the first post 
summarizing what I already learned researching the subject 
starting with the tips provided by you as well as anyone else 
that replied to my post. Please, if you want and have the time, 
check my last post and let me know anything I got wrong.


I do have a LOT of experience coding on the Windows platform, I 
have no less than 20 years at least, since Windows NT 1.0 
precisely, I do feel at ease with Win32 and COM. The problem 
right now is that, for whatever reasons, I stopped being coding 
Microsoft-centric solutions 5 or-so years ago. I am on archlinux 
right now and have a few boxes running freeBSD and/or 
DragonFlyBSD. I do not plan to go back to Microsoft. Obviously, I 
miss a lot of things; but mainly, SQL-Server, everything 
XML-related which is rock-solid on the Microsoft side, and last 
but not least, PowerShell, which I love by design but regret the 
way that was implemented, specially since the 2.0 release, it 
ended really bloated, but the concept, rocks.


I started to left ship with MicroSoft in the Vista ~ Windows 8 
time frame and left definitely on Windows 9/10. My last boxes 
still run Windows Server 2008 R2 with the newer versions of 
SQL-Server. Ballmer destroyed Microsoft as quality code. The 
userspace since Vista was terrible -and don't get me started on 
the Metro UI.


Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread zjh via Digitalmars-d-learn

On Saturday, 29 May 2021 at 00:52:10 UTC, someone wrote:

sciter, of course.  https://sciter.com/


I've also been looking for `good GUI`.
Now, I just find `WTL`. I don't like `QT`. It's too big.
I don't like `LGPL`. You can't link statically.
If you want to bind, I think `wxwidget` is good.
`Sciter's` problem is that it doesn't open source. Their 
binding(`wx/sciter`) is `out of date`.

There is also a `beamui`.



Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread zjh via Digitalmars-d-learn

maybe you can try nana.


nanapro,I just success compile.


Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread Marcone via Digitalmars-d-learn

On Friday, 28 May 2021 at 17:04:15 UTC, Vinod K Chandran wrote:

On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote:


I am learning D by writing a Windows only GUI library. It is 
taking too much time for me since, I am writing some stuff and 
then happen to learn some new things about it and re-writing 
it.Anyhow, so far so good. This is the code now.


```d
import winglib ;
import std.stdio : log = writeln;

void main() {   

auto frm = new Window() ;   
frm.text = "Learning D By Writing D";

// C = Control class. Window is derived from Control
// E = EventArgs.

	frm.onMouseHover = (c, e) => log("Mouse is now on ", e.x, ", 
", e.y);

frm.onMouseLeave = (c, e) => log("Mouse leaved from window") ; 
frm.onKeyDown =  (c, e) => log(e.keyCode, " key is pressed");
frm.create() ;

auto btn = new Button(frm) ;
btn.font.name = "Calibri" ;
btn.width = 150 ;
btn.text = "DMD Or LDC" ;
btn.font.size = 14 ;
btn.create() ;

frm.show() ;

}
```
I am slowly adding more features to this. Till now, Window & 
Button are completed.


Win32Api + Metaprogramming?


Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread someone via Digitalmars-d-learn

On Friday, 28 May 2021 at 01:44:24 UTC, zjh wrote:

maybe you can try nana.


nana ? can you elaborate please ?


Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread someone via Digitalmars-d-learn

On Thursday, 27 May 2021 at 16:49:41 UTC, Dejan Lekic wrote:


I humbly believe the most complete one is GtKD.

https://gtkdcoding.com/
https://gtkd.org

We all wish there was a STANDARD D GUI library out there, but 
that is a huge effort one or two individuals can't do by 
themselves (that is why all such efforts failed in the past)...


Thanks a lot for your info :) !

I want you to know that I am replying to myself on the first post 
summarizing what I already learned researching the subject 
starting with the tips provided by you as well as anyone else 
that replied to my post. Please, if you want and have the time, 
check my last post and let me know anything I got wrong.


As I stated in the original post and feel at ease with GTK+ 2.# 
and not so with the GTK+ 3.#. That's is why I choose MATE as my 
desktop environment which in reality is a stripped down version 
of MATE itself: the widget that rocks is the MATE panel, 
everything else is questionable, not to mention really bad 
software like Atril (the PDF viewer). I do run MATE on archlinux 
right now and built the package myself setting aside everything I 
do not want/use.


Do you know if GTKD will be kepping support for the 2.# branch, 
or, if they plan to deprecate it moving ahead ?


Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread Marcone via Digitalmars-d-learn

On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote:

Yes, I know this is a question lacking a straightforward answer.

Requirements:

[...]


Win32Api. You can use resEdit to create your resource GUI. Work 
only for Windows. Here is my program created with Dlang and 
Win32Api GUI:   
https://sourceforge.net/projects/direct-http-tunnel/


Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread someone via Digitalmars-d-learn

On Thursday, 27 May 2021 at 09:11:44 UTC, Виталий Фадеев wrote:


sciter, of course.  https://sciter.com/
Or write Dlang alternative.


Thanks a lot for your info :) !

I want you to know that I am replying to myself on the first post 
summarizing what I already learned researching the subject 
starting with the tips provided by you as well as anyone else 
that replied to my post. Please, if you want and have the time, 
check my last post and let me know anything I got wrong.


I need to research sciter a bit more: a first sight is not what I 
am looking for, it seems is has something like a browser 
rendering engine to apply what you define in a resource file, if 
so, I guess it will be very slow compared with any native and/or 
quasi-native toolkit. Give me more time and I'll keep you posted.


Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread someone via Digitalmars-d-learn

On Thursday, 27 May 2021 at 09:01:04 UTC, btiffin wrote:

libagar is a nice little framework.  But, it's C still (and 
Ada, Perl, COBOL), not D yet.  Will see how it goes.


Thanks a lot for your info :) !

I want you to know that I am replying to myself on the first post 
summarizing what I already learned researching the subject 
starting with the tips provided by you as well as anyone else 
that replied to my post. Please, if you want and have the time, 
check my last post and let me know anything I got wrong.




Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread someone via Digitalmars-d-learn

On Thursday, 27 May 2021 at 07:20:17 UTC, zjh wrote:


I have download FOX.and success compile.
I think it is very good.small and beauty.


Thanks a lot for your info :) !

I want you to know that I am replying to myself on the first post 
summarizing what I already learned researching the subject 
starting with the tips provided by you as well as anyone else 
that replied to my post. Please, if you want and have the time, 
check my last post and let me know anything I got wrong.




Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread someone via Digitalmars-d-learn

On Thursday, 27 May 2021 at 07:00:32 UTC, Imperatorn wrote:

I would like to recommend DlangUI [1], but we have tried now 
for months to get in contact with the owner of it (to take over 
development) and are getting no reponse.


Thanks a lot for your info :) !

I want you to know that I am replying to myself on the first post 
summarizing what I already learned researching the subject 
starting with the tips provided by you as well as anyone else 
that replied to my post. Please, if you want and have the time, 
check my last post and let me know anything I got wrong.


Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread someone via Digitalmars-d-learn

On Thursday, 27 May 2021 at 02:55:14 UTC, Adam D. Ruppe wrote:

http://arsdnet.net/minigui-linux.png
http://arsdnet.net/minigui-sprite.png


Thanks a lot for your info :) !

I want you to know that I am replying to myself on the first post 
summarizing what I already learned researching the subject 
starting with the tips provided by you as well as anyone else 
that replied to my post. Please, if you want and have the time, 
check my last post and let me know anything I got wrong.


Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread someone via Digitalmars-d-learn

On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote:

Any comments are welcomed, even any comments regarding anyone 
experience with GUI development within D, no matter whether the 
answer would be relevant to my specific question seeking a 
choice or not.


First and foremost, thanks everybody for your replies :) !

I didn't know some of the toolkits you advised me to try even 
existed.


There was a lot of info for me to digest before starting 
answering you on some of the specifics and/or personal experience 
with them, so, I did my homework and make the following summary 
(mainly relevant to my requirements) to organize my thoughts so I 
could make a roadmap to start selecting/discarding toolkits, and 
please, let me know anything I got wrong and/or point me to 
anything that is plainly wrong in the following summary:


- Microsoft 
[MFC](https://en.wikipedia.org/wiki/Microsoft_Foundation_Class_Library) is a Microsoft Visual C++ wrapper around the Windows API
- Microsoft [Windows 
Forms](https://en.wikipedia.org/wiki/Windows_Forms) for the net 
framework (not a Windows API wrapper)
- Microsoft 
[WPL](https://en.wikipedia.org/wiki/Windows_Presentation_Foundation) (aka Windows Presentation Foundation) for the net framework 3.0 using XAML or any CLR language
- Microsoft [WinUI # 
1](https://docs.microsoft.com/windows/apps/winui/)
- Microsoft [WinUI # 
2](https://docs.microsoft.com/windows/apps/winui/winui2/release-notes/) for UWP XAML apps
- Microsoft [WinUI # 
3](https://docs.microsoft.com/windows/apps/winui/winui3/release-notes/) for UWP XAML / Win32 apps (aka Project Reunion)


- Gnome [GNUstep](https://en.wikipedia.org/wiki/GNUstep) for 
Objective-C
- Apple [Cocoa](https://en.wikipedia.org/wiki/Cocoa_(API)) for 
Objective-C


- [MOTIF](https://en.wikipedia.org/wiki/Motif_(software)) for C 
is a legacy UNIX toolkit
- [libagar](http://libagar.org/) (aka agar) for 
(industry-standard ANSI X3.159-1989) C: 
[documentation](http://libagar.org/docs) for 
[1.6.0](http://libagar.org/mdoc.cgi?man=AG_Intro.3), 
[screenshots](http://libagar.org/screenshots.html)

   - supports texture and GPU acceleration wherever available
   - supports linux/freeBSD/dragonFlyBSD (at least)

- [Fox](http://www.fox-toolkit.org/home.html) for C++: 
[overview](http://www.fox-toolkit.org/goals.html), plain 
[documentation](http://www.fox-toolkit.org/doc.html), 
[FAQ](http://www.fox-toolkit.org/faq.html), and 
[screenshots](http://www.fox-toolkit.org/screenshots.html)
   - relies only on core system facilities and **does not wrap** 
native GUI libraries or toolkits

   - supports linux/freeBSD (at least)
   - used by the xfe file manager app

- [wxWidgets](https://en.wikipedia.org/wiki/WxWidgets) (former 
wxWindows) for C++: 
[overview](https://docs.wxwidgets.org/3.0/page_introduction.html), excellent plain [documentation](https://docs.wxwidgets.org/3.0/), [tutorials](https://docs.wxwidgets.org/3.0/page_topics.html); eg: [hello world app](https://docs.wxwidgets.org/3.0/overview_helloworld.html)

   - supports native platform controls wherever possible
   - supports UniCode: 
(https://docs.wxwidgets.org/3.0/overview_unicode.html)overview

   - wxMSW is the native port for Microsoft Windows
   - wxGTK2 port supporting GTK+ 2.# ≥ 2.6
   - wxGTK3 port supporting GTK+ 3.#
   - first-impressions: fully-alive

- 
[arsd](http://dpldocs.info/experimental-docs/arsd.html#desktop-gui): [simpledisplay](http://dpldocs.info/experimental-docs/arsd.simpledisplay.html) → [minigui](http://dpldocs.info/experimental-docs/arsd.minigui.html) for D: plain documentation
   - simpleDisplay provides basic cross-platform GUI-related 
functionality: creating windows, drawing on them, working with 
the clipboard, timers, openGL, and more; but, **does not 
provide** high-level GUI widgets
   - simpleDisplay does not have any dependencies outside the OS 
and color.d
   - simpleDisplay should support UniCode and i18n 
internationalization since its written in D to begin with (my 
assumption)
   - miniGUI primary goal is to be useful without being large and 
complicated (like GTK and/or QT) and it isn't hugely concerned 
with appearance
   - miniGUI keeps it simple on linux: some controls can be 
customized with CSS-inspired Widget.Style classes

   - miniGUI supports the native controls/themes on Windows
   - miniGUI supports creating widget trees at runtime from XML 
with arsd.minigui_xml
   - miniGUI requirements are arsd.simpledisplay and arsd.color 
dependencies on which it is built: nothing more
   - miniGUI had mostly additive changes or bug fixes since its 
inception until 05-2021
   - miniGUI should support UniCode and i18n internationalization 
since its written in D to begin with (my assumption)


- [dlangUI](https://github.com/buggins/dlangui) for D: 
[documentation](http://buggins.github.io/dlangui/ddox/), 
[tutorials](https://github.com/buggins/dlangui/wiki), and 
[screenshots](http://buggins.github.io/dlangui/screenshots.html)
   - it is a major-r

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread Vinod K Chandran via Digitalmars-d-learn

On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote:


I am learning D by writing a Windows only GUI library. It is 
taking too much time for me since, I am writing some stuff and 
then happen to learn some new things about it and re-writing 
it.Anyhow, so far so good. This is the code now.


```d
import winglib ;
import std.stdio : log = writeln;

void main() {   

auto frm = new Window() ;   
frm.text = "Learning D By Writing D";

// C = Control class. Window is derived from Control
// E = EventArgs.

	frm.onMouseHover = (c, e) => log("Mouse is now on ", e.x, ", ", 
e.y);

frm.onMouseLeave = (c, e) => log("Mouse leaved from window") ; 
frm.onKeyDown =  (c, e) => log(e.keyCode, " key is pressed");
frm.create() ;

auto btn = new Button(frm) ;
btn.font.name = "Calibri" ;
btn.width = 150 ;
btn.text = "DMD Or LDC" ;
btn.font.size = 14 ;
btn.create() ;

frm.show() ;

}
```
I am slowly adding more features to this. Till now, Window & 
Button are completed.







Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread Imperatorn via Digitalmars-d-learn

On Thursday, 27 May 2021 at 18:57:32 UTC, Alain De Vos wrote:

I think dlangui is a dead monkey.


Nah, it's ok