-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a replacement for gtk_radio_action_set_current_value() which
require GTK+ >= 2.10. Two new files were added, compat.h and compat.c.
- Loading branch information
Laurent Monin
committed
Apr 20, 2008
1 parent
bac25c1
commit c10bf95
Showing
4 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Geeqie | ||
* | ||
* Authors: Vladimir Nadvornik / Laurent Monin | ||
* | ||
* This software is released under the GNU General Public License (GNU GPL). | ||
* Please read the included file COPYING for more information. | ||
* This software comes with no warranty of any kind, use at your own risk! | ||
*/ | ||
|
||
#include "main.h" | ||
#include "compat.h" | ||
|
||
/* gtk_radio_action_set_current_value() replacement for GTK+ < 2.10 */ | ||
void radio_action_set_current_value(GtkRadioAction *action, gint current_value) | ||
{ | ||
#if GTK_CHECK_VERSION(2, 10, 0) | ||
gtk_radio_action_set_current_value(action, current_value); | ||
#else | ||
GSList *group; | ||
gint value; | ||
|
||
group = gtk_radio_action_get_group(action); | ||
while (group) | ||
{ | ||
action = GTK_RADIO_ACTION(group->data); | ||
g_object_get(G_OBJECT(action), "value", &value, NULL); | ||
if (value == current_value) | ||
{ | ||
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), TRUE); | ||
return; | ||
} | ||
group = g_slist_next(group); | ||
} | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Geeqie | ||
* | ||
* Authors: Vladimir Nadvornik / Laurent Monin | ||
* | ||
* | ||
* This software is released under the GNU General Public License (GNU GPL). | ||
* Please read the included file COPYING for more information. | ||
* This software comes with no warranty of any kind, use at your own risk! | ||
*/ | ||
|
||
#ifndef COMPAT_H | ||
#define COMPAT_H | ||
|
||
void radio_action_set_current_value(GtkRadioAction *action, gint current_value); | ||
|
||
#endif /* COMPAT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters