haxeui / hxWidgets

Haxe externs (and wrappers) for wxWidgets
MIT License
77 stars 22 forks source link

Sizer.hx: Int should be wx.widgets.SizerFlag #63

Closed Sl0vi closed 4 years ago

Sl0vi commented 5 years ago

Haxe version: 4.0.0-rc2 OS: Linux Mint 19.1

I get the following error when I try to compile a project with hxWidgets:

hxWidgets/samples/00-Showcase/.haxelib/hxWidgets/1,0,0/src/wx/widgets/Sizer.hx:17: characters 135-136 : Int should be wx.widgets.SizerFlag
hxWidgets/samples/00-Showcase/.haxelib/hxWidgets/1,0,0/src/wx/widgets/Sizer.hx:15: characters 121-122 : Int should be wx.widgets.SizerFlag

If I change the lines in Sizer.hx to use SizerFlag.None instead of the integer value 0, the compiler error goes away.

package wx.widgets;

import cpp.RawPointer;

@:include("wx/sizer.h")
@:unreflective
@:native("wxSizer")
@:structAccess
extern class Sizer extends Object {

    //////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Instance functions
    //////////////////////////////////////////////////////////////////////////////////////////////////////////
    @:native("Add")                 @:overload(function(sizer:RawPointer<Sizer>, proportion:Int = 0, flag:SizerFlag = 0, border:Int = 0):RawPointer<SizerItem> {})
-    @:native("Add")                 public function add(window:RawPointer<Window>, proportion:Int = 0, flag:SizerFlag = 0, border:Int = 0):RawPointer<SizerItem>;
+    @:native("Add")                 public function add(window:RawPointer<Window>, proportion:Int = 0, flag:SizerFlag = SizerFlag.NONE, border:Int = 0):RawPointer<SizerItem>;
    @:native("Insert")              @:overload(function(index:Int, sizer:RawPointer<Sizer>, proportion:Int = 0, flag:SizerFlag = 0, border:Int = 0):RawPointer<SizerItem> {})
-    @:native("Insert")              public function insert(index:Int, window:RawPointer<Window>, proportion:Int = 0, flag:SizerFlag = 0, border:Int = 0):RawPointer<SizerItem>;
+    @:native("Insert")              public function insert(index:Int, window:RawPointer<Window>, proportion:Int = 0, flag:SizerFlag = SizerFlag.NONE, border:Int = 0):RawPointer<SizerItem>;
    @:native("AddSpacer")           public function addSpacer(size:Int):RawPointer<SizerItem>;
    @:native("Remove")              public function remove(index:Int):Bool;
    @:native("Layout")              public function layout():Void;
}
ianharrigan commented 5 years ago

Its weird that this works fine for me, could this be a haxe-rc2 thing? Did this work previously (im on rc1)

Sl0vi commented 5 years ago

So I just tried reverting back to rc1 and the project builds correctly.

This does indeed seem to be caused by some change in Haxe 4.0.0-rc2.

chiswicked commented 5 years ago

For reference, same issue still persists in Haxe 4.0.0-rc.3 However reverting to Haxe 4.0.0-rc.1 did solve the problem.

ianharrigan commented 5 years ago

I fixed this recently (https://github.com/haxeui/hxWidgets/commit/92ebe8dab7124c049dfe97568ac15a42a764746f)... have you tried with latest?

chiswicked commented 5 years ago

I just tried (manually made the same change in my local copy) and worked! Is there any way to get the latest version through the haxelib package manager? It seems to be a relatively old version on https://lib.haxe.org/p/hxWidgets/

ianharrigan commented 5 years ago

Yeah, you are right, its a very old version. Ill push to haxelib tomorrow. I was going to wait until i start the main haxeui push on haxelib (in a couple of weeks) but hxwidgets isnt tied to that, so there is no reason why i cant to that sooner.

Cheers, Ian

ianharrigan commented 5 years ago

Ok, ive added a new haxelib release. If you get a moment, can you let me know if it all works fine for you?

Cheers, Ian

chiswicked commented 5 years ago

I can confirm that the latest v1.0.1 installed with haxelib does not have this problem any more on haxe v4.0.0-rc.3

thanks :)

now I just need to fix the libwxgtk-webview3.0-dev dependency issue as such library doesn't seem to exist on Disco Dingo :/

ianharrigan commented 4 years ago

OK, it seems the OP hasnt confirmed, but i think im going to close it myself (which i usually dont like to do).