Re: [pygtk] ComboBoxEntry and autocompletion

2004-12-06 Thread Harry Wright
* Antonio Prado <[EMAIL PROTECTED]> [2004-12-05 16:09]:
> Harry Wright 
> >Is there a better way to do autocompletion in a combobox than what I
> >have done in the code below (attached an EntryCompletion to the entry
> >box in the ComboBoxEntry). This works, but it seems a bit odd having a
> >both a pop-down list from the combobox and a pop-up list for the
> >autocompletion. Can it be done using just the combobox somehow?
> >
> >Also, is there any simple way to restrict the user to only entering text
> >in the list, without manually checking each character as it is entered?
> >
> 
> How you it solved this?

I "solved" it by redesigning my application -- I got rid of the
ComboBoxEntry and just use an Entry with an EntryCompletion. This is a
lot easier to use than a drop-down box with hundreds of entries.
Fortunately, my users (both of them!) know what they are going to enter,
so they don't need to see every choice in advance.

As for the 2nd question, I now check the text after it is entered. This
is more sensible for my application -- if something is entered that
isn't on the list, it probably should be added to the list.

Sorry -- none of this probably helps you much :-(

Harry.

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


Re: [pygtk] PyGTK gtkmm C++ wrap - possible?

2004-12-06 Thread Fabien COUTANT
[...]
> When I finally managed it to wrap the C++ code using SWIG the next 
> problem occured. When I try for example...
> 
> window = gtk.Window()
> widget = MyCustomWidget()
> window.add(widget)
> 
> ...I get an exception saying I'd have to pass a gtk.widget instead 
> of a 
> string?! As far as I understand from the SWIG documentation C/C++ 
> wrapped pointers are represented as strings in python. So what can 
> I do?
[...]

Hi Alex,

To avoid the "pointers as strings" symptom, you have to use SWIG's
type mappings to convert between a GtkWidget* and a Python type.
You also have to use and integrate the PyGTK infrastructure so that
your widget can be used from Python as other widgets.

This should work with C++ as it works with C.  As example of what I
did (a long time ago, this was with Gtk 1.2 / PyGTK 0.6.x and swig 1.1),
look at
http://www.fcoutant.freesurf.fr/python-cschtml.html
http://www.fcoutant.freesurf.fr/python-gdkpixbuf.html
which should give you ideas about what SWIG can do for you, and what
it can't.  I strongly advise you carefully read its manual, so that
you fully understand what you are doing (SWIG is quite obscure 
otherwise :).

The packages there are quite old.  The way to wrap Gtk widgets using
PyGtk may have changed with Python2.3 / PyGTK 2.x / Swig 1.3.  I just 
didn't
look.  It *may* be useful to you as a start point.

Alternatively you could use PyGtk 2.x code generator so that your widget
looks from Python as an object/class and its methods.  For this you 
*may*
have first to write C wrappers for your C++ class' methods, since PyGtk
will only call C functions...

-- 
Hope this helps,
Fabien.
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] UIManager and right-justify

2004-12-06 Thread John Finlay
Niklas Volbers wrote:
Hello everyone,
I have made the transition to gtk.UIManager. 

Now I am wondering if it is possible to right-justify an item in a menu bar.  I 
would like to have the 'help' menu on the right side.  Google was no friend of 
mine, since the example for the UIManager includes the text 'justify'.
Any help would be appreciated,
 

I think you have to retrieve the help menu and set it to be right 
justified, for example:

helpmenu = uimanager.get_widget('/Menubar/HelpMenu')
helpmenu.set_right_justifed(True)
where '/Menubar/HelpMenu' is the path to the help menu in uimanager.
John
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] PyGTK gtkmm C++ wrap - possible?

2004-12-06 Thread Xavier Ordoquy
On Sat, 2004-12-04 at 19:43 +0100, Alexander Lehmann wrote:
> Hello all,

Hi

> I have written a custom widget using gtkmm (not gtk+!) that is directly 
> derived from Gtk::DrawingArea.

I really don't have any idea if that can work.

> When I finally managed it to wrap the C++ code using SWIG the next 
> problem occured. When I try for example...

We don't use Swig for generating the pygtk wrappers. There are tools in
the pygtk tarball in the codegen directory.

Regards,
Xavier.

-- 
"Complexity has nothing to do with intelligence.
 Simplicity does."
 (Larry Bossidy, CEO, Allied Signal)


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


[pygtk] spreadsheet widget

2004-12-06 Thread Niklas Volbers
Hello everyone,

I am looking for some kind of spreadsheet widget that can display my data, 
which is stored in a numarray matrix (rows x columns).  Is there any widget 
available to display a spreadsheet?  Or would I simply use a TreeView/ListStore 
and use appropriate cell-renderers?   If so, are there editable CellRenderers?

Any ideas, suggestions, hints... would be appreciated,

Niklas Volbers.




Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193

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


[pygtk] UIManager and right-justify

2004-12-06 Thread Niklas Volbers
Hello everyone,

I have made the transition to gtk.UIManager. 

Now I am wondering if it is possible to right-justify an item in a menu bar.  I 
would like to have the 'help' menu on the right side.  Google was no friend of 
mine, since the example for the UIManager includes the text 'justify'.

Any help would be appreciated,

Niklas Volbers.

__
Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
weltweit telefonieren! http://freephone.web.de/?mc=021201

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