Comments (5)
@mikdevind The textbox widget is similar to the text widget of tkinter and both don't have the justify option directly, you have to use tag method like mentioned here:
https://www.tutorialspoint.com/how-to-set-justification-on-tkinter-text-box
from customtkinter.
inputanSearch.tag_configure("center", justify='center')
AttributeError: 'CTkTextbox' object has no attribute 'tag_configure'
program is
inputanSearch = tk.CTkTextbox(FrameHome, wrap="none",font=("Times", 20), height=45, width=890)
inputanSearch.grid(row=0, column=0, padx=3, pady=5)
inputanSearch.tag_configure("center", justify='center')
from customtkinter.
@mikdevind
Try this:
import customtkinter
class App(customtkinter.CTk):
def __init__(self):
super().__init__()
self.grid_rowconfigure(0, weight=1) # configure grid system
self.grid_columnconfigure(0, weight=1)
self.textbox = customtkinter.CTkTextbox(master=self, width=400, corner_radius=0)
self.textbox.grid(row=0, column=0, sticky="nsew")
self.textbox._textbox.tag_configure("text", justify='center') # first, justify text position using tag_configure
self.textbox.insert("0.0", "Some example text!\n" * 20) # insert all the text
self.textbox._textbox.tag_add("text", "0.0", "end") # add this line in the end
app = App()
app.mainloop()
from customtkinter.
not work for centering text in CTkTextbox
from customtkinter.
Thanks you
from customtkinter.
Related Issues (20)
- Line numbers for CTkTextBox HOT 3
- How do i remove the text over the image HOT 2
- OptionMenu cut off HOT 8
- bind("<<ComboboxSelected>>" HOT 1
- dynamic output terminal HOT 1
- Typo error in CtkComboBox Methods
- .
- add feature textbox typing
- scrollable frame destroy() still hasn't fixed yet
- Request: Separator
- segmented button command error HOT 1
- Vertical Progressbar rendering bug HOT 2
- Scrollable Frame HOT 1
- button anchor
- Make Scrollable frame and option menu better HOT 2
- Combobox bind in keyboard keys Dropdown menu
- How do I add an image to a button? HOT 1
- CTkTabview allowing to change tabs when CTkTabview_obj.configure(state="disable")
- Issues with crashing - tcl86t.dll on Customtkinter 5.2.2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from customtkinter.