What exactly does the function objectGetProperty need in its third argument value “GValue”?

I am trying to compile the example from https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/blob/main/video/gtk4/examples/gtksink.py . I need to write it in Haskell and I’m currently stuck on the paintable = gtksink.get_property('paintable') function written in Python. I’ve searched around and found objectGetProperty from the Gi-GObject library which seems like the one that I need. However I can’t seem to get it to work because it asks me for a GValue of some kind in its third argument. I have tried to pass it a lot of stuff but nothing seems correct.

This is my code up so far:

{-# LANGUAGE OverloadedStrings, OverloadedLabels, ImplicitParams #-}

import Control.Monad (void)
import System.Environment (getArgs, getProgName)

import Data.Int (Int32)
import qualified GHC.Foreign as GHC

import qualified GI.Gtk as Gtk
import qualified GI.Gdk as Gdk
import qualified GI.Gsk as Gsk
import qualified GI.Gio as Gio
import qualified GI.GObject as GObject
import qualified GI.Gst as Gst
import qualified GI.GLib as GLib
import qualified Data.Text as T
import Data.GI.Base

activate :: Gtk.Application -> IO ()
activate app = do

  pipeline <- Gst.pipelineNew (Just ("pippo"))
  
  gtksink <- Gst.elementFactoryMake "gtk4paintablesink" (Just ("pluto"))
  paintable <- GObject.objectGetProperty gtksink "paintable" 0


  player <- Gtk.videoNew
  Gtk.videoSetAutoplay player True
  file_to_play <- Gio.fileNewForPath ("D:/stack-projects/gtk-intro-twelve/big-buck-bunny_trailer.webm")
  Gtk.videoSetFile player (Just (file_to_play))

  window <- new Gtk.ApplicationWindow [#application := app,
                                       #title := "Hello",
                                       #child := player]
  #setDefaultSize window 1427 1080
  #show window

main :: IO ()
main = do
  app <- new Gtk.Application [#applicationId := "haskell-gi.Gtk4.test",
                              On #activate (activate ?self)]

  -- If the application does not need to parse command line arguments
  -- just pass Nothing.
  args <- getArgs
  progName <- getProgName
  void $ #run app (Just $ progName : args)

It compiles with the errors:

D:stack-projectsgtk-intro-twelveappMain.hs:46:16: error: [GHC-05617]
    * Could not solve: `Data.GI.Base.Overloading.CheckForAncestorType
                          (Maybe Gst.Element)
                          GObject.Object
                          (Data.GI.Base.Overloading.ParentTypes (Maybe Gst.Element))'
        arising from a use of `GObject.objectGetProperty'
    * In a stmt of a 'do' block:
        paintable <- GObject.objectGetProperty gtksink "paintable" 0
      In the expression:
        do pipeline <- Gst.pipelineNew (Just ("pippo"))
           gtksink <- Gst.elementFactoryMake
                        "gtk4paintablesink" (Just ("pluto"))
           paintable <- GObject.objectGetProperty gtksink "paintable" 0
           player <- Gtk.videoNew
           ....
      In an equation for `activate':
          activate app
            = do pipeline <- Gst.pipelineNew (Just ("pippo"))
                 gtksink <- Gst.elementFactoryMake
                              "gtk4paintablesink" (Just ("pluto"))
                 paintable <- GObject.objectGetProperty gtksink "paintable" 0
                 ....
   |
46 |   paintable <- GObject.objectGetProperty gtksink "paintable" 0
   |                ^^^^^^^^^^^^^^^^^^^^^^^^^

D:stack-projectsgtk-intro-twelveappMain.hs:46:16: error: [GHC-39999]
    * No instance for `GObject (Maybe Gst.Element)'
        arising from a use of `GObject.objectGetProperty'
    * In a stmt of a 'do' block:
        paintable <- GObject.objectGetProperty gtksink "paintable" 0
      In the expression:
        do pipeline <- Gst.pipelineNew (Just ("pippo"))
           gtksink <- Gst.elementFactoryMake
                        "gtk4paintablesink" (Just ("pluto"))
           paintable <- GObject.objectGetProperty gtksink "paintable" 0
           player <- Gtk.videoNew
           ....
      In an equation for `activate':
          activate app
            = do pipeline <- Gst.pipelineNew (Just ("pippo"))
                 gtksink <- Gst.elementFactoryMake
                              "gtk4paintablesink" (Just ("pluto"))
                 paintable <- GObject.objectGetProperty gtksink "paintable" 0
                 ....
   |
46 |   paintable <- GObject.objectGetProperty gtksink "paintable" 0
   |                ^^^^^^^^^^^^^^^^^^^^^^^^^

D:stack-projectsgtk-intro-twelveappMain.hs:46:62: error: [GHC-39999]
    * No instance for `Num GValue' arising from the literal `0'
    * In the third argument of `GObject.objectGetProperty', namely `0'
      In a stmt of a 'do' block:
        paintable <- GObject.objectGetProperty gtksink "paintable" 0
      In the expression:
        do pipeline <- Gst.pipelineNew (Just ("pippo"))
           gtksink <- Gst.elementFactoryMake
                        "gtk4paintablesink" (Just ("pluto"))
           paintable <- GObject.objectGetProperty gtksink "paintable" 0
           player <- Gtk.videoNew
           ....
   |
46 |   paintable <- GObject.objectGetProperty gtksink "paintable" 0
   |                                                              ^

I have started from the https://github.com/haskell-gi/haskell-gi/blob/master/examples/Gtk4/gtk4-example.hs example, I’m trying to display a video through Gtk4.

I’ve tried looking online at the docs.gtk.org website, I looked at the GObject class and read something about having to first install properties before accessing them with install_properties and GParamSpecs but I’m not sure I’m on the right track. Do you mind explaining to me what I’m doing wrong? I’ve been stuck on this for hours. Thank you in advance.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật