diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2008-03-16 14:39:05 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2008-03-16 14:39:05 +0100 |
commit | a44a417b087ec99f18a51607ca0bb39ddd66fb43 (patch) | |
tree | 3e999ea2ade3757a50e3f630aa500eff94990cb4 | |
parent | 0f663c876b721eb8a41e16964cb0810197eb9a86 (diff) | |
download | mdk-a44a417b087ec99f18a51607ca0bb39ddd66fb43.tar.gz mdk-a44a417b087ec99f18a51607ca0bb39ddd66fb43.tar.bz2 |
Compatibility with GTK+ 2.10
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | mixgtk/mixgtk_mixvm.c | 18 |
2 files changed, 18 insertions, 2 deletions
diff --git a/configure.in b/configure.in index ddb74f3..a7e8f59 100644 --- a/configure.in +++ b/configure.in @@ -123,7 +123,7 @@ esac],[gui=true]) dnl Check for gtk+ if test x$gui = xtrue; then -PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.12.0 libglade-2.0 >= 2.0.0 pango >= 1.4, +PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.10.0 libglade-2.0 >= 2.0.0 pango >= 1.4, [LIBS="$LIBS $GTK_LIBS" AM_CFLAGS="$AM_CFLAGS $GTK_CFLAGS"], [AC_MSG_WARN(Cannot find GTK+/Glade/Pango: the GUI shall not be built) gui=false]) diff --git a/mixgtk/mixgtk_mixvm.c b/mixgtk/mixgtk_mixvm.c index d0ccc05..268bc25 100644 --- a/mixgtk/mixgtk_mixvm.c +++ b/mixgtk/mixgtk_mixvm.c @@ -45,6 +45,12 @@ static GtkLabel *progtime_; static GtkLabel *uptime_; static mix_vm_t *vm_; +#define HAVE_OLD_GTK !GTK_CHECK_VERSION(2, 12, 0) + +#if HAVE_OLD_GTK +static GtkTooltips *tips_ = NULL; +#endif + /* Static function prototypes */ static void init_goto_ (void); @@ -69,6 +75,10 @@ mixgtk_mixvm_init (mix_vm_t *vm) vm_ = vm; +#if HAVE_OLD_GTK + if (!tips_) tips_ = gtk_tooltips_new (); +#endif + for (k = 0; k < REGISTER_NO_; ++k) { reg_entries_[k] = @@ -404,9 +414,15 @@ update_register_ (mixgtk_widget_id_t reg) gtk_entry_set_text (reg_entries_[reg - MIXGTK_WIDGET_rA], BUFFER); g_snprintf (BUFFER, 20, "%s%ld", mix_word_is_negative (tipval)? "-" : "", mix_word_magnitude (tipval)); + +#if HAVE_OLD_GTK + gtk_tooltips_set_tip (tips_, + GTK_WIDGET (reg_entries_[reg - MIXGTK_WIDGET_rA]), + BUFFER, NULL); +#else gtk_widget_set_tooltip_text ( GTK_WIDGET (reg_entries_[reg - MIXGTK_WIDGET_rA]), BUFFER); - +#endif } |