Is there a way to generate mouseover events when
the mouse passes over a word in a text control?
Thanks,
John
Is there a way to generate mouseover events when
the mouse passes over a word in a text control?
Thanks,
John
Hmmmm....what exactly are you after. Hyperlink-like behaviour?
If you are on Windows you could look at using wxTE_AUTO_URL style on
your text control. Then register the event EVT_TEXT_URL for that text
control.
On Wed, 2004-01-07 at 17:26, John Li wrote:
Is there a way to generate mouseover events when
the mouse passes over a word in a text control?Thanks,
John---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
--
Jim West
CheckLogix -a Concord company
102 S. Tejon Ste 920, Colorado Springs, CO 80903
719.633.7005 x223 Fax: 719.633.7006 Cell: 719.660.5676
Hello.
My colleagues and I are in the process of writing a wxPython application to
facilitate the transcription and qualitative analysis of digital video and
audio. As part of this process, we needed to get the embeddable version of
MySQL running. We found this task to be both non-trivial and inadequately
documented.
If anyone out there is interested in embedding MySQL in the Python or
wxPython application, one of the members of my team has written a Web Page
describing the steps he took to get it working. You can view this at:
http://www2.wcer.wisc.edu/Transana/Develop/mysql
I hope some of you find this information useful.
David Woods, Ph.D.
Wisconsin Center for Education Research
University of Wisconsin, Madison
http://www.transana.org
David Woods wrote:
Hello.
My colleagues and I are in the process of writing a wxPython
application to
facilitate the transcription and qualitative analysis of digital video and
audio. As part of this process, we needed to get the embeddable
version of
MySQL running. We found this task to be both non-trivial and inadequately
documented.If anyone out there is interested in embedding MySQL in the Python or
wxPython application, one of the members of my team has written a Web Page
describing the steps he took to get it working. You can view this at:http://www2.wcer.wisc.edu/Transana/Develop/mysql
I hope some of you find this information useful.
David Woods, Ph.D.
Wisconsin Center for Education Research
University of Wisconsin, Madison
http://www.transana.org
Thanks for that information. As an aside, there is another embedded
database that i'm finding a joy to work with - SQLite. It may not have
met your criteria, but for the things that i'm doing it fits the bill.
runs in Linux, Unix, and Windows (oh and the Sharp Zaurus <wink>) and is
in the public domain.
http://www.hwaci.com/sw/sqlite/
That, wxPython, and quixote (oh and of course python) is just making
programming bearable again <grin>.
- --
Tom Jenkins
devIS - Development Infostructure
> Is there a way to generate mouseover events when
> the mouse passes over a word in a text control?
>
> Thanks,
> John
>
>
Hmmmm....what exactly are you after. Hyperlink-like behaviour?If you are on Windows you could look at using wxTE_AUTO_URL style on
your text control. Then register the event EVT_TEXT_URL for that text
control.--
Jim West
CheckLogix -a Concord company
102 S. Tejon Ste 920, Colorado Springs, CO 80903
719.633.7005 x223 Fax: 719.633.7006 Cell: 719.660.5676
I'd like to display information about the word (dictionary, translation)
both at the point in a bubble and in more detail at the bottom in
another
text control or status bar. I'd like this to be cross-platform (esp.
linux & Windows).
Any advice on how to:
a) identify a word on mouseover?
b) pop up a bubble at the mouseover point?
Tom,
Yeah, we looked at SQLite and thought it was very impressive. However, part
of our evil plot to take over the world involves getting people hooked by
our program in single-user mode then moving them up the evolutionary ladder
to a multi-user mode that enables collaborative analysis. This requires a
more robust database than SQLite; hence MySQL. Some of our searches are
complex enough I wanted to standardize on a single SQL flavor.
I second your vote of Python and wxPython as the development platform of
choice, especially for cross-platform work. They've enabled us to build
Transana pretty quickly and very solidly, and hopefully will help make our
source code more accessible to the social scientists we hope to draw into
our Open Source development efforts.
David Woods, Ph.D.
Wisconsin Center for Education Research
University of Wisconsin, Madison
http://www.transana.org
-----Original Message-----
From: Tom Jenkins [mailto:tjenkins@devis.com]
Sent: Thursday, January 08, 2004 10:55 AM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] Embedding MySQL in Python Apps
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
David Woods wrote:
Hello.
My colleagues and I are in the process of writing a wxPython
application to
facilitate the transcription and qualitative analysis of digital video and
audio. As part of this process, we needed to get the embeddable
version of
MySQL running. We found this task to be both non-trivial and inadequately
documented.If anyone out there is interested in embedding MySQL in the Python or
wxPython application, one of the members of my team has written a Web Page
describing the steps he took to get it working. You can view this at:http://www2.wcer.wisc.edu/Transana/Develop/mysql
I hope some of you find this information useful.
David Woods, Ph.D.
Wisconsin Center for Education Research
University of Wisconsin, Madison
http://www.transana.org
Thanks for that information. As an aside, there is another embedded
database that i'm finding a joy to work with - SQLite. It may not have
met your criteria, but for the things that i'm doing it fits the bill.
runs in Linux, Unix, and Windows (oh and the Sharp Zaurus <wink>) and is
in the public domain.
http://www.hwaci.com/sw/sqlite/
That, wxPython, and quixote (oh and of course python) is just making
programming bearable again <grin>.
- --
Tom Jenkins
devIS - Development Infostructure
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
John Li wrote:
I'd like to display information about the word (dictionary, translation)
both at the point in a bubble and in more detail at the bottom in
another
text control or status bar. I'd like this to be cross-platform (esp.
linux & Windows).Any advice on how to:
a) identify a word on mouseover?
You can't with a wxTextCtrl, there is no way to get from the mouse
coords to the character position. I think you can with a StyledTextCtrl
though. Try using the EVT_STC_DWELLSTART and EVT_STC_DWELLEND
b) pop up a bubble at the mouseover point?
Use a wxTipWindow
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
I need to internationalize my wxPython ap. I've been playing with it for a
while, and even contributed an example to the wiki on how to do it. But now
I've come across something that's got me stumped. Hopefully one of you can
help me out here.
In my ap, I want to use wxMessageDialog for, you got it, message dialogs.
My call looks something like this:
dlg = wx.wxMessageDialog(self, _('Translatable Message'), _('Translatable
Heading'), style=wx.wxYES_NO)
dlg.ShowModal()
dlg.Destroy()
At this point, I can either have my messages translated by using:
self.presLan_es = gettext.translation('i18ntest', './locale',
languages=['es']) # Spanish
self.presLan_es.install()
or I can have the wxMessageDialog's text (on the "Yes" and "No" buttons)
translated by using:
self.wxPythonLan_es = gettext.translation('wxstd', './locale',
languages=['es']) # Spanish
self.wxPythonLan_es.install()
But I'm not smart enough to figure out how to get BOTH sets of text
translated at the same time. I end up either with my text in Spanish and
wxPython's text in English, or my text in English and wxPython's text in
Spanish. I can't seem to get both my code and wxPython's code to
internationalize at the same time.
Any ideas would be most welcome.
Thanks in advance,
David Woods
Wisconsin Center for Education Research
University of Wisconsin, Madison
http://www.transana.org
David Woods wrote:
But I'm not smart enough to figure out how to get BOTH sets of text
translated at the same time. I end up either with my text in Spanish and
wxPython's text in English, or my text in English and wxPython's text in
Spanish. I can't seem to get both my code and wxPython's code to
internationalize at the same time.
I'm not sure how to do it with python's gettext, but with wxLocale you can add multiple language catalogs. So you could initialize it so that the standard wx catalog is found, call AddCatalog to add your app's and then set _ to wxGetTranslation and not use Python's at all.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
Hi David and Robin,
Up to now I used gettext, but I would like to see the wxPython stuff translated too, having followed the message exchange I had a go at it today.
Robin Dunn wrote:
David Woods wrote:
But I'm not smart enough to figure out how to get BOTH sets of text
translated at the same time. I end up either with my text in Spanish and
wxPython's text in English, or my text in English and wxPython's text in
Spanish. I can't seem to get both my code and wxPython's code to
internationalize at the same time.I'm not sure how to do it with python's gettext, but with wxLocale you can add multiple language catalogs. So you could initialize it so that the standard wx catalog is found, call AddCatalog to add your app's and then set _ to wxGetTranslation and not use Python's at all.
__builtins__._ = wxGetTranslation
The above gives me an error "AttributeError: 'dict' object has no attribute '_'.
The other question I have is how do I switch language when I use wxLocale, is the following correct:
during init:
import locale
locale.setlocale(locale.LC_ALL, '')
__builtins__._ = wxGetTranslation
wxlocale = wxLocale()
wxlocale.Init(wxLANGUAGE_ENGLISH, wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING)
wxlocale.AddCatalog('myappdomain')
when changing to e.g. French:
wxlocale.Init(wxLANGUAGE_FRENCH, wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING)
And one last question, how come "wxlocale.AddCatalogLookupPathPrefix('myprefix')" is not supported?
See you
Werner
P.S. I am on Python 2.3.2, wxPython 2.4.2.4 on Windows XP Prof.
Up to now I used gettext, but I would like to see the wxPython
stuff translated too, having followed the message exchange I had a
go at it today.
You're trying to do the same I am doing now for an old application
that was in Portuguese only... Everything is fine, except for the
translation of the "CalenDlg".
(...)
__builtins__._ = wxGetTranslation
The above gives me an error "AttributeError: 'dict' object has no
attribute '_'.
It works here. The same happens if I only use '_ = wxGetTranslation'.
The other question I have is how do I switch language when I use
wxLocale, is the following correct:during init:
import locale
locale.setlocale(locale.LC_ALL, '')
I don't think you need the above two lines... At least they aren't
needed on a Linux box.
__builtins__._ = wxGetTranslation
wxlocale = wxLocale()
wxlocale.Init(wxLANGUAGE_ENGLISH, wxLOCALE_LOAD_DEFAULT |
wxLOCALE_CONV_ENCODING)
I use the options you passed to "wxlocale.Init" directly at the
constructor, so I have minus one line here...
wxlocale.AddCatalog('myappdomain')
when changing to e.g. French:
wxlocale.Init(wxLANGUAGE_FRENCH, wxLOCALE_LOAD_DEFAULT |
wxLOCALE_CONV_ENCODING)
I suppose so, if the system doesn't recognize it automatically. Here
it recognizes the language automatically from what's set up at the
environment.
And one last question, how come
"wxlocale.AddCatalogLookupPathPrefix('myprefix')" is not supported?
I think the question is: is it really necessary to have all the
language '.mo' files at the same directory as the application? How
can we put it in another place and tell the application it is there?
See you
WernerP.S. I am on Python 2.3.2, wxPython 2.4.2.4 on Windows XP Prof.
Python 2.2.2
wxPython 2.4.1.2
Linux
See you,
- --
Godoy. <godoy@metalab.unc.edu>
On Wednesday 21 January 2004 09:36, Werner F. Bruhin ("Werner F. Bruhin" <werner.bruhin@free.fr>) wrote:
And one last question, how come
"wxlocale.AddCatalogLookupPathPrefix('myprefix')" is not supported?
In 2.4 it would be
wxLocale_AddCatalogLookupPathPrefix
I think the question is: is it really necessary to have all the language '.mo' files at the same directory as the application? How can we put it in another place and tell the application it is there?
By using wxLocale_AddCatalogLookupPathPrefix
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
Indeed it works this way. Thanks.
Any special reason to use it like this instead of
wxLocale.AddCatalogLookupPathPrefix?
A note stating this difference for wxPython on the docs at the
wxWindows website would be nice. I'll be submitting a bug asking for
it if you think it's worth.
Be seeing you,
- --
Godoy. <godoy@metalab.unc.edu>
On Wednesday 21 January 2004 15:40, Robin Dunn (Robin Dunn <robin@alldunn.com>) wrote:
>>And one last question, how come
>>"wxlocale.AddCatalogLookupPathPrefix('myprefix')" is not
>> supported?In 2.4 it would be
wxLocale_AddCatalogLookupPathPrefix
Robin, Werner, Jorge, and anyone else who'd care to get involved,
Thanks for your help so far. I'm making progress, I think, but I'm still
stuck on my original issue, which is where this thread started.
I have attached a sample app that demonstrates the problem, at least for me
on my Win2K, Python 2.3.3, wxPython 2.4.2.4 setup. It's a dialog with a
couple of text lines, a couple of menus (including one that allows you to
change the program's language) and a button for a wxMessageDialog call. The
app was written in English but for demonstration purposes I have set it to
start up in Spanish.
You will see if you press the button that my Spanish message pops up, but
the "Yes" and "No" buttons from wxPython are in English. If you change
languages, all of my prompts change languages, but the wxPython prompts
continue to be in English. Or at least, that's what I see, and it would
help to know if you see something different.
To set up this demonstration, take the following steps:
1. Create a folder called "i18ntest" in your usual place for storing
wxPython projects.
2. Unzip the files attached here into that folder.
3. At the command prompt, issue the command (or your equivalent): "python
mki18n.py -m -e" to translate the "*.po" files I have included to "*.mo"
files on your system. A "locale" subfolder will be created, with "en", "es"
and "fr" subfolders containing "LC_MESSAGES" folders for English, Spanish,
and French translation files.
4. Locate the "wxstd_es.mo", and "wxstd_fr.mo" files from you wxPython
installation, and copy them to the appropriate language subfolders where you
find the corresponding "i18ntest_XX.mo" files.
5. Now run my sample program by issuing the command: "python i18ntest.py"
It looks to me like wxPython is unable to use its own translation files,
even though I have them in both the wxPython default installation folder and
my own app localization folder, as described above. Despite this,
wxLocale.IsOk() says things are loaded properly and
wxLocale.IsLoaded('wxstd') shows that they are getting loaded. (Actually,
wxLocale.IsLoaded('wxstd') fails if you change to English, but that's
because I have no "wxstd_en.mo" file on my system. I'm okay with that
because it makes sense to me.)
So I'd really appreciate any help you can give me in getting this sample
program to translate the wxPython buttons on the wxMessageDialog box. I'll
happily post all of this on the wxPyWiki once we get it figured out.
David Woods, Ph.D.
Wisconsin Center for Education Research
University of Wisconsin, Madison
http://www.transana.org
i18ntest.zip (12.4 KB)
-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Wednesday, January 21, 2004 11:40 AM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] Mixing my I18n with wxPython's
And one last question, how come
"wxlocale.AddCatalogLookupPathPrefix('myprefix')" is not supported?
In 2.4 it would be
wxLocale_AddCatalogLookupPathPrefix
I think the question is: is it really necessary to have all the
language '.mo' files at the same directory as the application? How
can we put it in another place and tell the application it is there?
By using wxLocale_AddCatalogLookupPathPrefix
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
Minor correction to the instructions below:
4. Locate the Spanish "wxstd.mo", and French "wxstd.mo" files from you
wxPython
installation, and copy them to the appropriate language subfolders where you
find the corresponding "i18ntest.mo" files.
That was a typing error, not an implementation error that is causing my
problems.
David
-----Original Message-----
From: David Woods [mailto:dwoods@wcer.wisc.edu]
Sent: Wednesday, January 21, 2004 1:49 PM
To: wxPython-users@lists.wxwindows.org
Subject: RE: [wxPython-users] Mixing my I18n with wxPython's
Robin, Werner, Jorge, and anyone else who'd care to get involved,
Thanks for your help so far. I'm making progress, I think, but I'm still
stuck on my original issue, which is where this thread started.
I have attached a sample app that demonstrates the problem, at least for me
on my Win2K, Python 2.3.3, wxPython 2.4.2.4 setup. It's a dialog with a
couple of text lines, a couple of menus (including one that allows you to
change the program's language) and a button for a wxMessageDialog call. The
app was written in English but for demonstration purposes I have set it to
start up in Spanish.
You will see if you press the button that my Spanish message pops up, but
the "Yes" and "No" buttons from wxPython are in English. If you change
languages, all of my prompts change languages, but the wxPython prompts
continue to be in English. Or at least, that's what I see, and it would
help to know if you see something different.
To set up this demonstration, take the following steps:
1. Create a folder called "i18ntest" in your usual place for storing
wxPython projects.
2. Unzip the files attached here into that folder.
3. At the command prompt, issue the command (or your equivalent): "python
mki18n.py -m -e" to translate the "*.po" files I have included to "*.mo"
files on your system. A "locale" subfolder will be created, with "en", "es"
and "fr" subfolders containing "LC_MESSAGES" folders for English, Spanish,
and French translation files.
4. Locate the "wxstd_es.mo", and "wxstd_fr.mo" files from you wxPython
installation, and copy them to the appropriate language subfolders where you
find the corresponding "i18ntest_XX.mo" files.
5. Now run my sample program by issuing the command: "python i18ntest.py"
It looks to me like wxPython is unable to use its own translation files,
even though I have them in both the wxPython default installation folder and
my own app localization folder, as described above. Despite this,
wxLocale.IsOk() says things are loaded properly and
wxLocale.IsLoaded('wxstd') shows that they are getting loaded. (Actually,
wxLocale.IsLoaded('wxstd') fails if you change to English, but that's
because I have no "wxstd_en.mo" file on my system. I'm okay with that
because it makes sense to me.)
So I'd really appreciate any help you can give me in getting this sample
program to translate the wxPython buttons on the wxMessageDialog box. I'll
happily post all of this on the wxPyWiki once we get it figured out.
David Woods, Ph.D.
Wisconsin Center for Education Research
University of Wisconsin, Madison
http://www.transana.org
-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Wednesday, January 21, 2004 11:40 AM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] Mixing my I18n with wxPython's
And one last question, how come
"wxlocale.AddCatalogLookupPathPrefix('myprefix')" is not supported?
In 2.4 it would be
wxLocale_AddCatalogLookupPathPrefix
I think the question is: is it really necessary to have all the
language '.mo' files at the same directory as the application? How
can we put it in another place and tell the application it is there?
By using wxLocale_AddCatalogLookupPathPrefix
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
David Woods wrote:
Robin, Werner, Jorge, and anyone else who'd care to get involved,
Thanks for your help so far. I'm making progress, I think, but I'm still
stuck on my original issue, which is where this thread started.I have attached a sample app that demonstrates the problem, at least for me
on my Win2K, Python 2.3.3, wxPython 2.4.2.4 setup. It's a dialog with a
couple of text lines, a couple of menus (including one that allows you to
change the program's language) and a button for a wxMessageDialog call. The
app was written in English but for demonstration purposes I have set it to
start up in Spanish.You will see if you press the button that my Spanish message pops up, but
the "Yes" and "No" buttons from wxPython are in English. If you change
languages, all of my prompts change languages, but the wxPython prompts
continue to be in English. Or at least, that's what I see, and it would
help to know if you see something different.
The text for the buttons in a wxMessageDialog do not come from the wxWindows message catalog because it is a native Windows dialog, so it is up to Microsoft to determine where the text for those labels comes from. I've never tried it but I think that if you install the Win2k support for Spanish and then set your system to use that locale then it will work. Another possibility is to just write your own MessageDialog class.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!