Pmw.Counter and Pmw.ScrolledCanvas questions

John McMonagle johnmc at velseis.com.au
Thu Jul 11 01:41:37 EDT 2002


My first question is to do with Pmw.Counter.  I am creating a
Pmw.Counter like so (see below code sample):

from Tkinter import *
import Pmw
r = Tk()

c = Pmw.Counter(r, labelpos=W, labelmargin=5, label_text='Two\nLines',
label_justify=LEFT, buttonaspect=1.2)
c.pack()
 

Because the label spans two text lines, the entryfield is also
expanded to this height.

Is it possible to set the height of the entry field so as to only
appear as a single line ?  Another way to say it is can the frame
component height and position be changed within the hull component ?

I have tried c.configure(frame_height=10) but the megawidget is just
redrawn the same.  I suspect the frame component is being expanded to
the height of the hull component.

My second question is to do with Pmw.ScrolledCanvas.  In my
application, I have a zoom drag feature.  The user can drag an area in
the canvas window using button-3-press-motion-release to define an
area to zoom.  I am able to do the zooming ok but how do you set where
the horizontal and vertical scrollbars are postioned.  I wish the user
to see at the top left of the scrolled canvas window the point at
which they started the drag.  I guess it's just for convenience sake
so the user does not have to scroll through to their desired point
after the zoom.



More information about the Python-list mailing list