diff --git a/config.h.in b/config.h.in index 6ea241eceec1027d75a368f6abf172b5bd3bb049..4326cdbcf96eeb9637a04b2b295ed25fa2f723a8 100644 --- a/config.h.in +++ b/config.h.in @@ -24,6 +24,9 @@ /* Define to 1 if licensed under terms of the GNU General Public License. */ #undef GPL_LICENSED +/* Define to 1 if using gtk+-2.10.0 or higher */ +#undef GTK2_USE_RADIO_SET + /* Define to 1 if using gtk+-2.12.0 or higher */ #undef GTK2_USE_TOOLTIP diff --git a/configure b/configure index 8897649fc163d48db4b9b6e87218cca325a5eaa0..dc40b02ccb3bb330c9ec6f233e6eb4f13fea0c26 100755 --- a/configure +++ b/configure @@ -18524,6 +18524,12 @@ else fi +if test ${gtk_config_minor_version=0} -gt 10 ; then + +$as_echo "#define GTK2_USE_RADIO_SET 1" >>confdefs.h + +fi + if test ${gtk_config_minor_version=0} -gt 12 ; then $as_echo "#define GTK2_USE_TOOLTIP 1" >>confdefs.h diff --git a/configure.ac b/configure.ac index 46c4c7107f4d4487596477e9dd005982eda72f8a..c75d18290cabec9c566e108fcf818a706133243e 100644 --- a/configure.ac +++ b/configure.ac @@ -180,6 +180,10 @@ AC_SUBST(HAVE_SOME_CURSES) AM_PATH_GTK_2_0([2.7.1], [ac_have_gtk="yes"], [ac_have_gtk="no"], [gthread]) AM_CONDITIONAL(HAVE_GTK, test "x$ac_have_gtk" = "xyes") +if test ${gtk_config_minor_version=0} -gt 10 ; then + AC_DEFINE([GTK2_USE_RADIO_SET], 1, [Define to 1 if using gtk+-2.10.0 or higher]) +fi + if test ${gtk_config_minor_version=0} -gt 12 ; then AC_DEFINE([GTK2_USE_TOOLTIP], 1, [Define to 1 if using gtk+-2.12.0 or higher]) fi diff --git a/src/sview/sview.c b/src/sview/sview.c index 23e759a6010f08137f645f937c4bf101669b912b..7e20437f043b43f9cce3c184c92a361c039648b0 100644 --- a/src/sview/sview.c +++ b/src/sview/sview.c @@ -342,6 +342,7 @@ static void _reconfigure(GtkToggleAction *action) static void _get_current_debug(GtkRadioAction *action) { +#ifdef GTK2_USE_RADIO_SET static int debug_level = 0; static slurm_ctl_conf_info_msg_t *slurm_ctl_conf_ptr = NULL; static GtkAction *debug_action = NULL; @@ -359,6 +360,13 @@ static void _get_current_debug(GtkRadioAction *action) debug_inited = 1; gtk_radio_action_set_current_value(GTK_RADIO_ACTION(debug_action), debug_level); +#else + /* Since gtk_radio_action_set_current_value wasn't added to + GTK until 2.10 we have to just not set the first one here + correctly unless we are running with it. + */ + debug_inited = 1; +#endif } static void _set_debug(GtkRadioAction *action,