Permalink
Browse files

Add missing hl_gtk_radio_menu_group_get_select

  • Loading branch information...
1 parent 6c6e081 commit ac29b4a64bb0ff7f414ef55047c6b3d9e46115a1 @jtappin jtappin committed Feb 8, 2013
Showing with 61 additions and 3 deletions.
  1. +30 −1 src/gtk-hl-menu-tmpl.f90
  2. +31 −2 src/gtk-hl-menu.f90
View
@@ -55,7 +55,7 @@ module gtk_hl_menu
& gtk_menu_item_new_with_label, gtk_menu_item_set_submenu,&
& gtk_menu_new, gtk_menu_shell_append, gtk_menu_shell_insert,&
& gtk_radio_menu_item_get_group, gtk_radio_menu_item_new,&
- & gtk_radio_menu_item_new_with_label,&
+ & gtk_radio_menu_item_new_with_label, gtk_check_menu_item_get_active, &
& gtk_separator_menu_item_new, gtk_tearoff_menu_item_new,&
& gtk_widget_add_accelerator, gtk_widget_set_sensitive,&
& gtk_label_new, gtk_label_set_markup, gtk_container_add, &
@@ -456,6 +456,35 @@ subroutine hl_gtk_radio_menu_group_set_select(group, index)
end subroutine hl_gtk_radio_menu_group_set_select
!+
+ function hl_gtk_radio_menu_group_get_select(group) result(index)
+
+ integer(kind=c_int) :: index
+ type(c_ptr) :: group
+
+ ! Find the selected button in a radio group in a menu.
+ !
+ ! GROUP: c_ptr: required: The group of the last button added to
+ ! the radio menu
+ !-
+
+ integer(kind=c_int) :: nbuts, i
+ type(c_ptr) :: but
+
+ nbuts = g_slist_length(group)
+ index=-1
+
+ do i = 1, nbuts
+ but = g_slist_nth_data(group, nbuts-i)
+ if (.not. c_associated(but)) exit
+
+ if (gtk_check_menu_item_get_active(but)==TRUE) then
+ index = i-1
+ return
+ end if
+ end do
+ end function hl_gtk_radio_menu_group_get_select
+
+ !+
subroutine hl_gtk_menu_item_set_label_markup(item, label)
type(c_ptr) :: item
character(kind=c_char), dimension(*), intent(in) :: label
View
@@ -26,7 +26,7 @@
! --------------------------------------------------------
! gtk-hl-menu.f90
-! Generated: Wed Feb 6 17:08:04 2013 GMT
+! Generated: Fri Feb 8 21:55:44 2013 GMT
! Please do not edit this file directly,
! Edit gtk-hl-menu-tmpl.f90, and use ./mk_gtk_hl.pl to regenerate.
! Generated for GTK+ version: 2.24.0.
@@ -54,7 +54,7 @@ module gtk_hl_menu
& gtk_menu_item_new_with_label, gtk_menu_item_set_submenu,&
& gtk_menu_new, gtk_menu_shell_append, gtk_menu_shell_insert,&
& gtk_radio_menu_item_get_group, gtk_radio_menu_item_new,&
- & gtk_radio_menu_item_new_with_label,&
+ & gtk_radio_menu_item_new_with_label, gtk_check_menu_item_get_active, &
& gtk_separator_menu_item_new, gtk_tearoff_menu_item_new,&
& gtk_widget_add_accelerator, gtk_widget_set_sensitive,&
& gtk_label_new, gtk_label_set_markup, gtk_container_add, &
@@ -455,6 +455,35 @@ subroutine hl_gtk_radio_menu_group_set_select(group, index)
end subroutine hl_gtk_radio_menu_group_set_select
!+
+ function hl_gtk_radio_menu_group_get_select(group) result(index)
+
+ integer(kind=c_int) :: index
+ type(c_ptr) :: group
+
+ ! Find the selected button in a radio group in a menu.
+ !
+ ! GROUP: c_ptr: required: The group of the last button added to
+ ! the radio menu
+ !-
+
+ integer(kind=c_int) :: nbuts, i
+ type(c_ptr) :: but
+
+ nbuts = g_slist_length(group)
+ index=-1
+
+ do i = 1, nbuts
+ but = g_slist_nth_data(group, nbuts-i)
+ if (.not. c_associated(but)) exit
+
+ if (gtk_check_menu_item_get_active(but)==TRUE) then
+ index = i-1
+ return
+ end if
+ end do
+ end function hl_gtk_radio_menu_group_get_select
+
+ !+
subroutine hl_gtk_menu_item_set_label_markup(item, label)
type(c_ptr) :: item
character(kind=c_char), dimension(*), intent(in) :: label

0 comments on commit ac29b4a

Please sign in to comment.