Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 06-11-2018, 05:33 AM   #1
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default [SOLVED] Python Tkinter only supports ASCII characters in REAPER ?

Hi,


it seems that it is not possible to add utf-8 symbols like ✖ in Tkinter GUI with REAPER.


In REAPER:



From Python IDLE




How come ?




Code:
## IMPORTS

#Sys
import sys
sys.argv=["Main"]

#Tkinter
from tkinter import * 

### DEF FUNCTIONS

 #Quit the script
def quit():
  global root
  root.destroy()
  
## INIT CODE

root = Tk() # Init TK

buttons = Frame(root)
buttons.pack(fill=X)
bouton1 = Button(buttons, text="✔", command=lambda: quit())
bouton1.grid(row = 0,column = 0)

mainloop(  )

Last edited by X-Raym; 06-11-2018 at 10:29 AM.
X-Raym is offline   Reply With Quote
Old 06-11-2018, 10:01 AM   #2
tparker24
Human being with feelings
 
Join Date: Dec 2017
Posts: 83
Default

I was able to duplicate the problem, and was able to fix it, by using an explicit unicode constant, thusly:

Code:
#bouton1 = Button(buttons, text="✔", command=lambda: quit())
x =  "\u2714"
bouton1 = Button(buttons, text=x, command=lambda: quit())
Give that a try.

Last edited by tparker24; 06-11-2018 at 10:03 AM. Reason: typo
tparker24 is offline   Reply With Quote
Old 06-11-2018, 10:23 AM   #3
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

It worked ! Nice trick !!


Here is a nice toolbar :P

X-Raym is offline   Reply With Quote
Old 06-13-2018, 01:09 AM   #4
meradium
Human being with feelings
 
Join Date: May 2018
Posts: 38
Default

May I ask how you got it Tkinter working for you inside Reaper?

Whatever I do, as soon as I include anything Tkinter related and execute the script Reaper just wont do anything at all.

As a starter I used the example template script on github.

I'm on OSX. I pointed Reaper to the Python 3 64bit interpreter. Python scripts run fine. It's just Tkinter which is causing trouble here.

When I run the demo straight from the console it runs fine. It only seems to have trouble from inside Reaper.

Any ideas or suggestions?
meradium is offline   Reply With Quote
Old 06-13-2018, 01:43 AM   #5
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

@meradium
I'm on Win, and the template I made (which is probably the one you use) should work just fine



but seems there is problem with mac



I haven't personnaly tested on Mac yet.


The solution may be to use beyond.reaper and run the script outside reaper instead of running the script in REAPER.


I'll make my own test on Mac at some point.

I invite you to join one of this thread to discuss about this particular issue.

Last edited by X-Raym; 06-13-2018 at 01:49 AM.
X-Raym is offline   Reply With Quote
Old 06-28-2018, 02:57 PM   #6
meradium
Human being with feelings
 
Join Date: May 2018
Posts: 38
Default

Will keep an eye on it. So far I guess I will have to live without an UI or start learning Lua....

But Reaper keeps me busy learning the basics first... boy there are sooo many options for everything. This is quite a change coming from Cubase...
meradium is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:10 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.