1
# -*- coding: utf-8 -*-
3
# THIS FILE IS PART OF THE JOKOSHER PROJECT AND LICENSED UNDER THE GPL. SEE
4
# THE 'COPYING' FILE FOR DETAILS
8
# This is the GUI class for the Note Selector Panel for Score Instruments. It will
9
# take a selection and return the notes duration.
11
#-------------------------------------------------------------------------------
18
class ScoreControlBox(gtk.HBox):
20
# Had to use the unicode code points as \U000note doesn't work correctly.
22
noteUTF8 = {"whole":"𝅝", "half":"𝅗𝅥", "quarter":"𝅘𝅥", "8th":"𝅘𝅥𝅮", "16th":"𝅘𝅥𝅯", "32nd":"𝅘𝅥𝅰", "64th":"𝅘𝅥𝅱", "128th":"𝅘𝅥𝅲", "whole-rest": "𝄻", "half-rest": "𝄼", "quarter-rest": "𝄽", "8th-rest": "𝄾", "16th-rest": "𝄿", "32nd-rest": "𝅀", "64th-rest": "𝅁", "128th-rest": "𝅂"}
24
#_____________________________________________________________________
27
gtk.Container.__init__(self)
30
attr = pango.AttrList()
31
size = pango.AttrSize(20000,0,-1)
35
dictValues = self.noteUTF8.values()
39
temp = dictValues[pos]
40
button = gtk.Button(temp)
42
label.set_attributes(attr)
45
button.connect("clicked", self.OnClick)
46
#_____________________________________________________________________
47
def OnClick(self,widget):
48
selDuration = widget.get_label()
50
for key, value in self.noteUTF8.iteritems():
51
if selDuration == value: