Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,5 @@
|
|||
program hello
|
||||
use windows
|
||||
integer :: res
|
||||
res = MessageBoxA(0, LOC("Hello, World"), LOC("Window Title"), MB_OK)
|
||||
end program
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
program hello
|
||||
use user32
|
||||
integer :: res
|
||||
res = MessageBox(0, "Hello, World", "Window Title", MB_OK)
|
||||
end program
|
||||
40
Task/Hello-world-Graphical/Fortran/hello-world-graphical-3.f
Normal file
40
Task/Hello-world-Graphical/Fortran/hello-world-graphical-3.f
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
module handlers_m
|
||||
use iso_c_binding
|
||||
use gtk
|
||||
implicit none
|
||||
|
||||
contains
|
||||
|
||||
subroutine destroy (widget, gdata) bind(c)
|
||||
type(c_ptr), value :: widget, gdata
|
||||
call gtk_main_quit ()
|
||||
end subroutine destroy
|
||||
|
||||
end module handlers_m
|
||||
|
||||
program test
|
||||
use iso_c_binding
|
||||
use gtk
|
||||
use handlers_m
|
||||
implicit none
|
||||
|
||||
type(c_ptr) :: window
|
||||
type(c_ptr) :: box
|
||||
type(c_ptr) :: button
|
||||
|
||||
call gtk_init ()
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL)
|
||||
call gtk_window_set_default_size(window, 500, 20)
|
||||
call gtk_window_set_title(window, "gtk-fortran"//c_null_char)
|
||||
call g_signal_connect (window, "destroy"//c_null_char, c_funloc(destroy))
|
||||
box = gtk_hbox_new (TRUE, 10_c_int);
|
||||
call gtk_container_add (window, box)
|
||||
button = gtk_button_new_with_label ("Goodbye, World!"//c_null_char)
|
||||
call gtk_box_pack_start (box, button, FALSE, FALSE, 0_c_int)
|
||||
call g_signal_connect (button, "clicked"//c_null_char, c_funloc(destroy))
|
||||
call gtk_widget_show (button)
|
||||
call gtk_widget_show (box)
|
||||
call gtk_widget_show (window)
|
||||
call gtk_main ()
|
||||
|
||||
end program test
|
||||
Loading…
Add table
Add a link
Reference in a new issue