Kotlin-native: GUI desktop applications

Created on 14 May 2018  路  7Comments  路  Source: JetBrains/kotlin-native

Desktop GUI applications are somewhat broken, at least for Windows.
I created simple project for cross-platform GUI: https://github.com/msink/klib-ui
Nothing fancy, and it somewhat works, but looks not "themed", like in Win95.
What I did wrong?

What should be - compiled from C example:
image
How it looks actually - converted to Kotlin/Native:
image

Cannot test Mac version, on linux looks as expected:
image

Most helpful comment

screen shot 2018-05-15 at 00 26 17

@msink, yes :)

All 7 comments

Seems problem is described here: https://stackoverflow.com/questions/17978546/how-to-make-window-look-more-modern. Mike, could you please try to implement suggested steps in your apps?

Well, I just downloaded Resource Hacker, opened K/N version, and imported Manifest from C version:

<?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="*"
    name="CompanyName.ProductName.YourApplication"
    type="win32"
/>
<description>Your application description here.</description>
<!-- we DO need comctl6 in the static case -->
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="*"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
    <application>
        <!--The ID below indicates application support for Windows Vista -->
        <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
        <!--The ID below indicates application support for Windows 7 -->
        <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
    </application>
</compatibility>
</assembly>

And now both versions look identical.
But how to automate this using gradle?

Maybe, as temporary workaround.
But in long run it should have direct support in gradle plugin.

And BTW, can someone confirm that https://github.com/msink/klib-ui/releases/download/alpha-3.5-3/libui-hello-osx actually works on OSX?

screen shot 2018-05-15 at 00 26 17

@msink, yes :)

Not sure if adding PE resource manipulations into generic Gradle plugin makes much sense, but adding external tools is generally easy, so shalln't be a big deal.

Was this page helpful?
0 / 5 - 0 ratings