flat assembler
Message board for the users of flat assembler.
Index
> Linux > Fasm and gtk+-2.0 with g_signal_connect |
Author |
|
scientica 18 Dec 2003, 13:54
please post your source (it makes it easier to see what's the error, like maybe youforgot to make some extrn (or somthing like that))
_________________ ... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself. - Bradley Kuhn |
|||
18 Dec 2003, 13:54 |
|
Todd 26 May 2004, 22:14
I'm having the same exact problem. If it will help, here's the source for my test, and the commands I used to compile it:
Code: format ELF include 'cdecl.inc' public main extrn gtk_init extrn gtk_main extrn gtk_window_new extrn gtk_widget_show extrn gtk_main_quit extrn g_signal_connect extrn g_print section '.text' executable proc main, argc, argv enter lea eax, [argc] lea ebx, [argv] ccall gtk_init, eax, ebx ccall gtk_window_new, 0 mov [window], eax ccall g_signal_connect, [window], ev_delete, delete_event ccall g_signal_connect, [window], ev_destroy, destroy_event ccall gtk_widget_show, [window] call gtk_main return proc delete_event, widget, event, data enter mov eax, 0 return proc destroy_event, widget, data enter call gtk_main_quit return section '.data' writeable window dd ? ev_delete db 'delete_event', 0 ev_destroy db 'destroy', 0 And for compiling: Code: fasm gtktest.asm gtktest.o gcc gtktest.o -o gtktest `pkg-config --cflags --libs gtk+-2.0` Last edited by Todd on 30 May 2004, 22:09; edited 2 times in total |
|||
26 May 2004, 22:14 |
|
scientica 30 May 2004, 17:22
Aha! I think I found the problem: http://mail.gnome.org/archives/gtk-app-devel-list/2002-November/msg00275.html
(I sort of suspected it when seeind the "#define" in the header file...) Quote: g_signal_connect is a macro, so (AFAIK) you cannot import it. You can -- I'll see if I can get it to work with g_signal_connect_data instead - or make a nice fasm macro |
|||
30 May 2004, 17:22 |
|
Todd 30 May 2004, 22:14
Yes, that was it! Thanks for finding that, it works great now. All you need to do is change the g_signal_connect parts to g_signal_connect_data, and add two parameters onto the end. For example:
This: Code: extrn g_signal_connect ccall g_signal_connect, [widget], signal, function Becomes this: Code: extrn g_signal_connect_data ccall g_signal_connect_data, [widget], signal, function, dword 0, dword 0 The last two parameters, according to gsignal.h, are "destroy_data" and "connect_flags". If you use the g_signal_connect macro (in C) they are always set to 0. Thanks again! |
|||
30 May 2004, 22:14 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.