![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Newbie
Join Date: Apr 2008
Posts: 11
Rep Power: 0
![]() |
Re: I am looking for
Basically As we all Know I have a text (notepad) based project and I cant seem to change the font, thanks to your guys help i have been able to successfully import the font.py module and i have been able to select the font so that :
def Font(self):Now under the part where it sais if Font It should have something where it changes the current font of my text program from say ariel to webdings or what ever the user changes, along with size and color (if chosen) i have tried a million things and nothing works, i have even looked at the IDE code for python and still cant get it to work.Its like changing the font of either selected text or text in general is impossible. what am i doing wrong? |
|
|
|
|
|
#12 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,435
Rep Power: 8
![]() |
Re: I am looking for
You're assigning the result of
Font.askChooseFont( root ) to Font. Does this not seem like it may cause problems to you?Try this: root = Tix.Tk( )
rootFont = Font.askChooseFont( root )
if rootFont:
print rootFontAlso, use [code] tags for blocks of code - [icode] is for code within sentences. |
|
|
|
|
|
#13 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,722
Rep Power: 5
![]() |
Re: I am looking for
You don't want your variable to be a function pointer... Go back a few steps to the code I showed you. That's the code you want.
You place the indented part of my code into the part of your program where you want the user to be able to select the font. Then you pass the "font" variable to the function in Tkinter to actually make the change. It's nice to be new and trying to learn Tkinter, but if you're a "complete noob", perhaps you need to take a couple steps back. GUI programming is very difficult. Could you maybe post the complete code in code tags? |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|