Re: [pygtk] TreeView and CellRendererCombo - MS Access-like form behaviour

2008-04-20 Thread Stéphane Brunet

John Finlay a écrit :

Stéphane Brunet wrote:

Hi,

btw, thank you John Finlay for the answer on my last question.

In my quest of a GUI interfacing my small database application (I did 
try OpenOffice Base and went mad after one hour :S ) I would like to 
copy some behaviour of MS Access in my forms.


Say I have two (SQL) tables with two fields and one relation between 
the two:


  
|Table1|  |Table2|
  
| Field1 (int) || Field1 (int) |
| Field2 (str) |  | Field2 (str) |
  

Now in my PyGTK form of Table1 (a TreeView), when I display the 
Field1 in the first column, I would like to have a ComboBox which 
displays the text associated to the integer value of Table2 (i.e. 
Table2.Field2) rather than the value directly. However, I still want 
it stored as an integer in Table1.Field1.


How would you do this in an elegant manner ? Do I have to create my 
own CellRenderer more generic than a CellRendererCombo ?
How do you want the db info displayed in the treeview? 
I think of actually displaying the content of Table1 with Field1 in the 
first column and Field2 in a second column. However, Field1 wouldn't be 
displayed as an integer but as a string coming from Table2. In order to 
modify the content of Field1, I would like the user to select a string 
(of Table2.Field2) in a CellRendererCombo rather than an integer.



Are you planning on inserting the
table info into a liststore or generating it on the fly?

I thought of using two separate ListStore to store the content of each 
table. I don't know if it is the best way but I want to alter the 
information in the DB only when the user has finished his modifications 
in the GUI.


Stéphane
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] TreeView and CellRendererCombo - MS Access-like form behaviour

2008-04-19 Thread Stéphane Brunet

Hi,

btw, thank you John Finlay for the answer on my last question.

In my quest of a GUI interfacing my small database application (I did 
try OpenOffice Base and went mad after one hour :S ) I would like to 
copy some behaviour of MS Access in my forms.


Say I have two (SQL) tables with two fields and one relation between the 
two:


  
|Table1|  |Table2|
  
| Field1 (int) || Field1 (int) |
| Field2 (str) |  | Field2 (str) |
  

Now in my PyGTK form of Table1 (a TreeView), when I display the Field1 
in the first column, I would like to have a ComboBox which displays the 
text associated to the integer value of Table2 (i.e. Table2.Field2) 
rather than the value directly. However, I still want it stored as an 
integer in Table1.Field1.


How would you do this in an elegant manner ? Do I have to create my own 
CellRenderer more generic than a CellRendererCombo ?


Thanks again,

Stéphane

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] Sharing a CellRenderer among two or more columns

2008-04-18 Thread Stéphane Brunet

Hi,

I am working on TreeViews using a ListStore model but I couldn't find 
any answer on this yet:


Say I have a ListStore with 4 columns containing strings. They are all 
be rendered by a CellRendererText object in a separate TreeViewColumn. I 
have tried to use a single instance of CellRendererText assigned to each 
TreeViewColumn and it worked great.


However, when I want to make each column editable, how do I specify the 
callback function to the CellRendererText object so that it will know in 
which column to put the new text ? Am I compelled to use a separate 
instance of CellRendererText for each column ?


Thank you,

Stéphane

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Python 3.0 plans

2007-08-29 Thread Stéphane Brunet

Johan Dahlin a écrit :


It is different from the old 2.x series in the sense that it will not 
be backwards compatible with the old python releases. A program 
written for Python 2.x will not run under Python 3.x unless it 
restricts itself to a tiny tiny subset which is really not practical 
(for instance, unicode can't be used).

Hi,

It seems that the transition may not be too painful. Guido Van Rossum 
wrote on his blog about a Python 2.6 version which will keep backward 
compatibility but provide features to check Python 3 compatibility :


http://www.artima.com/weblogs/viewpost.jsp?thread=208549

Regards,

Stéphane
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] PyGTKGLext 1.1.0 windows binary installer for Python 2.5 now available

2006-11-11 Thread Stéphane Brunet

Hi,

Thanks to the hard work from Clovis Goldemberg, we managed to build a 
windows installer for Python 2.5.


You will find the executable file at this URL :

http://www.stephanebrunet.net/gtkglext/pygtkglext-1.1.0.win32-py2.5.exe

This has been tested by Clovis and I on two separate machines.
Please let me know if some people are interested in a package for Python 
2.4.


Regards,

Stéphane Brunet
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] obsolete Win32 binaries

2005-10-06 Thread Stéphane Brunet


Marek Kubica wrote:


Hello,

On Thu, 6 Oct 2005 11:28:41 +0200
Gatti Lorenzo [EMAIL PROTECTED] wrote:

 


The semi-official Windows binaries by Cedric Gustin
(http://www.pcpm.ucl.ac.be/~gustin/win32_ports/) stop at PyGTK 2.6.2,
skipping newer versions since 2.6.3: is it an abandoned initiative?
   


No, it isn't but there are no GTK+ 2.8 binaries for Windows ready yet,
Cedric Gustin just builds PyGTK, not GTK+. GTK+ is not included in his
binaries so you have to get them separately.

Binaries are normally here:
http://gladewin32.sourceforge.net/ newest is 2.6.10 (preferred by most)
http://gimp-win.sourceforge.net/stable.html newest is 2.6.9
http://www.gimp.org/~tml/gimp/win32/ newest is 2.6.9
You see, no GTK+ 2.8

It may be so, because of problems with Cairo on Windows, I don't know.

greets,
Marek
 

I f you go to the gimp-win sourceforge page, in the file section, there 
are some 2.8 release installer :


http://sourceforge.net/project/showfiles.php?group_id=121075package_id=132255

However, it sounds like unstable else it will be on the website as well.

Stéphane
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] more languages

2005-08-18 Thread Stéphane Brunet

Luigi Pantano wrote:


how I can create a program in more languages (English, German,
Italian...) using the pygtk?
 


You can use the python gettext module

Stéphane

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] dsextra.py installed with PyGTK 2.4.1 binaries (windows)

2005-03-02 Thread Stéphane Brunet
Hi,
I am trying to build and install PyGTKGLext for Windows with Python 2.4 
and PyGTK 2.4.1.
The build process was successful but the install one failed. I get the 
following error :

C:\msys\1.0\home\Stephane\pygtkglext-1.0.1setup.py build 
--compiler=mingw32 install
running build
running build_py
running build_ext
using MinGW GCC version 3.4.2 with -mms-bitfields option
running install
running install_lib
Traceback (most recent call last):
File C:\msys\1.0\home\Stephane\pygtkglext-1.0.1\setup.py, line 158, in ?
  cmdclass={'install_lib': PyGtkGLExtInstallLib,
File C:\Python24\lib\distutils\core.py, line 149, in setup
  dist.run_commands()
File C:\Python24\lib\distutils\dist.py, line 946, in run_commands
  self.run_command(cmd)
File C:\Python24\lib\distutils\dist.py, line 966, in run_command
  cmd_obj.run()
File C:\Python24\lib\distutils\command\install.py, line 505, in run
  self.run_command(cmd_name)
File C:\Python24\lib\distutils\cmd.py, line 333, in run_command
  self.distribution.run_command(command)
File C:\Python24\lib\distutils\dist.py, line 966, in run_command
  cmd_obj.run()
File C:\msys\1.0\home\Stephane\pygtkglext-1.0.1\setup.py, line 61, in 
run
  self.add_template_option('VERSION', VERSION)
File C:\Python24\lib\distutils\cmd.py, line 112, in __getattr__
  raise AttributeError, attr
AttributeError: add_template_option

After investigating, I remarked that dsextra.py installed in 
C:\Python24\Lib\site-packages\gtk-2.0 is different than the one provided 
in the pygtk-2.4.1 source package. Indeed, it contains the definition of 
InstallData class which is more recent than the 2.4.1 version, according 
to the pygtk CVS. And the InstallLib class has no add_template_option() 
method any more (that's why there's an error...). But after looking at 
this file, I found that it is also different to the next CVS one...

So I am completely messed up but I still want to update the setup.py of 
PyGTKGLext package in order to get a working binary installer for 
Windows. How shoud I use the new InstallData class ? Which version of 
dsextra shoud I refer to ?

FYI, I used the already-build pkgtk binary installer for windows.
Thanks a lot!
Stéphane
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Strange problem when converting strings to floats

2005-01-18 Thread Stéphane Brunet
Maciej Katafiasz wrote:
Just a guess, but what does your control panel say about decimal
separator in canadian french locale? Maybe that's the problem...
HTH,
Maciej
 

The decimal separator is a comma for this locale, just as in french for 
France. (PyGTK displays it correctly).

Stphane
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Strange problem when converting strings to floats

2005-01-18 Thread Stéphane Brunet
Gustavo J. A. M. Carneiro wrote:
 I suspect this is an incompatibility of PyGTK with Python 2.4.  It
would be nice if you could post a small test program to [1]
demonstrating this problem, so that we can fix it ASAP.
[1] http://bugzilla.gnome.org/show_bug.cgi?id=164451
 

I posted a test program this morning.
I also found a workaround but I am not quite sure this is the good way 
to deal with this problem :

import locale
import pygtk
pygtk.require('2.0')
import gtk
locale.setlocale(locale.LC_ALL, '')   - Invoke setlocale *after* 
importing pygtk and gtk
locale.atof(3,1415)

Regards,
Stéphane
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] Strange problem when converting strings to floats

2005-01-17 Thread Stéphane Brunet
Hi,
I have got a strange problem when converting a string into a float.
When using Canadian French localisation (LANG=fr_CA), the locale.atof() 
function doesn't behave as usual.

This code should run without problem :
import locale
locale.setlocale(locale.LC_ALL, '')
locale.atof(3,1415)
However, this one throws an exception (on Windows only)  :
import locale
locale.setlocale(locale.LC_ALL, '')
import pygtk
pygtk.require('2.0')
import gtk
locale.atof(3,1415)   -- Thows a ValueError exception
Note that de decimal separator is a comma in canadian french...
I tried the code on linux with Python 2.3 and PyGTK 2.4.1 and everything 
works fine.
On windows I have Python 2.4 and PyGTK 2.4.1. Unfortunately, my 
application must run on Windows...

Does anyone had the same problem before ?
Thanks,
Stéphane
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] l10n newbie questions

2005-01-14 Thread Stéphane Brunet
Hi,
I am trying to work with the python locale package and PyGTK but it 
doesn't seem to be so easy.

1- when getting a string for a gtk.Entry object :
 value = locale.atof(textEntry.get_text())
the text 125,5 cannot be converted into a float even if my locale 
defines a , as a decimal separator

2- when I force the locale to be e.g. English, or English_Canada, 
the decimal separator is . (as given by locale.localeconv() ) but 
PyGTK is still using the comma as decimal separator (which is the 
default locale on my computer French_Canada)

The result : my floats are displayed with a comma but I can only enter 
floats with a point as decimal separator. :-(

Here is the way I initialize my packages :

import locale
locale.setlocale(locale.LC_ALL, '')
import pygtk
pygtk.require('2.0')
import gtk
import re
-
I am using Python on windows (Python 2.4 (#60, Nov 30 2004, 11:49:19) 
[MSC v.1310 32 bit (Intel)] on win32) with PyGTK 2.4.1

Do I use the locale package the wrong way ?
btw, do you know why on Windows the locale strings have to be named 
English_Canada rather than en_CA ?

Regards,
Stéphane

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/