How to get the GTK version of MaxIDE?

Archives Forums/Linux Discussion/How to get the GTK version of MaxIDE?

Wellmt(Posted 2006) [#1]
I see in another thread that Brucey has been doing some outstanding work getting GTK working with Blitzmax

Can someone give me some simple instructions on how to get or build the GTK IDE.

I really can't stand the FLTK based editor and so don't bother with BM too much.

TIA.


Wellmt(Posted 2006) [#2]
It's it's the community edition that I'd like in GTK.


Wellmt(Posted 2006) [#3]
OK I guess I'll have to figure it out myself then...


Mark Tiffany(Posted 2006) [#4]
You can download the source for the CE IDE from SF.net (see link in my sig), download Brucey's GTK module, change the import in maxide.bmx from FLTK to GTK and recompile. You will need maxGUI to do this.

I have asked a few times for a binary to post on SF.net - if you, or anyone else manages to compile it I will happily post it up on SF.net for others.


Wellmt(Posted 2006) [#5]
Thanks Mark. I've got MaxGui and with these instructions I should be able to build it.

My Ubuntu box isn't stable yet, but as soon as it is and I compile it, I'll let you know.


Yan(Posted 2006) [#6]
I haven't had any luck building a stable CE IDE binary, using either the GTK or mozilla HTML controls, on Ubuntu (Edgy Eft). :o/

Although I have a feeling it's my Linux ineptitude which is to blame.


Wellmt(Posted 2006) [#7]
Yan, me neither...

It seems that the IDE compiles well enough but you need to include a module, I guess to handle the help system. The choices being Mozilla Firefox or the GTK HTML engine.

If I build with Brucey's gtkwebgtkhtml module then everything appears to build OK but I get a core dump when the IDE executes.

I can't get the gtkwebmozilla module to build. I'm getting the following:

/usr/bin/ld: warning: libxpcom_core.so, needed by /usr/lib/mozilla-firefox/libgtkembedmoz.so, not found (try using -rpath or -r

I can see that libxpcom_core.so is in /usr/lib/firefox (/usr/lib/mozilla-firefox is a link to /usr/lib/firefox)

..and I installed VMWare Workstation especially!


Wellmt(Posted 2006) [#8]
Aha..got round the module linking problem for the gtkwebmozilla module above. In case it helps anyone else:

In the shell type:
LD_LIBRARY_PATH="/usr/lib/firefox"
export it using:
export LD_LIBRARY_PATH
you can test using: echo $LD_LIBRARY_PATH

Then navigate to your Blitzmax folder and run the IDE to load the CE_IDE code and build CE_IDE.

The bad news is that this also core dumps :-(


Wellmt(Posted 2006) [#9]
The error is:

*** glibc detected *** ./maxide: double free or corruption (!prev): 0x08a05360 ***

Any ideas?


Brucey(Posted 2006) [#10]
You might want to try updating some modules and see if it makes a difference (libpng and zlib). You can download mods with the latest code for both libs via this tweaks post.
I have a feeling it might be due to a difference between the version of a library that is compiled into the exe (ie. the max module version) and one on the system. Which is why I made updated mods available.
However, since it works for me without those updates, I have as yet been unable to trace the problem any further.
If you do have any success with it, please let me know.

Since the versions of libpng and zlib included with max are fairly old now anyways, using updated versions would, in theory, have less bugs/security issues....

skid noted also that if he removed the "png" mod import from the gtkhtml mod that it would run without the memory crash - and hence me thinking that it was an issue with incompatible version of libpng...

HTH


Brucey(Posted 2006) [#11]
btw, if you build GUI apps that don't require an HTML view (and so don't need you to import either html mod) these issues don't arise.

Sorry for the problems.

I suppose this is one advantage of having a non-working html view widget built-in (a la FLTK) in that you don't have to fiddle around trying to get an external widget working...


Wellmt(Posted 2006) [#12]
Thanks Brucey, I'll give it a go. Keep up the good work.


Wellmt(Posted 2006) [#13]
Success!

I've successfully got the GTK version to build in the VMWare Ubuntu 6.10 environment with the GTK Mozilla modules. Brucey was spot on with the tips above. You need to replace the zlib, pnglib and pngloader modules with the ones linked in his message above.

You can actually use the help functions in Linux now and now Bmax looks like a proper Linux App!

Going to test it in a 'real' Ubuntu environment shortly. If it all looks OK I'll send it over to Mark T to post up.


Wellmt(Posted 2006) [#14]
Mark Tiffany, you've got mail.

It all works fine except that you need to set the LD_LIBRARY_PATH before executing the IDE. I've cobbled together a bash script for now which seems to work.


Brucey(Posted 2006) [#15]
Brucey was spot on with the tips above.


Thanks for working through it :-D

As I said before, it was always working on my various distros, so it was a bit of guesswork on my part as the the problem.

Glad to know now what it was now that had been causing the problem.
I suppose I should bug BRL with getting those tweaks made official ;-)

You have to agree that a working Help makes all the difference...


Wellmt(Posted 2006) [#16]
This modification actually makes Blitmax usable under Linux. Without the working help it was awful.Bmax IDE actually looks nice now too. I'd sign the petition!

Just need to find a neater way of launching the app without running a script, otherwise Gnome keeps prompting whether to open the script or run it.

I reckon it might be possible to construct a launcher command to do the trick. I'll read through this and see if it helps.

http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html


Brucey(Posted 2006) [#17]
How's about ldconfig ?

ldconfig is an application that "permanently" tells the OS where to find shared libraries.

usage:
ldconfig path/to/the/shared/objects

..which adds the specific directory to the internal list.
(you'll need root/sudo access to do this, of course)

Means you don't need to set LD_LIBRARY_PATH in a script.

Your other option is to either add your LD_LIBRARY_PATH export to your .profile or /etc/profile, which should mean it's set when you login.


I wrote the GTK module simply because the FLTK IDE didn't work properly.


Mark Tiffany(Posted 2006) [#18]
Mark Tiffany, you've got mail.

Ta! I'm at work right now, but will try to check it out and post it up tonight.


Yan(Posted 2006) [#19]
I'd already installed the updated mods (ta very much) and it seems that I only needed to build in release mode all along as, for some strange reason, it was debug mode that was giving me all the problems...???

I think I'll try rebuilding *all* modules later and see if that helps.

Anyway, thanks for the great work you've done on the modules, Brucey.


Wellmt(Posted 2006) [#20]
Another good one from Brucey. In Ubuntu, Simply open a terminal and type:

sudo ldconfig /usr/lib/firefox

enter your password and you'll be able to run the GTK IDE with no problems, even after logging out and back in again.

In some other distros you may need to change the path in the line above to ldconfig /usr/lib/mozilla-firefox or to wherever the libgtkembedmoz.so file can be found on your system. Also you may need to use the root user account if your distro isn't configured to use sudo.


Brucey(Posted 2006) [#21]
Note on those zlib / libpng module updates - are now officially available via the usual syncmods :-)


Nigel Brown(Posted 2006) [#22]
Just downloaded the GTK mod from your website and CTL-D returns an error:

Compile Error
Overriding method differs by type

When I click close it takes me to line 930 of gtkgadget.bmk that reads:

Method PopupMenu( menu:TGAdget )


Brucey(Posted 2006) [#23]
Yeah, looks like the MaxGUI API was changed without anyone mentioning anything.
Until I get it updated, you can change that line to :
Method PopupMenu(menu:TGadget, extra:Object=Null)


On the same note... FLTK GUI also has the issue (well, it seems to on my copy of max on linux)


Nigel Brown(Posted 2006) [#24]
Brucey, thanks works fine now. Next problem I have is when I include bah.gtkmaxgui i get:

Linking:main
/usr/lib/gcc/i586-suse-linux/4.1.0/../../../../i586-suse-linux/bin/ld: cannot find -lglib-2.0
collect2: ld returned 1 exit status

any ideas?


Brucey(Posted 2006) [#25]
perhaps you don't have the developer gtk files installed?

The package names tend to have "devel" in them, eg.
glib2-devel-2.8.5-23.i586.rpm

Normal distros don't require the developer shared objects. They are only required for linking (during compilation).

You can (generally) tell if you are missing a dev library because the file with ".so" as the prefix isn't in your /usr/lib
For example, you might see
libglib-2.0.so.0.0.6
libglib-2.0.so.0

but the linker requires
libglib-2.0.so


You *can* cheat, by creating a symlink of that name and point it to the ..0.0.6 file... but it's better if you have the *proper* package installed.

If you look at the list of imports with "-lxxxx", those are at least some of the ones you'll need.
If your package manager is half-decent, getting the gtk+ 2.0 dev one should also net you the other required libraries.


Remember, these dev packages are only used for compiling. After that, your exe only uses the normal libs.

:o)


Nigel Brown(Posted 2006) [#26]
Brucey, Yet again you save the day had to install another lib as well but then all compiled an ran. Things need a little housekeeping now to place panels etc but looks 100% better than before. Thnk you.


Nigel Brown(Posted 2006) [#27]
Just downloaded the maxide120_d.bmx file and compiled it, looks really good apart from the colours are not default and if you edit them under IDE options they dont actualy change?

I am using SUSE 10.1


Mark Tiffany(Posted 2006) [#28]
I've just posted the GTK linux build provided by wellmt on the SF.net site.


Wellmt(Posted 2006) [#29]
The text cursor is really difficult to see. Does anyone know of a way around it?