flat assembler
Message board for the users of flat assembler.

flat assembler > Linux > GTK examples in FASM obsolete?

Author
Thread Post new topic Reply to topic
keantoken



Joined: 19 Mar 2008
Posts: 69
Hello all.

The GTK examples work after installing the now more hard to find GTK/Glib 1.2. Even so, I get this error:

Code:
$ ./button

Gtk-WARNING **: Failed to load module "libcanberra-gtk-module.so": libcanberra-gtk-module.so: cannot open shared object file: No such file or directory
Button was clicked...

Button was clicked...

closing application...
$
    


A fix for this is to do:

Code:
$ unset GTK_MODULES    


However anyone who uses the program may have to do this, until the next Linux update breaks it completely.

What changes are needed to make them current? I want to use these templates in my first programs.

- keantoken
Post 07 Dec 2010, 01:42
View user's profile Send private message Reply with quote
ProphetOfDoom



Joined: 08 Aug 2008
Posts: 120
Location: UK
Hi,

I assume you're using the gtk-button example. I got it working by doing the following.

1) Install libgtk2.0-dev (at least that's what it's called on Ubuntu)
2) Install the program pkg-config if you haven't already got it.
3) Change the second line of "makefile" to read:

Code:
gcc -Wall -s -O3  button.o -o button `pkg-config --cflags gtk+-2.0` `pkg-config --libs gtk+-2.0`
    


4) open "button.asm" and change this:

Code:
extrn gtk_signal_connect
    


to this:

Code:
extrn g_signal_connect_data
    


Now change the two calls to gtk_signal_connect so they read:

Code:
    ccall g_signal_connect_data, [hWindow], szDeleteEvent, DeleteEvent, dword 0, dword 0

    ccall g_signal_connect_data, [hButton], szClicked, ButtonClick, dword 0, dword 0
    
Post 08 Dec 2010, 21:35
View user's profile Send private message Reply with quote
keantoken



Joined: 19 Mar 2008
Posts: 69
Thanks!

- keantoken
Post 08 Dec 2010, 22:58
View user's profile Send private message Reply with quote
bazik



Joined: 28 Jul 2003
Posts: 34
Location: .de
I should really update those examples to GTK2+ Smile
Post 12 Dec 2010, 23:17
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7288
Location: Kraków, Poland
bazik! It is so amazing to see you here again. How are you?
Post 13 Dec 2010, 00:50
View user's profile Send private message Visit poster's website Reply with quote
bazik



Joined: 28 Jul 2003
Posts: 34
Location: .de
I'm fine, I posted a thread in the Heap, about emerging back from exile Wink
Post 13 Dec 2010, 12:19
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.