[monkey-bubble: 55/753] restore state does not exist on the new Gtk
- From: Sven Herzberg <herzi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [monkey-bubble: 55/753] restore state does not exist on the new Gtk
- Date: Wed, 14 Jul 2010 22:00:18 +0000 (UTC)
commit 8c6e21820c19bb0af557a91957425b1487535699
Author: Miguel de Icaza <miguel nuclecu unam mx>
Date: Thu Jan 22 02:14:09 1998 +0000
restore state does not exist on the new Gtk
Wed Jan 21 20:11:45 1998 Miguel de Icaza <miguel nuclecu unam mx>
* obgtk/ObgtkWidget.[mh]: restore state does not exist on the new Gtk
* libgnome/gnome-score-helper.c (main): Display statistics.
* libgnome/gnome-score.c (gnome_score_log): we need to call _exit
instead of exit() if the exec fails (since gtk will try to
shutdown itself).
* libgnomeui/gnome-scores.c (gnome_scores_display): New function.
Takes care of all the details of displaying the score.
* programs/same-gnome.c (show_scores): use the simplified routine
* programs/gnomine/gnomine.c (show_scores): likewise
libgnomeui/gnome-scores.c | 34 ++++++++++++++++++++++++++++------
libgnomeui/gnome-scores.h | 2 ++
2 files changed, 30 insertions(+), 6 deletions(-)
---
diff --git a/libgnomeui/gnome-scores.c b/libgnomeui/gnome-scores.c
index d0333f7..5232796 100644
--- a/libgnomeui/gnome-scores.c
+++ b/libgnomeui/gnome-scores.c
@@ -10,6 +10,8 @@
#include "libgnome/gnome-util.h"
#include "libgnome/gnome-config.h"
#include "libgnome/gnome-i18n.h"
+#include "libgnome/gnome-score.h"
+#include "libgnome/gnome-string.h"
#include "gtk/gtk.h"
@@ -188,12 +190,6 @@ void gnome_scores_set_logo_label (GnomeScores *gs, gchar *txt, gchar *font,
if(col)
memcpy((void *) &s->fg[0], col, sizeof(GdkColor) );
- if( font ) fo = font;
- else fo = "-freefont-garamond-*-*-*-*-30-170-*-*-*-*-iso8859-1";
-
- if ((f = gdk_fontset_load (fo)))
- s->font = f;
-
gs->logo = gtk_label_new(txt);
gtk_widget_set_style(GTK_WIDGET(gs->logo), s);
gtk_box_pack_end (GTK_BOX(gs->vbox), gs->logo, TRUE, TRUE, 0);
@@ -234,3 +230,29 @@ void gnome_scores_set_logo_pixmap (GnomeScores *gs, gchar *pix_name)
gtk_widget_show (gs->logo);
}
+void
+gnome_scores_display (gchar *title, gchar *app_name, gchar *level, int pos)
+{
+ GtkWidget *hs;
+ GdkColor ctitle = {0, 0, 0, 65535};
+ GdkColor col = {0, 65535, 0, 0};
+ gchar **names = NULL;
+ gfloat *scores = NULL;
+ time_t *scoretimes = NULL;
+ gint top;
+ int i;
+
+ top = gnome_score_get_notable(app_name, level, &names, &scores, &scoretimes);
+ if (top > 0){
+ hs = gnome_scores_new(top, names, scores, scoretimes, 0);
+ gnome_scores_set_logo_label (GNOME_SCORES(hs), title, 0,
+ &ctitle);
+ if(pos)
+ gnome_scores_set_color(GNOME_SCORES(hs), pos-1, &col);
+
+ gtk_widget_show (hs);
+ gnome_string_array_free(names);
+ g_free(scores);
+ g_free(scoretimes);
+ }
+}
diff --git a/libgnomeui/gnome-scores.h b/libgnomeui/gnome-scores.h
index b16d7f1..a0eb50a 100644
--- a/libgnomeui/gnome-scores.h
+++ b/libgnomeui/gnome-scores.h
@@ -54,6 +54,8 @@ void gnome_scores_set_def_color (GnomeScores *, GdkColor*);
array, not a pointer as in [set|def]_color */
void gnome_scores_set_colors (GnomeScores *, GdkColor*);
+void gnome_scores_display (gchar *title, gchar *app_name, gchar *level, int pos);
+
END_GNOME_DECLS
#endif /* GNOME_SCORES_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]