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).
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Read-Only Bugs"
The self.togge3 button works perfectly on Linux; but not on Windows
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.