Aboghazala / AwesomeTkinter

Pretty tkinter widgets
MIT License
100 stars 7 forks source link

Buttons and drop down menus #12

Open Yahyaotaif opened 2 years ago

Yahyaotaif commented 2 years ago

I can't seem to have Arabic letters to display correctly with buttons, drop down menus, and check boxes in Linux. Does AwesomTkinter only work with labels and text entries ? If not, can you please provide some examples.

Aboghazala commented 2 years ago

@Yahyaotaif you can render the text before setting the widget text example below

import tkinter as tk
import awesometkinter as atk
from awesometkinter.bidirender import render_text

root = tk.Tk()

text='اضغط هنا'
rtext = render_text(text)  # prepare Arabic letters for tkinter widgets

tk.Button(root, text=text).pack()
tk.Button(root, text=rtext).pack()  # Arabic shows correctly here

root.mainloop()

this can be done for any widget not just buttons

Yahyaotaif commented 2 years ago

Thank you for having the time and your effort to do this !