Programming Forums
User Name Password Register
 

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

Reply
 
Thread Tools Display Modes
Old Apr 25th, 2008, 10:34 PM   #11
Adam.K
Newbie
 
Join Date: Apr 2008
Posts: 11
Rep Power: 0 Adam.K is on a distinguished road
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):
import Font
import Tix

root = Tix.Tk( )
Font = Font.askChooseFont( root )

if Font:
print Font


Now under the part where it sais if Font
print 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?
Adam.K is offline   Reply With Quote
Old Apr 26th, 2008, 6:01 AM   #12
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,435
Rep Power: 8 Ooble is on a distinguished road
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 rootFont

Also, use [code] tags for blocks of code - [icode] is for code within sentences.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Apr 26th, 2008, 8:46 AM   #13
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,722
Rep Power: 5 Sane is on a distinguished road
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?
Sane is online now   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 6:18 AM.

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