Re: UI Library

2022-06-16 Thread harakim via Digitalmars-d-learn

On Saturday, 11 June 2022 at 21:50:47 UTC, Adam D Ruppe wrote:

On Saturday, 11 June 2022 at 01:20:17 UTC, harakim wrote:
The issue I'm having is that I don't understand how to assign 
bounds in the nested widget. I'm sure there's a very clean 
solution. I basically want a paintContent method but with the 
bounds dynamically assigned by the parent.


Well the bounds given to paintContent just define your content 
area boundaries, relative to the nested widget. The content 
area is inside its own border. The actual position is assigned 
by the parent (the virtual function there is 
recomputeChildLayout, you can override that to arrange instead 
of letting it automatically fill the space).


The recomputeChildLayout method is the answer I was looking for.


You describe copying the paint method into the paint content 
method. I did the exact opposite and copied from the paintContent 
method to the paint method and it worked. I am getting pretty 
comfortable with using simple display, but I will probably look 
to minigui in the future. This application is just for me to use 
so I don't need interactive buttons and so forth.


Thanks for making these libraries available. I'm also using your 
sqllite and http2 modules so far. :)


Re: UI Library

2022-06-11 Thread Adam D Ruppe via Digitalmars-d-learn

On Saturday, 11 June 2022 at 21:44:17 UTC, harakim wrote:
I tried the solution I suggested and it did not work because 
the child would occlude the parent (which is in the comments 
now that I see it.)


yeah minigui's model is to tile the widgets; they aren't supposed 
to overlap (except their parent, but then they cover the parent)


I decided to stick to simpledisplay strictly and forgo using 
the minigui library for the time being, and that is working 
well.


Yeah, nested widgets are something i sometimes use btu more often 
then not, i'll make the whole display for a thing - say a graph - 
just be a single widget and paint it in there.


A simpledisplay window's paint code can generally be pasted into 
a single minigui widget's paint code without much modification 
(the minigui WidgetPainter actually is a subclass of 
simpledisplay's ScreenPainter)


Re: UI Library

2022-06-11 Thread Adam D Ruppe via Digitalmars-d-learn

On Saturday, 11 June 2022 at 01:20:17 UTC, harakim wrote:
The issue I'm having is that I don't understand how to assign 
bounds in the nested widget. I'm sure there's a very clean 
solution. I basically want a paintContent method but with the 
bounds dynamically assigned by the parent.


Well the bounds given to paintContent just define your content 
area boundaries, relative to the nested widget. The content area 
is inside its own border. The actual position is assigned by the 
parent (the virtual function there is recomputeChildLayout, you 
can override that to arrange instead of letting it automatically 
fill the space).




I don't really know what exactly you have in mind for the bounds, 
but anything outside your widget area is going to be clipped 
anyway, so I think you really want to change that child layout 
computation.





Re: UI Library

2022-06-11 Thread harakim via Digitalmars-d-learn

On Saturday, 11 June 2022 at 01:20:17 UTC, harakim wrote:

On Friday, 20 May 2022 at 12:07:46 UTC, Adam D Ruppe wrote:

On Friday, 20 May 2022 at 03:47:14 UTC, harakim wrote:

Thank you. I will definitely give that a try.
But just ask me if something comes up since I can push fixes 
to master p quickly.
If there is a more elegant solution, then I will use it. 
Otherwise, this solution will work fine with some comments.


I tried the solution I suggested and it did not work because the 
child would occlude the parent (which is in the comments now that 
I see it.)
I decided to stick to simpledisplay strictly and forgo using the 
minigui library for the time being, and that is working well.


Re: UI Library

2022-06-10 Thread Marcone via Digitalmars-d-learn

On Friday, 20 May 2022 at 02:37:48 UTC, harakim wrote:
I need to write a piece of software to track and categorize 
some purchases. It's the kind of thing I could probably write 
in a couple of hours in C#/Java + html/css/javascript. However, 
something keeps drawing me to D and as this is a simple 
application, it would be a good one to get back in after almost 
a year hiatus.


[...]


Qt Creator + Dlang: https://youtu.be/TFN5P4eoS_o


Re: UI Library

2022-06-10 Thread Marcone via Digitalmars-d-learn

On Friday, 20 May 2022 at 02:37:48 UTC, harakim wrote:
I need to write a piece of software to track and categorize 
some purchases. It's the kind of thing I could probably write 
in a couple of hours in C#/Java + html/css/javascript. However, 
something keeps drawing me to D and as this is a simple 
application, it would be a good one to get back in after almost 
a year hiatus.


[...]


QtE5
https://github.com/MGWL/QtE5


Re: UI Library

2022-06-10 Thread harakim via Digitalmars-d-learn

On Friday, 20 May 2022 at 12:07:46 UTC, Adam D Ruppe wrote:

On Friday, 20 May 2022 at 03:47:14 UTC, harakim wrote:

Thank you. I will definitely give that a try.
But just ask me if something comes up since I can push fixes to 
master p quickly.


I have been using the minigui library and it's working well for 
me. Thank you for creating it. I decided to throw together a bar 
chart, but it has been was more complicated than I gave it credit 
for. I am breaking it up into multiple nested widgets.


The issue I'm having is that I don't understand how to assign 
bounds in the nested widget. I'm sure there's a very clean 
solution. I basically want a paintContent method but with the 
bounds dynamically assigned by the parent. My thought is:

1. Create a setBounds on the child
2. Call setBounds on the child from inside paintContent of the 
parent
3. Instead of using paintContent in the child, use paint and use 
the bounds specified there


but that seems kind of off because I pass the bounds from parent 
to child separate from having the bounds in the child and it is 
not intuitive that the bounds would always be set by the parent 
before the child is painted. If there is a more elegant solution, 
then I will use it. Otherwise, this solution will work fine with 
some comments.


Re: UI Library

2022-05-28 Thread Sergey via Digitalmars-d-learn

On Saturday, 28 May 2022 at 02:39:41 UTC, Jack wrote:

On Friday, 20 May 2022 at 12:32:37 UTC, ryuukk_ wrote:
Avoid GTK, it's bloated, GTK4 looks like a toolkit to design 
mobile apps, and you need runtime dependencies on windows


adam's gui library is very nice, 0 dependencies

I personally prefer IMGUI, 0 dependencies, you bring the



could you send me please the link for this lib?

windowing library of your choice, i pick GLFW since it's 
minimal


IMGUI is fully capable, someone made a Spotify client with it!

https://user-images.githubusercontent.com/3907907/81094458-d20d9200-8f03-11ea-81e0-e72c0063b3a7.png


There are several bindings.
https://code.dlang.org/search?q=Imgui


Re: UI Library

2022-05-27 Thread Jack via Digitalmars-d-learn

On Friday, 20 May 2022 at 12:32:37 UTC, ryuukk_ wrote:
Avoid GTK, it's bloated, GTK4 looks like a toolkit to design 
mobile apps, and you need runtime dependencies on windows


adam's gui library is very nice, 0 dependencies

I personally prefer IMGUI, 0 dependencies, you bring the



could you send me please the link for this lib?


windowing library of your choice, i pick GLFW since it's minimal

IMGUI is fully capable, someone made a Spotify client with it!

https://user-images.githubusercontent.com/3907907/81094458-d20d9200-8f03-11ea-81e0-e72c0063b3a7.png




Re: UI Library

2022-05-21 Thread harakim via Digitalmars-d-learn

On Friday, 20 May 2022 at 08:03:10 UTC, drug wrote:
You can select category in dub (code.dlang.org) to get 
something like this:

https://code.dlang.org/?sort=updated=20=library.gui


Thanks. I'm still kind of new to dub so I didn't know this 
existed!
I'm glad there are multiple options that look like they'd do the 
job.


Re: UI Library

2022-05-21 Thread harakim via Digitalmars-d-learn

On Friday, 20 May 2022 at 12:07:46 UTC, Adam D Ruppe wrote:
The docs don't have a lot of examples but hopefully one you do 
the first one the rest won't be too hard, the classes are 
relatively simple and the events are based on javascript so if 
you've used that before you can probably get to know it.


But just ask me if something comes up since I can push fixes to 
master p quickly.


Your libraries and code samples have always been really simple to 
understand. I'll let you know if I find anything that doesn't 
make sense.


On Friday, 20 May 2022 at 12:07:46 UTC, Adam D Ruppe wrote:
My minigui uses the normal Windows controls so it works well 
there. On linux it uses a custom thing of my own design so your 
mileage may vary.


I will probably use this exclusively on Windows for a long time to
come, so I can cross that bridge when I get there.




Re: UI Library

2022-05-20 Thread ryuukk_ via Digitalmars-d-learn
Avoid GTK, it's bloated, GTK4 looks like a toolkit to design 
mobile apps, and you need runtime dependencies on windows


adam's gui library is very nice, 0 dependencies

I personally prefer IMGUI, 0 dependencies, you bring the 
windowing library of your choice, i pick GLFW since it's minimal


IMGUI is fully capable, someone made a Spotify client with it!

https://user-images.githubusercontent.com/3907907/81094458-d20d9200-8f03-11ea-81e0-e72c0063b3a7.png


Re: UI Library

2022-05-20 Thread Adam D Ruppe via Digitalmars-d-learn

On Friday, 20 May 2022 at 03:47:14 UTC, harakim wrote:

Thank you. I will definitely give that a try.


My minigui uses the normal Windows controls so it works well 
there. On linux it uses a custom thing of my own design so your 
mileage may vary.


The docs don't have a lot of examples but hopefully one you do 
the first one the rest won't be too hard, the classes are 
relatively simple and the events are based on javascript so if 
you've used that before you can probably get to know it.


But just ask me if something comes up since I can push fixes to 
master p quickly.


The only files it needs from the repo are `minigui.d`, 
`simpledisplay.d` and `color.d`. There's other optional things in 
there that might be useful though. My recommended way to use it 
is to `git clone` the repo in your source dir then `dmd -i 
yourfile.d` so it is easy to update with a `git pull` and the 
compiler pulls what it needs (and nothing more) automatically 
when compiling.


But you can also do it yourself or use the dub packages etc.


Re: UI Library

2022-05-20 Thread Mike Parker via Digitalmars-d-learn

On Friday, 20 May 2022 at 07:05:21 UTC, Tejas wrote:


Maybe gtkd?
https://code.dlang.org/packages/gtk-d


And some corresponding tutorials:

https://gtkdcoding.com/


Re: UI Library

2022-05-20 Thread zjh via Digitalmars-d-learn

On Friday, 20 May 2022 at 02:37:48 UTC, harakim wrote:




`winrt` may be good.
but `winrtd` has many bugs.


Re: UI Library

2022-05-20 Thread Tejas via Digitalmars-d-learn

On Friday, 20 May 2022 at 02:37:48 UTC, harakim wrote:
I need to write a piece of software to track and categorize 
some purchases. It's the kind of thing I could probably write 
in a couple of hours in C#/Java + html/css/javascript. However, 
something keeps drawing me to D and as this is a simple 
application, it would be a good one to get back in after almost 
a year hiatus.


[...]


Maybe gtkd?
https://code.dlang.org/packages/gtk-d


Re: UI Library

2022-05-19 Thread harakim via Digitalmars-d-learn

On Friday, 20 May 2022 at 02:53:39 UTC, Craig Dillabaugh wrote:

On Friday, 20 May 2022 at 02:37:48 UTC, harakim wrote:
I need to write a piece of software to track and categorize 
some purchases. It's the kind of thing I could probably write 
in a couple of hours in C#/Java + html/css/javascript. 
However, something keeps drawing me to D and as this is a 
simple application, it would be a good one to get back in 
after almost a year hiatus.


[...]


Maybe you can use minigui from arsd

https://github.com/adamdruppe/arsd


Thank you. I will definitely give that a try.


Re: UI Library

2022-05-19 Thread Craig Dillabaugh via Digitalmars-d-learn

On Friday, 20 May 2022 at 02:37:48 UTC, harakim wrote:
I need to write a piece of software to track and categorize 
some purchases. It's the kind of thing I could probably write 
in a couple of hours in C#/Java + html/css/javascript. However, 
something keeps drawing me to D and as this is a simple 
application, it would be a good one to get back in after almost 
a year hiatus.


[...]


Maybe you can use minigui from arsd

https://github.com/adamdruppe/arsd