View Single Post
Old 09-13-2013, 08:44 AM   #6
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by Sasje View Post
Hi mwe,

I also get that sporadically. Sometimes it starts fine, and sometimes it throws. Why it happens is a mystery to me... I'm not very well versed in Python, in fact, it's my 2nd Python script. Maybe we can suppress it, or maybe it's just a bug...

Microsoft says: "This is an unsupported way to load Visual C++ DLLs."

Probably something to do with tkinter?

...so if anyone has a suggestion/idea?

-
Working fine here (Win XP 32bit), thank you.

Quote:
Originally Posted by nofish View Post
Thanks for this.

I just tested it, no errors here so far, seems to work fine.

I like such "creativity aids" when the damn writer's block is round the corner.

Though I hope the Reaper devs can somehow make working with tkinter apps like this a little less quirky.

Currently:

- hides behind Reaper's window when clicking anywhere in Reaper
It is possible to place the tkinter window on top of other windows with "wm_attributes("-topmost", 1)":

Code:
class Application:

    def __init__(self, root):
        self.root = root
        self.root.title('ReaChorder')
        self.root.wm_attributes("-topmost", 1)
        ttk.Frame(self.root, borderwidth=5, relief="sunken", width=740,height=300).pack()
        self.init_widgets()
Quote:
Originally Posted by nofish View Post
- no undo (as said, but probably hard to implement)
Undo should work if these (bolded) lines are added to ReaChord_Functions.py:

Code:
from sws_python import *
from contextlib import contextmanager
from random import randint

@contextmanager
def undoable(message):
    RPR_Undo_BeginBlock2(0)
    try:
        yield
    finally:
        RPR_Undo_EndBlock2(0, message, -1)

posi = 0
.
.
.
def drawMidi(a,b,c,d,e):
    with undoable("Undo point name here"):
        selAllNotesTselection()
        deleteSelectedNotes()
        MidiPos = 11520
        rand = randint(0, 2)
        #drawChords(a,b,c,d,0,'verse',rand)
        e = int(e)
        d = int(d)

        if e == 0 or e == 1: # Chords only
.
.
.
Here's another "undo" example (flip selected notes - post #38):
http://forum.cockos.com/showthread.php?t=91871
Quote:
Originally Posted by nofish View Post
- steals Reaper's keyboard shortcuts when in focus
This is the most annoying thing with tkinter - ReaScript doesn't support multithreading .

Last edited by spk77; 09-13-2013 at 09:09 AM.
spk77 is offline   Reply With Quote