Error with "g_signal_connect_data_" since PB 5.40
Error with "g_signal_connect_data_" since PB 5.40
Since PB 5.40 I get the following error from the compiler at line:
g_signal_connect_data_(*Widget, *buffer, Function, user_data.i, 0, 0)
The error: Bad parameter type: a string is expected.
Before, with exactly the same code files, I didn't get this or any other error.
Now, my question is: At which part PureBasic expects now a string and didn't before?
Thanks
gerd
g_signal_connect_data_(*Widget, *buffer, Function, user_data.i, 0, 0)
The error: Bad parameter type: a string is expected.
Before, with exactly the same code files, I didn't get this or any other error.
Now, my question is: At which part PureBasic expects now a string and didn't before?
Thanks
gerd
Re: Error with "g_signal_connect_data_" since PB 5.40
Hello Gerd!
In your example the *buffer-argument is the mentioned string and it seems to be no longer a pointer:
You could use something like: But the safe way is an import like:and a call likeso the string is reliably passed as UTF-8.
Best Regards, Charly
In your example the *buffer-argument is the mentioned string and it seems to be no longer a pointer:
You could use something like:
Code: Select all
g_signal_connect_data_(*gInstance, "value-changed", @My_Callback(), Variable, #Null, #Null)
Code: Select all
g_signal_connect_data(*instance, detailed_signal.p-utf8, *c_handler, *pdata, destroy= 0, flags= 0)
Code: Select all
g_signal_connect_data(*gInstance, "value-changed", @My_Callback(), Variable);, #Null, #Null)
Best Regards, Charly
PureBasic 5.4-5.7, Linux: (X/L/K)Ubuntus+Mint - Windows XP (32Bit)
PureBasic Linux-API-Library & Viewer: http://www.chabba.de
PureBasic Linux-API-Library & Viewer: http://www.chabba.de
Re: Error with "g_signal_connect_data_" since PB 5.40
Thank you Oma,
this problem seems to be solved. Unfortunately now I get the following linker error
purebasic.o: In function `PB_EndFunctions':
(.text+0xa9016): undefined reference to `gdk_pixbuf_render_pixmap_and_mask'
collect2: error: ld returned 1 exit status
and I have no clue, what it means.
I would be grateful, if somebody could help me with this too.
Thanks
gerd
this problem seems to be solved. Unfortunately now I get the following linker error
purebasic.o: In function `PB_EndFunctions':
(.text+0xa9016): undefined reference to `gdk_pixbuf_render_pixmap_and_mask'
collect2: error: ld returned 1 exit status
and I have no clue, what it means.
I would be grateful, if somebody could help me with this too.
Thanks
gerd
Re: Error with "g_signal_connect_data_" since PB 5.40
Hi Gerd,
gdk_pixbuf_render_pixmap_and_mask is deprecated in Gtk3.
Please post an example how and where it's used, then we have a chance to find a proper replacement.
Regards, Charly
gdk_pixbuf_render_pixmap_and_mask is deprecated in Gtk3.
Please post an example how and where it's used, then we have a chance to find a proper replacement.
Regards, Charly
PureBasic 5.4-5.7, Linux: (X/L/K)Ubuntus+Mint - Windows XP (32Bit)
PureBasic Linux-API-Library & Viewer: http://www.chabba.de
PureBasic Linux-API-Library & Viewer: http://www.chabba.de
Re: Error with "g_signal_connect_data_" since PB 5.40
Hi Oma,
posting an example, that's where the problem starts. My program consists of 7 files with about 25k lines
and I have no clue where this gdk_pixbuf_render_pixmap_and_mask is coming from.
I will try to find some more infos, but this might take a while.
Thanks
gerd
edit: just one question. What replaces the deprecated function?
posting an example, that's where the problem starts. My program consists of 7 files with about 25k lines
and I have no clue where this gdk_pixbuf_render_pixmap_and_mask is coming from.
I will try to find some more infos, but this might take a while.
Thanks
gerd
edit: just one question. What replaces the deprecated function?
Re: Error with "g_signal_connect_data_" since PB 5.40
Hi Gerd,
there's no direct replacement for the command (possibly used for background-images?)
Pixmap-support has dropped in Gtk3.
But maybe another method is found to fill the "source gap".
Best regards, Charly
there's no direct replacement for the command (possibly used for background-images?)
Pixmap-support has dropped in Gtk3.
But maybe another method is found to fill the "source gap".
Best regards, Charly
PureBasic 5.4-5.7, Linux: (X/L/K)Ubuntus+Mint - Windows XP (32Bit)
PureBasic Linux-API-Library & Viewer: http://www.chabba.de
PureBasic Linux-API-Library & Viewer: http://www.chabba.de
Re: Error with "g_signal_connect_data_" since PB 5.40
You can compile with the 'gtk2' subsystem if you want to support your old program with new PB version
Re: Error with "g_signal_connect_data_" since PB 5.40
if im just going to release a "regular small utility app with 'typical' GUI - nothing fancy, that doesn't specifically use any new features (to my knowledge)" should I just always compile with gtk2 or gtk3? I have no idea so any suggestions/advice welcome thankyou
Re: Error with "g_signal_connect_data_" since PB 5.40
Unfortunately I cannot compile with 'gtk2' subsystem because I get the following:
[13:12:27] Waiting for executable to start...
[13:12:27] Executable type: Linux - x86 (32bit, Unicode)
[13:12:27] Executable started.
[13:12:27] [WARNING] Main.pb (Line: 1)
[13:12:27] [WARNING] Gtk (ERROR): GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
[13:12:30] The debugged executable quit unexpectedly.
And as before, I have no clue where to look after. And what does "GTK+ 2.x symbols detected" mean?
I have set the subsystem "gtk2", so I would think the detection of GTK+ 2.x symbols is, what has to be expected?
Then why this warning, which is more likely an error, because the program quits.
Any help is welcome.
Thanks
gerd
[13:12:27] Waiting for executable to start...
[13:12:27] Executable type: Linux - x86 (32bit, Unicode)
[13:12:27] Executable started.
[13:12:27] [WARNING] Main.pb (Line: 1)
[13:12:27] [WARNING] Gtk (ERROR): GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
[13:12:30] The debugged executable quit unexpectedly.
And as before, I have no clue where to look after. And what does "GTK+ 2.x symbols detected" mean?
I have set the subsystem "gtk2", so I would think the detection of GTK+ 2.x symbols is, what has to be expected?
Then why this warning, which is more likely an error, because the program quits.
Any help is welcome.
Thanks
gerd
Re: Error with "g_signal_connect_data_" since PB 5.40
Ok!
After a bit more thinking about the original problem together with the information from Oma
about the exact position of the problem within the code, I inserted an additional line,
which solved the problem. Below I post the modification I had to make:
Here the original portion of the code:
And now the same code with an additional line inserted:
Now, what I don't understand, why the first version does not work, although,
if I use Debug to see the content of the buffer both versions show the same.
Anybody has an explanation for me?
Thanks to everybody who helped and tried to help
regards
gerd
After a bit more thinking about the original problem together with the information from Oma
about the exact position of the problem within the code, I inserted an additional line,
which solved the problem. Below I post the modification I had to make:
Here the original portion of the code:
Code: Select all
Procedure.i GTKSignalConnect(*Widget, Signal.s, Function, user_data.i)
Protected *buffer
*buffer = AllocateMemory(StringByteLength(Signal.s, #PB_Ascii) + 1)
If *buffer
PokeS(*buffer, Signal.s, -1, #PB_Ascii)
g_signal_connect_data_(*Widget, *buffer, Function, user_data.i, 0, 0)
FreeMemory(*buffer)
EndIf
EndProcedure
Code: Select all
Procedure.i GTKSignalConnect(*Widget, Signal.s, Function, user_data.i)
Protected *buffer
*buffer = AllocateMemory(StringByteLength(Signal.s, #PB_Ascii) + 1)
If *buffer
PokeS(*buffer, Signal.s, -1, #PB_Ascii)
Signal.s = PeekS(*buffer, -1, #PB_Ascii) ; <------ This is what I inserted!
g_signal_connect_data_(*Widget, Signal.s, Function, user_data.i, 0, 0)
FreeMemory(*buffer)
EndIf
EndProcedure
if I use Debug to see the content of the buffer both versions show the same.
Anybody has an explanation for me?
Thanks to everybody who helped and tried to help
regards
gerd
Re: Error with "g_signal_connect_data_" since PB 5.40
@Oma
You were right, the function "gdk_pixbuf_render_pixmap_and_mask", is used for
background images of windows. For now I just commented it out until I find a
suitable replacement.
Many thanks for your help
gerd
You were right, the function "gdk_pixbuf_render_pixmap_and_mask", is used for
background images of windows. For now I just commented it out until I find a
suitable replacement.
Many thanks for your help
gerd
Re: Error with "g_signal_connect_data_" since PB 5.40
The problem using the deprecated gdk_pixbuf_render_pixmap_and_mask() in Gtk3 when displaying a background image was already discussed in this previous thread. At the end of this thread I posted an example code which demonstrates how to display a background image using the same code for both Gtk2 and Gtk3.
Re: Error with "g_signal_connect_data_" since PB 5.40
Thank you Shardik,
it does work very well.
Greetings
gerd
it does work very well.
Greetings
gerd