buggins / dlangui

Cross Platform GUI for D programming language
Boost Software License 1.0
804 stars 120 forks source link

Console "Hello, world" isn't compiles #385

Closed denizzzka closed 7 years ago

denizzzka commented 7 years ago
/+ dub.sdl:
name "hello_world"
dependency "dlangui" version="*"
subConfiguration "dlangui" "console"
+/

import dlangui;

mixin APP_ENTRY_POINT;

/// entry point for dlangui based application
extern (C) int UIAppMain(string[] args) {
    // create window
    Window window = Platform.instance.createWindow("My Window", null);
    // create some widget to show in window
    window.mainWidget = (new Button()).text("Hello world"d).textColor(0xFF0000); // red text
    // show window
    window.show();
    // run message loop
    return Platform.instance.enterMessageLoop();
}
$ dub run --single union_bug.d 
Performing "debug" build using dmd for x86_64.
dlangui 0.9.80: building configuration "console"...
/usr/include/dmd/phobos/std/uri.d(323,19): Deprecation: function std.utf.toUTF8 is deprecated - To be removed November 2017. Please use std.utf.encode instead.
dlangui/src/dlangui/dialogs/filedlg.d(368,9): Warning: statement is not reachable
Warning: statement is not reachable
dmd failed with exit code 1.

After I tried to fix this warning it runs but isn't displays any text and sends garbage symbols to terminal if I move mouse on terminal window.

and3md commented 7 years ago

Console platform need a lot of work. I tried run my own project and it works but I need change terminal window size to see something (after run there is blank screen). Now I'm focused on SDL and Windows platform but maybe this helps you.

denizzzka commented 7 years ago

fixed in #388

buggins commented 7 years ago

Console app somtimes requires changes in code. Avoid using of sizes / margins in pixels. Possible workaround: use points. Custom console theme may help as well.

buggins commented 7 years ago

Closing since PR is merged