Permalink
Browse files

* Add scrolled window to HL_CONTAINER, and a markup friendly set labe…

…l for HL_BUTTON

* Change various NULL settings to use the ISO_C_BINDING values in all HL modules.
  • Loading branch information...
1 parent 5af09d1 commit e6eb552ef48fb51982b0343b9c3536307c613700 @jtappin jtappin committed May 16, 2012
View
60 src/gtk-draw-hl-tmpl.f90
@@ -70,7 +70,7 @@ module gtk_draw_hl
& GDK_KEY_RELEASE_MASK, GDK_LEAVE_NOTIFY_MASK, GDK_POINTER_MOTION_MASK,&
& GDK_STRUCTURE_MASK, GDK_ALL_EVENTS_MASK, CAIRO_FORMAT_ARGB32, &
& GDK_COLORSPACE_RGB, GTK_POLICY_AUTOMATIC, CAIRO_FORMAT_RGB24, &
- & CNULL, NULL, FNULL, TRUE, FALSE
+ & TRUE, FALSE
use cairo, only: cairo_create, cairo_destroy, cairo_get_target, &
& cairo_image_surface_create, cairo_paint, cairo_set_source, &
@@ -205,7 +205,7 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
! Add it to a scrolling window if one is requested
if (present(scroll)) then
- scroll = gtk_scrolled_window_new(NULL, NULL)
+ scroll = gtk_scrolled_window_new(C_NULL_PTR, C_NULL_PTR)
call gtk_scrolled_window_set_policy(scroll, GTK_POLICY_AUTOMATIC, &
& GTK_POLICY_AUTOMATIC)
if (present(ssize)) &
@@ -251,49 +251,49 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
if (present(realize)) then
if (present(data_realize)) then
- call g_signal_connect(plota, "realize"//cnull, realize, &
+ call g_signal_connect(plota, "realize"//c_null_char, realize, &
& data_realize)
else
- call g_signal_connect(plota, "realize"//cnull, realize)
+ call g_signal_connect(plota, "realize"//c_null_char, realize)
endif
end if
! Destroy signal
if (present(destroy)) then
if (present(data_destroy)) then
- call g_signal_connect(plota, "destroy"//cnull, destroy, &
+ call g_signal_connect(plota, "destroy"//c_null_char, destroy, &
& data_destroy)
else
- call g_signal_connect(plota, "destroy"//cnull, destroy)
+ call g_signal_connect(plota, "destroy"//c_null_char, destroy)
end if
else
- call g_signal_connect(plota, "destroy"//cnull, &
+ call g_signal_connect(plota, "destroy"//c_null_char, &
& c_funloc(hl_gtk_drawing_area_destroy_cb))
end if
! Expose event
if (present(expose_event)) then
if (present(data_expose)) then
-!!$2 call g_signal_connect(plota, "expose-event"//cnull, expose_event, &
+!!$2 call g_signal_connect(plota, "expose-event"//c_null_char, expose_event, &
!!$2 & data_expose)
-!!$3 call g_signal_connect(plota, "draw"//cnull, expose_event, &
+!!$3 call g_signal_connect(plota, "draw"//c_null_char, expose_event, &
!!$3 & data_expose)
endif
else
-!!$2 call g_signal_connect(plota, "expose-event"//cnull, &
+!!$2 call g_signal_connect(plota, "expose-event"//c_null_char, &
!!$2 & c_funloc(hl_gtk_drawing_area_expose_cb))
-!!$3 call g_signal_connect(plota, "draw"//cnull, &
+!!$3 call g_signal_connect(plota, "draw"//c_null_char, &
!!$3 & c_funloc(hl_gtk_drawing_area_expose_cb))
end if
! Button_press event
if (present(button_press_event)) then
if (present(data_button_press)) then
- call g_signal_connect(plota, "button-press-event"//cnull, &
+ call g_signal_connect(plota, "button-press-event"//c_null_char, &
& button_press_event, data_button_press)
else
- call g_signal_connect(plota, "button-press-event"//cnull, &
+ call g_signal_connect(plota, "button-press-event"//c_null_char, &
& button_press_event)
endif
if (auto_add == TRUE) mask = ior(mask, &
@@ -303,10 +303,10 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
! Button_release event
if (present(button_release_event)) then
if (present(data_button_release)) then
- call g_signal_connect(plota, "button-release-event"//cnull, &
+ call g_signal_connect(plota, "button-release-event"//c_null_char, &
& button_release_event, data_button_release)
else
- call g_signal_connect(plota, "button-release-event"//cnull, &
+ call g_signal_connect(plota, "button-release-event"//c_null_char, &
& button_release_event)
endif
if (auto_add == TRUE) mask = ior(mask, &
@@ -316,10 +316,10 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
! Scroll event
if (present(scroll_event)) then
if (present(data_scroll)) then
- call g_signal_connect(plota, "scroll-event"//cnull, scroll_event, &
+ call g_signal_connect(plota, "scroll-event"//c_null_char, scroll_event, &
& data_scroll)
else
- call g_signal_connect(plota, "scroll-event"//cnull, scroll_event)
+ call g_signal_connect(plota, "scroll-event"//c_null_char, scroll_event)
endif
if (auto_add == TRUE) mask = ior(mask, &
& iand(GDK_SCROLL_MASK, insert_mask))
@@ -328,10 +328,10 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
! Key_press event
if (present(key_press_event)) then
if (present(data_key_press)) then
- call g_signal_connect(plota, "key-press-event"//cnull, &
+ call g_signal_connect(plota, "key-press-event"//c_null_char, &
& key_press_event, data_key_press)
else
- call g_signal_connect(plota, "key-press-event"//cnull, &
+ call g_signal_connect(plota, "key-press-event"//c_null_char, &
& key_press_event)
endif
! Note: For keyboard events, the drawing area must be able to
@@ -348,10 +348,10 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
if (auto_add == TRUE) &
& call gtk_widget_add_events(plota, GDK_KEY_RELEASE_MASK)
if (present(data_key_release)) then
- call g_signal_connect(plota, "key-release-event"//cnull, &
+ call g_signal_connect(plota, "key-release-event"//c_null_char, &
& key_release_event, data_key_release)
else
- call g_signal_connect(plota, "key-release-event"//cnull, &
+ call g_signal_connect(plota, "key-release-event"//c_null_char, &
& key_release_event)
endif
! Note: For keyboard events, the drawing area must be able to
@@ -365,10 +365,10 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
! Motion event
if (present(motion_event)) then
if (present(data_motion)) then
- call g_signal_connect(plota, "motion-notify-event"//cnull, &
+ call g_signal_connect(plota, "motion-notify-event"//c_null_char, &
& motion_event, data_motion)
else
- call g_signal_connect(plota, "motion-notify-event"//cnull, &
+ call g_signal_connect(plota, "motion-notify-event"//c_null_char, &
& motion_event)
endif
if (auto_add == TRUE) mask = ior(mask, &
@@ -378,10 +378,10 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
! Enter event
if (present(enter_event)) then
if (present(data_enter)) then
- call g_signal_connect(plota, "enter-notify-event"//cnull, &
+ call g_signal_connect(plota, "enter-notify-event"//c_null_char, &
& enter_event, data_enter)
else
- call g_signal_connect(plota, "enter-notify-event"//cnull, &
+ call g_signal_connect(plota, "enter-notify-event"//c_null_char, &
& enter_event)
endif
if (auto_add == TRUE) mask = ior(mask, &
@@ -391,10 +391,10 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
! Leave event
if (present(leave_event)) then
if (present(data_leave)) then
- call g_signal_connect(plota, "leave-notify-event"//cnull, &
+ call g_signal_connect(plota, "leave-notify-event"//c_null_char, &
& leave_event, data_leave)
else
- call g_signal_connect(plota, "leave-notify-event"//cnull, &
+ call g_signal_connect(plota, "leave-notify-event"//c_null_char, &
& leave_event)
endif
if (auto_add == TRUE) mask = ior(mask, &
@@ -404,10 +404,10 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
! Configure event
if (present(configure_event)) then
if (present(data_configure)) then
- call g_signal_connect(plota, "configure-event"//cnull, &
+ call g_signal_connect(plota, "configure-event"//c_null_char, &
& configure_event, data_configure)
else
- call g_signal_connect(plota, "configure-event"//cnull, &
+ call g_signal_connect(plota, "configure-event"//c_null_char, &
& configure_event)
endif
if (auto_add == TRUE) mask = ior(mask, &
@@ -508,7 +508,7 @@ function hl_gtk_drawing_area_cairo_new(area) result(cr)
isurface = g_object_get_data(area, "backing-surface")
if (.not. c_associated(isurface)) then
- cr = NULL
+ cr = C_NULL_PTR
write(error_unit,*) "hl_gtk_pixbuf_cairo_new:: Backing surface is NULL"
return
end if
View
62 src/gtk-draw-hl.f90
@@ -27,7 +27,7 @@
! --------------------------------------------------------
! gtk-draw-hl.f90
-! Generated: Thu Dec 1 21:27:37 2011 GMT
+! Generated: Wed May 16 14:59:04 2012 GMT
! Please do not edit this file directly,
! Edit gtk-draw-hl-tmpl.f90, and use ./mk_gtk_hl.pl to regenerate.
! --------------------------------------------------------
@@ -70,7 +70,7 @@ module gtk_draw_hl
& GDK_KEY_RELEASE_MASK, GDK_LEAVE_NOTIFY_MASK, GDK_POINTER_MOTION_MASK,&
& GDK_STRUCTURE_MASK, GDK_ALL_EVENTS_MASK, CAIRO_FORMAT_ARGB32, &
& GDK_COLORSPACE_RGB, GTK_POLICY_AUTOMATIC, CAIRO_FORMAT_RGB24, &
- & CNULL, NULL, FNULL, TRUE, FALSE
+ & TRUE, FALSE
use cairo, only: cairo_create, cairo_destroy, cairo_get_target, &
& cairo_image_surface_create, cairo_paint, cairo_set_source, &
@@ -205,7 +205,7 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
! Add it to a scrolling window if one is requested
if (present(scroll)) then
- scroll = gtk_scrolled_window_new(NULL, NULL)
+ scroll = gtk_scrolled_window_new(C_NULL_PTR, C_NULL_PTR)
call gtk_scrolled_window_set_policy(scroll, GTK_POLICY_AUTOMATIC, &
& GTK_POLICY_AUTOMATIC)
if (present(ssize)) &
@@ -251,49 +251,49 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
if (present(realize)) then
if (present(data_realize)) then
- call g_signal_connect(plota, "realize"//cnull, realize, &
+ call g_signal_connect(plota, "realize"//c_null_char, realize, &
& data_realize)
else
- call g_signal_connect(plota, "realize"//cnull, realize)
+ call g_signal_connect(plota, "realize"//c_null_char, realize)
endif
end if
! Destroy signal
if (present(destroy)) then
if (present(data_destroy)) then
- call g_signal_connect(plota, "destroy"//cnull, destroy, &
+ call g_signal_connect(plota, "destroy"//c_null_char, destroy, &
& data_destroy)
else
- call g_signal_connect(plota, "destroy"//cnull, destroy)
+ call g_signal_connect(plota, "destroy"//c_null_char, destroy)
end if
else
- call g_signal_connect(plota, "destroy"//cnull, &
+ call g_signal_connect(plota, "destroy"//c_null_char, &
& c_funloc(hl_gtk_drawing_area_destroy_cb))
end if
! Expose event
if (present(expose_event)) then
if (present(data_expose)) then
- call g_signal_connect(plota, "expose-event"//cnull, expose_event, &
+ call g_signal_connect(plota, "expose-event"//c_null_char, expose_event, &
& data_expose)
-!!$3 call g_signal_connect(plota, "draw"//cnull, expose_event, &
+!!$3 call g_signal_connect(plota, "draw"//c_null_char, expose_event, &
!!$3 & data_expose)
endif
else
- call g_signal_connect(plota, "expose-event"//cnull, &
+ call g_signal_connect(plota, "expose-event"//c_null_char, &
& c_funloc(hl_gtk_drawing_area_expose_cb))
-!!$3 call g_signal_connect(plota, "draw"//cnull, &
+!!$3 call g_signal_connect(plota, "draw"//c_null_char, &
!!$3 & c_funloc(hl_gtk_drawing_area_expose_cb))
end if
! Button_press event
if (present(button_press_event)) then
if (present(data_button_press)) then
- call g_signal_connect(plota, "button-press-event"//cnull, &
+ call g_signal_connect(plota, "button-press-event"//c_null_char, &
& button_press_event, data_button_press)
else
- call g_signal_connect(plota, "button-press-event"//cnull, &
+ call g_signal_connect(plota, "button-press-event"//c_null_char, &
& button_press_event)
endif
if (auto_add == TRUE) mask = ior(mask, &
@@ -303,10 +303,10 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
! Button_release event
if (present(button_release_event)) then
if (present(data_button_release)) then
- call g_signal_connect(plota, "button-release-event"//cnull, &
+ call g_signal_connect(plota, "button-release-event"//c_null_char, &
& button_release_event, data_button_release)
else
- call g_signal_connect(plota, "button-release-event"//cnull, &
+ call g_signal_connect(plota, "button-release-event"//c_null_char, &
& button_release_event)
endif
if (auto_add == TRUE) mask = ior(mask, &
@@ -316,10 +316,10 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
! Scroll event
if (present(scroll_event)) then
if (present(data_scroll)) then
- call g_signal_connect(plota, "scroll-event"//cnull, scroll_event, &
+ call g_signal_connect(plota, "scroll-event"//c_null_char, scroll_event, &
& data_scroll)
else
- call g_signal_connect(plota, "scroll-event"//cnull, scroll_event)
+ call g_signal_connect(plota, "scroll-event"//c_null_char, scroll_event)
endif
if (auto_add == TRUE) mask = ior(mask, &
& iand(GDK_SCROLL_MASK, insert_mask))
@@ -328,10 +328,10 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
! Key_press event
if (present(key_press_event)) then
if (present(data_key_press)) then
- call g_signal_connect(plota, "key-press-event"//cnull, &
+ call g_signal_connect(plota, "key-press-event"//c_null_char, &
& key_press_event, data_key_press)
else
- call g_signal_connect(plota, "key-press-event"//cnull, &
+ call g_signal_connect(plota, "key-press-event"//c_null_char, &
& key_press_event)
endif
! Note: For keyboard events, the drawing area must be able to
@@ -348,10 +348,10 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
if (auto_add == TRUE) &
& call gtk_widget_add_events(plota, GDK_KEY_RELEASE_MASK)
if (present(data_key_release)) then
- call g_signal_connect(plota, "key-release-event"//cnull, &
+ call g_signal_connect(plota, "key-release-event"//c_null_char, &
& key_release_event, data_key_release)
else
- call g_signal_connect(plota, "key-release-event"//cnull, &
+ call g_signal_connect(plota, "key-release-event"//c_null_char, &
& key_release_event)
endif
! Note: For keyboard events, the drawing area must be able to
@@ -365,10 +365,10 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
! Motion event
if (present(motion_event)) then
if (present(data_motion)) then
- call g_signal_connect(plota, "motion-notify-event"//cnull, &
+ call g_signal_connect(plota, "motion-notify-event"//c_null_char, &
& motion_event, data_motion)
else
- call g_signal_connect(plota, "motion-notify-event"//cnull, &
+ call g_signal_connect(plota, "motion-notify-event"//c_null_char, &
& motion_event)
endif
if (auto_add == TRUE) mask = ior(mask, &
@@ -378,10 +378,10 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
! Enter event
if (present(enter_event)) then
if (present(data_enter)) then
- call g_signal_connect(plota, "enter-notify-event"//cnull, &
+ call g_signal_connect(plota, "enter-notify-event"//c_null_char, &
& enter_event, data_enter)
else
- call g_signal_connect(plota, "enter-notify-event"//cnull, &
+ call g_signal_connect(plota, "enter-notify-event"//c_null_char, &
& enter_event)
endif
if (auto_add == TRUE) mask = ior(mask, &
@@ -391,10 +391,10 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
! Leave event
if (present(leave_event)) then
if (present(data_leave)) then
- call g_signal_connect(plota, "leave-notify-event"//cnull, &
+ call g_signal_connect(plota, "leave-notify-event"//c_null_char, &
& leave_event, data_leave)
else
- call g_signal_connect(plota, "leave-notify-event"//cnull, &
+ call g_signal_connect(plota, "leave-notify-event"//c_null_char, &
& leave_event)
endif
if (auto_add == TRUE) mask = ior(mask, &
@@ -404,10 +404,10 @@ function hl_gtk_drawing_area_new(scroll, size, ssize, expose_event, &
! Configure event
if (present(configure_event)) then
if (present(data_configure)) then
- call g_signal_connect(plota, "configure-event"//cnull, &
+ call g_signal_connect(plota, "configure-event"//c_null_char, &
& configure_event, data_configure)
else
- call g_signal_connect(plota, "configure-event"//cnull, &
+ call g_signal_connect(plota, "configure-event"//c_null_char, &
& configure_event)
endif
if (auto_add == TRUE) mask = ior(mask, &
@@ -508,7 +508,7 @@ function hl_gtk_drawing_area_cairo_new(area) result(cr)
isurface = g_object_get_data(area, "backing-surface")
if (.not. c_associated(isurface)) then
- cr = NULL
+ cr = C_NULL_PTR
write(error_unit,*) "hl_gtk_pixbuf_cairo_new:: Backing surface is NULL"
return
end if
View
2 src/gtk-hl-accelerator-tmpl.f90
@@ -44,7 +44,7 @@ module gtk_hl_accelerator
! Auto-generated use's
use gtk, only: gtk_widget_add_accelerator, &
& GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE, &
- & NULL, CNULL, FNULL, TRUE, FALSE
+ & TRUE, FALSE
use gdk, only: gdk_keyval_from_name
View
4 src/gtk-hl-accelerator.f90
@@ -26,7 +26,7 @@
! --------------------------------------------------------
! gtk-hl-accelerator.f90
-! Generated: Thu Dec 1 21:27:37 2011 GMT
+! Generated: Wed May 16 14:59:04 2012 GMT
! Please do not edit this file directly,
! Edit gtk-hl-accelerator-tmpl.f90, and use ./mk_gtk_hl.pl to regenerate.
! --------------------------------------------------------
@@ -44,7 +44,7 @@ module gtk_hl_accelerator
! Auto-generated use's
use gtk, only: gtk_widget_add_accelerator, &
& GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE, &
- & NULL, CNULL, FNULL, TRUE, FALSE
+ & TRUE, FALSE
use gdk, only: gdk_keyval_from_name
View
58 src/gtk-hl-button-tmpl.f90
@@ -48,8 +48,9 @@ module gtk_hl_button
& gtk_radio_button_new_with_label, gtk_toggle_button_get_active,&
& gtk_toggle_button_set_active, gtk_widget_add_accelerator,&
& gtk_widget_set_sensitive, gtk_widget_set_tooltip_text, &
- & gtk_label_new, gtk_label_set_markup, gtk_container_add, &
- & NULL, CNULL, FNULL, TRUE, FALSE, g_signal_connect
+ & gtk_label_new, gtk_label_set_markup, gtk_container_add,&
+ & gtk_button_set_label, &
+ & TRUE, FALSE, g_signal_connect
use g, only: g_slist_length, g_slist_nth, g_slist_nth_data
@@ -107,7 +108,7 @@ function hl_gtk_button_new(label, clicked, data, tooltip, sensitive, &
if(markup) then
but = gtk_button_new()
- label_w=gtk_label_new(cnull)
+ label_w=gtk_label_new(c_null_char)
call gtk_label_set_markup(label_w, label)
call gtk_container_add(but, label_w)
else
@@ -116,16 +117,16 @@ function hl_gtk_button_new(label, clicked, data, tooltip, sensitive, &
if (present(clicked)) then
if (present(data)) then
- call g_signal_connect(but, "clicked"//CNULL, &
+ call g_signal_connect(but, "clicked"//C_NULL_CHAR, &
& clicked, data)
else
- call g_signal_connect(but, "clicked"//CNULL, &
+ call g_signal_connect(but, "clicked"//C_NULL_CHAR, &
& clicked)
end if
! An accelerator
if (present(accel_key) .and. present(accel_group)) &
- & call hl_gtk_widget_add_accelerator(but, "clicked"//cnull, &
+ & call hl_gtk_widget_add_accelerator(but, "clicked"//c_null_char, &
& accel_group, accel_key, accel_mods, accel_flags)
end if
@@ -137,6 +138,37 @@ function hl_gtk_button_new(label, clicked, data, tooltip, sensitive, &
end function hl_gtk_button_new
!+
+ subroutine hl_gtk_button_set_label(button, label, is_markup)
+ type(c_ptr), intent(in) :: button
+ character(kind=c_char), dimension(*), intent(in) :: label
+ integer(kind=c_int), intent(in), optional :: is_markup
+
+ ! Set the label of a button, including using markup.
+ !
+ ! BUTTON: c_ptr: required: The button to modify.
+ ! LABEL: string: required: The new label for the button.
+ ! IS_MARKUP: boolean: optional: Set this to TRUE if the label contains
+ ! pango markup.
+ !-
+
+ logical :: markup
+ type(c_ptr) :: label_w
+
+ if (present(is_markup)) then
+ markup = c_f_logical(is_markup)
+ else
+ markup = .false.
+ end if
+
+ if (markup) then
+ label_w = gtk_bin_get_child(button)
+ call gtk_label_set_markup(label_w, label)
+ else
+ call gtk_button_set_label(button, label)
+ end if
+ end subroutine hl_gtk_button_set_label
+
+ !+
function hl_gtk_check_button_new(label, toggled, data, tooltip, &
& initial_state, sensitive, is_markup) result(but)
@@ -173,7 +205,7 @@ function hl_gtk_check_button_new(label, toggled, data, tooltip, &
if(markup) then
but = gtk_check_button_new()
- label_w=gtk_label_new(cnull)
+ label_w=gtk_label_new(c_null_char)
call gtk_label_set_markup(label_w, label)
call gtk_container_add(but, label_w)
else
@@ -182,9 +214,9 @@ function hl_gtk_check_button_new(label, toggled, data, tooltip, &
if (present(toggled)) then
if (present(data)) then
- call g_signal_connect(but, "toggled"//cnull, toggled, data)
+ call g_signal_connect(but, "toggled"//c_null_char, toggled, data)
else
- call g_signal_connect(but, "toggled"//cnull, toggled)
+ call g_signal_connect(but, "toggled"//c_null_char, toggled)
end if
end if
@@ -215,7 +247,7 @@ function hl_gtk_radio_button_new(group, label, toggled, data, tooltip, &
! GROUP: c_ptr: required: The group to which the button belongs.
! This is an INOUT argument so it must be a variable
! of type(c_ptr). To start a new group (menu) initialize
- ! the variable to NULL, to add a new button use the value
+ ! the variable to C_NULL_PTR, to add a new button use the value
! returned from the last call to hl_gtk_radio_button_new. This
! is the variable which you use to do things like setting the
! selection.
@@ -241,7 +273,7 @@ function hl_gtk_radio_button_new(group, label, toggled, data, tooltip, &
if(markup) then
but = gtk_radio_button_new(group)
- label_w=gtk_label_new(cnull)
+ label_w=gtk_label_new(c_null_char)
call gtk_label_set_markup(label_w, label)
call gtk_container_add(but, label_w)
else
@@ -252,9 +284,9 @@ function hl_gtk_radio_button_new(group, label, toggled, data, tooltip, &
if (present(toggled)) then
if (present(data)) then
- call g_signal_connect(but, "toggled"//cnull, toggled, data)
+ call g_signal_connect(but, "toggled"//c_null_char, toggled, data)
else
- call g_signal_connect(but, "toggled"//cnull, toggled)
+ call g_signal_connect(but, "toggled"//c_null_char, toggled)
end if
end if
if (present(tooltip)) call gtk_widget_set_tooltip_text(but, tooltip)
View
60 src/gtk-hl-button.f90
@@ -26,7 +26,7 @@
! --------------------------------------------------------
! gtk-hl-button.f90
-! Generated: Thu Dec 1 21:27:37 2011 GMT
+! Generated: Wed May 16 14:59:04 2012 GMT
! Please do not edit this file directly,
! Edit gtk-hl-button-tmpl.f90, and use ./mk_gtk_hl.pl to regenerate.
! --------------------------------------------------------
@@ -48,8 +48,9 @@ module gtk_hl_button
& gtk_radio_button_new_with_label, gtk_toggle_button_get_active,&
& gtk_toggle_button_set_active, gtk_widget_add_accelerator,&
& gtk_widget_set_sensitive, gtk_widget_set_tooltip_text, &
- & gtk_label_new, gtk_label_set_markup, gtk_container_add, &
- & NULL, CNULL, FNULL, TRUE, FALSE, g_signal_connect
+ & gtk_label_new, gtk_label_set_markup, gtk_container_add,&
+ & gtk_button_set_label, &
+ & TRUE, FALSE, g_signal_connect
use g, only: g_slist_length, g_slist_nth, g_slist_nth_data
@@ -107,7 +108,7 @@ function hl_gtk_button_new(label, clicked, data, tooltip, sensitive, &
if(markup) then
but = gtk_button_new()
- label_w=gtk_label_new(cnull)
+ label_w=gtk_label_new(c_null_char)
call gtk_label_set_markup(label_w, label)
call gtk_container_add(but, label_w)
else
@@ -116,16 +117,16 @@ function hl_gtk_button_new(label, clicked, data, tooltip, sensitive, &
if (present(clicked)) then
if (present(data)) then
- call g_signal_connect(but, "clicked"//CNULL, &
+ call g_signal_connect(but, "clicked"//C_NULL_CHAR, &
& clicked, data)
else
- call g_signal_connect(but, "clicked"//CNULL, &
+ call g_signal_connect(but, "clicked"//C_NULL_CHAR, &
& clicked)
end if
! An accelerator
if (present(accel_key) .and. present(accel_group)) &
- & call hl_gtk_widget_add_accelerator(but, "clicked"//cnull, &
+ & call hl_gtk_widget_add_accelerator(but, "clicked"//c_null_char, &
& accel_group, accel_key, accel_mods, accel_flags)
end if
@@ -137,6 +138,37 @@ function hl_gtk_button_new(label, clicked, data, tooltip, sensitive, &
end function hl_gtk_button_new
!+
+ subroutine hl_gtk_button_set_label(button, label, is_markup)
+ type(c_ptr), intent(in) :: button
+ character(kind=c_char), dimension(*), intent(in) :: label
+ integer(kind=c_int), intent(in), optional :: is_markup
+
+ ! Set the label of a button, including using markup.
+ !
+ ! BUTTON: c_ptr: required: The button to modify.
+ ! LABEL: string: required: The new label for the button.
+ ! IS_MARKUP: boolean: optional: Set this to TRUE if the label contains
+ ! pango markup.
+ !-
+
+ logical :: markup
+ type(c_ptr) :: label_w
+
+ if (present(is_markup)) then
+ markup = c_f_logical(is_markup)
+ else
+ markup = .false.
+ end if
+
+ if (markup) then
+ label_w = gtk_bin_get_child(button)
+ call gtk_label_set_markup(label_w, label)
+ else
+ call gtk_button_set_label(button, label)
+ end if
+ end subroutine hl_gtk_button_set_label
+
+ !+
function hl_gtk_check_button_new(label, toggled, data, tooltip, &
& initial_state, sensitive, is_markup) result(but)
@@ -173,7 +205,7 @@ function hl_gtk_check_button_new(label, toggled, data, tooltip, &
if(markup) then
but = gtk_check_button_new()
- label_w=gtk_label_new(cnull)
+ label_w=gtk_label_new(c_null_char)
call gtk_label_set_markup(label_w, label)
call gtk_container_add(but, label_w)
else
@@ -182,9 +214,9 @@ function hl_gtk_check_button_new(label, toggled, data, tooltip, &
if (present(toggled)) then
if (present(data)) then
- call g_signal_connect(but, "toggled"//cnull, toggled, data)
+ call g_signal_connect(but, "toggled"//c_null_char, toggled, data)
else
- call g_signal_connect(but, "toggled"//cnull, toggled)
+ call g_signal_connect(but, "toggled"//c_null_char, toggled)
end if
end if
@@ -215,7 +247,7 @@ function hl_gtk_radio_button_new(group, label, toggled, data, tooltip, &
! GROUP: c_ptr: required: The group to which the button belongs.
! This is an INOUT argument so it must be a variable
! of type(c_ptr). To start a new group (menu) initialize
- ! the variable to NULL, to add a new button use the value
+ ! the variable to C_NULL_PTR, to add a new button use the value
! returned from the last call to hl_gtk_radio_button_new. This
! is the variable which you use to do things like setting the
! selection.
@@ -241,7 +273,7 @@ function hl_gtk_radio_button_new(group, label, toggled, data, tooltip, &
if(markup) then
but = gtk_radio_button_new(group)
- label_w=gtk_label_new(cnull)
+ label_w=gtk_label_new(c_null_char)
call gtk_label_set_markup(label_w, label)
call gtk_container_add(but, label_w)
else
@@ -252,9 +284,9 @@ function hl_gtk_radio_button_new(group, label, toggled, data, tooltip, &
if (present(toggled)) then
if (present(data)) then
- call g_signal_connect(but, "toggled"//cnull, toggled, data)
+ call g_signal_connect(but, "toggled"//c_null_char, toggled, data)
else
- call g_signal_connect(but, "toggled"//cnull, toggled)
+ call g_signal_connect(but, "toggled"//c_null_char, toggled)
end if
end if
if (present(tooltip)) call gtk_widget_set_tooltip_text(but, tooltip)
View
62 src/gtk-hl-chooser-tmpl.f90
@@ -88,7 +88,7 @@ module gtk_hl_chooser
& GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER,&
& GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,&
& GTK_FILE_CHOOSER_ACTION_SAVE, GTK_RESPONSE_DELETE_EVENT,&
- & NULL, CNULL, FNULL, TRUE, FALSE, g_signal_connect
+ & TRUE, FALSE, g_signal_connect
use g, only: g_free, g_slist_free, g_slist_length, g_slist_nth,&
& g_slist_nth_data
@@ -106,8 +106,8 @@ module gtk_hl_chooser
! it still has to be bind(c) otherwise c_loc() will croak on it.
type, bind(c) :: hl_gtk_chooser_info
- type(c_ptr) :: chooser=NULL, chooser_sel_list=NULL
- type(c_ptr) :: chooser_curdir=NULL, fentry=NULL
+ type(c_ptr) :: chooser=C_NULL_PTR, chooser_sel_list=C_NULL_PTR
+ type(c_ptr) :: chooser_curdir=C_NULL_PTR, fentry=C_NULL_PTR
integer(kind=c_int) :: iselect=0
end type hl_gtk_chooser_info
@@ -170,9 +170,9 @@ function hl_gtk_file_chooser_button_new(directory, title, &
if (present(title)) then
cbutton = gtk_file_chooser_button_new(title, mode)
else if (mode == GTK_FILE_CHOOSER_ACTION_OPEN) then
- cbutton = gtk_file_chooser_button_new("Choose file"//cnull, mode)
+ cbutton = gtk_file_chooser_button_new("Choose file"//c_null_char, mode)
else
- cbutton = gtk_file_chooser_button_new("Choose directory"//cnull, mode)
+ cbutton = gtk_file_chooser_button_new("Choose directory"//c_null_char, mode)
end if
call gtk_file_chooser_set_local_only(cbutton, TRUE)
@@ -202,37 +202,37 @@ function hl_gtk_file_chooser_button_new(directory, title, &
if (idx1 < 0) then
if (index(filter(i)(idx0:), '/') == 0) then
call gtk_file_filter_add_pattern(gfilter, &
- & trim(adjustl(filter(i)(idx0:)))//cnull)
+ & trim(adjustl(filter(i)(idx0:)))//c_null_char)
else
call gtk_file_filter_add_mime_type(gfilter, &
- & trim(adjustl(filter(i)(idx0:)))//cnull)
+ & trim(adjustl(filter(i)(idx0:)))//c_null_char)
end if
exit
else
if (index(filter(i)(idx0:idx1), '/') == 0) then
call gtk_file_filter_add_pattern(gfilter, &
- & trim(adjustl(filter(i)(idx0:idx1)))//cnull)
+ & trim(adjustl(filter(i)(idx0:idx1)))//c_null_char)
else
call gtk_file_filter_add_mime_type(gfilter, &
- & trim(adjustl(filter(i)(idx0:idx1)))//cnull)
+ & trim(adjustl(filter(i)(idx0:idx1)))//c_null_char)
end if
idx0=idx1+2
end if
end do
if (present(filter_name)) then
- call gtk_file_filter_set_name(gfilter, filter_name(i)//cnull)
+ call gtk_file_filter_set_name(gfilter, filter_name(i)//c_null_char)
else
- call gtk_file_filter_set_name(gfilter, trim(filter(i))//cnull)
+ call gtk_file_filter_set_name(gfilter, trim(filter(i))//c_null_char)
end if
call gtk_file_chooser_add_filter(cbutton, gfilter)
end do
end if
if (present(file_set)) then
if (present(data)) then
- call g_signal_connect(cbutton, "file-set"//cnull, file_set, data)
+ call g_signal_connect(cbutton, "file-set"//c_null_char, file_set, data)
else
- call g_signal_connect(cbutton, "file-set"//cnull, file_set)
+ call g_signal_connect(cbutton, "file-set"//c_null_char, file_set)
end if
end if
@@ -418,39 +418,39 @@ function hl_gtk_file_chooser_show(files, cdir, directory, create, &
if (idx1 < idx0) then
if (index(filter(i)(idx0:), '/') == 0) then
call gtk_file_filter_add_pattern(gfilter, &
- & trim(adjustl(filter(i)(idx0:)))//cnull)
+ & trim(adjustl(filter(i)(idx0:)))//c_null_char)
else
call gtk_file_filter_add_mime_type(gfilter, &
- & trim(adjustl(filter(i)(idx0:)))//cnull)
+ & trim(adjustl(filter(i)(idx0:)))//c_null_char)
end if
exit
else
if (index(filter(i)(idx0:idx1), '/') == 0) then
call gtk_file_filter_add_pattern(gfilter, &
- & trim(adjustl(filter(i)(idx0:idx1)))//cnull)
+ & trim(adjustl(filter(i)(idx0:idx1)))//c_null_char)
else
call gtk_file_filter_add_mime_type(gfilter, &
- & trim(adjustl(filter(i)(idx0:idx1)))//cnull)
+ & trim(adjustl(filter(i)(idx0:idx1)))//c_null_char)
end if
idx0=idx1+2
end if
end do
if (present(filter_name)) then
call gtk_file_filter_set_name(gfilter, &
- & trim(filter_name(i))//cnull)
+ & trim(filter_name(i))//c_null_char)
else
call gtk_file_filter_set_name(gfilter, &
- & trim(filter(i))//cnull)
+ & trim(filter(i))//c_null_char)
end if
call gtk_file_chooser_add_filter(chooser_info%chooser, gfilter)
end do
if (present(all)) then
if (all == TRUE) then
gfilter = gtk_file_filter_new()
call gtk_file_filter_add_pattern(gfilter, &
- & "*"//cnull)
+ & "*"//c_null_char)
call gtk_file_filter_set_name(gfilter, &
- "All Files"//cnull)
+ "All Files"//c_null_char)
call gtk_file_chooser_add_filter(chooser_info%chooser, gfilter)
end if
end if
@@ -460,22 +460,22 @@ function hl_gtk_file_chooser_show(files, cdir, directory, create, &
if (present(edit_filters)) then
if (edit_filters == TRUE) then
fbox = hl_gtk_box_new(horizontal=TRUE)
- junk = gtk_label_new("New filter:"//cnull)
+ junk = gtk_label_new("New filter:"//c_null_char)
call hl_gtk_box_pack(fbox, junk)
chooser_info%fentry = &
& hl_gtk_entry_new(activate=c_funloc(hl_gtk_chooser_filt_cb), &
- & len=60, tooltip="Enter a new filter here."//cnull, &
+ & len=60, tooltip="Enter a new filter here."//c_null_char, &
& data=c_loc(chooser_info))
call hl_gtk_box_pack(fbox, chooser_info%fentry)
- fapply = hl_gtk_button_new("Apply"//cnull, &
+ fapply = hl_gtk_button_new("Apply"//c_null_char, &
& clicked=c_funloc(hl_gtk_chooser_filt_cb), &
& data=c_loc(chooser_info))
call hl_gtk_box_pack(fbox, fapply)
call gtk_file_chooser_set_extra_widget(chooser_info%chooser, fbox)
end if
end if
- call g_signal_connect(dialog, "response"//cnull, &
+ call g_signal_connect(dialog, "response"//c_null_char, &
& c_funloc(hl_gtk_chooser_resp_cb), c_loc(chooser_info))
call gtk_widget_show_all (dialog)
@@ -574,27 +574,27 @@ subroutine hl_gtk_chooser_filt_cb(widget, gdata) bind(c)
if (idx1 < idx0) then
if (index(filter(idx0:), '/') == 0) then
call gtk_file_filter_add_pattern(gfilter, &
- & trim(adjustl(filter(idx0:)))//cnull)
+ & trim(adjustl(filter(idx0:)))//c_null_char)
else
call gtk_file_filter_add_mime_type(gfilter, &
- & trim(adjustl(filter(idx0:)))//cnull)
+ & trim(adjustl(filter(idx0:)))//c_null_char)
end if
exit
else
if (index(filter(idx0:idx1), '/') == 0) then
call gtk_file_filter_add_pattern(gfilter, &
- & trim(adjustl(filter(idx0:idx1)))//cnull)
+ & trim(adjustl(filter(idx0:idx1)))//c_null_char)
else
call gtk_file_filter_add_mime_type(gfilter, &
- & trim(adjustl(filter(idx0:idx1)))//cnull)
+ & trim(adjustl(filter(idx0:idx1)))//c_null_char)
end if
idx0=idx1+2
end if
end do
call gtk_file_filter_set_name(gfilter, &
- & trim(filter)//cnull)
+ & trim(filter)//c_null_char)
call gtk_file_chooser_add_filter(chooser_info%chooser, gfilter)
- call gtk_entry_set_text(chooser_info%fentry, CNULL)
+ call gtk_entry_set_text(chooser_info%fentry, C_NULL_CHAR)
end subroutine hl_gtk_chooser_filt_cb
end module gtk_hl_chooser
View
64 src/gtk-hl-chooser.f90
@@ -26,7 +26,7 @@
! --------------------------------------------------------
! gtk-hl-chooser.f90
-! Generated: Thu Dec 1 21:27:37 2011 GMT
+! Generated: Wed May 16 14:59:04 2012 GMT
! Please do not edit this file directly,
! Edit gtk-hl-chooser-tmpl.f90, and use ./mk_gtk_hl.pl to regenerate.
! --------------------------------------------------------
@@ -88,7 +88,7 @@ module gtk_hl_chooser
& GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER,&
& GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,&
& GTK_FILE_CHOOSER_ACTION_SAVE, GTK_RESPONSE_DELETE_EVENT,&
- & NULL, CNULL, FNULL, TRUE, FALSE, g_signal_connect
+ & TRUE, FALSE, g_signal_connect
use g, only: g_free, g_slist_free, g_slist_length, g_slist_nth,&
& g_slist_nth_data
@@ -106,8 +106,8 @@ module gtk_hl_chooser
! it still has to be bind(c) otherwise c_loc() will croak on it.
type, bind(c) :: hl_gtk_chooser_info
- type(c_ptr) :: chooser=NULL, chooser_sel_list=NULL
- type(c_ptr) :: chooser_curdir=NULL, fentry=NULL
+ type(c_ptr) :: chooser=C_NULL_PTR, chooser_sel_list=C_NULL_PTR
+ type(c_ptr) :: chooser_curdir=C_NULL_PTR, fentry=C_NULL_PTR
integer(kind=c_int) :: iselect=0
end type hl_gtk_chooser_info
@@ -170,9 +170,9 @@ function hl_gtk_file_chooser_button_new(directory, title, &
if (present(title)) then
cbutton = gtk_file_chooser_button_new(title, mode)
else if (mode == GTK_FILE_CHOOSER_ACTION_OPEN) then
- cbutton = gtk_file_chooser_button_new("Choose file"//cnull, mode)
+ cbutton = gtk_file_chooser_button_new("Choose file"//c_null_char, mode)
else
- cbutton = gtk_file_chooser_button_new("Choose directory"//cnull, mode)
+ cbutton = gtk_file_chooser_button_new("Choose directory"//c_null_char, mode)
end if
call gtk_file_chooser_set_local_only(cbutton, TRUE)
@@ -202,37 +202,37 @@ function hl_gtk_file_chooser_button_new(directory, title, &
if (idx1 < 0) then
if (index(filter(i)(idx0:), '/') == 0) then
call gtk_file_filter_add_pattern(gfilter, &
- & trim(adjustl(filter(i)(idx0:)))//cnull)
+ & trim(adjustl(filter(i)(idx0:)))//c_null_char)
else
call gtk_file_filter_add_mime_type(gfilter, &
- & trim(adjustl(filter(i)(idx0:)))//cnull)
+ & trim(adjustl(filter(i)(idx0:)))//c_null_char)
end if
exit
else
if (index(filter(i)(idx0:idx1), '/') == 0) then
call gtk_file_filter_add_pattern(gfilter, &
- & trim(adjustl(filter(i)(idx0:idx1)))//cnull)
+ & trim(adjustl(filter(i)(idx0:idx1)))//c_null_char)
else
call gtk_file_filter_add_mime_type(gfilter, &
- & trim(adjustl(filter(i)(idx0:idx1)))//cnull)
+ & trim(adjustl(filter(i)(idx0:idx1)))//c_null_char)
end if
idx0=idx1+2
end if
end do
if (present(filter_name)) then
- call gtk_file_filter_set_name(gfilter, filter_name(i)//cnull)
+ call gtk_file_filter_set_name(gfilter, filter_name(i)//c_null_char)
else
- call gtk_file_filter_set_name(gfilter, trim(filter(i))//cnull)
+ call gtk_file_filter_set_name(gfilter, trim(filter(i))//c_null_char)
end if
call gtk_file_chooser_add_filter(cbutton, gfilter)
end do
end if
if (present(file_set)) then
if (present(data)) then
- call g_signal_connect(cbutton, "file-set"//cnull, file_set, data)
+ call g_signal_connect(cbutton, "file-set"//c_null_char, file_set, data)
else
- call g_signal_connect(cbutton, "file-set"//cnull, file_set)
+ call g_signal_connect(cbutton, "file-set"//c_null_char, file_set)
end if
end if
@@ -418,39 +418,39 @@ function hl_gtk_file_chooser_show(files, cdir, directory, create, &
if (idx1 < idx0) then
if (index(filter(i)(idx0:), '/') == 0) then
call gtk_file_filter_add_pattern(gfilter, &
- & trim(adjustl(filter(i)(idx0:)))//cnull)
+ & trim(adjustl(filter(i)(idx0:)))//c_null_char)
else
call gtk_file_filter_add_mime_type(gfilter, &
- & trim(adjustl(filter(i)(idx0:)))//cnull)
+ & trim(adjustl(filter(i)(idx0:)))//c_null_char)
end if
exit
else
if (index(filter(i)(idx0:idx1), '/') == 0) then
call gtk_file_filter_add_pattern(gfilter, &
- & trim(adjustl(filter(i)(idx0:idx1)))//cnull)
+ & trim(adjustl(filter(i)(idx0:idx1)))//c_null_char)
else
call gtk_file_filter_add_mime_type(gfilter, &
- & trim(adjustl(filter(i)(idx0:idx1)))//cnull)
+ & trim(adjustl(filter(i)(idx0:idx1)))//c_null_char)
end if
idx0=idx1+2
end if
end do
if (present(filter_name)) then
call gtk_file_filter_set_name(gfilter, &
- & trim(filter_name(i))//cnull)
+ & trim(filter_name(i))//c_null_char)
else
call gtk_file_filter_set_name(gfilter, &
- & trim(filter(i))//cnull)
+ & trim(filter(i))//c_null_char)
end if
call gtk_file_chooser_add_filter(chooser_info%chooser, gfilter)
end do
if (present(all)) then
if (all == TRUE) then
gfilter = gtk_file_filter_new()
call gtk_file_filter_add_pattern(gfilter, &
- & "*"//cnull)
+ & "*"//c_null_char)
call gtk_file_filter_set_name(gfilter, &
- "All Files"//cnull)
+ "All Files"//c_null_char)
call gtk_file_chooser_add_filter(chooser_info%chooser, gfilter)
end if
end if
@@ -460,22 +460,22 @@ function hl_gtk_file_chooser_show(files, cdir, directory, create, &
if (present(edit_filters)) then
if (edit_filters == TRUE) then
fbox = hl_gtk_box_new(horizontal=TRUE)
- junk = gtk_label_new("New filter:"//cnull)
+ junk = gtk_label_new("New filter:"//c_null_char)
call hl_gtk_box_pack(fbox, junk)
chooser_info%fentry = &
& hl_gtk_entry_new(activate=c_funloc(hl_gtk_chooser_filt_cb), &
- & len=60, tooltip="Enter a new filter here."//cnull, &
+ & len=60, tooltip="Enter a new filter here."//c_null_char, &
& data=c_loc(chooser_info))
call hl_gtk_box_pack(fbox, chooser_info%fentry)
- fapply = hl_gtk_button_new("Apply"//cnull, &
+ fapply = hl_gtk_button_new("Apply"//c_null_char, &
& clicked=c_funloc(hl_gtk_chooser_filt_cb), &
& data=c_loc(chooser_info))
call hl_gtk_box_pack(fbox, fapply)
call gtk_file_chooser_set_extra_widget(chooser_info%chooser, fbox)
end if
end if
- call g_signal_connect(dialog, "response"//cnull, &
+ call g_signal_connect(dialog, "response"//c_null_char, &
& c_funloc(hl_gtk_chooser_resp_cb), c_loc(chooser_info))
call gtk_widget_show_all (dialog)
@@ -574,27 +574,27 @@ subroutine hl_gtk_chooser_filt_cb(widget, gdata) bind(c)
if (idx1 < idx0) then
if (index(filter(idx0:), '/') == 0) then
call gtk_file_filter_add_pattern(gfilter, &
- & trim(adjustl(filter(idx0:)))//cnull)
+ & trim(adjustl(filter(idx0:)))//c_null_char)
else
call gtk_file_filter_add_mime_type(gfilter, &
- & trim(adjustl(filter(idx0:)))//cnull)
+ & trim(adjustl(filter(idx0:)))//c_null_char)
end if
exit
else
if (index(filter(idx0:idx1), '/') == 0) then
call gtk_file_filter_add_pattern(gfilter, &
- & trim(adjustl(filter(idx0:idx1)))//cnull)
+ & trim(adjustl(filter(idx0:idx1)))//c_null_char)
else
call gtk_file_filter_add_mime_type(gfilter, &
- & trim(adjustl(filter(idx0:idx1)))//cnull)
+ & trim(adjustl(filter(idx0:idx1)))//c_null_char)
end if
idx0=idx1+2
end if
end do
call gtk_file_filter_set_name(gfilter, &
- & trim(filter)//cnull)
+ & trim(filter)//c_null_char)
call gtk_file_chooser_add_filter(chooser_info%chooser, gfilter)
- call gtk_entry_set_text(chooser_info%fentry, CNULL)
+ call gtk_entry_set_text(chooser_info%fentry, C_NULL_CHAR)
end subroutine hl_gtk_chooser_filt_cb
end module gtk_hl_chooser
View
10 src/gtk-hl-combobox-tmpl.f90
@@ -59,7 +59,7 @@ module gtk_hl_combobox
!!$3 & gtk_combo_box_text_append_text,&
!!$3 & gtk_combo_box_text_insert_text,&
!!$3 & gtk_combo_box_text_prepend_text,&
- & NULL, CNULL, FNULL, TRUE, FALSE, g_signal_connect
+ & TRUE, FALSE, g_signal_connect
implicit none
@@ -115,18 +115,18 @@ function hl_gtk_combo_box_new(has_entry, changed, data, initial_choices, &
do i=1,size(initial_choices)
!GTK3
!!$3 call gtk_combo_box_text_append_text(cbox, &
-!!$3 & trim(initial_choices(i))//CNULL)
+!!$3 & trim(initial_choices(i))//C_NULL_CHAR)
!GTK2
!!$2 call gtk_combo_box_append_text(cbox, &
-!!$2 & trim(initial_choices(i))//CNULL)
+!!$2 & trim(initial_choices(i))//C_NULL_CHAR)
end do
end if
if (present(changed)) then
if (present(data)) then
- call g_signal_connect(cbox, "changed"//CNULL, changed, data)
+ call g_signal_connect(cbox, "changed"//C_NULL_CHAR, changed, data)
else
- call g_signal_connect(cbox, "changed"//CNULL, changed)
+ call g_signal_connect(cbox, "changed"//C_NULL_CHAR, changed)
end if
end if
View
12 src/gtk-hl-combobox.f90
@@ -26,7 +26,7 @@
! --------------------------------------------------------
! gtk-hl-combobox.f90
-! Generated: Thu Dec 1 21:27:37 2011 GMT
+! Generated: Wed May 16 14:59:04 2012 GMT
! Please do not edit this file directly,
! Edit gtk-hl-combobox-tmpl.f90, and use ./mk_gtk_hl.pl to regenerate.
! --------------------------------------------------------
@@ -59,7 +59,7 @@ module gtk_hl_combobox
!!$3 & gtk_combo_box_text_append_text,&
!!$3 & gtk_combo_box_text_insert_text,&
!!$3 & gtk_combo_box_text_prepend_text,&
- & NULL, CNULL, FNULL, TRUE, FALSE, g_signal_connect
+ & TRUE, FALSE, g_signal_connect
implicit none
@@ -115,18 +115,18 @@ function hl_gtk_combo_box_new(has_entry, changed, data, initial_choices, &
do i=1,size(initial_choices)
!GTK3
!!$3 call gtk_combo_box_text_append_text(cbox, &
-!!$3 & trim(initial_choices(i))//CNULL)
+!!$3 & trim(initial_choices(i))//C_NULL_CHAR)
!GTK2
call gtk_combo_box_append_text(cbox, &
- & trim(initial_choices(i))//CNULL)
+ & trim(initial_choices(i))//C_NULL_CHAR)
end do
end if
if (present(changed)) then
if (present(data)) then
- call g_signal_connect(cbox, "changed"//CNULL, changed, data)
+ call g_signal_connect(cbox, "changed"//C_NULL_CHAR, changed, data)
else
- call g_signal_connect(cbox, "changed"//CNULL, changed)
+ call g_signal_connect(cbox, "changed"//C_NULL_CHAR, changed)
end if
end if
View
148 src/gtk-hl-container-tmpl.f90
@@ -37,21 +37,23 @@ module gtk_hl_container
! Containers
! The high-level interface provides convenience interfaces for:
! * Window, the gtk top-level window.
- ! * Box, Horizontal and vertical boxes to pack widgets. This was added because the
- ! gtk_box_pack_start_defaults procedure is removed from GTK3.x
+ ! * Box, Horizontal and vertical boxes to pack widgets. This was added
+ ! because the gtk_box_pack_start_defaults procedure is removed from GTK3.x
! * Table, a grid layout of widgets
- ! Note that the wierd convention where rows comes before columns in sizing
- ! tables, but X before Y in adding widgets follows the convention of GTK proper.
+ ! Note that the weird convention where rows comes before columns in sizing
+ ! tables, but X before Y in adding widgets follows the convention of
+ ! GTK proper.
! * Notebook, a tabbed container to pack widgets
+ ! * ScrolledWindow, a scrolled window into which to place another widget.
!/
use gtk_sup
use iso_c_binding
! autogenerated use's
- use gtk, only: gtk_accel_group_new, gtk_box_pack_start&
- &, gtk_container_set_border_width, gtk_hbox_new, gtk_label_new&
- &, gtk_notebook_append_page, gtk_notebook_insert_page,&
+ use gtk, only: gtk_accel_group_new, gtk_box_pack_start, &
+ & gtk_container_set_border_width, gtk_hbox_new, gtk_label_new, &
+ & gtk_notebook_append_page, gtk_notebook_insert_page,&
& gtk_notebook_new, gtk_notebook_popup_disable,&
& gtk_notebook_popup_enable, gtk_notebook_prepend_page,&
& gtk_notebook_set_scrollable,&
@@ -69,8 +71,12 @@ module gtk_hl_container
& gtk_window_set_title, gtk_window_set_transient_for, &
!!$2 & gtk_notebook_set_group, &
!!$3 & gtk_notebook_set_group_name, &
+ & gtk_scrolled_window_new, gtk_scrolled_window_set_policy, &
+ & gtk_widget_set_size_request, gtk_scrolled_window_add_with_viewport, &
+ & gtk_container_add, &
& GTK_WINDOW_TOPLEVEL, GTK_EXPAND, GTK_FILL, &
- & NULL, CNULL, FNULL, TRUE, FALSE, g_signal_connect
+ & TRUE, FALSE, g_signal_connect, &
+ & GTK_POLICY_AUTOMATIC
implicit none
@@ -107,8 +113,10 @@ function hl_gtk_window_new(title, destroy, delete_event, data_destroy, &
! RESIZABLE: boolean: optional: Is the window resizable.
! DECORATED: boolean: optional: Set FALSE to disable window decorations.
! DELETABLE: boolean: optional: Set to FALSE to remove the "delete" button.
- ! ABOVE: boolean: optional: Set to TRUE to make the window stay on top of others.
- ! BELOW: boolean: optional: Set to TRUE to make the window stay below others.
+ ! ABOVE: boolean: optional: Set to TRUE to make the window stay on top of
+ ! others.
+ ! BELOW: boolean: optional: Set to TRUE to make the window stay below
+ ! others.
! PARENT: c_ptr: optional: An optional parent window for the new window.
! ACCEL_GROUP: c_ptr: optional: An accelerator group, used to add
! accelerators to widgets within the window.
@@ -123,19 +131,19 @@ function hl_gtk_window_new(title, destroy, delete_event, data_destroy, &
if (present(delete_event)) then
if (present(data_delete_event)) then
- call g_signal_connect(win, "delete-event"//CNULL, delete_event, &
+ call g_signal_connect(win, "delete-event"//C_NULL_CHAR, delete_event, &
& data_delete_event)
else
- call g_signal_connect(win, "delete-event"//CNULL, delete_event)
+ call g_signal_connect(win, "delete-event"//C_NULL_CHAR, delete_event)
end if
end if
if (present(destroy)) then
if (present(data_destroy)) then
- call g_signal_connect(win, "destroy"//CNULL, destroy, &
+ call g_signal_connect(win, "destroy"//C_NULL_CHAR, destroy, &
& data_destroy)
else
- call g_signal_connect(win, "destroy"//CNULL, destroy)
+ call g_signal_connect(win, "destroy"//C_NULL_CHAR, destroy)
end if
end if
@@ -465,7 +473,7 @@ function hl_gtk_notebook_add_page(nbook, page, position, at_start, &
if (present(label)) then
lwidget = gtk_label_new(label)
else
- lwidget = NULL
+ lwidget = C_NULL_PTR
end if
if (present(position)) then
@@ -492,4 +500,114 @@ function hl_gtk_notebook_add_page(nbook, page, position, at_start, &
& call gtk_notebook_set_tab_detachable(nbook, page, detachable)
end function hl_gtk_notebook_add_page
+
+ !+
+ function hl_gtk_scrolled_window_new(hpolicy, vpolicy, &
+ & hsize, vsize, hadjustment, vadjustment) result(win)
+
+ type(c_ptr) :: win
+ integer(kind=c_int), intent(in), optional :: hpolicy, vpolicy
+ integer(kind=c_int), intent(in), optional :: hsize, vsize
+ type(c_ptr), intent(in), optional :: hadjustment, vadjustment
+
+ ! Create a scrolled window, with convenient settings.
+ !
+ ! HPOLICY: c_int: optional: Whether to show the horizontal scrollbar
+ ! default- GTK_POLICY_AUTOMATIC, allowed- any GTK_POLICY_TYPE
+ ! VPOLICY: c_int: optional: Whether to show the vertical scrollbar
+ ! default- GTK_POLICY_AUTOMATIC, allowed- any GTK_POLICY_TYPE
+ ! HSIZE: c_int: optional: The size of the window in the horizontal
+ ! direction.
+ ! VSIZE: c_int: optional: The size of the window in the vertical
+ ! direction.
+ ! HADJUSTMENT: c_ptr: optional: An adjustment widget to use in place
+ ! of the automatically generated scrollbar in the horizontal
+ ! direction.
+ ! VADJUSTMENT: c_ptr: optional: An adjustment widget to use in place
+ ! of the automatically generated scrollbar in the vertical
+ ! direction.
+ !-
+
+ integer(kind=c_int) :: hpol, vpol, hsz, vsz
+ type(c_ptr) :: hadj, vadj
+ logical :: have_size, have_policy
+
+ ! Set up the scroll bar policies.
+ have_policy = .false.
+ if (present(hpolicy)) then
+ hpol = hpolicy
+ have_policy = .true.
+ else
+ hpol = GTK_POLICY_AUTOMATIC
+ end if
+ if (present(vpolicy)) then
+ vpol = vpolicy
+ have_policy = .true.
+ else
+ vpol = GTK_POLICY_AUTOMATIC
+ end if
+
+ ! Set up the sizes
+ have_size = .false.
+ if (present(hsize)) then
+ hsz = hsize
+ have_size = .true.
+ else
+ hsz = -1
+ end if
+ if (present(vsize)) then
+ vsz = vsize
+ have_size = .true.
+ else
+ vsz = -1
+ end if
+
+ ! Set up the adjustments
+ if (present(hadjustment)) then
+ hadj = hadjustment
+ else
+ hadj = c_null_ptr
+ end if
+ if (present(vadjustment)) then
+ vadj = vadjustment
+ else
+ vadj = c_null_ptr
+ end if
+
+ win = gtk_scrolled_window_new(hadj, vadj)
+
+ if (have_policy) call gtk_scrolled_window_set_policy(win, hpol, vpol)
+ if (have_size) call gtk_widget_set_size_request(win, hsz, vsz)
+ end function hl_gtk_scrolled_window_new
+
+ !+
+ subroutine hl_gtk_scrolled_window_add(win, child, viewport)
+ type(c_ptr), intent(in) :: win, child
+ integer(kind=c_int), intent(in), optional :: viewport
+
+ ! Add a widget to a scrolled window.
+ !
+ ! WIN: c_ptr: required: The scrolled window.
+ ! CHILD: c_ptr: required: The widget to insert.
+ ! VIEWPORT: c_int: optional: Set this to true if the child widget
+ ! requires a viewport between it and the scrolled window.
+ ! Unfortunately I can't see a way to determine automatically
+ ! whether this is needed.
+ !-
+
+ logical :: vp
+
+ if (present(viewport)) then
+ vp = c_f_logical(viewport)
+ else
+ vp = .false.
+ end if
+
+ if (vp) then
+ call gtk_scrolled_window_add_with_viewport(win, child)
+ else
+ call gtk_container_add(win, child)
+ end if
+ end subroutine hl_gtk_scrolled_window_add
+
end module gtk_hl_container
View
150 src/gtk-hl-container.f90
@@ -26,7 +26,7 @@
! --------------------------------------------------------
! gtk-hl-container.f90
-! Generated: Thu Dec 1 21:27:37 2011 GMT
+! Generated: Wed May 16 14:59:04 2012 GMT
! Please do not edit this file directly,
! Edit gtk-hl-container-tmpl.f90, and use ./mk_gtk_hl.pl to regenerate.
! --------------------------------------------------------
@@ -37,21 +37,23 @@ module gtk_hl_container
! Containers
! The high-level interface provides convenience interfaces for:
! * Window, the gtk top-level window.
- ! * Box, Horizontal and vertical boxes to pack widgets. This was added because the
- ! gtk_box_pack_start_defaults procedure is removed from GTK3.x
+ ! * Box, Horizontal and vertical boxes to pack widgets. This was added
+ ! because the gtk_box_pack_start_defaults procedure is removed from GTK3.x
! * Table, a grid layout of widgets
- ! Note that the wierd convention where rows comes before columns in sizing
- ! tables, but X before Y in adding widgets follows the convention of GTK proper.
+ ! Note that the weird convention where rows comes before columns in sizing
+ ! tables, but X before Y in adding widgets follows the convention of
+ ! GTK proper.
! * Notebook, a tabbed container to pack widgets
+ ! * ScrolledWindow, a scrolled window into which to place another widget.
!/
use gtk_sup
use iso_c_binding
! autogenerated use's
- use gtk, only: gtk_accel_group_new, gtk_box_pack_start&
- &, gtk_container_set_border_width, gtk_hbox_new, gtk_label_new&
- &, gtk_notebook_append_page, gtk_notebook_insert_page,&
+ use gtk, only: gtk_accel_group_new, gtk_box_pack_start, &
+ & gtk_container_set_border_width, gtk_hbox_new, gtk_label_new, &
+ & gtk_notebook_append_page, gtk_notebook_insert_page,&
& gtk_notebook_new, gtk_notebook_popup_disable,&
& gtk_notebook_popup_enable, gtk_notebook_prepend_page,&
& gtk_notebook_set_scrollable,&
@@ -69,8 +71,12 @@ module gtk_hl_container
& gtk_window_set_title, gtk_window_set_transient_for, &
& gtk_notebook_set_group, &
!!$3 & gtk_notebook_set_group_name, &
+ & gtk_scrolled_window_new, gtk_scrolled_window_set_policy, &
+ & gtk_widget_set_size_request, gtk_scrolled_window_add_with_viewport, &
+ & gtk_container_add, &
& GTK_WINDOW_TOPLEVEL, GTK_EXPAND, GTK_FILL, &
- & NULL, CNULL, FNULL, TRUE, FALSE, g_signal_connect
+ & TRUE, FALSE, g_signal_connect, &
+ & GTK_POLICY_AUTOMATIC
implicit none
@@ -107,8 +113,10 @@ function hl_gtk_window_new(title, destroy, delete_event, data_destroy, &
! RESIZABLE: boolean: optional: Is the window resizable.
! DECORATED: boolean: optional: Set FALSE to disable window decorations.
! DELETABLE: boolean: optional: Set to FALSE to remove the "delete" button.
- ! ABOVE: boolean: optional: Set to TRUE to make the window stay on top of others.
- ! BELOW: boolean: optional: Set to TRUE to make the window stay below others.
+ ! ABOVE: boolean: optional: Set to TRUE to make the window stay on top of
+ ! others.
+ ! BELOW: boolean: optional: Set to TRUE to make the window stay below
+ ! others.
! PARENT: c_ptr: optional: An optional parent window for the new window.
! ACCEL_GROUP: c_ptr: optional: An accelerator group, used to add
! accelerators to widgets within the window.
@@ -123,19 +131,19 @@ function hl_gtk_window_new(title, destroy, delete_event, data_destroy, &
if (present(delete_event)) then
if (present(data_delete_event)) then
- call g_signal_connect(win, "delete-event"//CNULL, delete_event, &
+ call g_signal_connect(win, "delete-event"//C_NULL_CHAR, delete_event, &
& data_delete_event)
else
- call g_signal_connect(win, "delete-event"//CNULL, delete_event)
+ call g_signal_connect(win, "delete-event"//C_NULL_CHAR, delete_event)
end if
end if
if (present(destroy)) then
if (present(data_destroy)) then
- call g_signal_connect(win, "destroy"//CNULL, destroy, &
+ call g_signal_connect(win, "destroy"//C_NULL_CHAR, destroy, &
& data_destroy)
else
- call g_signal_connect(win, "destroy"//CNULL, destroy)
+ call g_signal_connect(win, "destroy"//C_NULL_CHAR, destroy)
end if
end if
@@ -465,7 +473,7 @@ function hl_gtk_notebook_add_page(nbook, page, position, at_start, &
if (present(label)) then
lwidget = gtk_label_new(label)
else
- lwidget = NULL
+ lwidget = C_NULL_PTR
end if
if (present(position)) then
@@ -492,4 +500,114 @@ function hl_gtk_notebook_add_page(nbook, page, position, at_start, &
& call gtk_notebook_set_tab_detachable(nbook, page, detachable)
end function hl_gtk_notebook_add_page
+
+ !+
+ function hl_gtk_scrolled_window_new(hpolicy, vpolicy, &
+ & hsize, vsize, hadjustment, vadjustment) result(win)
+
+ type(c_ptr) :: win
+ integer(kind=c_int), intent(in), optional :: hpolicy, vpolicy
+ integer(kind=c_int), intent(in), optional :: hsize, vsize
+ type(c_ptr), intent(in), optional :: hadjustment, vadjustment
+
+ ! Create a scrolled window, with convenient settings.
+ !
+ ! HPOLICY: c_int: optional: Whether to show the horizontal scrollbar
+ ! default- GTK_POLICY_AUTOMATIC, allowed- any GTK_POLICY_TYPE
+ ! VPOLICY: c_int: optional: Whether to show the vertical scrollbar
+ ! default- GTK_POLICY_AUTOMATIC, allowed- any GTK_POLICY_TYPE
+ ! HSIZE: c_int: optional: The size of the window in the horizontal
+ ! direction.
+ ! VSIZE: c_int: optional: The size of the window in the vertical
+ ! direction.
+ ! HADJUSTMENT: c_ptr: optional: An adjustment widget to use in place
+ ! of the automatically generated scrollbar in the horizontal
+ ! direction.
+ ! VADJUSTMENT: c_ptr: optional: An adjustment widget to use in place
+ ! of the automatically generated scrollbar in the vertical
+ ! direction.
+ !-
+
+ integer(kind=c_int) :: hpol, vpol, hsz, vsz
+ type(c_ptr) :: hadj, vadj
+ logical :: have_size, have_policy
+
+ ! Set up the scroll bar policies.
+ have_policy = .false.
+ if (present(hpolicy)) then
+ hpol = hpolicy
+ have_policy = .true.
+ else
+ hpol = GTK_POLICY_AUTOMATIC
+ end if
+ if (present(vpolicy)) then
+ vpol = vpolicy
+ have_policy = .true.
+ else
+ vpol = GTK_POLICY_AUTOMATIC
+ end if
+
+ ! Set up the sizes
+ have_size = .false.
+ if (present(hsize)) then
+ hsz = hsize
+ have_size = .true.
+ else
+ hsz = -1
+ end if
+ if (present(vsize)) then
+ vsz = vsize
+ have_size = .true.
+ else
+ vsz = -1
+ end if
+
+ ! Set up the adjustments
+ if (present(hadjustment)) then
+ hadj = hadjustment
+ else
+ hadj = c_null_ptr
+ end if
+ if (present(vadjustment)) then
+ vadj = vadjustment
+ else
+ vadj = c_null_ptr
+ end if
+
+ win = gtk_scrolled_window_new(hadj, vadj)
+
+ if (have_policy) call gtk_scrolled_window_set_policy(win, hpol, vpol)
+ if (have_size) call gtk_widget_set_size_request(win, hsz, vsz)
+ end function hl_gtk_scrolled_window_new
+
+ !+
+ subroutine hl_gtk_scrolled_window_add(win, child, viewport)
+ type(c_ptr), intent(in) :: win, child
+ integer(kind=c_int), intent(in), optional :: viewport
+
+ ! Add a widget to a scrolled window.
+ !
+ ! WIN: c_ptr: required: The scrolled window.
+ ! CHILD: c_ptr: required: The widget to insert.
+ ! VIEWPORT: c_int: optional: Set this to true if the child widget
+ ! requires a viewport between it and the scrolled window.
+ ! Unfortunately I can't see a way to determine automatically
+ ! whether this is needed.
+ !-
+
+ logical :: vp
+
+ if (present(viewport)) then
+ vp = c_f_logical(viewport)
+ else
+ vp = .false.
+ end if
+
+ if (vp) then
+ call gtk_scrolled_window_add_with_viewport(win, child)
+ else
+ call gtk_container_add(win, child)
+ end if
+ end subroutine hl_gtk_scrolled_window_add
+
end module gtk_hl_container
View
17 src/gtk-hl-dialog-tmpl.f90
@@ -52,12 +52,12 @@ module gtk_hl_dialog
& gtk_window_set_destroy_with_parent, gtk_window_set_modal,&
& gtk_window_set_title, gtk_window_set_transient_for, &
& GTK_BUTTONS_YES_NO, GTK_MESSAGE_QUESTION, GTK_MESSAGE_OTHER,&
- & GTK_MESSAGE_ERROR, GTK_ICON_SIZE_DIALOG, GTK_MESSAGE_WARNING&
- &, GTK_MESSAGE_INFO, GTK_BUTTONS_NONE, GTK_BUTTONS_OK,&
+ & GTK_MESSAGE_ERROR, GTK_ICON_SIZE_DIALOG, GTK_MESSAGE_WARNING, &
+ & GTK_MESSAGE_INFO, GTK_BUTTONS_NONE, GTK_BUTTONS_OK,&
& GTK_RESPONSE_OK, GTK_BUTTONS_CLOSE, GTK_RESPONSE_CLOSE,&
& GTK_BUTTONS_CANCEL, GTK_RESPONSE_CANCEL, GTK_RESPONSE_YES,&
& GTK_RESPONSE_NO, GTK_BUTTONS_OK_CANCEL, GTK_RESPONSE_NONE,&
- & NULL, CNULL, FNULL, TRUE, FALSE
+ & TRUE, FALSE
implicit none
@@ -78,7 +78,8 @@ function hl_gtk_message_dialog_show(message, button_set, title, type, &
! for the built in one are variadic and so not callable from Fortran.
!
! MESSAGE: string(n): required: The message to display. Since this is
- ! a string array, the CNULL terminations are provided internally
+ ! a string array, the C_NULL_CHAR terminations are provided
+ ! internally
! BUTTON_SET: integer: required: The set of buttons to display
! TITLE: string: optional: Title for the window.
! TYPE: c_int: optional: Message type (a GTK_MESSAGE_ value)
@@ -129,7 +130,7 @@ function hl_gtk_message_dialog_show(message, button_set, title, type, &
junk = gtk_image_new_from_stock(GTK_STOCK_DIALOG_QUESTION, &
& GTK_ICON_SIZE_DIALOG)
case default
- junk=NULL
+ junk=C_NULL_PTR
end select
if (c_associated(junk)) call gtk_box_pack_start(hb, junk, TRUE, TRUE, 0)
vb = gtk_vbox_new(FALSE, 0)
@@ -140,11 +141,11 @@ function hl_gtk_message_dialog_show(message, button_set, title, type, &
do i = 1, size(message)
if (i == 1) then
- junk = gtk_label_new(cnull)
+ junk = gtk_label_new(c_null_char)
call gtk_label_set_markup(junk, '<b><big>'//trim(message(i))// &
- & '</big></b>'//cnull)
+ & '</big></b>'//c_null_char)
else
- junk = gtk_label_new(trim(message(i))//cnull)
+ junk = gtk_label_new(trim(message(i))//c_null_char)
end if
call gtk_box_pack_start(vb, junk, TRUE, TRUE, 0)
end do
View
19 src/gtk-hl-dialog.f90
@@ -26,7 +26,7 @@
! --------------------------------------------------------
! gtk-hl-dialog.f90
-! Generated: Thu Dec 1 21:27:37 2011 GMT
+! Generated: Wed May 16 14:59:04 2012 GMT
! Please do not edit this file directly,
! Edit gtk-hl-dialog-tmpl.f90, and use ./mk_gtk_hl.pl to regenerate.
! --------------------------------------------------------
@@ -52,12 +52,12 @@ module gtk_hl_dialog
& gtk_window_set_destroy_with_parent, gtk_window_set_modal,&
& gtk_window_set_title, gtk_window_set_transient_for, &
& GTK_BUTTONS_YES_NO, GTK_MESSAGE_QUESTION, GTK_MESSAGE_OTHER,&
- & GTK_MESSAGE_ERROR, GTK_ICON_SIZE_DIALOG, GTK_MESSAGE_WARNING&
- &, GTK_MESSAGE_INFO, GTK_BUTTONS_NONE, GTK_BUTTONS_OK,&
+ & GTK_MESSAGE_ERROR, GTK_ICON_SIZE_DIALOG, GTK_MESSAGE_WARNING, &
+ & GTK_MESSAGE_INFO, GTK_BUTTONS_NONE, GTK_BUTTONS_OK,&
& GTK_RESPONSE_OK, GTK_BUTTONS_CLOSE, GTK_RESPONSE_CLOSE,&
& GTK_BUTTONS_CANCEL, GTK_RESPONSE_CANCEL, GTK_RESPONSE_YES,&
& GTK_RESPONSE_NO, GTK_BUTTONS_OK_CANCEL, GTK_RESPONSE_NONE,&
- & NULL, CNULL, FNULL, TRUE, FALSE
+ & TRUE, FALSE
implicit none
@@ -78,7 +78,8 @@ function hl_gtk_message_dialog_show(message, button_set, title, type, &
! for the built in one are variadic and so not callable from Fortran.
!
! MESSAGE: string(n): required: The message to display. Since this is
- ! a string array, the CNULL terminations are provided internally
+ ! a string array, the C_NULL_CHAR terminations are provided
+ ! internally
! BUTTON_SET: integer: required: The set of buttons to display
! TITLE: string: optional: Title for the window.
! TYPE: c_int: optional: Message type (a GTK_MESSAGE_ value)
@@ -129,7 +130,7 @@ function hl_gtk_message_dialog_show(message, button_set, title, type, &
junk = gtk_image_new_from_stock(GTK_STOCK_DIALOG_QUESTION, &
& GTK_ICON_SIZE_DIALOG)
case default
- junk=NULL
+ junk=C_NULL_PTR
end select
if (c_associated(junk)) call gtk_box_pack_start(hb, junk, TRUE, TRUE, 0)
vb = gtk_vbox_new(FALSE, 0)
@@ -140,11 +141,11 @@ function hl_gtk_message_dialog_show(message, button_set, title, type, &
do i = 1, size(message)
if (i == 1) then
- junk = gtk_label_new(cnull)
+ junk = gtk_label_new(c_null_char)
call gtk_label_set_markup(junk, '<b><big>'//trim(message(i))// &
- & '</big></b>'//cnull)
+ & '</big></b>'//c_null_char)
else
- junk = gtk_label_new(trim(message(i))//cnull)
+ junk = gtk_label_new(trim(message(i))//c_null_char)
end if
call gtk_box_pack_start(vb, junk, TRUE, TRUE, 0)
end do
View
36 src/gtk-hl-entry-tmpl.f90
@@ -77,7 +77,7 @@ module gtk_hl_entry
& gtk_text_view_new_with_buffer, gtk_text_view_set_editable,&
& gtk_widget_set_sensitive, gtk_widget_set_size_request,&
& gtk_widget_set_tooltip_text, GTK_POLICY_AUTOMATIC, &
- & NULL, CNULL, FNULL, TRUE, FALSE, g_signal_connect
+ & TRUE, FALSE, g_signal_connect
implicit none
@@ -132,35 +132,35 @@ function hl_gtk_entry_new(len, editable, activate, data, tooltip, value, &
if (present(activate)) then
if (present(data)) then
call g_signal_connect(entry, &
- & "activate"//CNULL, activate, data)
+ & "activate"//C_NULL_CHAR, activate, data)
else
call g_signal_connect(entry, &
- & "activate"//CNULL, activate)
+ & "activate"//C_NULL_CHAR, activate)
end if
end if
if (present(changed)) then
if (present(data_changed)) then
- call g_signal_connect(entry, "changed"//CNULL, changed, &
+ call g_signal_connect(entry, "changed"//C_NULL_CHAR, changed, &
& data_changed)
else
- call g_signal_connect(entry, "changed"//CNULL, changed)
+ call g_signal_connect(entry, "changed"//C_NULL_CHAR, changed)
end if
end if
if (present(delete_text)) then
if (present(data_delete_text)) then
- call g_signal_connect(entry, "delete-text"//CNULL, delete_text, &
+ call g_signal_connect(entry, "delete-text"//C_NULL_CHAR, delete_text, &
& data_delete_text)
else
- call g_signal_connect(entry, "delete-text"//CNULL, delete_text)
+ call g_signal_connect(entry, "delete-text"//C_NULL_CHAR, delete_text)
end if
end if
if (present(insert_text)) then
if (present(data_insert_text)) then
- call g_signal_connect(entry, "insert-text"//CNULL, insert_text, &
+ call g_signal_connect(entry, "insert-text"//C_NULL_CHAR, insert_text, &
& data_insert_text)
else
- call g_signal_connect(entry, "insert-text"//CNULL, insert_text)
+ call g_signal_connect(entry, "insert-text"//C_NULL_CHAR, insert_text)
end if
end if
@@ -255,11 +255,11 @@ function hl_gtk_text_view_new(scroll, editable, changed, data_changed, &
character(kind=c_char), dimension(:), allocatable :: text0
type(gtktextiter), target :: iter
- tbuf = gtk_text_buffer_new(NULL)
+ tbuf = gtk_text_buffer_new(C_NULL_PTR)
view = gtk_text_view_new_with_buffer(tbuf)
if (present(scroll)) then
- scroll = gtk_scrolled_window_new(NULL, NULL)
+ scroll = gtk_scrolled_window_new(C_NULL_PTR, C_NULL_PTR)
call gtk_scrolled_window_set_policy(scroll, GTK_POLICY_AUTOMATIC, &
& GTK_POLICY_AUTOMATIC)
if (present(ssize)) call gtk_widget_set_size_request(scroll, ssize(1), ssize(2))
@@ -285,26 +285,26 @@ function hl_gtk_text_view_new(scroll, editable, changed, data_changed, &
! Attach the various signals
if (present(changed)) then
if (present(data_changed)) then
- call g_signal_connect(tbuf, "changed"//cnull, changed, &
+ call g_signal_connect(tbuf, "changed"//c_null_char, changed, &
& data_changed)
else
- call g_signal_connect(tbuf, "changed"//cnull, changed)
+ call g_signal_connect(tbuf, "changed"//c_null_char, changed)
end if
end if
if (present(insert_text)) then
if (present(data_insert_text)) then
- call g_signal_connect(tbuf, "insert-text"//cnull, insert_text, &
+ call g_signal_connect(tbuf, "insert-text"//c_null_char, insert_text, &
& data_insert_text)
else
- call g_signal_connect(tbuf, "insert-text"//cnull, insert_text)
+ call g_signal_connect(tbuf, "insert-text"//c_null_char, insert_text)
end if
end if
if (present(delete_range)) then
if (present(data_delete_range)) then
- call g_signal_connect(tbuf, "delete-range"//cnull, delete_range, &
+ call g_signal_connect(tbuf, "delete-range"//c_null_char, delete_range, &
& data_delete_range)
else
- call g_signal_connect(tbuf, "delete-range"//cnull, delete_range)
+ call g_signal_connect(tbuf, "delete-range"//c_null_char, delete_range)
end if
end if
@@ -374,7 +374,7 @@ subroutine hl_gtk_text_view_insert(view, text, line, column, replace, &
icol = 0
end if
if (present(replace)) then
- call hl_gtk_text_view_delete(NULL, line=line, column=icol, &
+ call hl_gtk_text_view_delete(C_NULL_PTR, line=line, column=icol, &
& n_chars=size(text0), buffer=tbuf)
end if
call gtk_text_buffer_get_iter_at_line_offset(tbuf, c_loc(iter), &
View
38 src/gtk-hl-entry.f90
@@ -26,7 +26,7 @@
! --------------------------------------------------------
! gtk-hl-entry.f90
-! Generated: Thu Dec 1 21:27:37 2011 GMT
+! Generated: Wed May 16 14:59:04 2012 GMT
! Please do not edit this file directly,
! Edit gtk-hl-entry-tmpl.f90, and use ./mk_gtk_hl.pl to regenerate.
! --------------------------------------------------------
@@ -77,7 +77,7 @@ module gtk_hl_entry
& gtk_text_view_new_with_buffer, gtk_text_view_set_editable,&
& gtk_widget_set_sensitive, gtk_widget_set_size_request,&
& gtk_widget_set_tooltip_text, GTK_POLICY_AUTOMATIC, &
- & NULL, CNULL, FNULL, TRUE, FALSE, g_signal_connect
+ & TRUE, FALSE, g_signal_connect
implicit none
@@ -132,35 +132,35 @@ function hl_gtk_entry_new(len, editable, activate, data, tooltip, value, &
if (present(activate)) then
if (present(data)) then
call g_signal_connect(entry, &
- & "activate"//CNULL, activate, data)
+ & "activate"//C_NULL_CHAR, activate, data)
else
call g_signal_connect(entry, &
- & "activate"//CNULL, activate)
+ & "activate"//C_NULL_CHAR, activate)
end if
end if
if (present(changed)) then
if (present(data_changed)) then
- call g_signal_connect(entry, "changed"//CNULL, changed, &
+ call g_signal_connect(entry, "changed"//C_NULL_CHAR, changed, &
& data_changed)
else
- call g_signal_connect(entry, "changed"//CNULL, changed)
+ call g_signal_connect(entry, "changed"//C_NULL_CHAR, changed)
end if
end if
if (present(delete_text)) then
if (present(data_delete_text)) then
- call g_signal_connect(entry, "delete-text"//CNULL, delete_text, &
+ call g_signal_connect(entry, "delete-text"//C_NULL_CHAR, delete_text, &
& data_delete_text)
else
- call g_signal_connect(entry, "delete-text"//CNULL, delete_text)
+ call g_signal_connect(entry, "delete-text"//C_NULL_CHAR, delete_text)
end if
end if
if (present(insert_text)) then
if (present(data_insert_text)) then
- call g_signal_connect(entry, "insert-text"//CNULL, insert_text, &
+ call g_signal_connect(entry, "insert-text"//C_NULL_CHAR, insert_text, &
& data_insert_text)
else
- call g_signal_connect(entry, "insert-text"//CNULL, insert_text)
+ call g_signal_connect(entry, "insert-text"//C_NULL_CHAR, insert_text)
end if
end if
@@ -255,11 +255,11 @@ function hl_gtk_text_view_new(scroll, editable, changed, data_changed, &
character(kind=c_char), dimension(:), allocatable :: text0
type(gtktextiter), target :: iter
- tbuf = gtk_text_buffer_new(NULL)
+ tbuf = gtk_text_buffer_new(C_NULL_PTR)
view = gtk_text_view_new_with_buffer(tbuf)
if (present(scroll)) then
- scroll = gtk_scrolled_window_new(NULL, NULL)
+ scroll = gtk_scrolled_window_new(C_NULL_PTR, C_NULL_PTR)
call gtk_scrolled_window_set_policy(scroll, GTK_POLICY_AUTOMATIC, &
& GTK_POLICY_AUTOMATIC)
if (present(ssize)) call gtk_widget_set_size_request(scroll, ssize(1), ssize(2))
@@ -285,26 +285,26 @@ function hl_gtk_text_view_new(scroll, editable, changed, data_changed, &
! Attach the various signals
if (present(changed)) then
if (present(data_changed)) then
- call g_signal_connect(tbuf, "changed"//cnull, changed, &
+ call g_signal_connect(tbuf, "changed"//c_null_char, changed, &
& data_changed)
else
- call g_signal_connect(tbuf, "changed"//cnull, changed)
+ call g_signal_connect(tbuf, "changed"//c_null_char, changed)
end if
end if
if (present(insert_text)) then
if (present(data_insert_text)) then
- call g_signal_connect(tbuf, "insert-text"//cnull, insert_text, &
+ call g_signal_connect(tbuf, "insert-text"//c_null_char, insert_text, &
& data_insert_text)
else
- call g_signal_connect(tbuf, "insert-text"//cnull, insert_text)
+ call g_signal_connect(tbuf, "insert-text"//c_null_char, insert_text)
end if
end if
if (present(delete_range)) then
if (present(data_delete_range)) then
- call g_signal_connect(tbuf, "delete-range"//cnull, delete_range, &
+ call g_signal_connect(tbuf, "delete-range"//c_null_char, delete_range, &
& data_delete_range)
else
- call g_signal_connect(tbuf, "delete-range"//cnull, delete_range)
+ call g_signal_connect(tbuf, "delete-range"//c_null_char, delete_range)