Hi,
As I'm working on an application that will be cross-platform (Windows/Linux/MacOSX), I'm starting to port my Windows GUI code to Linux in wich I'm using a lot of controls subclassing.
Having then started to learn the GTK+2 API, I've discovered that some functions are not recognized by PureBasic.
For instance, for a StringGadget (entry/editable under gtk), I've been able to use gtk_entry_get_layout_() to retrieve the PangoLayout but I've been unable to use gtk_entry_layout_index_to_text_index_() or gtk_entry_text_index_to_layout_index_() as those are not recognized by PureBasic.
What should I do to use/add to the list of recognized GTK+2 function by PureBasic ?
Thanks in advance,
Cheers,
Guy.
ps: I'm using PB 4.61 (x64) on Ubuntu 12.04.1
Missing GTK+2 API
- grabiller
- Enthusiast
- Posts: 309
- Joined: Wed Jun 01, 2011 9:38 am
- Location: France - 89220 Rogny-Les-Septs-Ecluses
- Contact:
Missing GTK+2 API
guy rabiller | radfac founder / ceo | raafal.org
Re: Missing GTK+2 API
Hello grabiller,
When you discover a GTK API are not recognized by PureBasic you have to do something like this :
Best regards
Guimauve
When you discover a GTK API are not recognized by PureBasic you have to do something like this :
Code: Select all
ImportC "-gtk"
gdk_event_handler_set(*func, *mdata, *notify)
g_signal_connect(instance, signal.p-utf8, *fn, *vdata, destroy = 0, flags = 0) As "g_signal_connect_data"
g_object_set_data_(*Widget.GtkWidget, strData.p-utf8, *userdata) As "g_object_set_data"
g_object_get_data_(*Widget.GtkWidget, strData.p-utf8) As "g_object_get_data"
g_object_set_property_(*widget, Property.p-utf8, *val) As "g_object_set_property"
EndImport
Guimauve
Dear Optimist, Pessimist,
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
- grabiller
- Enthusiast
- Posts: 309
- Joined: Wed Jun 01, 2011 9:38 am
- Location: France - 89220 Rogny-Les-Septs-Ecluses
- Contact:
Re: Missing GTK+2 API
Ah, thanks a lot.
Is there a way to permanently add the functions into some PureBasic config/db files or something so we dont have to add the code or use additionnel includes files ?
Cheers,
Guy.
Is there a way to permanently add the functions into some PureBasic config/db files or something so we dont have to add the code or use additionnel includes files ?
Cheers,
Guy.
guy rabiller | radfac founder / ceo | raafal.org
Re: Missing GTK+2 API
You have to add these ImportC statements to your programs.grabiller wrote:What should I do to use/add to the list of recognized GTK+2 function by PureBasic ?
Code: Select all
ImportC ""
gtk_entry_layout_index_to_text_index(*Entry.GtkEntry, LayoutIndex.I)
gtk_entry_text_index_to_layout_index(*Entry.GtkEntry, TextIndex.I)
EndImport
You should put these lines into an include file.grabiller wrote:Is there a way to permanently add the functions into some PureBasic config/db files or something so we dont have to add the code or use additionnel includes files ?
- grabiller
- Enthusiast
- Posts: 309
- Joined: Wed Jun 01, 2011 9:38 am
- Location: France - 89220 Rogny-Les-Septs-Ecluses
- Contact:
Re: Missing GTK+2 API
Yes, thanks.
I thought there was some way to include the missing apis into some config files for PureBasic to be permanently 'aware' of the new apis entries without ressorting to include files.
Cheers,
Guy.
I thought there was some way to include the missing apis into some config files for PureBasic to be permanently 'aware' of the new apis entries without ressorting to include files.
Cheers,
Guy.
guy rabiller | radfac founder / ceo | raafal.org
Re: Missing GTK+2 API
One possibility would be to automatically add the ImportC statements by a special IDE tool to each new source file opened in the PB IDE. You will need PB 5.00 Beta 2 for this. Take a look into freak's posting:grabiller wrote:I thought there was some way to include the missing apis into some config files for PureBasic to be permanently 'aware' of the new apis entries without ressorting to include files.
http://www.purebasic.fr/english/viewtop ... 24&start=7
- grabiller
- Enthusiast
- Posts: 309
- Joined: Wed Jun 01, 2011 9:38 am
- Location: France - 89220 Rogny-Les-Septs-Ecluses
- Contact:
Re: Missing GTK+2 API
Hi,
Thanks for the info, indeed this will be very practical.
That said I've found the pbsoimporter tool wich seems to be the answer to my needs, I'll investigate further.
Cheers,
Guy.
Thanks for the info, indeed this will be very practical.
That said I've found the pbsoimporter tool wich seems to be the answer to my needs, I'll investigate further.
Cheers,
Guy.
guy rabiller | radfac founder / ceo | raafal.org