473,796 Members | 2,520 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unreliable main window drag for Tkinter/Cygwin

I have created a somewhat complicated GUI which updates itself every
1/2 second by checking on several non-blocking sockets for data and
modifying StringVars and/or canvas graphs when new information is
present.

The basic structure is:
======
from Tkinter import *

top=Tk()

#define a bunch of gui stuff

def guiUpdate():
# check for new data and if necessary, update 5 small
# canvasses (strip charts) and about 10 StringVars
...
top.after(500, guiUpdate)

guiUpdate()
top.mainloop()
=======

This works just great on Linux. It also works great on CygWin unless
I try to reposition the main window by dragging the title bar. If I
am still holding the mouse button down when guiUpdate() runs, the main
window sometimes snaps back to its original position. If I'm fast and
accomplish the reposition between updates, it's fine. However, for a
normal reposition, the window almost always snaps back, making simple
repositioning irritating.

There are no explicit mouse event bindings on the top level window but
there are several static binds on enclosed widgets. There are no
dynamic bindings anywhere.

My StripChart class creates a canvass 400 pixels wide. Updates
involve inserting the new data point at the beginning of an array,
truncating the end of the array if necessary, deleting the previous
tagged line, and doing a create_line()us ing the updated array.

Since I wasn't sure how the stripchart would be used, I added a
self.canvas.upd ate() at the end of my stripchart.upda te() method. If
I comment out that line and just let top.mainloop() handle the
updates, everything seems to work fine. Is there something wrong with
individual canvas updates?
Jul 18 '05 #1
1 1821
> Is there something wrong with individual canvas updates?

Yes. `update' can cause event handling code to run at unexpected times;
it's considered problematic even in raw Tcl/Tk code. See
http://wiki.tcl.tk/1255 for more details.
Jason Harper
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5799
by: Jörg Maier | last post by:
Hey guys, i have a big problem using Tkinter and pexpect in cygwin. i try to program an winscp-like rsync Program for all posix Platforms (linux, macosx, cygwin). i got a class SslConnection with a method listDirectory that gives back a list of an remote directory using pexpect. this method works in linux, it works in cygwin-python from command-line, but invoked in an Tkinter-Program i got the strange Exception:...
2
2104
by: James Ash | last post by:
I'm writing a very simple and small Ptyhon/Tkinter application and I'm having trouble getting the menus to appear correctly. Rather than a name appearing on the menu bar, I see "()" instead. Clicking on these "()" does nothing (other than changing the appearance of them to indicated they've been pressed). I'm using Python 2.2.3 on Win2K, using a release downloaded from one of the Cygwin mirrors. This is most likely a simple mistake...
4
5242
by: Grzegorz Dostatni | last post by:
Good morning. I've got a Tkinter problem: File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 2310, in selection_present return self.tk.getboolean( TclError: expected boolean value but got "" Now a few weeks ago there was a similar problem with the boolean value. That's when the tcl started returning "???" for unknown fields in a
5
5563
by: Sean McIlroy | last post by:
The subject line essentially says it all. Is there a way to do it? If so, where do I look to find out how? Any help will be much appreciated. Thx, STM
6
2445
by: William Gill | last post by:
A short while ago someone posted that(unlike the examples) you should use Tk as the base for your main window in tkinter apps, not Frame. Thus : class MyMain(Frame): def __init__(self, master): self.root = master self.master=master self.createWidgets() def createWidgets(): ...
0
3588
by: syed_saqib_ali | last post by:
Below is a simple code snippet showing a Tkinter Window bearing a canvas and 2 connected scrollbars (Vertical & Horizontal). Works fine. When you shrink/resize the window the scrollbars adjust accordingly. However, what I really want to happen is that the area of the canvas that the scrollbars show (the Scrollregion) should expand as the window grows. It doesn't currently do this. although, if the window shrinks smaller than the...
1
12360
by: syed_saqib_ali | last post by:
Below is a simple code snippet showing a Tkinter Window bearing a canvas and 2 connected scrollbars (Vertical & Horizontal). Works fine. When you shrink/resize the window the scrollbars adjust accordingly. However, what I really want to happen is that the area of the canvas that the scrollbars show (the Scrollregion) should expand as the window grows. It doesn't currently do this. although, if the window shrinks smaller than the original...
4
2126
by: mdmdmd | last post by:
Hello, I wish to collect 4 files from a user. So I have decided to use tkFileDialog askopenfilename. My problem is that after a few file selections the root window is destroyed (the whole program just dissappears) I have created a simple example and was able to reproduce the same thing with this. I've just started using tkinter so I have no idea what I may be doing wrong. If anyone has any ideas please let me know.
0
852
by: Tim Daneliuk | last post by:
I am having trouble getting tkinter to recognize the following key presses- it seems to be ignoring them alltogether: Alt F1-F10: FreeBSD 4.x console running XFree86 and cygwin/X (current) connected to same machine. Works on cygwin/X local to Windows machine and native Windows. Ctl 1-5: FreeBSD, Cygwin/X (local or connected to FreeBSD), Windows - i.e. Does not seem to work anywhere.
0
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10230
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10174
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5442
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.