From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andy Tai Newsgroups: gmane.lisp.guile.user Subject: Re: guile_gi question: gtk+ interface object? Date: Tue, 14 Jun 2022 21:05:43 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32477"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user@gnu.org To: Maxime Devos Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed Jun 15 06:08:34 2022 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o1KKY-0008FE-1L for guile-user@m.gmane-mx.org; Wed, 15 Jun 2022 06:08:34 +0200 Original-Received: from localhost ([::1]:59140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1KKW-0000ox-F8 for guile-user@m.gmane-mx.org; Wed, 15 Jun 2022 00:08:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52736) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1KIQ-0000lx-AQ for guile-user@gnu.org; Wed, 15 Jun 2022 00:06:22 -0400 Original-Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]:36797) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1KIO-00053y-9U for guile-user@gnu.org; Wed, 15 Jun 2022 00:06:21 -0400 Original-Received: by mail-io1-xd2b.google.com with SMTP id c189so152889iof.3 for ; Tue, 14 Jun 2022 21:06:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atai-org.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=xycrzvDjMQUSM0RiGlxaokGpQjZEDTx7D9xlGPr/5/w=; b=75g1/E0R/fvISoPPJDl8TXiVIchRjLDGpqRPpgc8Zvxe1fRMiJUuUMzmhLlXbLmiiF 0RJ6ZW+vqGziE54BFIB084fe7sJAb9wmoIA7LkZFZfDR9OE6QZ7blDTj3T130KL+GXyc c6wRw2JZYoYYsc8kDRb+GqZ/zZMBM+7NLM6kSug09tXkBMt657xTq8n+6s3999WofSmt 5v2zdF7FhWbZKmZKdK3NlmovVb4iC9hrFWSrolaQB288WtmQrPEAnJx+QEQVWPvcvD2r AaLl4sjOHfqQNBmgoHIOSjZ1a7XfcCRVCyYkFDoDxcp6/DIoG4WIJ+3RQa9B+2zSmpyb JXpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=xycrzvDjMQUSM0RiGlxaokGpQjZEDTx7D9xlGPr/5/w=; b=U78qIHkW+1g09vA7IUAlDuRXIWce2uFZDne/Kg57TPjFr8xSiJG9emv5n8fnaMzqSQ i9rldCeMCZ7YiUPXE4LDr0rnt1Ow0H/n4609T9+fCzepp7kWxaq4mHXByeZgaDF35kZ0 Ge/Ya/F/ZXb8jPTBKR/MiKsxLR0DH0/KMzbvkL+xw5egjWRIi53wQXZv0lYuGt/L606l TwwNaBf+8rQQlJOwtoGsbESCfKbDCVnDO3HXXEDL2G1hXAkKpY2Z0kFhPH1EV2yNdx38 2+t2J/GjpXvn6zGQUxH/xYtBXBq6Y8+Wy7x+BpCsRA3c96lDid0Hh9Pan/L1VRKCXgGR dUsw== X-Gm-Message-State: AOAM5324GuDAdWPBxivgKjJr1pcy8vskIfVmU/X4S9F8mZ6uKlDoUlFK 3gRg8TnZPiGrpxrngmWjt92bJD1nGJmDPoKmh80= X-Google-Smtp-Source: ABdhPJyGKxU3Vc1SPmgYgMb53oj7QKhhAfO4htymKp2IFqlVAE1fDxk9RbImq8V4rKB7OOku7CmCD5nnSS+giZa5VXg= X-Received: by 2002:a05:6602:27cd:b0:669:3d8d:4d77 with SMTP id l13-20020a05660227cd00b006693d8d4d77mr4003446ios.216.1655265978991; Tue, 14 Jun 2022 21:06:18 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::d2b; envelope-from=lichengtai@gmail.com; helo=mail-io1-xd2b.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:18310 Archived-At: Hi, thanks for the reply. The interface in GObject level does not necessarily translate as is to GOOPS at guile level... the context of this question is (let ((iter (make )) (model (make ))) (define selected (tree-selection:get-selected! selection model iter)) get_selected(GtkTreeModel out model, GtkTreeeIter out iter) has two out parameters, model and iter, but I think GOOPS does type check on arguments before invoking a method so both parameters must be initialized to the expected types. The model parameter normally is instance of a GOBject class "implementing" the GtkTreeModel interface (at the GOBject level), and I cannot pass in a concrete GOBject class that implements GtkTreeModel as GOOPS will reject such calls--GOOPS does not understand "class implementing an interface" at the GOBject level. So I don't know how to initialize the model parameter. On Tue, Jun 14, 2022 at 12:42 PM Maxime Devos wrot= e: > > Andy Tai schreef op di 14-06-2022 om 11:52 [-0700]: > > question: how to create object representing Gtk+ (version 3) > > interfaces? For example. > > > > (let (model (make ))) > > > > would fail because GtkTreeModel is an interface, not class derived > > from GObject. > > By definition, you cannot instatiate interfaces, but you can > instantiate classes derived from GtkTreeModel? > Maybe guile-gi even supports defining an implementation yourself in > Scheme with GOOPS ... > --=20 Andy Tai, atai@atai.org, Skype: licheng.tai, Line: andy_tai, WeChat: andyta= i1010 Year 2021 =E6=B0=91=E5=9C=8B110=E5=B9=B4 =E8=87=AA=E5=8B=95=E7=9A=84=E7=B2=BE=E7=A5=9E=E5=8A=9B=E6=98=AF=E4=BF=A1=E4= =BB=B0=E8=88=87=E8=A6=BA=E6=82=9F =E8=87=AA=E5=8B=95=E7=9A=84=E8=A1=8C=E7=82=BA=E5=8A=9B=E6=98=AF=E5=8B=9E=E5= =8B=95=E8=88=87=E6=8A=80=E8=83=BD