File: bugs.html

package info (click to toggle)
python-pmw 1.2-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,024 kB
  • ctags: 3,802
  • sloc: python: 17,143; makefile: 41
file content (378 lines) | stat: -rw-r--r-- 13,833 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378

    <html>
    <head>
    <meta name="description" content="Pmw - a toolkit for building high-level compound widgets in Python">
    <meta name="content" content="python, megawidget, mega widget, compound widget, gui, tkinter">
    <title>List of known bugs</title>
    </head>

    <body bgcolor="#ffffff" text="#000000" link="#0000ee"
	vlink="551a8b" alink="ff0000">

    <h1 ALIGN="CENTER">List of known bugs</h1>
    
<p>
This is a list of some of the known bugs in Pmw.  If you fix any of
these, please let the maintainer (<em>gregm@iname.com</em>) know.</p>
<ul><li><p>Under the Enlightenment window manager, if show() is called when
      a window is already displayed (and is not obscured by other
      windows), then the application will hang for two seconds.  This
      is either a bug in Tcl/Tk or in Enlightenment.  See the comment
      in the Tk function WaitForConfigureNotify() in the Tk source
      file tk8.3.2/unix/tkUnixWm.c:</p>
<dl><dd><pre> /*
  * One more tricky detail about this procedure.  In some cases the
  * window manager will decide to ignore a configure request (e.g.
  * because it thinks the window is already in the right place).
  * To avoid hanging in this situation, only wait for a few seconds,
  * then give up.
  */</pre></dd></dl>


</li>
<li><p>On NT, Pmw.MenuBar does not display message bar help for menu
      items.  It seems that Tk menu widgets do not support &lt;Motion&gt;
      events on MS.  This probably is an issue that should be taken up
      with the Tcl/Tk people.  (Reported by Stefan Schone.  Pmw.0.7)</p>

</li>
<li><p>Run the CounterDialog.py demo, select the show dialog button and
      press ok.  Now exit the dialog (either with the exit button or
      the close box).  The following error appears:</p>
<dl><dd><pre> Menu ID 256 is already in use!Fatal Python Error: Tcl/Tk panic</pre></dd></dl>

<p>      This may be a problem with Mac version of Tk.  (Reported by
      Anthony Wilson.)</p>


</li>
<li><p>Pmw.Balloons bind to widgets and canvas items.  This means that
      bindings made by other users are deleted when the balloon makes
      its bindings.  (For example, the "Delete" canvas item in the
      Balloon demo overrides that &lt;ButtonPress&gt; binding and so that
      balloon is not withdrawn when the mouse button is pressed over
      the item.)</p>
<p>      The obvious solution is for Pmw.Balloon to add its bindings with
      a <em>+</em>.  But this would make the unbind and tagunbind methods
      inconsistent - they would remove all bindings, not just the ones
      added by the balloon.  A better way would be for the balloon to
      add a bindtag to each widget`s bindtag list - then it would not
      upset any other bindings and it could be deleted cleanly. 
      (Reported by Joe Saltiel)</p>


</li></ul>

<dl><dd><pre> import Tkinter
 import Pmw
 
 def foo(event):
     print '&lt;Enter&gt; event on text'
 
 root = Pmw.initialise()
 balloon = Pmw.Balloon()
 
 canvas = Tkinter.Canvas()
 canvas.pack()
 
 text1 = canvas.create_text(50, 50, text = 'hello
there')
 
 # As is, the balloon does not appear over the text, but foo
 # is called.  Swap the following two lines and the balloon
 # appears but foo will not be called.
 canvas.tag_bind(text1, "&lt;Enter&gt;", foo)
 balloon.tagbind(canvas, text1, 'text 1 help')
 
 root.mainloop()</pre></dd></dl>
<ul><li><p>In Pmw.Balloon, the balloon should not be withdrawn when the
      pointer leaves a widget or item and it immediatly enters another
      widget or item with balloon help.  Instead, the balloon should
      be moved and its contents changed immediately.</p>

</li>
<li><p>When a Pmw.Balloon is bound to a canvas item, moving the item
      becomes very slow.  (Reported by Joe Saltiel)</p>
<dl><dd><pre> &gt; Second, after I fixed my ordering problem I noticed, there
 &gt; is a pretty big delay in updating widgets that have balloon
 &gt; messages bound to them.  (For example dragging a box across
 &gt; a screen, the box has a delayed reaction.) I believe this is
 &gt; due to some of the timing functions used in PmwBalloon, I am
 &gt; not sure if there is a way around it.  I set all timers to
 &gt; zero, and still had the problem.</pre></dd></dl>


</li>
<li><p>When running Pmw demos under ptui the busy cursor does not
      appear.</p>

</li>
<li><p>If a combobox has a horizontal scrollbar and it displays its
      listbox above the entry, then it is misplaced.</p>

</li>
<li><p>Bug in Pmw.PanedWidget:  repeat by creating new panes in Demo -
      existing panes jump to the right 1 or 2 pixels.</p>

</li>
<li><p>Bug in Pmw.PanedWidget:  repeat by setting hull_borderwidth to
      20 in demo - initial drag jumps to right by about 20 pixels. 
      Also right hand side border is missing.  (Fix may be similar to
      method used in Pmw.ScrolledFrame to give canvas border.)</p>

</li>
<li><p>Fix ButtonRelease events so they do not trigger without a
      corresponding ButtonPress event.</p>
<p>      From Joe Saltiel:  I was playing around with a scrolledlistbox
      and tkFileDialog.  When I have the dialog open above the list
      box and I doubleclick on it, I invoke the selectioncmd of the
      listbox as well as the tkFileDialog box, should this be
      happening?</p>

<p>      Attached is small sample program you can try.  To get the bug to
      show you must do two things.  First, when you open the file
      dialog box, make sure the item you are going to select if
      over(above) the scrolledlistbox.  Second, you have to double
      click on that item.  If you single click and hit "Open" you do
      not get the bug.  Nor do you get it unless the file you click on
      is directly over the clickable region of the scrolledlist box.</p>
<dl><dd><pre> import Tkinter
 import Pmw
 import tkFileDialog
 import string 
 
 def askOpen():
     file = tkFileDialog.askopenfile(filetypes=[("all files", "*")])  
     print file
 
 def printMe():
     print "Me"
 
 root = Tkinter.Tk()
 Pmw.initialise(root)
 
 frame1 = Tkinter.Frame(root)
 lst = string.split("abc def ghi jkl mno pqr stu vwx yz")
 lstbox = Pmw.ScrolledListBox(frame1, items=lst, selectioncommand=printMe)
 lstbox.grid(row=0, column=0, columnspan=2)
 Tkinter.Button(frame1, text='open', command=askOpen).grid(row=1, column=0)
 Tkinter.Button(frame1, text='exit', command=root.destroy).grid(row=1, column=1)
 frame1.pack()
 
 root.mainloop()</pre></dd></dl>


<p>      Response:  I have found where the problem is but I am not sure
      how to fix it.  It appears that the tkFileDialog box closes on a
      ButtonPress event.  The corresponding ButtonRelease event is
      then sent to whichever widget is under the cursor at the time of
      the Release.  I have reproduced the problem with a Tcl-only
      script:</p>
<dl><dd><pre> listbox .l
 .l insert 0 1 2 3 4
 bind .l &lt;ButtonRelease-1&gt; {puts AAAGGHHH!}

 button .b -text open -command tk_getOpenFile
 pack .l .b</pre></dd></dl>


<p>      If you do a quick Press-Release-Press over the file dialog, it
      is withdrawn.  If you then keep the mouse button down and move
      the mouse around, you will see that the button and the listbox
      still respond to it.  If you do the final button Release over
      the listbox, its &lt;ButtonRelease-1&gt; binding is invoked.</p>

<p>      I think the correct solution is to modify Pmw to be very careful
      when to accept ButtonRelease events.  It will need to also bind
      to ButtonPress events and make sure that it gets a Press before
      it accepts the Release.  I'll try to do the change as soon as
      possible, but the code involved is fairly complex so I it may
      take a little time.</p>


</li>
<li><p>Investigate bug in Tk8.0:  When a dialog pops up over the
      pointer then the keyboard focus is not set and so &lt;Return&gt; does
      not invoke default button.</p>

</li>
<li><p>Under both X and NT, the arrows in the timecounter, counter and
      combobox do not match the scrollbar arrows.</p>

</li>
<li><p>Pmw.Group does not work correctly when the tag is a compound
      widget.  The tag is placed such that the top of the tag is cut
      off.  (Reported by Peter Stoehr.)</p>
<dl><dd><pre> import Tkinter
 import Pmw
 
 root = Tkinter.Tk()
 Pmw.initialise(root, fontScheme = 'pmw1')
 exitButton = Tkinter.Button(root, text = 'Exit', command = root.destroy)
 exitButton.pack(side = 'bottom')
 
 def makeGroup(tagClassName):
     tagClass = eval(tagClassName)
     group = Pmw.Group(
         tag_pyclass = tagClass,
         hull_background = 'red',
         groupchildsite_background = 'blue',
     )
     group.pack(fill = 'both', expand = 1, padx = 6, pady = 6)
     child = Tkinter.Label(group.interior(),
         text = 'Group with tag ' + tagClassName,
         background = 'aliceblue',
     )
     child.pack(padx = 10, pady = 5, expand = 1, fill = 'both')

     return group
 
 grp1 = makeGroup('Pmw.EntryField')
 grp2 = makeGroup('Pmw.ComboBox')
 grp3 = makeGroup('Tkinter.Entry')
 
 root.mainloop()</pre></dd></dl>

<p>      Also, Pmw.Group does not resize correctly if the simple widget
      changes size.  For example:</p>
<dl><dd><pre> grp3.configure(tag_font = ('Helveltica', '-160'))</pre></dd></dl>



</li>
<li><p>Bug(s) in PmwScrolledCanvas.  There is a bug in 0.8.1
      PmwScrolledCanvas._setRegion.  If there are no objects in the
      canvas, then error occurs on len(region) because region is None. 
      Below is an attempt to fix it.  Click on Show, then on Delete. 
      The window then continuously resizes.  If the ScrolledCanvas is
      created with canvasmargin = 0, the problem goes away.  (Reported
      by Anders Henja.)</p>
<dl><dd><pre> import Tkinter
 import Pmw
 
 def _setRegion(self):
     # Attempt to fix PmwScrolledCanvas._setRegion.
     self.setregionTimer = None
 
     region = self._canvas.bbox('all')
     canvasmargin = self['canvasmargin']
     if region is None:
         region = (0, 0, 0, 0)
     region = (region[0] - canvasmargin, region[1] - canvasmargin,
         region[2] + canvasmargin, region[3] + canvasmargin)
     self._canvas.configure(scrollregion = region)
 
 def show():
     canvas.component('canvas').delete('all')
     canvas.create_oval(0, 0, 800, 600, fill = 'red')
     canvas.configure(canvas_width = 600, canvas_height = 450)
     canvas.resizescrollregion()
 
 def delete():
     canvas.component('canvas').delete('all')
     canvas.configure(canvas_width = 0, canvas_height = 0)
     canvas.resizescrollregion()
 
 root=Tkinter.Tk()
 Pmw.initialise(root)
 
 buttonbox=Pmw.ButtonBox()
 buttonbox.pack(fill='x',side='bottom',padx=5,pady=5)
 buttonbox.add('Show',command=show)
 buttonbox.add('Delete',command=delete)
 buttonbox.alignbuttons()
 
 canvas=Pmw.ScrolledCanvas(canvasmargin=2)
 canvas.__class__._setRegion = _setRegion
 canvas.pack(fill='both',side='right',expand=1)
 
 root.mainloop()</pre></dd></dl>


</li>
<li><p>Bug in Pmw.Dialog:  if <strong>defaultbutton</strong> is configured before
      <strong>buttons</strong> during <strong>self.initialiseoptions()</strong> (that is if
      <strong>self._constructorKeywords.keys()</strong> returns a different order),
      then <strong>setdefault()</strong> fails.</p>

</li>
<li><p>Bugs in Tk which affect Pmw.MainMenuBar:</p>
<ul><li><p>Extra bindings assigned to a Tkinter.Menu widget using
          bindtags have no effect.  Hence the method used in
          Pmw.MenuBar for status help (bind_class followed by
          bindtags) does not work and therefore binding to the menu
          widget is used instead.</p>

</li>
<li><p>The <strong>'active'</strong> tag for the <code>index()</code> method of Tkinter.Menu
          always returns <strong>None</strong>.  Hence, in the menu widget motion
          binding, <code>event.y</code> and the <strong>'@'</strong> format is used instead, for
          all menus except the toplevel main menu.</p>

</li>
<li><p>For the toplevel main menu, <code>event.x</code> must be used for the
          <code>index()</code> method, but it returns the wrong index.  It
          appears that the Tk widget is assuming vertical layout
          to calculate distances, rather than horizontal.</p>

</li>
<li><p>For toplevel main menus, several Tk commands, such as
          <code>winfo_height()</code>, do not work.  This prevents the use of
          balloon help for Pmw.MainMenuBar.</p>

</li></ul>

</li>
<li><p>Bug in Pmw.ComboBox:  Tab to combobox arrow, use up/down arrow
     keys to change selection, hit return, nothing happens, &lt;Shift
     Tab&gt; to entry window, hit return, combobox changes</p>
<ul><li><p>actually, it would be better if you could not tab to
          the arrow, only the entry field, like the Pmw.Counter.</p>

</li>
<li><p>the problem is if the entry field is not editable, what to
          do then?</p>

</li></ul>

</li>
<li><p>Bug in TimeCounter: Arrow keys don't work when focus is on entry.</p>

</li>
<li><p>Bug in Pmw.NoteBook: The size of the tab does not change when
    the text value changes</p>

</li>
<li><p>Bug in Pmw.NoteBook: The name of the tab components has a "-" sign
    in it, which means that component options can not be used in the
    configure command. Eg:</p>
<dl><dd><pre> n = Pmw.NoteBook()
 p = n.add('page1')
 n.configure(page1_background = 'red')   # works
 n.configure(page1-tab_background = 'red')   # fail, must do this:
 n.component('page1-tab').configure(background = 'red')   # works</pre></dd></dl>


</li></ul>
<p></p>




    <center><P ALIGN="CENTER">
    <IMG SRC = blue_line.gif ALT = "" WIDTH=320 HEIGHT=5>
    </p></center>
    

    <font size=-1>
    <center><P ALIGN="CENTER">
    Pmw 1.2 -
     5 Aug 2003
     - <a href="index.html">Home</a>
    
    </p></center>
    </font>

    </body>
    </html>