Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 05 09:38
    cwensley labeled #1946
  • May 05 09:38
    cwensley labeled #1945
  • May 05 09:38
    cwensley labeled #1944
  • May 05 09:38
    cwensley labeled #1943
  • May 05 09:38
    cwensley labeled #1942
  • May 03 20:08
    InfinityGhost opened #1947
  • May 02 10:01
    cwensley labeled #1929
  • May 02 10:01
    cwensley labeled #1925
  • May 02 09:43

    cwensley on develop

    Fix possible NRE with Graphics.… Merge pull request #1946 from c… (compare)

  • May 02 09:43
    cwensley closed #1946
  • May 02 09:35
    cwensley opened #1946
  • Apr 30 22:38

    cwensley on develop

    Wpf: Fix setting selected index… Merge pull request #1945 from c… (compare)

  • Apr 30 22:38
    cwensley closed #1945
  • Apr 30 22:30
    cwensley opened #1945
  • Apr 28 19:23

    cwensley on develop

    Mac: Fix some issues with AutoS… Merge pull request #1944 from c… (compare)

  • Apr 28 19:23
    cwensley closed #1944
  • Apr 28 19:14
    cwensley opened #1944
  • Apr 28 17:46

    cwensley on develop

    Mac: Fix vertical alignment of … Merge pull request #1943 from c… (compare)

  • Apr 28 17:46
    cwensley closed #1943
  • Apr 28 17:37
    cwensley synchronize #1943
Curtis Wensley
@cwensley
vertical aligning? Like Label.VerticalAlignment = VerticalAlignment.Center ?
for a ListBox, there's no API for that, as I mentioned.
With FormattedText, you can Measure and then align it wherever you want.
though that assumes you're using a Drawable to draw the text.
Geoff McQueen
@geoff-m
yeah i am using Drawable
Jordan Peck
@Auburn
Is it possible to create a framework-dependant cross-platform binary when using eto.forms?
realonepiecefreak
@onepiecefreak3
As far as I'm aware, you could theoretically execute every binary by Eto.Forms on any platform. However the technology used behind the specific Eto platform is the limiting factor. I would say, using something like GDK or OpenTK as your platform should make it executable cross-platform, given the respective dependincies are installed of course.
You cannot create an Eto.Forms application based on WPF or WinForms and execute it on Linux or Mac, as far as I'm aware, since the netcore framework does not support them either, and Eto "merely" relies on both existing technologies to wrap around.
Jordan Peck
@Auburn
And there is no way to conditionally load the correct platform.dll at runtime?
Curtis Wensley
@cwensley
@Auburn you could, theoretically do that, yes. This is how it worked when using .NET Framework or mono. It gets complicated on .NET Core/5+ as you can only compile Wpf or WinForms on windows. I might be able to "fix" that by removing the Microsoft.WindowsDesktop.App framework reference, but I don't know if that'll break other things.
Jordan Peck
@Auburn
Can you make the Microsoft.WindowsDesktop.App framework reference conditional?
Curtis Wensley
@cwensley
Not as far as I understand how nupkg's work..
It's either required or not..
Jordan Peck
@Auburn
I'm trying to publish for osx-x64 but it's giving me this error
Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app.
linux-x64 and win-x64 are fine, and Google isn't giving any helpful answers
It works if I do a self contained binary, but I don't really want that
Curtis Wensley
@cwensley
Do you have TrimMode set to link?
Jordan Peck
@Auburn
Not sure, this is my command dotnet publish .\FastNoiseLite.csproj -c Release -r osx-x64 --no-self-contained
It's probably whatever the default is
Looks like the default is copyused
Curtis Wensley
@cwensley
Should be.. try adding /p:MacBundleDotNet=False to your command
Jordan Peck
@Auburn
That works thanks
Curtis Wensley
@cwensley
I shouldn't be enabling it if SelfContained is set to false.. hm.
Geoff McQueen
@geoff-m
Is there an equivalent of InvokeRequired()?
i.e. a way to check that the current thread is the UI thread, or a way to schedule work for execution on the UI thread?
Curtis Wensley
@cwensley
Hm there’s no InvokeRequired() however to invoke you use Application.Instance.Invoke/AsyncInvoke. Calling Invoke on the main thread will execute it directly vs scheduling it for later.
Geoff McQueen
@geoff-m
I see. Thanks.
Jordan Peck
@Auburn
Got some more troubles with my MacOS binary, it doesn't want to run without being a .app
Unhandled exception. System.InvalidOperationException: Could not detect platform. Are you missing a platform assembly?

 ---> System.InvalidOperationException: Platform type 'Eto.Mac.Platform, Eto.Mac64' was loaded but is not valid in the current context.  E.g. Mac platforms require to be in an .app bundle to run
Curtis Wensley
@cwensley
@Auburn yes that is normal. Mac applications require an .app bundle to run. This is an OS limitation/requirement.
Jordan Peck
@Auburn
Should it still be possible to run it using dotnet ./myappbinary
Curtis Wensley
@cwensley
No, because it doesn't satisfy the "running in an .app bundle" requirement. I have recently added a change that will let you run it via "dotnet run myProject.csproj" though, which should make things easier.
Curtis Wensley
@cwensley
If you want to run it via command line, or for debugging, you can execute myApp.app/Contents/MacOS/myApp
Jordan Peck
@Auburn
So there is no way to make it framework dependant then?
Curtis Wensley
@cwensley
You can, this is what Eto.Platform.Mac64 nuget package does for you in Debug mode by default.
it still has an executable, just not the whole framework included.
If you're building for release, just set MacBundleDotNet to false in your .csproj.
Jordan Peck
@Auburn
With MacBundleDotNet=false it still produces a 77MB .app
All the system.x.dlls are still there
Curtis Wensley
@cwensley
Are you running dotnet build or dotnet publish?
Jordan Peck
@Auburn
publish
Curtis Wensley
@cwensley
try just build, the nuget package runs the publish for you (you can disable that via MacAutoPublishBundle=false
Jordan Peck
@Auburn
oh I had --self-contained that was causing dotnet to bundle
Curtis Wensley
@cwensley
ah
that'd do it.. 😄
philstopford
@philstopford
@cwensley : just asking - are you making progress on the OpenTK / Veldrid projects? :)
realonepiecefreak
@onepiecefreak3
@cwensley I'm not entirely sure if it's a problem with my code yet, or with Eto.Forms. I have code that converts a System.Drawing.Bitmap to an Eto.Drawing.Bitmap. However converting said image to Eto seems to get rid of alpha completely. It seems that the alpha value is always set to 255 and therefore gets completely ignored.
However, this does not happen, if I load up the image with Eto directly, instead of going through System.Drawing. Which makes me believe that at least not the platform assembly or similar underlying handlers are the actual cause.
// Initialize images
var img = (System.Drawing.Bitmap)System.Drawing.Image.FromFile(@"path_to_png");
var etoImg = new Bitmap(@"path_to_png");

// Convert System.Drawing to Eto.Drawing
var sysImg = new Bitmap(image.Width, image.Height,PixelFormat.Format32bppRgba, image.ToColors().Select(x => Eto.Drawing.Color.FromArgb(x.R, x.G, x.B, x.A)).ToArray());

// Now that both images are in Eto, one can try to render them with an ImageView
imgView.Image = sysImg;
// imgView.Image = etoImg;
imgView.Invalidate();