Page 2 of 4
Posted: Tue May 23, 2006 9:38 am
by walker
Hi,
I'll do... that was the reason why I'd started glade2pb

Posted: Tue May 23, 2006 1:29 pm
by Inf0Byt3
Extremelly usefull! Thanks walker! * Thumbs up *
Posted: Tue May 23, 2006 7:11 pm
by walker
Thank you..
So I might started it at the right time... as you'd switched completely to Linux (read it in another post

....good decision)
Posted: Tue May 23, 2006 7:35 pm
by Inf0Byt3
Thanks! BTW, I'm having a big problem... Can't find any docs for GLADE and the package I got with urpmi doesn't have the docs in it... Do you know some sites where I can learn to use it? I can't move widgets

(.
PS. Running on Mandriva2006 and your app exits whenever I push any button. What should I do?
Posted: Tue May 23, 2006 8:38 pm
by Nik
Well the exact same problem exists on dapper too as mentioned above I will download his package now and begin investigation...
EDIT:
Ok I think it is a serious problem, however I had luck and could find some things out.
I startet the PB code with the Debugger, all works well until one clicks a button, then the Debugger show a Memory access violation at the end of the procedure. I know nothing about gtk and have never used it howeverr I suspected that the callbacks are called by the signal handlers
Code: Select all
g_signal_connect_object_( *toolbutton1, "clicked",@on_toolbutton1_clicked(),#Null, #Null);
so I removed all of the signal connects and ran again now I couldn crahsh it, so I enabled the first one and added a few simple commands to it and a CallDebugger in the beginning. This showed that the commands are run, and it crashes only at the ProcedureReturn. Though I know very little ASM I suspected that ProcedureReturn uses the assembler "ret" menemonic so I added !ret between the commands and this lead to:
Code: Select all
Procedure on_toolbutton1_clicked (toolbutton,user_data)
;Your code here
CallDebugger
a.l=10
b.l=20
Debug a+b
Debug b-a
!inc eax
debug a*b
!ret
c.l=10
d.l=20
Debug c+d
EndProcedure
Again stepping through this part of the code showed that it is now crashing at the !ret instruction. This leads to the conclusion that the problem is that the processor doesn't know where to jump when a ret happens. As I said I know nothing about asm, but I suspect that it has to do with how the procedure is called, as far as I know this is called the calling convention and it seems that different GTK versions use different calling conventions. And that PB is using a different one. I will now try to declare the callback as ProcedureC and report wether this solves the problem...
I hope this news may help you walker or maybe even Fred, since he might run into the same problem.
Posted: Tue May 23, 2006 9:00 pm
by Inf0Byt3
Great! I hope you find the problem...
BTW, I ran it from the console and got this error: "Segmentation error!". Hope it helps.
Posted: Tue May 23, 2006 9:13 pm
by Nik
Well ok I found a working, however ugly solution, declaring the Procedure with ProcedureCDLL solves the crashing. On the other hand the Debugger crashes when he encounters such a procedure.
An updated version of the example can be found here
sceneproject.org/~niklas/PBTests/CDLLTest.tar.gz
Sourcecode and excutable is includede
@Infobyte: Please test wether it fixes Mandriva as well
Posted: Tue May 23, 2006 9:48 pm
by Inf0Byt3
Yep, tested it and it works perfectly. Here's a screenshot :

Posted: Tue May 23, 2006 9:52 pm
by Nik
Hehe, realy realy nice to see.
Posted: Tue May 23, 2006 10:08 pm
by Inf0Byt3
I hope walker will fix this soon

...We really need a VD. It would spare us hours of work.
Posted: Tue May 23, 2006 10:15 pm
by walker
Hi,
could you please download g2pb again? I'd tried (after studying the gtk2 reference a while) to solve the problem... please start the prog from a command line and report the output (if any)... I'd changed the G_Signal_Connect_Object() call a bit... (may i'd missunderstood it in the past...)
The downloadlink:
http://home.arcor.de/x-linux/pure/g2pb
Thanks in advance
PS: It was Nik's report which brought me to the idea
Posted: Tue May 23, 2006 10:21 pm
by Nik
Unlike the ProcedureCDLL trick it doesn't fix the problem the error still is "Speicherzugriffsfehler" aka "Memory Access Violation"
Posted: Tue May 23, 2006 10:37 pm
by walker
Hmmmmm... I belive it's a limmitation of PB3.94...
I get NO error running it on my Kanotix-Box (full updated; debian based)
My opinion:
When Fred started the development, he uses a GTK/GLib etc Version of 2.4 or 2.6 I think... These libs are included in PB...(statically) That's why PB 3.94 runs on older Distros without any issue (even the GTK2-Ide works perfect)
But who uses a distro from around the beginning of 2005 without updates? (Nobody... except maybe Fred

)
That is an issue to be solved in the future... the installed version should be used dynamically...(the GTK-development is now at V2.9)
Anyway.. I don't give up... there is a solution.. somewhere.. I still have to find it :roll:
Posted: Tue May 23, 2006 10:39 pm
by Nik
Just read two or three posts above and see my solution^^ :roll:
Posted: Tue May 23, 2006 10:51 pm
by walker
Hi,
I'd raed it.. and I'm changing the Source at the moment... thanks.. but here is a screenshot of the example when I'm running it... please compare it to the one of Inf0Byt3...
the 3 Buttons are the difference (no Icons).. Why?? I don't know.. I think, that's an issue of the different gtk versions (see above) and such things should not happen!
If this issue is not solved in PB4.0, you'll never be able to give away an application which uses GTK-stuff... you'll never be sure about if it's working or not...
My screenshot:
