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?
#4
Thanks guys! I think I found a better solution by editing the XML and adding an explicit <label> child to the <button>:
<object class="GtkButton">
  <child>
    <object class="GtkLabel">
      <property name="justify">center</property>
      <property name="label">Two&#xD;Lines</property>
    </object>
  </child>
</object>
Probably obvious to the more experienced, but I'm only just getting my feet wet with this.
Reply


Messages In This Thread
RE: [PyGTK] How to center text on multi-line buttons? - by Lomax - Jan-23-2021, 03:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] [Solved]Change text color of one line in TextBrowser Extra 2 4,953 Aug-23-2022, 09:11 PM
Last Post: Extra
  [PyGUI] Creating hot spots in PyGTK DrakeSoft 1 1,634 Aug-01-2022, 04:35 PM
Last Post: Axel_Erfurt
  Line numbers in Text widget rfresh737 3 5,487 Apr-15-2021, 12:30 PM
Last Post: rfresh737
  [PyGTK] Creating Book Table ramazanemreosmanoglu 3 1,880 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,082 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,126 Jul-30-2019, 10:49 AM
Last Post: wuf
  [Tkinter] Line Number Tkinter Text Are smabubakkar 1 4,399 Jun-22-2019, 07:05 PM
Last Post: woooee
  [Tkinter] How do I center this text in tkinter? ejected 4 63,653 Mar-29-2019, 10:35 PM
Last Post: woooee
  Multi windows in tkinter buttons not responding correctly curtjohn86 13 11,660 Jul-01-2017, 03:42 PM
Last Post: nilamo
  the alternate keyboard commands / center command Luke_Drillbrain 3 4,144 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