denemo-devel
[Top][All Lists]
Advanced

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

[Denemo-devel] [bug #50204] Re-order lyric verses


From: Richard Shann
Subject: [Denemo-devel] [bug #50204] Re-order lyric verses
Date: Wed, 1 Feb 2017 19:43:57 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.4.0

URL:
  <http://savannah.gnu.org/bugs/?50204>

                 Summary: Re-order lyric verses
                 Project: Denemo
            Submitted by: rshann
            Submitted on: Wed 01 Feb 2017 07:43:55 PM GMT
                Category: None
                Severity: 1 - Wish
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

It would be nice to re-order verses by dragging the tabs in the notebook.
While it is easy to enable dragging the tabs, the code below fails to actually
re-order the verses for the reasons explained.


// this doesn't work because page_num is the *new* position, ie it is pos
// we have to go through the list parsing "Verse %d" from the label to get pos
and
//afterwards re-write all the labels in the new order.
static void
reorder_verse (GtkNotebook *notebook,
               GtkWidget   *child,
               guint        page_num,
               DenemoStaff*     thestaff)
{
    GList *children  = gtk_container_get_children (GTK_CONTAINER(notebook));
    gint pos = g_list_index (children, child);
    GList *this = g_list_nth (thestaff->verses, pos);
    thestaff->verses = g_list_remove_link (thestaff->verses, this);
    thestaff->verses = g_list_insert (thestaff->verses, this->data,
page_num);
    g_list_free (this);
    g_print ("Reordered %d as %d\n", pos, page_num);
} 

...
 gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (notebook),
gtk_widget_get_parent (textview), TRUE);
  g_signal_connect (G_OBJECT (notebook), "page-reordered", G_CALLBACK
(reorder_verse), staff);
  ...




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?50204>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]