Hi... I have this addLink button, that calls the addLinkClick function. content is a multiline text control.
The following are variables: href,target,linkName
I want this button to print

print "<a href='"+href+"' target='"+target+"'>"+linkName+"</a>"

into the content control.

How do I do this?
Also...does anybody now how to run a wxPython .py application?

Let's assume you have Windows on your box. Toggle to plain text, then highlight, copy and paste the code below into your editor, save it as wxtext101.py (or such). If Python and wxPython is properly installed, double-click on the filename to run it:

import wx

class MyPanel(wx.Panel):
    """panel with multiline text control"""
    def __init__(self, parent, id):
        wx.Panel.__init__(self, parent, id)

        self.edit3 = wx.TextCtrl(self, -1, value="", pos=(10, 10),
                size=(300, 125), style=wx.TE_MULTILINE)

        #print "<a href='"+href+"' target='"+target+"'>"+linkName+"</a>"
        href = 'fi'
        target = 'fo'
        linkName = 'fum'
        str1 = "print "+"<a href='"+href+"' target='"+target+"'>"+linkName+"</a>"

app = wx.PySimpleApp()
# create window/frame, no parent, -1 is default ID
frame = wx.Frame(None, -1, "wx.TextCtrl", size = (400, 310))
# -1 is default ID

Oh it ran! thank you!

But what I want is to put a textbox where you can type in something instead of fum, for instance. In other words, you type something in the textbox, click a button, and the outcome is printed

This article has been dead for over six months. Start a new discussion instead.