Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Python (http://www.programmingforums.org/forum43.html)
-   -   wxPython Help (http://www.programmingforums.org/showthread.php?t=10033)

Sane May 28th, 2006 3:16 PM

wxPython Help
 
I've got several questions about wxPython, and I'm trying my best to solve them all myself. So, for now, I'll just start with a basic question I've been trying to figure out myself.

How do I make a flat button? The darker ones that you can not click? I have tried...

:

        but_cancel = wx.Button(panel, ID_CANCEL, "Cancel", style=wxNO_BORDER )

wxNO_BORDER, is supposed to flatten it in Windows and GTK+. However, it still displays as a normal button.

Help?

Prm753 May 28th, 2006 4:16 PM

Did you check this out: http://wiki.wxpython.org/index.cgi/GenWinFlatButton

Or just this: Google Search

Dunno if that's what you are looking for. MF_GRAYED can be used in the Win32 API to gray out a button.

Sane May 28th, 2006 5:17 PM

No, that makes one of those old win32 buttons. The ones without a border that get a border when you hover over top. I need one that doesn't hover, click, or trigger events. A flat, readonly button.


Edit:

Do you know how to get what in html is called a fieldset? The border and caption wrapped around things like "Options - quote message in reply" part of the quick post?

DaWei May 28th, 2006 5:47 PM

Are you referring to a text box or label widget, not a button? Put inside a border, say?

Sane May 28th, 2006 6:42 PM

Oh, I guess that's what I should have searched for... a label. Yes, just the same thing as

Quote:

Originally Posted by VB Forums
Options
Quote message in reply?

Right underneath where I am currently typing.

Prm753 May 28th, 2006 6:49 PM

You mean like a group box or a grayed out checkbox or both?

Sane May 28th, 2006 7:02 PM

http://img530.imageshack.us/img530/9994/getit1fs.jpg

That is what I'm looking for, a fix to my code to make wxNO_BORDER work as intended. Nuff' said.


As to the legend/fieldset/label thing, I've figured it out by sprawling through the documentation of wxwidgets: wxStaticBox() ... I'm surprised I managed to find that since its an unexpected name.

DaWei May 28th, 2006 7:04 PM

Get Boa Constructor or something similar. This stuff is right in front of your eyes on the menu bars. What you're calling no border, if that's actually what you mean, is disabled (grayed out), a state.
http://www.daweidesigns.com/images/Stuff.gif

Sane May 28th, 2006 7:32 PM

Even if wxNO_BORDER doesn't grey it out, shouldn't it still at least do something? And after some poking around, I've still only found support for a disabled state on bitmap buttons, no more.

P.S. Here's what I've got so far.

http://img512.imageshack.us/img512/7...eenshot2fo.png

Really just the disabled buttons left...

Sane May 28th, 2006 9:04 PM

Wow, all I did was dir() the button and found a method called disable. Apparently all wxWidgets support this method:

:

        but_cancel  = wx.Button(panel, ID_CANCEL, "Cancel")
        but_cancel.Disable()


I'm having other difficulties, but I won't bother asking.


All times are GMT -5. The time now is 7:57 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC