Re: Python 1.2 and Motif

Sjoerd Mullender (Sjoerd.Mullender@cwi.nl)
Thu, 23 Mar 1995 13:18:08 +0100

On Wed, Mar 22 1995 Stephane Lentz wrote:

> I've started developping an application using Python 1.1.1
> and I'm faced with several problems (some ressources canno't be
> passed to some widgets, ...).
>
> I would like to know if the new release will offer a larger Motif
> support.

Together with Python 1.2 the latest and greatest X extension
(including Motif support) will be released. There are many changes
between this new release and the provious one. I include the CHANGES
file in which I tried to note the changes.

This is a, no doubt incomplete, list of changes between this release
of the X extensions to Python and the previous one.

- There is documentation!

- The module Xm does not contain any functions anymore. Instead, the
functions are now widget methods.
The cv.py script deals with these.

- Some of the memory leaks have been plugged. Widget objects are now
actually deallocated when no longer used. Callback arguments are
now deallocated when all widgets that used them are deallocated.
Motif compound strings (variables of type XmString) are now freed
when they are no longer used. Probably not all leaks have been
plugged.

- Functions in Xlib that deal with Display variables are now methods
of a new Display object.
Affected functions:
CheckMaskEvent
NextEvent
PeekEvent
PutBackEvent
Flush
CreateFontCursor
ConnectionNumber
The cv.py script deals with these.

- More functions have been implemented.

- Bugs have been fixed. (I suppose some new bugs have been
introduced, though. :-)

- When a widget is destroyed, all its child widgets are also
destroyed. The interpreter now keeps track of destroyed widgets and
raises an exception if anything is tried on them (except another
DestroyWidget).

- Instead of using fontobject.fid, you should now use the fontobject
itself.

- Some methods require a pixmap argument. It used to be left as an
excercise to the programmer to obtain the proper pointer value. Now
you can (must) just specify a pixmap object.

- ReadBitmapFile now returns a pixmap object as one of the elements in
the tuple.

- New methods/functions:
colormap.QueryColor
colormap.QueryColors
colormap.LookupColor
colormap.ParseColor
Xt.ToolkitInitialize
Xt.ManageChildren
Xt.OpenDisplay
widget.LowerWindow
widget.GetGeometry
widget.DefineCursor
widget.UndefineCursor
widget.GrabButton
widget.UngrabButton

- New Motif widget methods:
OptionButtonGadget
OptionLabelGadget
ScaleSetValue
ScaleGetValue

- The XC_ prefixes have been removed from the names in
Lib/Xcursorfont.py.
The cv.py script deals with these.

- The __methods__ variable now gives all widget methods instead of
only a subset.

- The module HTML only contains a few functions now. The other
functions are now methods of HTML widgets. The cv.py script deals
with this.

- Widget methods are only methods of widgets for which it makes sense.
(E.g., FileSelectionBoxGetChild is a method of XmFileSelectionBox
widgets, and of no other.)

- The Window Attribute object has been removed. Instead, the
ChangeWindowAttributes widget method now accepts a dictionary where
the keys are the names of the struct members that are to be changed,
and the values are the new values.

- Constraint resources and Motif secondary resources are now
understood so they can be set.

Sjoerd Mullender, CWI, P.O. Box 94079, 1090 GB Amsterdam, The Netherlands
E-Mail: Sjoerd.Mullender@cwi.nl; Phone: +31 20 592 4127; Fax: +31 20 592 4199
URL: http://www.cwi.nl/cwi/people/Sjoerd.Mullender.html