# Calling library function with a Pointer(Void) argument

**URL:** <https://forum.crystal-lang.org/t/calling-library-function-with-a-pointer-void-argument/6142>\
**Category:** Help & Support\
**Created:** [November 4, 2023, 7:06pm UTC](https://forum.crystal-lang.org/t/calling-library-function-with-a-pointer-void-argument/6142 "2023-11-04T19:06:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gummybears](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/gummybears/32/1886_2.png) [@gummybears](https://forum.crystal-lang.org/u/gummybears)\
**Post date:** [November 4, 2023, 7:06pm UTC](https://forum.crystal-lang.org/t/calling-library-function-with-a-pointer-void-argument/6142/1 "2023-11-04T19:06:11Z")

</div>

Working on Gtk4 examples using the Gtk4 shard where I call the following method

```auto
 def add_constraints_from_description(lines : Enumerable(::String), hspacing : Int32, vspacing : Int32, views : Pointer(Void)) : GLib::List

```

and specifically the views argument of type Pointer(Void). The code compiles when I pass in Pointer(Void).null for views but than I get a Gtk error.

```auto
(crystal-run-main.tmp:12461): Gtk-CRITICAL **: 19:59:39.242: gtk_constraint_layout_add_constraints_from_descriptionv: assertion 'views != NULL' failed

```

which is expected as I pass in a Pointer(Void).null

The sample code can be found at (removed some of the comments)

```auto
https://github.com/gummybears/gtk4_with_crystal/blob/master/lesson009/vfl_grid.cr 

```

in method constraints

```auto
  def constraints()

    vfl = [
        "H:|-[button1(==button2)]-12-[button2]-|",
        "H:|-[button3]-|",
        "V:|-[button1]-12-[button3(==button1)]-|",
        "V:|-[button2]-12-[button3(==button2)]-|",
      ]

    views = Pointer(Void).null
    list = @manager.add_constraints_from_description(vfl,8,8,views)
  end

```

Using  
Crystal 1.9.2  
Gtk4 shard 0.15

---

<div class="post-metadata">

**Author:** ![mdwagner](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/mdwagner/32/1077_2.png) [@mdwagner](https://forum.crystal-lang.org/u/mdwagner)\
**Post date:** [November 4, 2023, 8:29pm UTC](https://forum.crystal-lang.org/t/calling-library-function-with-a-pointer-void-argument/6142/2 "2023-11-04T20:29:38Z")

</div>

> [@gummybears](#):
>
> `manager.add_constraints_from_description(vfl,8,8,views)`

Without knowing anything about GTK4, from this doc ([https://docs.gtk.org/gtk4/method.ConstraintLayout.add\_constraints\_from\_description.html](https://docs.gtk.org/gtk4/method.ConstraintLayout.add_constraints_from_description.html)), it would imply its either a single first view or it’s a null terminated collection of views.
