GithubHelp home page GithubHelp logo

Comments (6)

RGerculy avatar RGerculy commented on May 21, 2024 1

I noticed that as well when testing your code unfortunately that is beyond my abilities. Hopefully somebody else will be able to address that issue.

from sun-valley-ttk-theme.

zerozedsc avatar zerozedsc commented on May 21, 2024 1

I noticed that as well when testing your code unfortunately that is beyond my abilities. Hopefully somebody else will be able to address that issue.

Okey, thank you for helping me. I think i will close this issue, because it is not a big issue at all

from sun-valley-ttk-theme.

RGerculy avatar RGerculy commented on May 21, 2024

Hi, your issue is very vague, can you add more details? Which layout manager are you using in your application? Maybe include some code as well.
This is working for me:
button1.place(relx=0.5, rely=0.5, anchor=CENTER)

from sun-valley-ttk-theme.

zerozedsc avatar zerozedsc commented on May 21, 2024

I'm using pack layout, but when I'm using tk.Button the text-align well at the center. so maybe ttk.button does not align all text even after \n at the center.

This is my code:
button_1 = ttk.Button(self.left, text="ABCDEFGHIJKLMNOP\nQRSTUVWXYZ", width=int(W_LEFT/8), command=None, style=style1) button_1.pack(fill='x', anchor=CENTER, pady=1)

from sun-valley-ttk-theme.

RGerculy avatar RGerculy commented on May 21, 2024

Had to modify the code a little but I hope it still works for you.

        button_1 = ttk.Style()
        button_1.configure('Button1.TButton', justify='center')
        button_1 = ttk.Button(frame, text="ABCDEFGHIJKLMNOP\nQRSTUVWXYZ", width=8, command=None, style='Button1.TButton') 
        button_1.pack(fill='x', anchor=CENTER, pady=1)

button1

As far as anchor=center goes, I was unable to center it alone with that but hopefully this will help.

from sun-valley-ttk-theme.

zerozedsc avatar zerozedsc commented on May 21, 2024

yes, it works now. thank you. but why when using anchor=CENTER nothing happen with ttk.button. when using it on tk.button, it works well

from sun-valley-ttk-theme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.