Freebasic + Glade

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

Freebasic + Glade

#1 Post by Lobster »

I am putting together this info on using FreeBasic and Glade :)
http://tmxxine.com/wik/wikka.php?wakka=FreeBasic
  • FreeBasic working
    Glade working
Now I get this . . .

Code: Select all

# glade2bas           

(<unknown>:27288): libglade-WARNING **: could not find glade file '/root/my-documents/glade2bas.glade'

(<unknown>:27288): libglade-CRITICAL **: glade_xml_get_widget: assertion `self != NULL' failed

(<unknown>:27288): libglade-CRITICAL **: glade_xml_get_widget: assertion `self != NULL' failed
Segmentation fault
# 
What does it mean?
Is there any hope?
HELP! :?
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#2 Post by MU »

I think glade2bas is outdated and will not work with new versions of Glade, if I remember well.

You can do this:

freebasic has an example folder.
FreeBASIC/examples/libraries/Gtk/

I use Puppy3 with FreeBASIC-v0.18.3b-linux.tar.gz from the freebasic-website, so I don't know, if they are included in Puppy 4.

So I do:

cd FreeBASIC/examples/libraries/Gtk/
fbc glade_gui.bas
./glade_gui

That compiles and runs a program.
The program displays some elements in a window, that are loaded from glade_gui.xml.
This is a file created with Glade.
You cannot open this file in Glade 3, but that is no problem, as we can use a new one.

Now for tests, I create a subfolder "1".
I copy there glade_gui.bas and glade_gui.
I run glade (3.0.3), create a new window with some buttons.
I save that file as /root/project.glade.
Now I copy this file to FreeBASIC/examples/libraries/Gtk/1/glade_gui.xml

Then I type:
cd FreeBASIC/examples/libraries/Gtk/1/
./glade_gui

Now my new window is displayed, instead of the Glade-example.

The buttons do not react, and I must exit it by pressing CTRL-C in the consolewindow.
The reason is, that the buttons have different names than in the Glade-example xml file.
So I now had to edit glade_gui.bas to rename the example-functions, where a button is pressed.
You can open glade_gui.xml in a texteditor, to see the names (or look them up in the properties dialog in Glade).

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#3 Post by Lobster »

Thanks Mark ;)

I just found this on Barrys blog
which means it is a known bug
that was? is? sorted?
'glade2bas' is a GUI application for converting a .glade file into a skeleton freeBASIC program. It is in the devx_400.sfs file, however it was reported on the forum that it doesn't work -- its own glade2bas.glade file is missing.
I had to hack the source code, as it only looks for glade2bas.glade in the "current directory", which could be anything. I fixed it at /usr/bin/glade2bas.glade, so it is always found.

I have created a PET package 'glade2bas_DEV-1.0-patched1' rather than put it directly into the devx directory, as I'm gradually working toward Unleashed having all 'devx' components as individual PET packages. All chosen '_DEV' packages will end up in the 'devx' file.
Glade2bas also now has a menu entry, in the Utility menu. There is also a help file at /usr/share/doc/freebasic/howto_glade_freebasic.pdf.
I do not have glade2bas.glade anywhere on my system
. . . that might be the problem?

I am using Puppy 4 (two alphas not yet working on my hardware . . .)
so may have to come back to this thread

Other advisement welcome . . .
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#4 Post by MU »

glade2bas.glade
Maybe that is the one, that you create yourself with glade for your program?
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#5 Post by Lobster »

:lol:

Did think of that but was too obvious :oops:

Will give it a go . . .
many thanks
. . . ah progress . . .

Code: Select all

# glade2bas
Segmentation fault
# 
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

Post Reply