tkinter past text keeping font











up vote
0
down vote

favorite












I have a tkinter text widget and i would be able to copy a text from excel (as exemple) and past it into my text widget 'tC' and keep the font define in excel, like bold, italics, color ect.. for now i just get the text black and basic. I don't get if it's just the display or the font is not past. Thanks you



here how i create my text label :



windPop = tk.Toplevel()
windPop.attributes('-topmost', 'true')
windPop.wm_geometry("600x600")
frm1 = tk.LabelFrame(windPop)
frm1.pack(side=tk.TOP)

labT = tk.Label(frm1, text="Titre", bg="white", height=1, width=10)
labT.grid(row=0,column=1)
tT = tk.Text(frm1, height=1, width=10, bg="white")
tT.grid(row=0,column=2)

frm3 = tk.LabelFrame(windPop)
frm3.pack()

labT = tk.Label(frm3, text="Genre", bg="white", height=1, width=10)
labT.grid(row=0,column=1)
sexMail = tk.StringVar(frm3)
sexMail.set("neutre")
tG = tk.OptionMenu(frm3, windows.genreMailVariable, *windows.genreMail)
tG.grid(row=0,column=2)

frm2 = tk.LabelFrame(windPop)
frm2.pack()

labC = tk.Label(frm2, text="Corps du mail", bg="white", width=20)
labC.grid(row=0,column=1)
tC = tk.Text(frm2, height=30, width=40, bg="white")
tC.grid(row=0,column=2)

bb = tk.Button(windPop, text='valider creation', width=20)
bb.pack(pady=10, side=tk.BOTTOM)
bb.configure(command=lambda w=windows, corp=tC, titre=tT, genre=sexMail, par=windPop :self.valid_creation(w, corp, titre, genre, par))









share|improve this question


























    up vote
    0
    down vote

    favorite












    I have a tkinter text widget and i would be able to copy a text from excel (as exemple) and past it into my text widget 'tC' and keep the font define in excel, like bold, italics, color ect.. for now i just get the text black and basic. I don't get if it's just the display or the font is not past. Thanks you



    here how i create my text label :



    windPop = tk.Toplevel()
    windPop.attributes('-topmost', 'true')
    windPop.wm_geometry("600x600")
    frm1 = tk.LabelFrame(windPop)
    frm1.pack(side=tk.TOP)

    labT = tk.Label(frm1, text="Titre", bg="white", height=1, width=10)
    labT.grid(row=0,column=1)
    tT = tk.Text(frm1, height=1, width=10, bg="white")
    tT.grid(row=0,column=2)

    frm3 = tk.LabelFrame(windPop)
    frm3.pack()

    labT = tk.Label(frm3, text="Genre", bg="white", height=1, width=10)
    labT.grid(row=0,column=1)
    sexMail = tk.StringVar(frm3)
    sexMail.set("neutre")
    tG = tk.OptionMenu(frm3, windows.genreMailVariable, *windows.genreMail)
    tG.grid(row=0,column=2)

    frm2 = tk.LabelFrame(windPop)
    frm2.pack()

    labC = tk.Label(frm2, text="Corps du mail", bg="white", width=20)
    labC.grid(row=0,column=1)
    tC = tk.Text(frm2, height=30, width=40, bg="white")
    tC.grid(row=0,column=2)

    bb = tk.Button(windPop, text='valider creation', width=20)
    bb.pack(pady=10, side=tk.BOTTOM)
    bb.configure(command=lambda w=windows, corp=tC, titre=tT, genre=sexMail, par=windPop :self.valid_creation(w, corp, titre, genre, par))









    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have a tkinter text widget and i would be able to copy a text from excel (as exemple) and past it into my text widget 'tC' and keep the font define in excel, like bold, italics, color ect.. for now i just get the text black and basic. I don't get if it's just the display or the font is not past. Thanks you



      here how i create my text label :



      windPop = tk.Toplevel()
      windPop.attributes('-topmost', 'true')
      windPop.wm_geometry("600x600")
      frm1 = tk.LabelFrame(windPop)
      frm1.pack(side=tk.TOP)

      labT = tk.Label(frm1, text="Titre", bg="white", height=1, width=10)
      labT.grid(row=0,column=1)
      tT = tk.Text(frm1, height=1, width=10, bg="white")
      tT.grid(row=0,column=2)

      frm3 = tk.LabelFrame(windPop)
      frm3.pack()

      labT = tk.Label(frm3, text="Genre", bg="white", height=1, width=10)
      labT.grid(row=0,column=1)
      sexMail = tk.StringVar(frm3)
      sexMail.set("neutre")
      tG = tk.OptionMenu(frm3, windows.genreMailVariable, *windows.genreMail)
      tG.grid(row=0,column=2)

      frm2 = tk.LabelFrame(windPop)
      frm2.pack()

      labC = tk.Label(frm2, text="Corps du mail", bg="white", width=20)
      labC.grid(row=0,column=1)
      tC = tk.Text(frm2, height=30, width=40, bg="white")
      tC.grid(row=0,column=2)

      bb = tk.Button(windPop, text='valider creation', width=20)
      bb.pack(pady=10, side=tk.BOTTOM)
      bb.configure(command=lambda w=windows, corp=tC, titre=tT, genre=sexMail, par=windPop :self.valid_creation(w, corp, titre, genre, par))









      share|improve this question













      I have a tkinter text widget and i would be able to copy a text from excel (as exemple) and past it into my text widget 'tC' and keep the font define in excel, like bold, italics, color ect.. for now i just get the text black and basic. I don't get if it's just the display or the font is not past. Thanks you



      here how i create my text label :



      windPop = tk.Toplevel()
      windPop.attributes('-topmost', 'true')
      windPop.wm_geometry("600x600")
      frm1 = tk.LabelFrame(windPop)
      frm1.pack(side=tk.TOP)

      labT = tk.Label(frm1, text="Titre", bg="white", height=1, width=10)
      labT.grid(row=0,column=1)
      tT = tk.Text(frm1, height=1, width=10, bg="white")
      tT.grid(row=0,column=2)

      frm3 = tk.LabelFrame(windPop)
      frm3.pack()

      labT = tk.Label(frm3, text="Genre", bg="white", height=1, width=10)
      labT.grid(row=0,column=1)
      sexMail = tk.StringVar(frm3)
      sexMail.set("neutre")
      tG = tk.OptionMenu(frm3, windows.genreMailVariable, *windows.genreMail)
      tG.grid(row=0,column=2)

      frm2 = tk.LabelFrame(windPop)
      frm2.pack()

      labC = tk.Label(frm2, text="Corps du mail", bg="white", width=20)
      labC.grid(row=0,column=1)
      tC = tk.Text(frm2, height=30, width=40, bg="white")
      tC.grid(row=0,column=2)

      bb = tk.Button(windPop, text='valider creation', width=20)
      bb.pack(pady=10, side=tk.BOTTOM)
      bb.configure(command=lambda w=windows, corp=tC, titre=tT, genre=sexMail, par=windPop :self.valid_creation(w, corp, titre, genre, par))






      tkinter fonts copy-paste text-widget






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 days ago









      P M

      31




      31
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          There is no support for this in tkinter. Tkinter can't get font information from the clipboard.






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203432%2ftkinter-past-text-keeping-font%23new-answer', 'question_page');
            }
            );

            Post as a guest
































            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted










            There is no support for this in tkinter. Tkinter can't get font information from the clipboard.






            share|improve this answer

























              up vote
              1
              down vote



              accepted










              There is no support for this in tkinter. Tkinter can't get font information from the clipboard.






              share|improve this answer























                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                There is no support for this in tkinter. Tkinter can't get font information from the clipboard.






                share|improve this answer












                There is no support for this in tkinter. Tkinter can't get font information from the clipboard.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 2 days ago









                Bryan Oakley

                208k21239399




                208k21239399






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203432%2ftkinter-past-text-keeping-font%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest




















































































                    Popular posts from this blog

                    Schultheiß

                    Liste der Kulturdenkmale in Wilsdruff

                    Android Play Services Check