Python Forum
[PyGTK] How to center text on multi-line buttons?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGTK] How to center text on multi-line buttons?
#2
You use justify to left/right/center justify the text inside the label widget. To center the label widget inside the button you use alignment. There was a button.set_alignment(x, y) that did this but it is depreciated or gone. button.set_alignment(0.5, 0.5) would center the label widget inside the button. Now I think you use set_halign and set_valign on the label widget inside the button.
Reply


Messages In This Thread
RE: [PyGTK] How to center text on multi-line buttons? - by deanhystad - Jan-23-2021, 02:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] [Solved]Change text color of one line in TextBrowser Extra 2 5,041 Aug-23-2022, 09:11 PM
Last Post: Extra
  [PyGUI] Creating hot spots in PyGTK DrakeSoft 1 1,666 Aug-01-2022, 04:35 PM
Last Post: Axel_Erfurt
  Line numbers in Text widget rfresh737 3 5,573 Apr-15-2021, 12:30 PM
Last Post: rfresh737
  [PyGTK] Creating Book Table ramazanemreosmanoglu 3 1,898 Oct-27-2020, 06:47 PM
Last Post: Axel_Erfurt
  Part of code is adding extra new line when saving to text file. lovepeace 9 5,202 Aug-24-2019, 12:52 PM
Last Post: lovepeace
  Spacing Between two labels are very far and Top label is not in Center using Tkinter barry76 2 7,178 Jul-30-2019, 10:49 AM
Last Post: wuf
  [Tkinter] Line Number Tkinter Text Are smabubakkar 1 4,424 Jun-22-2019, 07:05 PM
Last Post: woooee
  [Tkinter] How do I center this text in tkinter? ejected 4 63,769 Mar-29-2019, 10:35 PM
Last Post: woooee
  Multi windows in tkinter buttons not responding correctly curtjohn86 13 11,775 Jul-01-2017, 03:42 PM
Last Post: nilamo
  the alternate keyboard commands / center command Luke_Drillbrain 3 4,169 Apr-30-2017, 03:30 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020