It is currently Wed Jul 08, 2020 10:38 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Gtk function prototypes
PostPosted: Mon Mar 06, 2017 7:46 pm 
Offline
User
User

Joined: Mon Jul 18, 2016 6:43 pm
Posts: 38
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: Gtk function prototypes
PostPosted: Tue Mar 07, 2017 2:22 am 
Offline
User
User

Joined: Mon Jul 18, 2016 6:43 pm
Posts: 38
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:
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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye