[Gambas-user] Gio icon, GIcon serialized for DesktopPortal Notify?

Bruce Steers bsteers4 at gmail.com
Sun Nov 26 02:17:12 CET 2023


Brilliant, Thank you Vuott  hopefully i can get that working for images

I have just discovered i can just use a stock icon name

my problem was i was trying using the icon name "question"  and did not
know the stock name for a question mark was "dialog-question" lol
but if i can get the code you have posted working i can branch out into
custom icons :)

Respects
BruceS

On Sun, 26 Nov 2023 at 00:36, vuott--- via User <user at lists.gambas-basic.org>
wrote:

> « *Does gambas do GIcon or anything from Gio library?*
> *   Will i need Extern library calls?* »
>
> Do you say something like this ?
>
> [code]
> Library "libgio-2.0:0.7200.4"
>
> ' GIcon* g_themed_icon_new (const char* iconname)
> ' Creates a new themed icon.
> Private Extern g_themed_icon_new(iconname As String) As Pointer
>
> ' GVariant* g_icon_serialize (GIcon* icon)
> ' Serializes a GIcon into a GVariant.
> Private Extern g_icon_serialize(icon As Pointer) As Pointer
>
> ' void g_variant_unref (GVariant* value)
> ' Decreases the reference count of value.
> Private Extern g_variant_unref(value As Pointer)
>
> ' void g_object_unref (gpointer object)
> ' Decreases the reference count of object.
> Private Extern g_object_unref(gobject As Pointer)
>
>
> Public Sub Main()
>
>   Dim ico, gv As Pointer
>
>   ico = g_themed_icon_new("org.freedesktop.portal.Notification")
>
>   gv = g_icon_serialize(ico)
>
>   ......
>   ......
>
>   g_variant_unref(gv)
>   g_object_unref(ico)
>
> End
> [/code]
>
>
>
>
> 25 nov 2023, 17:13 da bsteers4 at gmail.com:
>
> I'm using gb.dbus and desktop portal Notify
>
> I want to add an image.
> docs say i need a serialized GThemedIcon or GBytesIcon
> https://docs.gtk.org/gio/method.Icon.serialize.html
> https://www.manpagez.com/html/gio/gio-2.44.1/GBytesIcon.php
>
> https://developer-old.gnome.org/gio/stable/GThemedIcon.html#g-themed-icon-new
>
> Does gambas do GIcon or anything from Gio library?
>
> Will i need Extern library calls?
>
> Has anyone managed to add an image to dbus notification?
>
> Thanks in advance
> BruceS
>
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20231126/81f7e806/attachment.htm>


More information about the User mailing list