]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/framework-gnome.scm (item-event): Print grob id.
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 9 Nov 2004 00:00:42 +0000 (00:00 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 9 Nov 2004 00:00:42 +0000 (00:00 +0000)
* lily/context-property.cc (make_item_from_properties): Register grob.
* lily/context.cc (add_context): Register context.

* lily/include/context-selector.hh:
* lily/include/grob-selector.hh:
* lily/context-selector.cc:
* lily/grob-selector.cc: New file.

19 files changed:
ChangeLog
lily/auto-beam-engraver.cc
lily/context-def.cc
lily/context-property.cc
lily/context-selector.cc [new file with mode: 0644]
lily/context.cc
lily/grob-selector.cc [new file with mode: 0644]
lily/include/context-selector.hh [new file with mode: 0644]
lily/include/grob-selector.hh [new file with mode: 0644]
lily/include/grob.hh
lily/include/lily-guile.hh
lily/include/scm-hash.hh
lily/include/score-context.hh
lily/include/slur.hh
lily/paper-column.cc
lily/scm-hash.cc
lily/score-context.cc
lily/simple-spacer.cc
scm/framework-gnome.scm

index 6c27b4f10de97382e3203caa587654c1e22d99cb..ee479778d5968bea43262f731b2fc2def7fe4cd5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2004-11-09  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * scm/framework-gnome.scm (item-event): Print grob id.
+
+       * lily/context-property.cc (make_item_from_properties): Register grob.
+       * lily/context.cc (add_context): Register context.
+
+       * lily/include/context-selector.hh:
+       * lily/include/grob-selector.hh:
+       * lily/context-selector.cc:
+       * lily/grob-selector.cc: New file.
+
 2004-11-08  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
        * lily/slur.cc: add 'positions to interface
index 186c923de4a43040229ee7a5101c00f825cbc59f..d5bfa39bfccdb2011085ce1b5047e0c77b11f49c 100644 (file)
@@ -276,15 +276,13 @@ Auto_beam_engraver::consider_end (Moment test_mom)
     }
 }
 
-Spanner*
+Spanner *
 Auto_beam_engraver::create_beam ()
 {
   if (to_boolean (get_property ("skipTypesetting")))
-    {
-     return 0;
-    }
+    return 0;
   
-  Spannerbeam = new Spanner (beam_settings_);
+  Spanner *beam = new Spanner (beam_settings_);
   for (int i = 0; i < stems_->size (); i++)
     {
       /*
index dded720471da5bb5cc64f598bf3d1f392728f1e9..def8427221a9fe0b65984a59c858ecd611e844cf 100644 (file)
@@ -320,15 +320,15 @@ Context_def::instantiate (SCM ops)
   
   scm_gc_unprotect_object (g->self_scm ());
   
-  tg->accepts_list_ = get_accepted  (ops);
-  
+  tg->accepts_list_ = get_accepted (ops);
+
   return tg;
 }
 
 SCM
 Context_def::clone_scm () const
 {
-  Context_def * t = new Context_def (*this);
+  Context_def *t = new Context_def (*this);
   SCM x = t->self_scm ();
   scm_gc_unprotect_object (x);
   return x;
@@ -337,7 +337,7 @@ Context_def::clone_scm () const
 SCM
 Context_def::make_scm ()
 {
-  Context_deft = new Context_def;
+  Context_def *t = new Context_def;
   SCM x = t->self_scm ();
   scm_gc_unprotect_object (x);
   return x;
index 4796980d9fb4edb72d3031171d8ccf9c4b24b190..8d5923c1321443f848f64a976fb26f996b050290 100644 (file)
@@ -1,18 +1,19 @@
-/*   
-   translator-property.cc -- implement manipulation of immutable Grob
+/*
+   context-property.cc -- implement manipulation of immutable Grob
    property lists.
 
    source file of the GNU LilyPond music typesetter
 
    (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
- */
+*/
 
-#include "main.hh"
 #include "context.hh"
-#include "warn.hh"
+#include "grob-selector.hh"
+#include "engraver.hh"
 #include "item.hh"
+#include "main.hh"
 #include "spanner.hh"
-#include "engraver.hh"
+#include "warn.hh"
 
 /*
   Grob descriptions (ie. alists with layout properties) are
@@ -178,7 +179,7 @@ updated_grob_properties (Context * tg, SCM sym)
   else
     {
       SCM copy = daddy_props;
-      SCM * tail = &copy;
+      SCM *tail = &copy;
       SCM p = scm_car (props);
       while  (p != based_on)
        {
@@ -194,16 +195,17 @@ updated_grob_properties (Context * tg, SCM sym)
     }
 }
 
-Item*
+Item *
 make_item_from_properties (Translator *tr, SCM x, SCM cause)
 {
-  Context *tg = tr->context ();
+  Context *context = tr->context ();
   
-  SCM props = updated_grob_properties (tg, x);
-  Item *it= new Item (props);
+  SCM props = updated_grob_properties (context, x);
+  Item *it = new Item (props);
+  Grob_selector::register_grob (context, it);
 
   dynamic_cast<Engraver*>(tr)->announce_grob (it, cause);
-  
+
   return it;
 }
 
@@ -211,11 +213,11 @@ Spanner*
 make_spanner_from_properties (Translator *tr, SCM x, SCM cause)
 {
   Context *tg = tr->context ();
-  
+
   SCM props = updated_grob_properties (tg, x);
-  Spanner *it= new Spanner (props);
+  Spanner *it = new Spanner (props);
 
   dynamic_cast<Engraver*>(tr)->announce_grob (it, cause);
-  
+
   return it;
 }
diff --git a/lily/context-selector.cc b/lily/context-selector.cc
new file mode 100644 (file)
index 0000000..717bd5c
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+  context-selector.cc -- implement Context selection.
+
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#include "context-selector.hh"
+#include "context.hh"
+#include "scm-hash.hh"
+
+Scheme_hash_table *Context_selector::contexts_ = 0;
+
+void
+Context_selector::register_context (Context *context)
+{
+  if (!contexts_)
+    contexts_ = new Scheme_hash_table ();
+  int count = 0;
+  if (Context *first = retrieve_context (identify_context (context, 0)))
+    {
+      count = robust_scm2int (first->get_property ("max"), 0);
+      count++;
+      SCM s = scm_int2num (count);
+      first->set_property ("max", s);
+      context->set_property ("count", s);
+  }
+  /* FIXME: must alway set count, for get_property () not to segfault.  */
+  context->set_property ("count", scm_int2num (count));
+  contexts_->set (identify_context (context, count), context->self_scm ());
+}
+
+SCM
+Context_selector::identify_context (Context *context, int count)
+{
+  /* TODO: start time, parent-context-at-start */
+  return ly_symbol2scm ((context->context_name ()
+                        + ","
+                        + to_string (count)).to_str0 ());
+}
+
+SCM
+Context_selector::identify_context (Context *context)
+{
+  return
+    identify_context (context,
+                     robust_scm2int (context->get_property ("count"), 0));
+}
+
+Context *
+Context_selector::retrieve_context (SCM key)
+{
+  return unsmob_context (contexts_->get (key));
+}
index 75b378c8f3126926416c119d82e49ff04b09a648..3dd2c482e24becffc71031c35ba3121fe7bcd816 100644 (file)
@@ -7,15 +7,16 @@
 
 */
 
-#include "translator-group.hh"
 #include "context-def.hh"
+#include "context-selector.hh"
 #include "context.hh"
-#include "warn.hh"
+#include "ly-smobs.icc"
+#include "main.hh"
 #include "output-def.hh"
 #include "scm-hash.hh"
-#include "main.hh"
-#include "ly-smobs.icc"
 #include "score-context.hh"
+#include "translator-group.hh"
+#include "warn.hh"
 
 bool
 Context::is_removable () const
@@ -29,7 +30,7 @@ Context::check_removal ()
 {
   for (SCM p = context_list_; scm_is_pair (p); p = scm_cdr (p))
     {
-      Context *trg =  unsmob_context (scm_car (p));
+      Context *trg = unsmob_context (scm_car (p));
 
       trg->check_removal ();
       if (trg->is_removable ())
@@ -45,14 +46,14 @@ Context::Context (Context const&)
   assert (false);
 }
 
-Scheme_hash_table*
+Scheme_hash_table *
 Context::properties_dict () const
 {
   return Scheme_hash_table::unsmob (properties_scm_);
 }
 
 void
-Context::add_context (Context*t)
+Context::add_context (Context *t)
 {
   SCM ts = t->self_scm ();
   context_list_ = ly_append2 (context_list_,
@@ -62,9 +63,10 @@ Context::add_context (Context*t)
   if (!t->init_)
     {
       t->init_ = true;
-      
+      Context_selector::register_context (t);
+        
       scm_gc_unprotect_object (ts);
-      Context_def * td = unsmob_context_def (t->definition_);
+      Context_def *td = unsmob_context_def (t->definition_);
 
       /*
        this can not move before add_context (), because \override
@@ -306,11 +308,11 @@ find_context_below (Context * where,
        return where;
     }
   
-  Context * found = 0;
+  Context *found = 0;
   for (SCM s = where->children_contexts ();
        !found && scm_is_pair (s); s = scm_cdr (s))
     {
-      Context * tr = unsmob_context (scm_car (s));
+      Context *tr = unsmob_context (scm_car (s));
 
       found = find_context_below (tr, type, id);
     }
@@ -327,22 +329,21 @@ Context::properties_as_alist () const
 SCM
 Context::context_name_symbol () const
 {
-  Context_def * td = unsmob_context_def (definition_ );
+  Context_def *td = unsmob_context_def (definition_);
   return td->get_context_name ();
 }
 
 String
 Context::context_name () const
 {
-  return  ly_symbol2string (context_name_symbol ());
+  return ly_symbol2string (context_name_symbol ());
 }
 
 Score_context*
 Context::get_score_context () const
 {
-  if (Score_context *sc =dynamic_cast<Score_context*> ((Context*) this))
+  if (Score_context *sc = dynamic_cast<Score_context*> ((Context*) this))
     return sc;
-  
   else if (daddy_context_)
     return daddy_context_->get_score_context ();
   else
@@ -352,8 +353,7 @@ Context::get_score_context () const
 Output_def *
 Context::get_output_def () const
 {
-  return  (daddy_context_)
-    ? daddy_context_->get_output_def () : 0;
+  return daddy_context_ ? daddy_context_->get_output_def () : 0;
 }
 
 Context::~Context ()
@@ -374,7 +374,7 @@ Context::print_smob (SCM s, SCM port, scm_print_state *)
      
   scm_puts ("#<", port);
   scm_puts (classname (sc), port);
-  if (Context_def *d=unsmob_context_def (sc->definition_))
+  if (Context_def *d = unsmob_context_def (sc->definition_))
     {
       scm_puts (" ", port);
       scm_display (d->get_context_name (), port);
@@ -398,7 +398,7 @@ Context::print_smob (SCM s, SCM port, scm_print_state *)
 SCM
 Context::mark_smob (SCM sm)
 {
-  Context * me = (Context*) SCM_CELL_WORD_1 (sm);
+  Context *me = (Context*) SCM_CELL_WORD_1 (sm);
   
   scm_gc_mark (me->context_list_);
   scm_gc_mark (me->aliases_);
diff --git a/lily/grob-selector.cc b/lily/grob-selector.cc
new file mode 100644 (file)
index 0000000..58574a4
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+  grob-selector.cc -- implement Grob selection.
+
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#include "context-selector.hh"
+#include "context.hh"
+#include "grob-selector.hh"
+#include "grob.hh"
+#include "paper-column.hh"
+#include "scm-hash.hh"
+
+Scheme_hash_table *Grob_selector::grobs_ = 0;
+
+void
+Grob_selector::register_grob (Context *context, Grob *grob)
+{
+  if (!grobs_)
+    grobs_ = new Scheme_hash_table ();
+  int count = 0;
+  if (Grob *first = retrieve_grob (identify_grob (context, grob, 0)))
+    {
+      count = robust_scm2int (first->get_property ("max"), 0);
+      count++;
+      SCM s = scm_int2num (count);
+      first->set_property ("max", s);
+      grob->set_property ("count", s);
+    }
+  grob->set_property ("context", context->self_scm ());
+  grobs_->set (identify_grob (context, grob, count), grob->self_scm ());
+}
+
+SCM
+Grob_selector::identify_grob (Context *context, Grob *grob, int count)
+{
+  return ly_symbol2scm ((ly_symbol2string (Context_selector::identify_context (context))
+                        + ","
+                        + grob->name ()
+#if 0  // "when" not defined yet?
+                        + ","
+                        + Paper_column::when_mom (((Item*)grob)->get_column ()).to_string (),
+#endif                  
+                        + ","
+                        + to_string (count)).to_str0 ());
+}
+
+SCM
+Grob_selector::identify_grob (Grob *grob)
+{
+  return identify_grob (unsmob_context (grob->get_property ("context")),
+                       grob,
+                       robust_scm2int (grob->get_property ("count"), 0));
+}
+
+Grob *
+Grob_selector::retrieve_grob (SCM key)
+{
+  return unsmob_grob (grobs_->get (key));
+}
+
+LY_DEFINE (ly_grob_id, "ly:grob-id",
+          1, 0, 0, (SCM grob_scm),
+          "Return grob id.")
+{
+  Grob *grob = unsmob_grob (grob_scm);
+  SCM s = Grob_selector::identify_grob (grob);
+  return s;
+}
diff --git a/lily/include/context-selector.hh b/lily/include/context-selector.hh
new file mode 100644 (file)
index 0000000..5afc659
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+  context-selector.hh -- declare Context_selector
+
+  source file of the LilyPond music typesetter
+  
+  (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+#ifndef CONTEXT_SELECTOR_HH
+#define CONTEXT_SELECTOR_HH
+
+#include "lily-guile.hh"
+#include "lily-proto.hh"
+
+/**
+ * Context_selector:
+ * @register_context: register new #CONTEXT.
+ #
+ **/
+class Context_selector
+{
+  static Scheme_hash_table *contexts_;
+
+public:
+  static void register_context (Context *context);
+  static SCM identify_context (Context *context, int count);
+  static SCM identify_context (Context *context);
+  static Context *retrieve_context (SCM key);
+};
+
+#endif /* CONTEXT_SELECTOR_HH */
+
diff --git a/lily/include/grob-selector.hh b/lily/include/grob-selector.hh
new file mode 100644 (file)
index 0000000..be4b62b
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+  grob-selector.hh -- declare Grob_selector
+
+  source file of the LilyPond music typesetter
+  
+  (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+#ifndef GROB_SELECTOR_HH
+#define GROB_SELECTOR_HH
+
+#include "lily-guile.hh"
+#include "lily-proto.hh"
+
+/**
+ * Grob_selector:
+ * @register_grob: register new #GROB.
+ #
+ **/
+class Grob_selector
+{
+  static int count_;
+  static Scheme_hash_table *grobs_;
+
+public:
+  static void register_grob (Context *context, Grob *grob);
+  static SCM identify_grob (Context *context, Grob *grob, int count);
+  static SCM identify_grob (Grob *grob);
+  static Grob *retrieve_grob (SCM key);
+};
+
+#endif /* GROB_SELECTOR_HH */
index 52f4a0feecb4dd6445570cac91233aa75128f14b..c4d09fec84cd2ef92afdfc43a30a5062dc973af0 100644 (file)
@@ -151,4 +151,3 @@ SCM ly_grobs2scm (Link_array<Grob> a);
 Interval robust_relative_extent (Grob*, Grob*, Axis); 
 
 #endif /* GROB_HH */
-
index e06a507d62f89ae8e046d5d9525796d525430fa5..21da4a45950d6a3bf149f60f75bd66e222931442 100644 (file)
@@ -281,6 +281,6 @@ LY_DEFINE_WITHOUT_DECL (CLASS ## FNAME, CLASS::FNAME, PRIMNAME, REQ, OPT, \
                        VAR, ARGLIST, DOCSTRING)
 
 #define get_property(x) internal_get_property (ly_symbol2scm (x))
-#define set_property(x,y) internal_set_property (ly_symbol2scm (x), y)
+#define set_property(x, y) internal_set_property (ly_symbol2scm (x), y)
 
 #endif /* LILY_GUILE_HH */
index c5c2769e67ac646531bb748053d5ef71790a79c6..a8234945059da313e0227bcc06da665aba5045b6 100644 (file)
@@ -54,11 +54,12 @@ public:
   Scheme_hash_table (Scheme_hash_table const &);
 
   SCM to_alist () const;
+
 private:
   SCM hash_tab_;
   unsigned elt_count_;
   
-  DECLARE_SMOBS (Scheme_hash_table,foo);
+  DECLARE_SMOBS (Scheme_hash_table, foo);
 };
 
 
index 796fbee32d1a75a24769f78c3c4ff94c7bda2652..39cf74c61364397e10738b79bb58c6a94f0bde68 100644 (file)
@@ -1,18 +1,15 @@
-/*   
-score-context.hh -- declare Score_notation_context
-
-source file of the GNU LilyPond music typesetter
-
-(c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- */
-
+/*
+  score-context.hh -- declare Score_context
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
+*/
 #ifndef SCORE_CONTEXT_HH
 #define SCORE_CONTEXT_HH
 
 #include "global-context.hh"
 
-
 class Score_context : public Context
 {
  public:
@@ -22,6 +19,4 @@ class Score_context : public Context
   virtual void one_time_step ();
 };
 
-
-
 #endif /* SCORE_CONTEXT_HH */
index 125697632ce36c9b74da068674a5b124c24b752b..003fa48083e56d89b9f104527547c2e17b71f5a1 100644 (file)
@@ -1,14 +1,13 @@
-/* 
+/*
   slur.hh -- declare Slur
   
   source file of the GNU LilyPond music typesetter
   
   (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
 */
 
-#ifndef NEW_SLUR_HH
-#define NEW_SLUR_HH
+#ifndef SLUR_HH
+#define SLUR_HH
 
 #include "lily-proto.hh"
 #include "lily-guile.hh"
@@ -26,5 +25,4 @@ public:
   static Bezier get_curve (Grob*me);
 };
 
-#endif /* NEW_SLUR_HH */
-
+#endif /* SLUR_HH */
index d4d5a03e7eee5fcb568a3785205d5fec06891604..a955c6663cb97044817e556c1850be1ae3b74ff4 100644 (file)
@@ -72,15 +72,12 @@ Paper_column::Paper_column (SCM l)
 }
 
 Moment
-Paper_column::when_mom (Grob*me)
+Paper_column::when_mom (Grob *me)
 {
   SCM m = me->get_property ("when");
-  Moment s (0);
-  if (unsmob_moment (m))
-    {
-      return *unsmob_moment (m);
-    }
-  return s;
+  if (Moment *when = unsmob_moment (m))
+    return *when;
+  return Moment (0);
 }
 
 bool
index 7497d699d4f2734202cab2ff5bccadcb672dce6d..2cdbb1d50ccbff9aa7b17e8d07b7623951b995da 100644 (file)
@@ -4,8 +4,8 @@
   source file of the GNU LilyPond music typesetter
   
   (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
+
 #include <stdio.h>
 
 #include "scm-hash.hh"
@@ -58,6 +58,10 @@ Scheme_hash_table::operator = (Scheme_hash_table const & src)
   elt_count_ = copy_scm_hashes (hash_tab_, src.hash_tab_);
 }
 
+Scheme_hash_table::~Scheme_hash_table ()
+{
+}
+
 SCM
 Scheme_hash_table::mark_smob (SCM s)
 {
@@ -89,7 +93,6 @@ Scheme_hash_table::try_retrieve (SCM k, SCM *v)
     }
   else
     return false;
-
 }
 
 bool
@@ -104,9 +107,7 @@ Scheme_hash_table::set (SCM k, SCM v)
   assert (scm_is_symbol (k));
   SCM handle = scm_hashq_create_handle_x (hash_tab_, k, SCM_UNDEFINED);
   if (scm_cdr (handle) == SCM_UNDEFINED)
-    {
-      elt_count_++;
-    }
+    elt_count_++;
   
   scm_set_cdr_x (handle, v);
 
@@ -135,32 +136,21 @@ void
 Scheme_hash_table::remove (SCM k)
 {
   scm_hashq_remove_x (hash_tab_, k);
-  /*
-    don't decrease elt_count_ , as this may cause underflow. The exact
-    value of elt_count_ is not important.
-   */
-}
-
-Scheme_hash_table::~Scheme_hash_table ()
-{
+  /* Do not decrease elt_count_ as this may cause underflow.  The exact
+     value of elt_count_ is not important. */
 }
 
 SCM
 Scheme_hash_table::to_alist () const
 {
-  SCM l = SCM_EOL;
+  SCM lst = SCM_EOL;
   for (int i = SCM_VECTOR_LENGTH (hash_tab_); i--;)
-    for (SCM s = scm_vector_ref (hash_tab_, scm_int2num (i)); scm_is_pair (s); s = scm_cdr (s))
-      {
-       l = scm_acons (scm_caar (s), scm_cdar (s), l);
-      }
-  return l;  
+    for (SCM s = scm_vector_ref (hash_tab_, scm_int2num (i)); scm_is_pair (s);
+        s = scm_cdr (s))
+      lst = scm_acons (scm_caar (s), scm_cdar (s), lst);
+  return lst;
 }
 
-
-
-
-
 IMPLEMENT_SMOBS (Scheme_hash_table);
 IMPLEMENT_DEFAULT_EQUAL_P (Scheme_hash_table);
 
index 6cbd6a555915c9263a8f4ee6d20f1aea3adf7213..0e179e50c4ebe71f535789ea165b54b430e09ee7 100644 (file)
@@ -1,9 +1,9 @@
-/*   
-       score-context.cc -- implement Score_context
-
-       source file of the GNU LilyPond music typesetter
-
-       (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
+/*
+  score-context.cc -- implement Score_context
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "score-context.hh"
index eb20f0b1dadcb271b21ff1653a64b87027d25691..d9413d5b8ea2ad6065912af99084363be9ed4310 100644 (file)
@@ -268,7 +268,7 @@ LY_DEFINE(ly_solve_spring_rod_problem, "ly:solve-spring-rod-problem",
                   length, SCM_ARG3, __FUNCTION__, "number or #f");
 
 
-  bool is_ragged   = ragged == SCM_BOOL_T; 
+  bool is_ragged = ragged == SCM_BOOL_T; 
   Simple_spacer spacer; 
   for (SCM s = springs; scm_is_pair (s); s = scm_cdr (s))
     {
index 968d8132d1e0eddd0f4d3b811965ab88296c23d2..631c762f873af956c7082267b9b3ce5a7e112053 100644 (file)
          
          (let ((properties (ly:grob-properties grob))
                (basic-properties (ly:grob-basic-properties grob))
+               (id (ly:grob-id grob))
                (x (inexact->exact (gdk-event-button:x-root event)))
                (y (inexact->exact (gdk-event-button:y-root event))))
               
              
              (add window vbox)
              (connect button 'clicked (lambda (b) (destroy window)))
-             
+
              (for-each
               (lambda (x)
                 (let ((button (make <gtk-button>
                                  (format #f "~S" (cdr x))))))
                   (set-size-request button 150 BUTTON-HEIGHT)
                   (add vbox button)))
-              properties)
+              (cons (list id) properties))
              (add vbox button)
              
              ;; FIXME: how to do window placement?