Menu

#2983 Toggle.TButton style doesn't work on Windows

obsolete: 8.5.11
pending
5
2012-07-13
2012-07-13
Anonymous
No

I need a toggle button for an expansion dialog (i.e., you click the button and it stays down and the dialog expands to show more widgets; you click the button again and it comes up and the dialog contracts to show fewer widgets). See the OpenOffice Find dialog for an example.

This is easy to achieve by creating a custom style. However, it only seems to work on Linux, it does not work on Windows. Attatched is some code that illustrates the point (in Python 3/tkinter).

Discussion

  • Donal K. Fellows

    • labels: 104335 --> 88. Themed Tk
    • assigned_to: hobbs --> jenglish
     
  • Joe English

    Joe English - 2012-07-13

    It looks like the attached toggle.pyw is relying on "-relief raised" / "-relief sunken", but uses the default TButton layout. The (elements in) that layout are not guaranteed to support -relief; and in fact on Windows XP, Windows Vista, and OSX, they do not. You'll need to either assemble a Toggle.TButton layout from platform-independent elements, or provide theme-specific settings.

    Also: it looks like toggle.pyw implements something that acts quite a bit like a checkbutton. You might consider using a ttk::checkbutton instead.

     
  • Joe English

    Joe English - 2012-07-13
    • status: open --> pending
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.