unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* G-Golf - Callback segmentation fault
@ 2024-08-21 14:50 Matija Obid
  2024-08-21 15:19 ` pelzflorian (Florian Pelz)
  2024-08-22  0:21 ` David Pirotte
  0 siblings, 2 replies; 30+ messages in thread
From: Matija Obid @ 2024-08-21 14:50 UTC (permalink / raw)
  To: guile-user

[-- 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

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2024-09-07 14:08 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-21 14:50 G-Golf - Callback segmentation fault Matija Obid
2024-08-21 15:19 ` 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

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).