Display a GUI window. The window need not have any contents, but should respond to requests to be closed.

 
;GTK imports and defines etc.
%define GTK_WINDOW_TOPLEVEL 0
 
extern gtk_init
extern gtk_window_new
extern gtk_widget_show
extern gtk_signal_connect
extern gtk_main
extern g_print
extern gtk_main_quit
 
bits 32
 
section .text
	global _main
 
        ;exit signal
	sig_main_exit:
		push exit_sig_msg
		call g_print
		add esp, 4
		call gtk_main_quit
		ret
 
	_main:
		mov ebp, esp	
		sub esp, 8
		push argv
		push argc
		call gtk_init
		add esp, 8				;stack alignment.
		push GTK_WINDOW_TOPLEVEL
		call gtk_window_new
		add esp, 4
		mov [ebp-4], eax		;ebp-4 now holds our GTKWindow pointer.
		push 0
		push sig_main_exit
		push gtk_delete_event
		push dword [ebp-4]
		call gtk_signal_connect
		add esp, 16
		push dword [ebp-4]
		call gtk_widget_show
		add esp, 4
		call gtk_main	
 
section .data
;sudo argv 
argc                dd 1
argv                dd args
args                dd title   
						  dd 0
 
title               db "GTK Window",0
gtk_delete_event   db 'delete_event',0
exit_sig_msg      db "-> Rage quitting..",10,0
 
 