![]() ![]() #Info: btnProperty = 'weight' here, but could be 'slant', 'underline, 'overstrike', or any other two state array property. #this is part of a toggle button class or the like, or just passes the button state. So! This is just the way my brain forms the process w/ pseudo code. ![]() But wanted to tackle it anyway since I don't use TKinter. > text_nfigure(font= (current_font_family, current_font_size, 'bold','italic')) > text_nfigure(font= (current_font_family, current_font_size, 'normal')) > text_nfigure(font= (current_font_family, current_font_size, 'bold')) > text_property = tk.font.Font(font = text_editor) > #BOLD BUTTON FUNCTIONALITY def change_bold(): Underline_nfigure(command = change_underline) # text_nfigure(font= (current_font_family, current_font_size, 'normal','italic',1)) # if text_property.actual() = 'normal' and text_property.actual() = 'italic': # text_nfigure(font= (current_font_family, current_font_size, 'bold','italic',1)) # if text_property.actual() = 'bold' and text_property.actual() = 'italic': # text_nfigure(font= (current_font_family, current_font_size, 'bold','roman',1)) # if text_property.actual() = 'bold' and text_property.actual() = 'roman': # text_nfigure(font= (current_font_family, current_font_size, 'normal','roman',1)) # if text_property.actual() = 'normal' and text_property.actual() = 'roman': ![]() Text_nfigure(font= (current_font_family, current_font_size, 'underline')) Text_nfigure(font= (current_font_family, current_font_size, 'italic')) Text_nfigure(font= (current_font_family, current_font_size, 'bold','italic'))īold_nfigure(command = change_bold) ![]() Text_nfigure(font= (current_font_family, current_font_size, 'normal')) Text_nfigure(font= (current_font_family, current_font_size, 'bold')) Text_property = tk.font.Font(font = text_editor) I tried all possible ways those are commented with code #BOLD BUTTON FUNCTIONALITY The editor works perfectly but there is very small problem is that when I select 'Bold' font-style 'italic' is automatically un-selected and when I "UNDERLINE" text bold and italic are un-selected, In short, one function is working only at each time. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |