473,225 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

wxpython: handling URL event

8
I have set an url property to a text in a RichTextCtrl :
Expand|Select|Wrap|Line Numbers
  1.        self.obj.BeginURL('file:\\\%s'% str(i[0])) 
  2.        self.obj.WriteText( '%s/%s/%s\n' % (_splittata[-3], _splittata[-2], _splittata[-1]) )
  3.        self.obj.EndURL()
now the text il linked but when I click on it nothing happens: I think I need to Bind an event to the RichTextCtrl but what event? I don't know what is the appropriate event!
Please help me!
Jul 5 '07 #1
5 2087
bartonc
6,596 Expert 4TB
I have set an url property to a text in a RichTextCtrl :
Expand|Select|Wrap|Line Numbers
  1.        self.obj.BeginURL('file:\\\%s'% str(i[0])) 
  2.        self.obj.WriteText( '%s/%s/%s\n' % (_splittata[-3], _splittata[-2], _splittata[-1]) )
  3.        self.obj.EndURL()
now the text il linked but when I click on it nothing happens: I think I need to Bind an event to the RichTextCtrl but what event? I don't know what is the appropriate event!
Please help me!
You want to bind to the wx.EVT_TEXT_URL. Something like:
Expand|Select|Wrap|Line Numbers
  1.         self.textCtrl1.Bind(wx.EVT_TEXT_URL, self.OnTextCtrl1TextUrl, id=wxID_PANEL1TEXTCTRL1)
  2.  
Jul 5 '07 #2
nisyna
8
I love you ;.) !!!!! Thank you so much...it works!

another question:
i've done that:
Expand|Select|Wrap|Line Numbers
  1. self.textbox.Bind(wx.EVT_TEXT_URL,self.GoToURL)
  2.  
then:
Expand|Select|Wrap|Line Numbers
  1. def GoToURL(self,event):
  2.         print event.
  3.  
how to get the URL from the event? I think it's something like event.URL()???
thanks
Jul 5 '07 #3
bartonc
6,596 Expert 4TB
I love you ;.) !!!!! Thank you so much...it works!

another question:
i've done that:
Expand|Select|Wrap|Line Numbers
  1. self.textbox.Bind(wx.EVT_TEXT_URL,self.GoToURL)
  2.  
then:
[code=python]
def GoToURL(self,event):
print event.
[code]
how to get the URL from the event? I think it's something like event.URL()???
thanks
While I'm checking, please read this section of the Posting Guidelines to learn how to use code tags. Thanks.
Jul 5 '07 #4
bartonc
6,596 Expert 4TB
While I'm checking, please read this section of the Posting Guidelines to learn how to use code tags. Thanks.
It looks like
Expand|Select|Wrap|Line Numbers
  1. event.GetString()
is the one you want.
Jul 5 '07 #5
nisyna
8
While I'm checking, please read this section of the Posting Guidelines to learn how to use code tags. Thanks.
OK sorry and thank you!
Jul 5 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Robert | last post by:
Hello list, could somebody point me to a good reference about wxPython event handling? I have seen many examples but which one is the best. Waht are the advantages and disadvantages? Can you...
7
by: SeeBelow | last post by:
Do many people think that wxPython should replace Tkinter? Is this likely to happen? I ask because I have just started learning Tkinter, and I wonder if I should abandon it in favor of...
1
by: mdk.R | last post by:
Hello all: i'am installed wxPython 2.5 and Python2.3.4..i try execute script with wxPython but it show error: Traceback (most recent call last): File "E:\py\test.py", line 7, in ? import wx...
5
by: Jared Russell | last post by:
I've recently decided to try my hand at GUI programming with wxPython, and I've got a couple questions about the general conventions regarding it. To mess around with it, I decided to create a...
9
by: zxo102 | last post by:
Hi everyone, I am using a python socket server to collect data from a socket client and then control a image location ( wxpython) with the data, i.e. moving the image around in the wxpython frame....
0
by: gopython | last post by:
Hi, I just started coding with wxPython. The idea is to be able to change the gui dynamically. I am trying to change the static text inside the panel after the panel is created without user...
5
by: dynamo | last post by:
Hi everyone.I'm new to wxpython.And i have a little problem.I tried to run the following wxpython app code in IDLE for python25: import wx import os import re def z(a): for i in...
1
by: defireman | last post by:
Hi, Sorry for asking a newbie question, but I am currently using wxPython 2.6, and I don't know how to get the properties of an event object in wxPython when handling events. Is there some sort of...
4
by: Jimmy | last post by:
hi, all I'm having a problem with creating custom events in wxpython. I have a class A handling some data processing work and another class B of GUI matter. I need GUI to display information...
16
by: Andrea Gavana | last post by:
Hi Diez & All, Do you mind explaining "why" you find it *buttugly*? I am asking just out of curiosity, obviously. I am so biased towards wxPython that I won't make any comment on this thread...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.