Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 28th, 2006, 3:16 PM   #1
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,024
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
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?
Sane is offline   Reply With Quote
Old May 28th, 2006, 4:16 PM   #2
Prm753
Professional Programmer
 
Prm753's Avatar
 
Join Date: Oct 2005
Location: United States
Posts: 447
Rep Power: 4 Prm753 is on a distinguished road
Send a message via AIM to Prm753 Send a message via MSN to Prm753
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.
__________________
The world's first athletic computer geek!
The home of PrProgramsStudios
How not to post a question: <-- Please don't reply
Prm753 is offline   Reply With Quote
Old May 28th, 2006, 5:17 PM   #3
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,024
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
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?

Last edited by Sane; May 28th, 2006 at 5:38 PM.
Sane is offline   Reply With Quote
Old May 28th, 2006, 5:47 PM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Are you referring to a text box or label widget, not a button? Put inside a border, say?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old May 28th, 2006, 6:42 PM   #5
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,024
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
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.
Sane is offline   Reply With Quote
Old May 28th, 2006, 6:49 PM   #6
Prm753
Professional Programmer
 
Prm753's Avatar
 
Join Date: Oct 2005
Location: United States
Posts: 447
Rep Power: 4 Prm753 is on a distinguished road
Send a message via AIM to Prm753 Send a message via MSN to Prm753
You mean like a group box or a grayed out checkbox or both?
__________________
The world's first athletic computer geek!
The home of PrProgramsStudios
How not to post a question: <-- Please don't reply
Prm753 is offline   Reply With Quote
Old May 28th, 2006, 7:02 PM   #7
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,024
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane


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.
Sane is offline   Reply With Quote
Old May 28th, 2006, 7:04 PM   #8
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old May 28th, 2006, 7:32 PM   #9
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,024
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
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.



Really just the disabled buttons left...
Sane is offline   Reply With Quote
Old May 28th, 2006, 9:04 PM   #10
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,024
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
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.
Sane is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:45 AM.

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