Page 1 of 4

[PB-Linux] Using GLADE as VD for pureBasic (0.3.0)

Posted: Sun May 14, 2006 1:10 pm
by walker
Hi,

this is a simple, not yet finished project. It uses Glade C-outputfiles to convert them to PureBasic-source.

Image

To use this prog. you have to install Glade (if not already done).
After this, start Glade and create a project (i.e. a Window with some Buttons)
Save and create the sourcecode (make sure that Language in options is C..) but if you don't change anything, all runs well :wink:

The Project-path specified in the options must be selected in the options of glade2pb too... that's all (Language-selection doesn't work yet)
After that a click on the left most button will refresh the dropdown-list and show all projects in the given path (if any).
Select a project from the list an push the second button "Umwandeln". Now you'll find in the "Project folder"->src 3 pb-files
main.pb, interface.pb (the window-definitions etc.) and callbacks.pb (the procedures for each event defined in Glade)

If a requester pops up after selecting a project asking you to specify the project manually... you have different gtk version than me....(this is part of a workaround....and not avoidable yet....)

If a Gadget (or Widget in GTK) uses variables, they're not treaten right for the moment (i.e. toolbar; these variables must be edited by hand)

Btw.: the Glade2PB GUI is designd with Glade...

If there is enough interest in this project, I'll continue it....

Sourcecode then will be released with version 4 of PB for Linux because there are some workarounds (some things are missing or broken in V3.94, you'll fnd them in Bug-Reports later on) and the code itself isn't very clean...

At least, here is the downloadlink (approx 57k) http://home.arcor.de/x-linux/pure/g2pb
After downlading you may have to make it executable..

Comments, questions etc. are welcome...

...and if somone can provide a screenshot using an english environment...(want to know, if all GTK+ entries are translated automatically) Thanks

Posted: Sun May 14, 2006 4:48 pm
by josku_x
Looks very interesting, walker. I am soon switching to Linux, so maybe I'll have a look to Glade and your Glade2PB project. I hope you finish it soon :o

Posted: Sun May 14, 2006 10:43 pm
by Beach
Looks good so far. What a great idea!

Here is a screen shot on my english setup:

Image

Posted: Sun May 14, 2006 10:47 pm
by Beach
Just wanted to let you know that when I click the "Preferences" button I receive the following error:

Code: Select all

(g2pb:21357): Gtk-CRITICAL **: gtk_entry_set_text: assertion `text != NULL' failed
Segmentation fault

Posted: Mon May 15, 2006 9:08 am
by walker
Hi Beach,

thank you for the sreenshot... works as expected... 8) and for the error report.
The error raises only the first time you call the preferences because the path-var i'm using is NULL at this time (fixed) If the Preferences-Dialog is closed once with OK the error disapears...(it should be... :) ) even if no path is specified
I'd uploaded the fixed version if this error causes any problems on your machine...

@all: I would appreciate it if I could see more screenshots of any language used in this comunity (i.e. french,spanish etc.) to see, how it looks like in your language...

Posted: Mon May 15, 2006 1:55 pm
by Nik
Here it crashes with every button I click (Ubuntu Dapper Drake fully updated.)
Running it from the console only shows "Speicherfehler"
libgt1.2 is version 1.2.10-18
libgtk2.0 is version 2.8.17ubuntu4

Posted: Mon May 15, 2006 2:11 pm
by walker
Hi,

hmm.... and PureBasic is running? can you please use the gadget-example and compile it with GTK2 as Subsystem? (is the ubuntu a 32bit or 64bit version :?: ) Does it work?

AFAIK beach is running ubuntu too (seems so because of the window-decoration and colors) maybe I'm wrong...

Posted: Mon May 15, 2006 2:28 pm
by Nik
Beachs window decoration seem like Breezy not dapper like I'm running. Yes Purebasic runs fine, I have the scintilla issue though in the gtk2 ide, the example runs fine with gtk2 subsystemm though. You application also runs until the point when I click a button since this also happens with the quit button, it's probably a problem in the callback algorithm

PS: Does the color requester in the requerster example work for you? here it crashes unlike the other requesters.

Posted: Mon May 15, 2006 2:35 pm
by walker
Hi,

can you please execute this code

Code: Select all

Debug #GTK_MAJOR_VERSION
Debug #GTK_MINOR_VERSION
Debug #GTK_MICRO_VERSION
and tell me the result? Thanks

Posted: Mon May 15, 2006 2:46 pm
by Nik
with gtk2 subsystem it says
2
4
13

Posted: Mon May 15, 2006 8:59 pm
by walker
Hi,

hmmm.. that's what it says on my machine too... I believe, that's the Version Fred has used... It's not my installed version (that is 2.8.somewhat)

I'd downloaded Ubuntu Dapper flight-7 and tried to run glade2pb.. but it fails on every button-click (as Nik reported)
Console-output says "Speicherzugriffsfehler" what means "Invalid memory access"... but why :?: I'm a little confused now...

I'll try to find out....

Posted: Fri May 19, 2006 4:10 pm
by walker
Nik wrote: PS: Does the color requester in the requerster example work for you? here it crashes unlike the other requesters.
First it does not... but experimenting a little and I'd found out, that if you add a color

Code: Select all

Colour=ColorRequester(0)
all runs well :? It seems to be a bug.... all other Requesters are working...

Posted: Sun May 21, 2006 12:14 am
by Nik
Ok, I think you posted the color requester bug. Nevertheless the problem with dapper remains, I have just tested and now if I hit the Information button it the messagebox shows up but then it segfaults. Could you please send me the complete sourcecode of a program with maybe 3 buttons which show maybe messageboxes, done with your program, then I could use the Purebasic debugger to investigate further. I think this is very important since the dapper release is close. It would be cool if you could include the equivalent c source too. So we can check wether the bug is in gtk2 alone or in pb (I use Anjuta and glade produces project files for it so the whole package would be perfect.).

Posted: Tue May 23, 2006 12:06 am
by walker
Hi Nik,

here is a link to a packed project http://home.arcor.de/x-linux/pure/Projekt1.tar.gz which contains a small app (a window with a toolbar an 3 additional buttons) The original c-source is untouched. Extract it to the glade-project-folder...
I'd altered the PB-files (due to some restrictions in PB3.94) so they're compiling without error (only a few changes which imho does not affect the generally generated source itself)

It would be cool to find out, why on Dapper Drake the invalid memory access occurs :twisted:

Thanks in advance

Posted: Tue May 23, 2006 7:52 am
by bembulak
What an interesting project!
Since there is no Visual Designer for Linux-Users, this is really interesting! I hope you continue this project!
Thank you!