Bonjour

Je voudrais bien savoir pourquoi (" self.sca[0].bind('<ButtonRelease-1>',self.gama())") n'agit pas normalement..

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
 # Définition des curseurs
        def scanote1(self,xc):
                do=int(xc)
                xsi=self.sca[6].get()
                xre=self.sca[1].get()
                if do<xsi:self.sca[6].set(do)
                if do>xre+1 :self.sca[1].set(do-1)
                # Initialise sca[7](from_)
                xxrad=self.variable.get()
                if xxrad == "YOI": self.sca[7].configure(from_ = 0-do, to = 24-xsi)
                elif xxrad == "IOI": self.sca[7].configure(from_ = -12-do, to = 12-xsi)
                elif xxrad == "IOY": self.sca[7].configure(from_ = -24-do, to = 0-xsi)
                self.sca[0].bind('<ButtonRelease-1>',self.gama())
        # scanote1()
Voici le sujet du (" self.sca[0].bind('<ButtonRelease-1>',self.gama())")

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
# Les notes cursives scalpha : Graduations gérées.
                self.sca=[
                        Scale(
                                self,
                                length=300,
                                orient=HORIZONTAL,
                                label=label,
                                troughcolor=color,
                                sliderlength=20,
                                showvalue=1,
                                from_=f,
                                to=t,
                                tickinterval=1,
                                command=command,
                        ) for (label, color, f, t, command) in (
                                ("C", "black", 0, 5, self.scanote1),
                                ("D", "green", -1, 4, self.scanote2),
                                ("E", "blue", -2, 3, self.scanote3),
                                ("F", "grey", -2, 3, self.scanote4),
                                ("G", "red", -3, 2, self.scanote5),
                                ("A", "orange", -4, 1, self.scanote6),
                                ("B", "yellow", -5, 0, self.scanote7),
                                ("CDEFGAB", "ivory", -12, 12, self.scanote8),
                        )
                ]
                for x in self.sca: x.pack()