[gnome-robots/libgames-scores: 6/14] Signals for libgames-scores. 1st draft.



commit f1332f17cd5bf8235910b17095fd511a7c163542
Author: Nikhar Agrawal <nikharagrawal2006 gmail com>
Date:   Fri Aug 15 23:24:02 2014 +0530

    Signals for libgames-scores. 1st draft.
    
    Signals mechanism doesn't work.

 src/gnome-robots.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/gnome-robots.c b/src/gnome-robots.c
index b2ccd01..f984937 100644
--- a/src/gnome-robots.c
+++ b/src/gnome-robots.c
@@ -55,6 +55,7 @@ static gboolean window_is_maximized = FALSE;
 GtkWidget *game_area = NULL;
 GamesScoresContext *highscores;
 GSettings *settings;
+GamesScoresCategory cat = {"",""};
 /**********************************************************************/
 
 /**********************************************************************/
@@ -310,6 +311,13 @@ shutdown (GtkApplication *app, gpointer user_data)
   g_settings_set_boolean (settings, "window-is-maximized", window_is_maximized);
 }
 
+GamesScoresCategory *create_category_from_key (GamesScoresContext *context, gpointer key)
+{
+  cat.key = (gchar*) key;
+  cat.name = "whoa";
+  return &cat;
+}
+
 static void
 activate (GtkApplication *app, gpointer user_data)
 {
@@ -407,7 +415,7 @@ activate (GtkApplication *app, gpointer user_data)
                                          _("Game Type"),
                                          window,
                                          GAMES_SCORES_STYLE_PLAIN_DESCENDING);
-
+  g_signal_connect (GTK_WINDOW (highscores), "request-category", G_CALLBACK (create_category_from_key), 
NULL);
   gtk_widget_show_all (window);
 
   if (!load_game_configs ()) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]