Jump to page: 1 2
Thread overview
arsd-minigui - couple of questions
Mar 28, 2022
sai
Mar 28, 2022
sai
Mar 28, 2022
Adam Ruppe
Mar 28, 2022
Adam Ruppe
Mar 28, 2022
Sai
Mar 28, 2022
Adam Ruppe
Mar 28, 2022
Adam Ruppe
Mar 28, 2022
Adam Ruppe
Mar 29, 2022
sai
Mar 29, 2022
sai
Mar 29, 2022
sai
Mar 29, 2022
sai
Mar 29, 2022
Adam D Ruppe
Mar 29, 2022
sai
Apr 11, 2022
sai
Apr 11, 2022
Adam D Ruppe
Apr 11, 2022
sai
Mar 29, 2022
Adam D Ruppe
March 28, 2022
  1. I assume arsd-minigui library does not support transparent images by itself, does it? I am trying to show a png image with transparent areas on a button, but those transparent areas shows as black color.

  2. I want to show both image and text on a button, but looks like it shows image or text, but not both at the same time. Or am I missing some weird windows manifest stuff?

I am using latest arsd library on windows 10.

Thanks

March 28, 2022

On Monday, 28 March 2022 at 17:00:42 UTC, sai wrote:

>
  1. I assume arsd-minigui library does not support transparent images by itself, does it? I am trying to show a png image with transparent areas on a button, but those transparent areas shows as black color.

  2. I want to show both image and text on a button, but looks like it shows image or text, but not both at the same time. Or am I missing some weird windows manifest stuff?

I am using latest arsd library on windows 10.

Thanks

BTW, the code is very simple:

import arsd.minigui;

void main() {
	auto window = new Window();
	auto headBut = new Button(ImageLabel("Button name", MemoryImage.fromImage("file.png")), window);
	window.loop();
}
March 28, 2022

On Monday, 28 March 2022 at 17:00:42 UTC, sai wrote:

>
  1. I assume arsd-minigui library does not support transparent images by itself, does it? I am trying to show a png image with transparent areas on a button, but those transparent areas shows as black color.

I added that to simpledisplay last year, but never forwarded the flag to minigui since it didn't seem important.... should be easy enough to add, I'll take a look.

>
  1. I want to show both image and text on a button, but looks like it shows image or text, but not both at the same time. Or am I missing some weird windows manifest stuff?

Yeah, it is one or the other right now. I don't think the standard Windows control supports that without owner draw, which is something I've generally tried to avoid (but it isn't that hard to do at least in some cases...).

March 28, 2022

On Monday, 28 March 2022 at 17:00:42 UTC, sai wrote:

>
  1. I assume arsd-minigui library does not support transparent images by itself, does it? I am trying to show a png image with transparent areas on a button, but those transparent areas shows as black color.

Well, I tried forwarding the flag, I can custom draw it this way but the standard Windows button's normal draw doesn't appear to care...

There might be a trick I just don't know, but the problem is I don't know it lol.

March 28, 2022

On Monday, 28 March 2022 at 18:03:32 UTC, Adam Ruppe wrote:

>

On Monday, 28 March 2022 at 17:00:42 UTC, sai wrote:

>
  1. I assume arsd-minigui library does not support transparent images by itself, does it? I am trying to show a png image with transparent areas on a button, but those transparent areas shows as black color.

Well, I tried forwarding the flag, I can custom draw it this way but the standard Windows button's normal draw doesn't appear to care...

There might be a trick I just don't know, but the problem is I don't know it lol.

Thanks for the reply and the help.

FWIW, DWT which uses native controls on windows can show transparent pngs and also both image & text at the same time. However I had to add the following app.exe.manifest file in the same folder as the app.exe file. Otherwise it only shows text or image but not both. Not sure if this helps, but just want to let you know. Honestly I have no idea how this works under the hood.

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity
      version="1.0.0.0"
      processorArchitecture="X86"
      name="-"
      type="win32"
      />
  <description></description>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity
          type="win32"
          name="Microsoft.Windows.Common-Controls"
          version="6.0.0.0"
          processorArchitecture="*"
          publicKeyToken="6595b64144ccf1df"
          language="*"
          />
    </dependentAssembly>
  </dependency>
</assembly>
March 28, 2022

On Monday, 28 March 2022 at 21:10:47 UTC, Sai wrote:

>

FWIW, DWT which uses native controls on windows can show transparent pngs and also both image & text at the same time. However I had to add the following app.exe.manifest

Yeah, this tells me they used owner-drawn buttons, which is only supported if you use version 6 controls. The version 6 controls are nice btw even if you don't use this specific feature, they also come with automatic theme support and a few other nice things. I actually recommend in the docs that you use this for simpledisplay/minigui applications too, just then you also need to provide a draw method to do the text+image.

It isn't hard to do, about a dozen lines for this basic case that you can just opt into and use the default draw for other cases.

I was thinking about adding one of those anyway (another nice thing you can do is change the background color), I just haven't gotten around to it yet. Maybe I'll do it tomorrow.

Keep an eye on this thread, if I do, I'll let you know.

March 28, 2022

oooh it actually is even easier than I thought, just a changed flag plus the manifest.

Just pushed to minigui master. only ended up being 4 lines for this little thing.

Try rebuilding with that AND be sure to use the manifest file too, same as dwt. Then you should be able to find some joy.

March 28, 2022

In fact, using a pragma now, I think I got it so you don't even need the manifest now (the pragma includes a default one now).

Only works when doing dmd -m32mscoff or dmd -m64 builds (which are also what dub uses fyi), will NOT work with a default dmd no-switch build.

March 29, 2022

On Monday, 28 March 2022 at 23:03:01 UTC, Adam Ruppe wrote:

>

In fact, using a pragma now, I think I got it so you don't even need the manifest now (the pragma includes a default one now).

Only works when doing dmd -m32mscoff or dmd -m64 builds (which are also what dub uses fyi), will NOT work with a default dmd no-switch build.

I just cloned the latest arsd lib from github today and compiled the example. Got an error. Switched on verbose flag for dub and here is the output:

(Lines below until the error is just one giant line, I split them here for clarity)

C:\dlang\dmd2\windows\bin64\dmd.exe -of.dub\build\application-debug-windows-x86_64-dmd_v2.099.0-dirty-9C73C615E47957E2F0196C61BFACFF7A\app.exe

.dub\build\application-debug-windows-x86_64-dmd_v2.099.0-dirty-9C73C615E47957E2F0196C61BFACFF7A\app.obj

C:\dlang\arsd\.dub\build\library-debug-windows-x86_64-dmd_v2.099.0-dirty-5128CD87C77EA53A12BDD90A8B37E0E4\arsd-official_image_files.lib

C:\dlang\arsd\.dub\build\library-debug-windows-x86_64-dmd_v2.099.0-dirty-66D647CCA1055F2F9BD2C4AAD0551124\arsd-official_bmp.lib

C:\dlang\arsd\.dub\build\library-debug-windows-x86_64-dmd_v2.099.0-dirty-8F6807A564A94A3E26A5FDE91B0A798F\arsd-official_imageresize.lib

C:\dlang\arsd\.dub\build\library-debug-windows-x86_64-dmd_v2.099.0-dirty-24F06AB33E1AC529F9B3C0A9DEA4B137\arsd-official_jpeg.lib

C:\dlang\arsd\.dub\build\library-debug-windows-x86_64-dmd_v2.099.0-dirty-ABDB0882B5E2D9CDE956E9E845377256\arsd-official_png.lib

C:\dlang\arsd\.dub\build\library-debug-windows-x86_64-dmd_v2.099.0-dirty-1DE97EFE0E43837E141C233C0AA5C31F\arsd-official_svg.lib

C:\dlang\arsd\.dub\build\library-debug-windows-x86_64-dmd_v2.099.0-dirty-0128B44A475FA39689E2D238F5500D0D\arsd-official_minigui.lib

C:\dlang\arsd\.dub\build\normal-debug-windows-x86_64-dmd_v2.099.0-dirty-CD2FC136BEDCF32714DEA23BE867AC78\arsd-official_simpledisplay.lib

C:\dlang\arsd\.dub\build\library-debug-windows-x86_64-dmd_v2.099.0-dirty-1A0BC8A3D79617FC811AC1F1422195CC\arsd-official_color_base.lib gdi32.lib ole32.lib -m64 -g

lld-link: error: /manifestdependency: is not allowed in .drectve
Error: linker exited with status 1
FAIL .dub\build\application-debug-windows-x86_64-dmd_v2.099.0-dirty-9C73C615E47957E2F0196C61BFACFF7A\ app executable
C:\dlang\dmd2\windows\bin64\dmd.exe failed with exit code 1.

I searched for "manifestdependency" and "drectve" (w/o quotes) in arsd lib and couldn't find them so not sure how to debug this further. I also removed the explicit manifest file from the directory of the exe file (its presence didn't make any difference anyway, as exe file is not created as link failed).

March 29, 2022

Actually as you mentioned, I did find the changes in minigui.d file. I will try tweaking the pragma there see if anything works.

« First   ‹ Prev
1 2