guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile-GI: <GSimpleAction>: Setting parameter type to None or NULL


From: Mike Gran
Subject: Re: Guile-GI: <GSimpleAction>: Setting parameter type to None or NULL
Date: Sun, 25 Apr 2021 13:44:59 -0700

On Sun, Apr 25, 2021 at 07:36:04PM +0000, Luis Felipe wrote:
> Hello again,
> 
> I want to add actions to an application but I can't seem to find the correct 
> value to indicate that no parameter should be passed to a handler.
> 
> In Python, for example, I do this:
> 
>   action = Gio.SimpleAction.new("about", None)

The guile-gi equivalent would be

  (set! action (simple-action:new "about"))
or
  (set! action (simple-action:new "about" #f))

> 
> In Guile, I'm doing it like this for now:
> 
>   (let [(action (make ??GSimpleAction?? #:name "about"))
>         ...]
> 
>     ...)
> 
> But what I need to indicate is:
> 
>   (make ??GSimpleAction?? #:name "about" #:parameter-type None)
> 
> So what's the equivalent to None in Guile?

In this form, you'd do the following. Leaving out the #:parameter-type
from the constructor sets it to to its default of what Python would
call None.

   (make <GSimpleAction> #:name "about")

Regards,
Mike

> 
> 
> Any help is very welcome,
> 
> 
> ---
> Luis Felipe L??pez Acevedo
> https://luis-felipe.gitlab.io/
> 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]