-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Need same cast helper as stringObject() for FileInfo #135
Comments
I was just going to add your requested converter proc, but I noticed that your example code crash when compiled with --gc:arc. Does it crash for you also, and do you have an idea about the reason already? Yesterday I discovered another bug myself, see #137 So I think I will call the current version at github 0.90 for now and then try to fix bug #137. In the last week I spent a lot of time with the listview_clocks example requested by aeldemery. That example is really low level and too hard for pure Nim currently, but mixing C and Nim code works not that bad, so I got it working. But while playing with it I noticed another issue for the "transfer full" case of proc arguments. An example is
from listview_clocks.c. Here the clock expression is a "transfer full" parameter, which is used later in the proc again. So detaching it from the Nim GC with .ignoreFinalizer = true is not the best solution here, we should better call gtk_expression_ref() on the gtk object. I will try that for version 0.91 then. Another interesting problem is
Would compile fine without the gtk4. prefix, just using Nim's own bind keyword. But is not working then of course. Took me nearly a full day to find that. I regard that a Nim bug, but I guess reporting to Nim's issue tracker will not help, they will tell us that we should know what we are doing. |
Yes, I think this is exactly #137 Traceback (most recent call last)
/home/gavr/Projects/Nim/gintro/examples/gtk4/directory_list.nim(59) directory_list
/home/gavr/Projects/Nim/gintro/examples/gtk4/directory_list.nim(57) main
/home/gavr/.nimble/pkgs/gintro-#head/gintro/gio.nim(31021) run
/usr/lib/nim/core/macros.nim(565) connect_for_signal_cdecl_bind2
/home/gavr/Projects/Nim/gintro/examples/gtk4/directory_list.nim(13) bind_cb
/home/gavr/.nimble/pkgs/gintro-#head/gintro/gtk4.nim(49244) getItem
/usr/lib/nim/system/arc.nim(84) nimNewObj
/usr/lib/nim/system/alloc.nim(958) alloc0
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Error: execution of an external program failed: '/home/gavr/Projects/Nim/gintro/examples/gtk4/directory_list |
OK, following the discussion from https://discourse.gnome.org/t/get-ref-function-for-none-gobject-classes-like-gtkexpression/6696 with nimble install gintro@#head your example above should work now. We have also added the fileInfo() converter proc.
The existing examples seems to compile still and at least some work, but I have not tested all yet. The Gtk4 fontchooser example fails currently, but that may be due to a change in GTK4 itself. The listview_clock example works now also, I have split it in a low level C part and a Nim part. That splitting works not bad. I will ship the code soon. |
@StefanSalewski With new version I have error: |
We missed that because we have currently no working adwaita example.
We intentionally do not export gtk_expression_ref() because people shall not use it directly. But as adw.nim needs it we have to export it. So add an export marker to
manually for now. I will fix that soon. |
I have Adwaita examples in my PR |
Sorry, please stop further testing for now, we have stupid bugs like
Will try to fix it soon, should be easy. |
Should be fixed. Fontchooser works, and all including adw.nim compiles. Will do more serious tests soon. |
The text was updated successfully, but these errors were encountered: