unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: David Pirotte <david@altosw.be>
To: "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de>
Cc: guile-user <guile-user@gnu.org>
Subject: Re: GNU G-Golf 0.8.0-rc-3 available for testing
Date: Mon, 6 May 2024 22:39:03 -0300	[thread overview]
Message-ID: <20240506223903.4651070a@tintin> (raw)
In-Reply-To: <87r0em7xpk.fsf@pelzflorian.de>


[-- Attachment #1.1: Type: text/plain, Size: 453 bytes --]

Hi Florian,

> ...
> pygobject GTK3 examples are working.  I will experiment and try to
> write Vala/C code that breaks now.

I thought they had Gtk-4 examples as well. But anyway, I cooked a
pygobject version of this drawing-widget example, attached.

Could you:

	install pygobject
	[ run its test-suite ?		- it used to fail, in Guix

Drop this example somewhere:

	chmod a+x drawing-widget.py
	./drawing-widget.py

Thanks,
David

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: drawing-widget.py --]
[-- Type: text/x-python, Size: 1711 bytes --]

#!/usr/bin/env python3
# -*- mode: python; coding: utf-8 -*-
 
import gi
gi.require_version("Gtk", "4.0")
 
from gi.repository import Gtk, Gdk, Graphene
 
class DrawingWidget(Gtk.Widget):
    def do_snapshot(self, snapshot):
        width = self.get_width() / 2
        height = self.get_height() / 2
        color = Gdk.RGBA()
        
        color.parse("rgba(237, 20, 20, 1.0)")
        snapshot.append_color(
          color,
          # Gdk.RGBA(red=0.18, green=0.8, blue=0.44, alpha=1.0),
          Graphene.Rect.alloc().init(0, 0, width, height)
        )
        
        color.parse("rgba(46, 204, 112, 1.0)")
        snapshot.append_color(
          color,
          # Gdk.RGBA(red=0.18, green=0.8, blue=0.44, alpha=1.0),
          Graphene.Rect.alloc().init(width, 0, width, height)
        )
        
        color.parse("rgba(252, 189, 74, 1.0)")
        snapshot.append_color(
          color,
          # Gdk.RGBA(red=0.18, green=0.8, blue=0.44, alpha=1.0),
          Graphene.Rect.alloc().init(0, height, width, height)
        )
        
        color.parse("rgba(41, 127, 186, 1.0)")
        snapshot.append_color(
          color,
          # Gdk.RGBA(red=0.18, green=0.8, blue=0.44, alpha=1.0),
          Graphene.Rect.alloc().init(width, height, width, height)
        )

def on_activate(app):
    window = Gtk.ApplicationWindow(
        title="Drawing Widget",
        default_width=320,
        default_height=320,
        application=app,
        child=DrawingWidget(hexpand=True, vexpand=True)
    )
    window.present()
 
app = Gtk.Application(application_id='com.example.App')
app.connect('activate', on_activate)
app.run(None)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2024-05-07  1:39 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17  5:56 GNU G-Golf 0.8.0-rc-3 available for testing David Pirotte
2024-04-17 22:30 ` pelzflorian (Florian Pelz)
2024-04-18 22:21   ` David Pirotte
2024-04-19 17:00     ` pelzflorian (Florian Pelz)
2024-04-20  4:51       ` David Pirotte
2024-04-20  8:35         ` pelzflorian (Florian Pelz)
2024-04-30 17:51         ` pelzflorian (Florian Pelz)
2024-05-01  0:51           ` David Pirotte
2024-05-01  8:17             ` pelzflorian (Florian Pelz)
2024-05-07  1:39               ` David Pirotte [this message]
2024-05-07  9:36                 ` pelzflorian (Florian Pelz)
2024-05-07 23:53                   ` David Pirotte
2024-05-08 10:49                     ` pelzflorian (Florian Pelz)
2024-05-08 21:51                       ` David Pirotte
2024-05-02 18:50             ` pelzflorian (Florian Pelz)
2024-05-02 21:57               ` David Pirotte
2024-05-03  5:00                 ` David Pirotte
2024-05-03 11:35                 ` pelzflorian (Florian Pelz)
2024-05-04  5:59                   ` David Pirotte
2024-05-04 14:31                     ` pelzflorian (Florian Pelz)
2024-05-04 18:08                       ` pelzflorian (Florian Pelz)
2024-05-04 22:11                         ` David Pirotte
2024-05-04 22:23                         ` David Pirotte
2024-05-04 21:39                       ` David Pirotte
2024-05-05  1:43                         ` pelzflorian (Florian Pelz)
2024-05-05 21:30                           ` David Pirotte
2024-05-06  9:45                             ` pelzflorian (Florian Pelz)
2024-05-06  9:53                         ` Basile Starynkevitch
2024-05-06 13:08                           ` pelzflorian (Florian Pelz)
2024-05-03  0:17           ` David Pirotte

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=20240506223903.4651070a@tintin \
    --to=david@altosw.be \
    --cc=guile-user@gnu.org \
    --cc=pelzflorian@pelzflorian.de \
    /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).