unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Matija Obid <matija.obid@posteo.net>
To: guile-user@gnu.org
Subject: G-Golf - Callback segmentation fault
Date: Wed, 21 Aug 2024 14:50:36 +0000	[thread overview]
Message-ID: <87msl6c4lf.fsf@posteo.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]

Hello,

I'm facing the problem mentioned in [1]. Problematic are all examples
with virtual methods.

I have tried simpler example (attached) with same result. There is no
problem, when try same thing with guile-gi library. Somehow, callbacks
are not callable back from C code. Any clue?

I'm using Nix.


[1] https://lists.gnu.org/archive/html/guile-user/2024-05/msg00013.html

[-- Attachment #2: golf-drawing.scm --]
[-- Type: application/octet-stream, Size: 1162 bytes --]

#! /bin/sh
# -*- mode: scheme; coding: utf-8 -*-
exec guile -e main -s "$0" "$@"
!#

(gc-disable)

(eval-when (expand load eval)
  (use-modules (oop goops))

  (default-duplicate-binding-handler
    '(merge-generics replace warn-override-core warn last))

  (use-modules (g-golf))

  (g-irepository-require "Gtk" #:version "4.0")
  (for-each (lambda (name)
              (gi-import-by-name "Gtk" name))
			'("ApplicationWindow"
			  "Application"
			  "DrawingArea")))

(define (activate app)
  (let* ((window (make <gtk-application-window>
                   #:application app
                   #:default-width 960
                   #:default-height 540
                   #:title "Title"))
		 (drawing-area (make <gtk-drawing-area>)))
	(set-child window drawing-area)
	(set-draw-func drawing-area
				   (lambda (area cr w h d)
					 (display "I'm in!")
					 (force-output))
				   #f
				   (lambda _ #f))
    (show window)))

(define (main args)
  (let ((app (make <gtk-application>
               #:application-id "local.example.DrawingArea")))
    (connect app 'activate activate)
    (let ((status (g-application-run app args)))
      (exit status))))

[-- Attachment #3: Type: text/plain, Size: 21 bytes --]


-- 
Regards,
Matija

             reply	other threads:[~2024-08-21 14:50 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21 14:50 Matija Obid [this message]
2024-08-21 15:19 ` G-Golf - Callback segmentation fault pelzflorian (Florian Pelz)
2024-08-23 23:57   ` David Pirotte
2024-08-24 16:01     ` pelzflorian (Florian Pelz)
2024-08-25  5:09       ` David Pirotte
2024-08-25 13:28         ` pelzflorian (Florian Pelz)
2024-08-26  6:40           ` pelzflorian (Florian Pelz)
2024-08-22  0:21 ` David Pirotte
2024-08-27 20:09   ` Matija Obid
2024-08-28 10:50     ` pelzflorian (Florian Pelz)
2024-08-29  0:18     ` David Pirotte
2024-08-31 16:35       ` Matija Obid
2024-09-02 15:30         ` pelzflorian (Florian Pelz)
2024-09-02 21:18         ` David Pirotte
2024-09-03  1:01           ` David Pirotte
2024-09-05  4:00             ` David Pirotte
2024-09-05  7:24               ` pelzflorian (Florian Pelz)
2024-09-05  7:42                 ` pelzflorian (Florian Pelz)
2024-09-05 21:23                   ` David Pirotte
2024-09-05 21:44                     ` David Pirotte
2024-09-05 20:48                 ` David Pirotte
2024-09-05 13:37               ` Matija Obid
2024-09-05 22:14                 ` David Pirotte
2024-09-06  6:29                   ` David Pirotte
2024-09-06  9:44                     ` pelzflorian (Florian Pelz)
2024-09-06 18:37                       ` David Pirotte
2024-09-06 22:08                         ` David Pirotte
2024-09-06 23:16                           ` David Pirotte
2024-09-07 14:08                             ` pelzflorian (Florian Pelz)
2024-09-07 11:53                           ` Matija Obid

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87msl6c4lf.fsf@posteo.net \
    --to=matija.obid@posteo.net \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).