Skip to content
Browse files

Add DLLEXPORT attribute to handler functions in gtkbuilder2.f90

to make it working on MS Windows systems
  • Loading branch information...
1 parent 37c835e commit 600055dce25e07da247b8ffaaea26a586c0ed005 Jens Hunger committed Jun 14, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 examples/gtkbuilder2.f90
View
5 examples/gtkbuilder2.f90
@@ -52,6 +52,7 @@ module handlers
! X Window system. Then callback functions must have an event argument:
function delete_event (widget, event, gdata) result(ret) bind(c)
use iso_c_binding, only: c_ptr, c_int
+ !GCC$ ATTRIBUTES DLLEXPORT :: delete_event
integer(c_int) :: ret
type(c_ptr), value :: widget, event, gdata
print *, "my delete_event"
@@ -61,6 +62,7 @@ end function delete_event
! "destroy" is a GtkObject signal
subroutine destroy (widget, gdata) bind(c)
use iso_c_binding, only: c_ptr
+ !GCC$ ATTRIBUTES DLLEXPORT :: destroy
type(c_ptr), value :: widget, gdata
print *, "my destroy"
call gtk_main_quit ()
@@ -69,6 +71,7 @@ end subroutine destroy
! "clicked" is a GtkButton signal
function hello (widget, gdata ) result(ret) bind(c)
use iso_c_binding, only: c_ptr, c_int
+ !GCC$ ATTRIBUTES DLLEXPORT :: hello
integer(c_int) :: ret
type(c_ptr), value :: widget, gdata
print *, "Hello World!"
@@ -77,6 +80,7 @@ end function hello
function button1clicked (widget, gdata ) result(ret) bind(c)
use iso_c_binding, only: c_ptr, c_int
+ !GCC$ ATTRIBUTES DLLEXPORT :: button1clicked
integer(c_int) :: ret
type(c_ptr), value :: widget, gdata
print *, "Button 1 clicked!"
@@ -85,6 +89,7 @@ end function button1clicked
function button2clicked (widget, gdata ) result(ret) bind(c)
use iso_c_binding, only: c_ptr, c_int
+ !GCC$ ATTRIBUTES DLLEXPORT :: button2clicked
integer(c_int) :: ret
type(c_ptr), value :: widget, gdata
print *, "Button 2 clicked!"

0 comments on commit 600055d

Please sign in to comment.
Something went wrong with that request. Please try again.