These are chat archives for AvaloniaUI/Avalonia

4th
Jun 2018
Gutemberg Ribeiro
@galvesribeiro
Jun 04 2018 05:05
It looks like @grokys will become a MSFT employee after all hahahah
nc4rrillo @nc4rrillo wonders out loud if @grokys is on west coast time next week due to the MSFT acquisition :)
Nelson Carrillo
@nc4rrillo
Jun 04 2018 05:10
btw I found a StackOverflowException with the FontFamilyProperty
has to do with GetDefaultValue and the fact that its an inherited property
repro is simply scrolling a virtualized listbox :O
Jeremy Koritzinsky
@jkoritzinsky
Jun 04 2018 05:47
@jkoritzinsky thinks that Avalonia being brought into Microsoft just got marginally more likely.
Rayyan Tahir
@RayyanTahir
Jun 04 2018 09:55
Does anyone know a way to direct printf of a pinvoked DLL to console window?
ahopper
@ahopper
Jun 04 2018 10:11
I use std::cout to write to the console and it worked with no further tricks
that was on linux
Rayyan Tahir
@RayyanTahir
Jun 04 2018 10:13
Sorry, let me rephrase, From my Avalonia application I pinvoke a dll, when I call it's function it does a printf. Should that come up in my Avalonia application's console window? or should I use std::cout?
ahopper
@ahopper
Jun 04 2018 10:15
it does in my code using std::cout,i have not tried printf
Rayyan Tahir
@RayyanTahir
Jun 04 2018 10:15
thanks I'll try that and get back to you
@ahopper it doesn't work for me on Windows
ahopper
@ahopper
Jun 04 2018 10:16
windows can be a bit odd sometimes OutputDebugStringA works on windows
Rayyan Tahir
@RayyanTahir
Jun 04 2018 10:18
That doesn't print on console or DebugView, tried both. I'm probably missing something
ahopper
@ahopper
Jun 04 2018 10:32
Just tried on windows and it does not work for me either, odd because it works in wpf on windows
Rayyan Tahir
@RayyanTahir
Jun 04 2018 10:33
Maybe something to do with .net core?
ahopper
@ahopper
Jun 04 2018 10:33
works netcore and avalonia on linux
Rayyan Tahir
@RayyanTahir
Jun 04 2018 10:33
Oh okay
ahopper
@ahopper
Jun 04 2018 10:36
on wpf it goes to the vs output window. You could always write a callback into .net
Rayyan Tahir
@RayyanTahir
Jun 04 2018 10:36
Ahh! Callbacks, completely forgot about those. I'll use that
Nelson Carrillo
@nc4rrillo
Jun 04 2018 12:25
It should show up in your console without you doing anything else
danwalmsley
@danwalmsley
Jun 04 2018 12:28
@RayyanTahir there are kind of 2 consoles, the black window that is created when the app loads, and the one inside visual studio, check both to see if your printf messages are coming out on the other?
ahopper
@ahopper
Jun 04 2018 12:43
I made a mistake on my earlier quick test on windows, std::cout does go to the black avalonia console, outputDebugString does not appear anywhere.
It's official now :))
Steven Kirk
@grokys
Jun 04 2018 13:41
Heh yeah, so I hear!
You know as much as I do
I personally suspect that Avalonia was a major part in this
:P
ahopper
@ahopper
Jun 04 2018 13:42
:) I can think of no other reason
danwalmsley
@danwalmsley
Jun 04 2018 16:57
@boombuler you around
iv found that with drag and drop, if I capture the mouse inside pointer pressed and then begin a drag operation
I never get pointer release events even though the mouse was captured
are you able to point me to where in the code I can fix this?
danwalmsley
@danwalmsley
Jun 04 2018 17:54
@CommonGuy hey man
iv just noticed a little mistake you made in DropDownItem.cs
just want to make you aware of it for next time
you added this code:
IsFocusedProperty.Changed.Subscribe(x =>
            {
                var sender = x.Sender as IControl;

                if (sender != null)
                {
                           ((IPseudoClasses)sender.Classes).Set(":selected", (bool)x.NewValue);
                }
            });
that that code does is Set the :selected pseudo class on any instance of any class that has an IsSelectedProperty
so the effect of this is that TabStripItems and ListBoxItems loose their selected state when they loose focus (I guess you want this behaviour on dropdown)
so the fix for this is to do this inside the the non-static constructor
public DropDownItem()
        {
            this.GetObservable(DropDownItem.IsFocusedProperty).Subscribe(focused =>
            {
                PseudoClasses.Set(":selected", focused);            
            });
        }
can you confirm what you were trying to do here, perhaps you were trying to apply the :focused pseudo class and not the :selected one?
Ill submit a fix asap
danwalmsley
@danwalmsley
Jun 04 2018 18:05
@jkoritzinsky @wieslawsoltes @grokys could someone approve #1648 very quick fix for the above described issue.
Manuel
@CommonGuy
Jun 04 2018 18:09
@danwalmsley Oh sorry, I see the error now. I will keep it in mind, thank you for fixing the bug
danwalmsley
@danwalmsley
Jun 04 2018 18:10
im still unsure about if you wanted to set :focused
or :selected
does code look correct now?
Manuel
@CommonGuy
Jun 04 2018 18:12
I'm not sure about :focused or :selected... I copied the code from ListBoxItem to DropDownItem and changed it.
danwalmsley
@danwalmsley
Jun 04 2018 18:12
what were you trying to do by adding that code though?
because I don't think listbox item has it?
Manuel
@CommonGuy
Jun 04 2018 18:13
Before, DropDownItem and ListBoxItem were identical. But DropDownItems shouldn't be "selected" when they are focused with keyboard navigation, that's why I extracted the code and change it in DropDownItem.cs
danwalmsley
@danwalmsley
Jun 04 2018 18:13
ah I see
ok so I think the current fix does the same
Manuel
@CommonGuy
Jun 04 2018 18:15
Yes, it looks correct to me. Just setting the styles of the Item. What are the differences between :focused and :selected? Because the items are focused and kind of selected...
ahopper
@ahopper
Jun 04 2018 19:47
Is anyone successfully running an avalonia app on Ubuntu 16.04 x64 ?
Just had a user report this

$ ./SparkSDR.avalonia

Unhandled Exception: Avalonia.Gtk3.Interop.NativeException: Exception of type 'Avalonia.Gtk3.Interop.NativeException' was thrown.
at Avalonia.Gtk3.Interop.UnixLoader.GetProcAddress(IntPtr dll, String proc, Boolean optional)
at Avalonia.Gtk3.Interop.Resolver.Resolve(String basePath)
at Avalonia.Gtk3.Gtk3Platform.Initialize()
at Avalonia.Controls.AppBuilderBase1.Setup() at Avalonia.Controls.AppBuilderBase1.StartTMainWindow
at SparkSDR.avalonia.Program.Main(String[] args)
Aborted (core dumped)

from a self contained build
Benedikt Schroeder
@Gillibald
Jun 04 2018 20:05
AppVeyor is suddenly producing some random PossibleNullReferenceException. Has anyone the same issue?
Jeremy Koritzinsky
@jkoritzinsky
Jun 04 2018 20:32
@ahopper I was able to run it fine in Ubuntu 16.04 on WSL. Does your user have gtk3 installed? And what version?
ahopper
@ahopper
Jun 04 2018 20:33
I have asked the question, thanks
ahopper
@ahopper
Jun 04 2018 20:55
@jkoritzinsky I haven't tried running avalonia on WSL , does it work well?
Jeremy Koritzinsky
@jkoritzinsky
Jun 04 2018 20:56
Yeah! It works very well! It's how I usually work on Avalonia when fixing Linux bugs.
ahopper
@ahopper
Jun 04 2018 20:57
got any quick start hints?
ahopper
@ahopper
Jun 04 2018 21:06
just got this response re gtk version
danwalmsley
@danwalmsley
Jun 04 2018 21:17
image.png
Nelson Carrillo
@nc4rrillo
Jun 04 2018 21:22
nice :)
danwalmsley
@danwalmsley
Jun 04 2018 21:23
custom windows are a nightmare though
yowl
@yowl
Jun 04 2018 22:22
Can ask you graphics experts a question, did Cairo become out of favour and die?
Nelson Carrillo
@nc4rrillo
Jun 04 2018 22:28
yes, did not have an active maintainer
skia is much better maintained, both our backend and the .net bindings to it, SkiaSharp
yowl
@yowl
Jun 04 2018 22:34
thanks
Jeremy Koritzinsky
@jkoritzinsky
Jun 04 2018 22:41
@ahopper. Took a look at that thread. I think he needs a newer gtk3 version. Not positive though. And quickstart for WSL: install vcxsrv on the windows side and add export DISPLAY=0:0 to your .bashrc. As long as you have vcxsrv running you can run any X11 apps on the Ubuntu side. I know vscode is a little funky and requires a little more work though.