Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v9 / lib / python2.4 / site-packages / Pmw / Pmw_1_2 / doc / bugs.html
CommitLineData
920dae64
AT
1
2 <html>
3 <head>
4 <meta name="description" content="Pmw - a toolkit for building high-level compound widgets in Python">
5 <meta name="content" content="python, megawidget, mega widget, compound widget, gui, tkinter">
6 <title>List of known bugs</title>
7 </head>
8
9 <body bgcolor="#ffffff" text="#000000" link="#0000ee"
10 vlink="551a8b" alink="ff0000">
11
12 <h1 ALIGN="CENTER">List of known bugs</h1>
13
14<p>
15This is a list of some of the known bugs in Pmw. If you fix any of
16these, please let the maintainer (<em>gregm@iname.com</em>) know.</p>
17<ul><li><p>Under the Enlightenment window manager, if show() is called when
18 a window is already displayed (and is not obscured by other
19 windows), then the application will hang for two seconds. This
20 is either a bug in Tcl/Tk or in Enlightenment. See the comment
21 in the Tk function WaitForConfigureNotify() in the Tk source
22 file tk8.3.2/unix/tkUnixWm.c:</p>
23<dl><dd><pre> /*
24 * One more tricky detail about this procedure. In some cases the
25 * window manager will decide to ignore a configure request (e.g.
26 * because it thinks the window is already in the right place).
27 * To avoid hanging in this situation, only wait for a few seconds,
28 * then give up.
29 */</pre></dd></dl>
30
31
32</li>
33<li><p>On NT, Pmw.MenuBar does not display message bar help for menu
34 items. It seems that Tk menu widgets do not support &lt;Motion&gt;
35 events on MS. This probably is an issue that should be taken up
36 with the Tcl/Tk people. (Reported by Stefan Schone. Pmw.0.7)</p>
37
38</li>
39<li><p>Run the CounterDialog.py demo, select the show dialog button and
40 press ok. Now exit the dialog (either with the exit button or
41 the close box). The following error appears:</p>
42<dl><dd><pre> Menu ID 256 is already in use!Fatal Python Error: Tcl/Tk panic</pre></dd></dl>
43
44<p> This may be a problem with Mac version of Tk. (Reported by
45 Anthony Wilson.)</p>
46
47
48</li>
49<li><p>Pmw.Balloons bind to widgets and canvas items. This means that
50 bindings made by other users are deleted when the balloon makes
51 its bindings. (For example, the "Delete" canvas item in the
52 Balloon demo overrides that &lt;ButtonPress&gt; binding and so that
53 balloon is not withdrawn when the mouse button is pressed over
54 the item.)</p>
55<p> The obvious solution is for Pmw.Balloon to add its bindings with
56 a <em>+</em>. But this would make the unbind and tagunbind methods
57 inconsistent - they would remove all bindings, not just the ones
58 added by the balloon. A better way would be for the balloon to
59 add a bindtag to each widget`s bindtag list - then it would not
60 upset any other bindings and it could be deleted cleanly.
61 (Reported by Joe Saltiel)</p>
62
63
64</li></ul>
65
66<dl><dd><pre> import Tkinter
67 import Pmw
68
69 def foo(event):
70 print '&lt;Enter&gt; event on text'
71
72 root = Pmw.initialise()
73 balloon = Pmw.Balloon()
74
75 canvas = Tkinter.Canvas()
76 canvas.pack()
77
78 text1 = canvas.create_text(50, 50, text = 'hello
79there')
80
81 # As is, the balloon does not appear over the text, but foo
82 # is called. Swap the following two lines and the balloon
83 # appears but foo will not be called.
84 canvas.tag_bind(text1, "&lt;Enter&gt;", foo)
85 balloon.tagbind(canvas, text1, 'text 1 help')
86
87 root.mainloop()</pre></dd></dl>
88<ul><li><p>In Pmw.Balloon, the balloon should not be withdrawn when the
89 pointer leaves a widget or item and it immediatly enters another
90 widget or item with balloon help. Instead, the balloon should
91 be moved and its contents changed immediately.</p>
92
93</li>
94<li><p>When a Pmw.Balloon is bound to a canvas item, moving the item
95 becomes very slow. (Reported by Joe Saltiel)</p>
96<dl><dd><pre> &gt; Second, after I fixed my ordering problem I noticed, there
97 &gt; is a pretty big delay in updating widgets that have balloon
98 &gt; messages bound to them. (For example dragging a box across
99 &gt; a screen, the box has a delayed reaction.) I believe this is
100 &gt; due to some of the timing functions used in PmwBalloon, I am
101 &gt; not sure if there is a way around it. I set all timers to
102 &gt; zero, and still had the problem.</pre></dd></dl>
103
104
105</li>
106<li><p>When running Pmw demos under ptui the busy cursor does not
107 appear.</p>
108
109</li>
110<li><p>If a combobox has a horizontal scrollbar and it displays its
111 listbox above the entry, then it is misplaced.</p>
112
113</li>
114<li><p>Bug in Pmw.PanedWidget: repeat by creating new panes in Demo -
115 existing panes jump to the right 1 or 2 pixels.</p>
116
117</li>
118<li><p>Bug in Pmw.PanedWidget: repeat by setting hull_borderwidth to
119 20 in demo - initial drag jumps to right by about 20 pixels.
120 Also right hand side border is missing. (Fix may be similar to
121 method used in Pmw.ScrolledFrame to give canvas border.)</p>
122
123</li>
124<li><p>Fix ButtonRelease events so they do not trigger without a
125 corresponding ButtonPress event.</p>
126<p> From Joe Saltiel: I was playing around with a scrolledlistbox
127 and tkFileDialog. When I have the dialog open above the list
128 box and I doubleclick on it, I invoke the selectioncmd of the
129 listbox as well as the tkFileDialog box, should this be
130 happening?</p>
131
132<p> Attached is small sample program you can try. To get the bug to
133 show you must do two things. First, when you open the file
134 dialog box, make sure the item you are going to select if
135 over(above) the scrolledlistbox. Second, you have to double
136 click on that item. If you single click and hit "Open" you do
137 not get the bug. Nor do you get it unless the file you click on
138 is directly over the clickable region of the scrolledlist box.</p>
139<dl><dd><pre> import Tkinter
140 import Pmw
141 import tkFileDialog
142 import string
143
144 def askOpen():
145 file = tkFileDialog.askopenfile(filetypes=[("all files", "*")])
146 print file
147
148 def printMe():
149 print "Me"
150
151 root = Tkinter.Tk()
152 Pmw.initialise(root)
153
154 frame1 = Tkinter.Frame(root)
155 lst = string.split("abc def ghi jkl mno pqr stu vwx yz")
156 lstbox = Pmw.ScrolledListBox(frame1, items=lst, selectioncommand=printMe)
157 lstbox.grid(row=0, column=0, columnspan=2)
158 Tkinter.Button(frame1, text='open', command=askOpen).grid(row=1, column=0)
159 Tkinter.Button(frame1, text='exit', command=root.destroy).grid(row=1, column=1)
160 frame1.pack()
161
162 root.mainloop()</pre></dd></dl>
163
164
165<p> Response: I have found where the problem is but I am not sure
166 how to fix it. It appears that the tkFileDialog box closes on a
167 ButtonPress event. The corresponding ButtonRelease event is
168 then sent to whichever widget is under the cursor at the time of
169 the Release. I have reproduced the problem with a Tcl-only
170 script:</p>
171<dl><dd><pre> listbox .l
172 .l insert 0 1 2 3 4
173 bind .l &lt;ButtonRelease-1&gt; {puts AAAGGHHH!}
174
175 button .b -text open -command tk_getOpenFile
176 pack .l .b</pre></dd></dl>
177
178
179<p> If you do a quick Press-Release-Press over the file dialog, it
180 is withdrawn. If you then keep the mouse button down and move
181 the mouse around, you will see that the button and the listbox
182 still respond to it. If you do the final button Release over
183 the listbox, its &lt;ButtonRelease-1&gt; binding is invoked.</p>
184
185<p> I think the correct solution is to modify Pmw to be very careful
186 when to accept ButtonRelease events. It will need to also bind
187 to ButtonPress events and make sure that it gets a Press before
188 it accepts the Release. I'll try to do the change as soon as
189 possible, but the code involved is fairly complex so I it may
190 take a little time.</p>
191
192
193</li>
194<li><p>Investigate bug in Tk8.0: When a dialog pops up over the
195 pointer then the keyboard focus is not set and so &lt;Return&gt; does
196 not invoke default button.</p>
197
198</li>
199<li><p>Under both X and NT, the arrows in the timecounter, counter and
200 combobox do not match the scrollbar arrows.</p>
201
202</li>
203<li><p>Pmw.Group does not work correctly when the tag is a compound
204 widget. The tag is placed such that the top of the tag is cut
205 off. (Reported by Peter Stoehr.)</p>
206<dl><dd><pre> import Tkinter
207 import Pmw
208
209 root = Tkinter.Tk()
210 Pmw.initialise(root, fontScheme = 'pmw1')
211 exitButton = Tkinter.Button(root, text = 'Exit', command = root.destroy)
212 exitButton.pack(side = 'bottom')
213
214 def makeGroup(tagClassName):
215 tagClass = eval(tagClassName)
216 group = Pmw.Group(
217 tag_pyclass = tagClass,
218 hull_background = 'red',
219 groupchildsite_background = 'blue',
220 )
221 group.pack(fill = 'both', expand = 1, padx = 6, pady = 6)
222 child = Tkinter.Label(group.interior(),
223 text = 'Group with tag ' + tagClassName,
224 background = 'aliceblue',
225 )
226 child.pack(padx = 10, pady = 5, expand = 1, fill = 'both')
227
228 return group
229
230 grp1 = makeGroup('Pmw.EntryField')
231 grp2 = makeGroup('Pmw.ComboBox')
232 grp3 = makeGroup('Tkinter.Entry')
233
234 root.mainloop()</pre></dd></dl>
235
236<p> Also, Pmw.Group does not resize correctly if the simple widget
237 changes size. For example:</p>
238<dl><dd><pre> grp3.configure(tag_font = ('Helveltica', '-160'))</pre></dd></dl>
239
240
241
242</li>
243<li><p>Bug(s) in PmwScrolledCanvas. There is a bug in 0.8.1
244 PmwScrolledCanvas._setRegion. If there are no objects in the
245 canvas, then error occurs on len(region) because region is None.
246 Below is an attempt to fix it. Click on Show, then on Delete.
247 The window then continuously resizes. If the ScrolledCanvas is
248 created with canvasmargin = 0, the problem goes away. (Reported
249 by Anders Henja.)</p>
250<dl><dd><pre> import Tkinter
251 import Pmw
252
253 def _setRegion(self):
254 # Attempt to fix PmwScrolledCanvas._setRegion.
255 self.setregionTimer = None
256
257 region = self._canvas.bbox('all')
258 canvasmargin = self['canvasmargin']
259 if region is None:
260 region = (0, 0, 0, 0)
261 region = (region[0] - canvasmargin, region[1] - canvasmargin,
262 region[2] + canvasmargin, region[3] + canvasmargin)
263 self._canvas.configure(scrollregion = region)
264
265 def show():
266 canvas.component('canvas').delete('all')
267 canvas.create_oval(0, 0, 800, 600, fill = 'red')
268 canvas.configure(canvas_width = 600, canvas_height = 450)
269 canvas.resizescrollregion()
270
271 def delete():
272 canvas.component('canvas').delete('all')
273 canvas.configure(canvas_width = 0, canvas_height = 0)
274 canvas.resizescrollregion()
275
276 root=Tkinter.Tk()
277 Pmw.initialise(root)
278
279 buttonbox=Pmw.ButtonBox()
280 buttonbox.pack(fill='x',side='bottom',padx=5,pady=5)
281 buttonbox.add('Show',command=show)
282 buttonbox.add('Delete',command=delete)
283 buttonbox.alignbuttons()
284
285 canvas=Pmw.ScrolledCanvas(canvasmargin=2)
286 canvas.__class__._setRegion = _setRegion
287 canvas.pack(fill='both',side='right',expand=1)
288
289 root.mainloop()</pre></dd></dl>
290
291
292</li>
293<li><p>Bug in Pmw.Dialog: if <strong>defaultbutton</strong> is configured before
294 <strong>buttons</strong> during <strong>self.initialiseoptions()</strong> (that is if
295 <strong>self._constructorKeywords.keys()</strong> returns a different order),
296 then <strong>setdefault()</strong> fails.</p>
297
298</li>
299<li><p>Bugs in Tk which affect Pmw.MainMenuBar:</p>
300<ul><li><p>Extra bindings assigned to a Tkinter.Menu widget using
301 bindtags have no effect. Hence the method used in
302 Pmw.MenuBar for status help (bind_class followed by
303 bindtags) does not work and therefore binding to the menu
304 widget is used instead.</p>
305
306</li>
307<li><p>The <strong>'active'</strong> tag for the <code>index()</code> method of Tkinter.Menu
308 always returns <strong>None</strong>. Hence, in the menu widget motion
309 binding, <code>event.y</code> and the <strong>'@'</strong> format is used instead, for
310 all menus except the toplevel main menu.</p>
311
312</li>
313<li><p>For the toplevel main menu, <code>event.x</code> must be used for the
314 <code>index()</code> method, but it returns the wrong index. It
315 appears that the Tk widget is assuming vertical layout
316 to calculate distances, rather than horizontal.</p>
317
318</li>
319<li><p>For toplevel main menus, several Tk commands, such as
320 <code>winfo_height()</code>, do not work. This prevents the use of
321 balloon help for Pmw.MainMenuBar.</p>
322
323</li></ul>
324
325</li>
326<li><p>Bug in Pmw.ComboBox: Tab to combobox arrow, use up/down arrow
327 keys to change selection, hit return, nothing happens, &lt;Shift
328 Tab&gt; to entry window, hit return, combobox changes</p>
329<ul><li><p>actually, it would be better if you could not tab to
330 the arrow, only the entry field, like the Pmw.Counter.</p>
331
332</li>
333<li><p>the problem is if the entry field is not editable, what to
334 do then?</p>
335
336</li></ul>
337
338</li>
339<li><p>Bug in TimeCounter: Arrow keys don't work when focus is on entry.</p>
340
341</li>
342<li><p>Bug in Pmw.NoteBook: The size of the tab does not change when
343 the text value changes</p>
344
345</li>
346<li><p>Bug in Pmw.NoteBook: The name of the tab components has a "-" sign
347 in it, which means that component options can not be used in the
348 configure command. Eg:</p>
349<dl><dd><pre> n = Pmw.NoteBook()
350 p = n.add('page1')
351 n.configure(page1_background = 'red') # works
352 n.configure(page1-tab_background = 'red') # fail, must do this:
353 n.component('page1-tab').configure(background = 'red') # works</pre></dd></dl>
354
355
356</li></ul>
357<p></p>
358
359
360
361
362 <center><P ALIGN="CENTER">
363 <IMG SRC = blue_line.gif ALT = "" WIDTH=320 HEIGHT=5>
364 </p></center>
365
366
367 <font size=-1>
368 <center><P ALIGN="CENTER">
369 Pmw 1.2 -
370 5 Aug 2003
371 - <a href="index.html">Home</a>
372
373 </p></center>
374 </font>
375
376 </body>
377 </html>
378