Gtk function prototypes

Linux specific forum
dougmo52usr
User
User
Posts: 55
Joined: Mon Jul 18, 2016 6:43 pm

Gtk function prototypes

Post by dougmo52usr »

I see by using Pure Library Explorer that gtk_list_store_set_ has 3 args but the gtk docs show gtk_list_store_set has two plus a varargs ... . Pure Library tells me how many args but doesn't provide type information

1. Is there a PB file that shows the actual declarations for linux libraries such as Gtk functions so I can understand the args or a way to dump them from the library?
2. In gtk_list_store_set_, what is the type of the third argument?

Any short examples of how to call the gtk_list_store_set_ and gtk_list_store_set_value_ gtk functions?
dougmo52usr
User
User
Posts: 55
Joined: Mon Jul 18, 2016 6:43 pm

Re: Gtk function prototypes

Post by dougmo52usr »

I noticed that in OnBtnListStoreAddItem I could not pass a Protected gv.Gvalue to gtk_list_store_set_value_(*GtkListStore, @GtkTreeIter, 0, @gv). It fails with an "Invalid memory access". I can however declare gv.Gvalue as static or global and I get no memory error. Any ideas on this?

Code: Select all

Procedure OnBtnListStoreCreate()
  Debug #PB_Compiler_Procedure
  *GtkListStore = gtk_list_store_new_(1,#G_TYPE_STRING)
  If *GtkListStore
    Debug "gtk_list_store_new_ OK"
  Else
    Debug "gtk_list_store_new_ Failed"
  EndIf 
EndProcedure

Procedure OnBtnListStoreAddItem()
  Debug #PB_Compiler_Procedure
  If *GtkListStore
    Protected GtkTreeIter = #Null
    gtk_list_store_append_(*GtkListStore, @GtkTreeIter)
    FillMemory(@gv,SizeOf(gv),0)
    g_value_init_(@gv,#G_TYPE_STRING)
    g_value_set_string_(@gv,"Hello, world!")
    gtk_list_store_set_value_(*GtkListStore, @GtkTreeIter, 0, @gv)
  EndIf
EndProcedure
Post Reply