f



How can I detect when a window has been moved or resized?

How can I detect when a window has been moved or resized?

I've tried binding to the "<Configure>" event, but I need to be able
to ignore <Configure> events that are not due to moving or resizing.

Is this possible?

Many Thanks,
   =Adrian=

0
adrian488 (174)
10/1/2007 12:44:07 PM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

3 Replies
313 Views

Similar Articles

[PageSpeed] 47

Adrian Davis wrote:
> How can I detect when a window has been moved or resized?
> 
> I've tried binding to the "<Configure>" event, but I need to be able
> to ignore <Configure> events that are not due to moving or resizing.
> 
> Is this possible?

Yes it is possible.

You want to look at the percent substitutions that bind can do.  You also 
want to look at the if and continue commands.


-- 
+--------------------------------+---------------------------------------+
| Gerald W. Lester                                                       |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
0
Gerald.Lester (2014)
10/1/2007 1:22:25 PM
> Yes it is possible.
>
> You want to look at the percent substitutions that bind can do.  You also
> want to look at the if and continue commands.
>

Many Thanks.

I can see how the percent substitutions can give me the resize - How
can I check for a move?

Thanks Again,
   =Adrian=


0
adrian488 (174)
10/1/2007 2:33:05 PM
On Oct 1, 9:33 am, Adrian Davis <adr...@satisoft.com> wrote:
> > Yes it is possible.
>
> > You want to look at the percent substitutions that bind can do.  You also
> > want to look at the if and continue commands.
>
> Many Thanks.
>
> I can see how the percent substitutions can give me the resize - How
> can I check for a move?
>
> Thanks Again,
>    =Adrian=


I would probably record the settings when the window is created and
then check each <Configure> event for what changed.  Like so:

InitializeTop $top
bind $top <Configure> "ConfigureTop %W %w %h %x %y"

proc InitializeTop { top } {
    variable geom
    scan [winfo geometry $top] "%dx%d+%d+%d" geom($top,w) geom($top,h)
geom($top,x) geom($top,y)

}

proc ConfigureTop { top w h x y } {
    variable geom

    set moved 0
    set resized 0

    if {$geom($top,w) != $w || $geom($top,h) != $h} {
        set resized 1
    }

    if {$geom($top,x) != $x || $geom($top,y) != $y} {
        set moved 1
    }

    ## Set the new geometry values.
    InitializeTop $top
}


Whatever.  You get the idea. 0-]

0
damon6845 (74)
10/1/2007 3:43:39 PM
Reply:

Similar Artilces:

Application Window cannot be resized or moved under Mac but can under Windows and Linux
Hello All, I have an application that employs a smooth scrolling ticker control using a dialog windows as the main window. I can resize the main window and move it with the scrolling ticker scrolling text when the application is compiled for both Windows and Linux. However, I can do neither when the application is build for Mac, I can only close it. Does anybody have any idea as to why this weird behavior is occurring? Thanks in advance! ;-) Best Regards, -- Rob Krakora Senior Software Engineer MessageNet Systems 101 East Carmel Dr. Suite 105 Carmel, IN 46032 (31...

resizing objects in the window when the window resizes...
How do you anchor objects on the gui so that they resize and change as the main window is changed? JustSomeGuy a �crit: > How do you anchor objects on the gui so that they resize and change as the > main window is changed? Assuming the objects are actually on the main window, use the LockLeft, LockTop, LockRight and LockBottom properties. For example, if you set the LockTop and LockBottom properties to true, the control's height will change accordingly to the window. For more information, check the RectControl class in the language reference (help) and look fo...

Can't move palette windows / tool window. What is wrong ?
I can't move the small floating windows around. What is wrong with my photoshop CS ? It is original, reinstalled and activated less than a month ago on a fresh WinXP SP2. I used to be able to do it. BTW: Is there any way to run PS CS in "rootless" mode. i.e. not have it using the gray background, and making it love my ekstra monitor to the left of the main monitor ? -- Povl H. Pedersen - NoSpam@my.terminal.dk (yes - it works) Fastnet - IP telefoni: 5 kr/md Se http://www.musimi.dk > I can't move the small floating windows around... I've had troubles with some them...

How can I add a window resizing marker to the right corner of a Tk window
Hi Folks, Some time ago I remember seeing a Tk module for adding a small marker to the right corner of window so that it can be grabbed by the mouse and resize the window. However, I have forgotten the module name. Any help is greatly appreciated. Best Regards, -sm sm wrote: > Hi Folks, > > Some time ago I remember seeing a Tk module for adding a small marker > to the right corner of window so that it can be grabbed by the mouse and > resize the window. However, I have forgotten the module name. Any help > is greatly appreciated. You're look...

Cannot move/resize windows
I am experiencing a new case of partial WPS freeze: I can select, open, close or minimize any window/icon on the desktop, but I cannot move or resize them. I tried restarting the WPS but it didn't help Any ideas? thanks, Piersante ...

Can I move this window?
I use a KVM switch to switch between my Mac and a Windoze machine (I need to run a program not available for the Mac). I have two displays hooked up to the Mac, and the KVM switch switches the second display to the PC. Whenever I press the switch to to do this, a window appears in the middle of the main display telling me that the Mac can't identify my keyboard. This is fair enough, except that sometimes I want to see what's on the main display of the Mac, while I'm on the PC. The problem is, I can't drag the window out of the way without the keyboard, and as soon as I switch t...

Possible bug in Tcl or Windows or Tcl on Windows
Hi, There seems to be a bug in the way numbers are compared in Tcl. Consider the below script for calculating Pythagorean triplets. For hypotenuse upto a value of 100, there should have been 63 unique triplets. On Windows XP the script detects only 62. The script doesn't detect the case where c=99, b=20 ==> a=101. However running the same script under Tcl 8.4.1 in Cygwin detects 63 triplets. I don't have a Linux machine at hand to test it there. Following is the script and relevant output. Could anyone shed some light on the cause of this. Maybe it has something to do with how the numbers are represented internally? Running the script for N>100 shows up many more such missed values. An equivalent program in C runs correctly on the same machine. C code was compiled using both gcc and VC++6.0. ######################################################################### # a^2 = b^2 + c^2 proc pythag {MAX} { set i 0 for {set c 2} {$c <= $MAX} {incr c} { for {set b 1} {$b < $c} {incr b} { set a [expr hypot($c, $b)] ;# Calc. Hypot if { ($c == 99) && ($b == 20)} { ;# <<<<<<<< puts ">> [expr round($a)] == $a" } if {[expr round($a)] == $a} { puts "$a : $b : $c" incr i } } } return $i } if {$argc == 1} { set MAX [lindex $argv 0] } else { puts stderr "Usage: tclsh $argv0 N" exit } puts [pythag $MAX] ############# OUTPUT ################ Tcl 8.4.1 (Cygwi...

How can I make a window Resizable?
Hello! I opened a new window using 'resizable=no'. Can the child window make itself resizable even if it's opened with 'resizable=no'? For example: <body onload="javascript: window.resizable=true;"> TIA. Sam sam.s.kong@gmail.com said the following on 1/4/2006 4:53 PM: > Hello! > > I opened a new window using 'resizable=no'. Don't. > Can the child window make itself resizable even if it's opened with > 'resizable=no'? Depends on the browser and user settings. > For example: > > <body onload="javascript: window.resizable=true;"> Did you test it? -- Randy comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/ Thanks for the answer. I tested it with IE6 and it didn't work. Sam sam.s.kong@gmail.com said the following on 1/4/2006 8:24 PM: Please quote what you are replying to. If you want to post a followup via groups.google.com, don't use the "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers. > Thanks for the answer. > I tested it with IE6 and it didn't work. The way you make a window resizable is that you don't disable resizability to begin with. Then, it's not an issue. Why are you wanting to open a w...

Dynamic Resize Moves Window
I am updating the value for a widget label using widget_control and set_val= ue. The string length for the label varies, so I add the /dynamic_resize ke= yword to the widget label. The issue with this is that every time the widge= t label updates, the window jumps back to the centre of the screen, which i= s irritating. It seems like reloading the value for this widget somehow ref= reshes the entire widget base, which has the keyword '/center'. Is there a = way to suppress this? ...

Re: Windows are moving when resized ?
Looks like I find the answers by myself right after I post the message on the list. I just realized that the wxMDIParentFrame toolbar might be to blame, and after adding the following code : // get toolbar height, substract it from initial position wxWindow* toolbar = MainWindow::Instance()->GetToolBar(); if (toolbar) if (toolbar->IsShown()) pos.y -= toolbar->GetSize().GetHeight(); SetSize(wxSize(minW, minH)); Move(pos); (i.e. just sliding up the y position of the window with the height of main MDI frame toolbar) all works perfectly. Is this documen...

All windows redraw when moving or resizing
Hi, I have a problem with a remote xwindows connection running kde. It runs on Reflection X in xdmcp mode. Each time I move or resize a window all other windows and icons are redrawn in kde. this doesn't happen in a gnome session. The server has kde 3.3.1 (RHEL-4) installed. It also doesn't ahppen on on older version of kde runnning on Red Hat 7.3 Does anyone know how I can prevent this annoying effect in kde? Kind regards, Wim Ok I found something myself. Apparently it is kde's window manager (kwin) which is causing the problem. When I set the environment variable KDEWIN to m...

Can you resize a (Windows) modal widget?
Can you resize a modal widget? The documentation to the /MODAL keyword of Widget_Base seems to say no: "Modal dialogs cannot be resized, regardless of the setting of the TLB_SIZE_EVENTS keyword." But I was unaware of this limitation so I went ahead and used the /TLB_SIZE_EVENTS keyword to WIDGET_BASE on my top-level base (which also includes the /modal keyword), and roughly followed the resizing method described in http://www.idlcoyote.com/widget_tips/resize_draw.html And the resizing worked fine -- so long as one was working on a Mac. But the code fails on Windows machine. So perhaps the documentation should read that modal dialogs cannot be resized on a Windows machine? Or has anyone managed to resize a modal widget under Windows? Thanks, --Wayne ...

Detecting mouse button up after resizing window
Hi, I would like to have a "resize" callback that is only executed once at the end of a resize event (ie, when the mouse button is released after dragging a corner of the main window). The code below works, but I get resize events continuously while the window is being resized. Is there a way to capture a ButtonRelease event at the end of a resize? I've tried binding to ButtonRelease events but they do not appear to be captured while the mouse pointer is on the border of a window. I guess the window manager is capturing those events. #!/usr/bin/perl -w use stric...

kde all windows redraw when moving or resizing
Hi, I have a problem with a remote xwindows connection running kde. It runs on Reflection X in xdmcp mode. Each time I move or resize a window all other windows and icons are redrawn in kde. this doesn't happen in a gnome session. The server has kde 3.3.1 (RHEL-4) installed. It also doesn't ahppen on on older version of kde runnning on Red Hat 7.3 Does anyone know how I can prevent this annoying effect in kde? Kind regards, Wim ...

How to detect when the user stoped resizing a window ?
My problem is this : I want that when the user resizes the window (by using the mouse to move its margins) : a) if the user hasn't finished dragging the margins : do nothing b) when the user released the drag and drop mouse : depending on selected size : chose a new window size from some 5 pre-set ones The windows I'm using are wxMDIChildFrame if that's any help, Win2k system, wx 2.4.1 I tried overwriting OnSize but gets called even when the user is moving window boundaries. Do I have to track mouse status (if mouse left button is up or down) or is there a simpler w...

how can i move a window without title bar?
I need to move some windows created with Labview without titlebar. Has someone tried to do this? Thanks a lot Franco Take a look G Toolbox at: &nbsp;&nbsp;&nbsp; <a href="http://gtoolbox.yeah.net" target="_blank">http://gtoolbox.yeah.net</a> ...

Can I resize Excel window from IE browser?
Thank you for reading. I am not a programmer, I can just about cobble things together using code examples, so please be gentle! [What I want to do] - I will have an application open, such as Excel or Word. - I then want to open a HTML file in MSIE. - I then want the HTML file to resize Excel to fit vertically in 75% of the screen, and the HTML file to fit the remaining 25%. Thats it, I dont know if it can be done. I have trawled through web sites with javascript examples but did not find anything that fitted the bill. I will be eternally grateful to anyone who can suggest an answer. Tha...

Resizing an OLEControl when you resize the window
I am using CLassmate and have a Crystal Report Control on a resizable dialog window. The Ole control fills the dialog window so it looks like one window. When I resize the dialog window I would also like to resize the control so it fills the dialog window. I would also like to save the coordinates so the window remembers the last settings when I open the window again. Hi Geoffrey The easy way would be to set the Alignment Mode property of the control to AUTOALIGN_CLIENT. Another way would be to figure out the new origin and size of the control's BoundingBox in the window'...

What Can Linux do that Windows can not FOR ME?
This is not meant to start a flame war. I do not mean to imply one way or another that I know the answer to this question and that is why I am asking it. Now, here is the thing, I have been using windows for about 8 years now, and I have been using linux for about 2 years on and off. So clearly my experience with to OS's is far from being on par. Currently I have Win XP and MEPIS 2004 installed on my laptop. Win XP does everything I need it to do and my Linux system is about 90% there (I am sure that in a month or two I'll have it 100% usable for my needs). So both do there job quite w...

How to detect 32-bit Tcl on Windows-x64
Hi all, I need to avoid that somebody runs my Tcl application with a 32-bit WISH on a 64-bit Windows system. I can detect the 32-bit WISH by $tcl_platform(pointerSize). Any ideas how to detect the underlying 64-bit Windows ? Regards, Rolf. On 8/31/2011 8:53 PM, Rolf Schroedter wrote: > Hi all, > I need to avoid that somebody runs my Tcl application with a 32-bit WISH > on a 64-bit Windows system. > > I can detect the 32-bit WISH by $tcl_platform(pointerSize). > > Any ideas how to detect the underlying 64-bit Windows ? > > Regards, > Rolf. See http://blogs.msdn.com/b/david.wang/archive/2006/03/26/howto-detect-process-bitness.aspx /Ashok Thanks for the link. So I guess the following test will do it if { [info exists ::env(ProgramW6432)] } { ... } On 31.08.2011 19:17, Ashok Nadkarni wrote: > On 8/31/2011 8:53 PM, Rolf Schroedter wrote: >> Hi all, >> I need to avoid that somebody runs my Tcl application with a 32-bit WISH >> on a 64-bit Windows system. >> >> I can detect the 32-bit WISH by $tcl_platform(pointerSize). >> >> Any ideas how to detect the underlying 64-bit Windows ? >> >> Regards, >> Rolf. > > See > http://blogs.msdn.com/b/david.wang/archive/2006/03/26/howto-detect-process-bitness.aspx > > > /Ashok Or, more corresponding to the link: if { [string match "*64" $::env(PROCESSOR_ARCHITECTURE)] } { puts "Okay, we are a ...

Resizing windows and child windows (again :-))
Hi again, I'll explain my problem clearer than I did before. I create a wxFrame which is my top window -> myFrame. Then I create a wxWindow as container for a wxGLCanvas with 'myFrame' as the parent -> myGLManager. And finally I create a wxGLCanvas with 'myGLManager' as the parent -> myGLRenderer. When I resize myFrame by dragging the borders, only myGLManager is resized and myGLRenderer keeps its original size and I don't know why. Can someone help me on this? Regards, TM. --------------------------------------------------------------------- ...

Peak to Peak detection for a vector on a moving window
I have a vector with size (1x300000) lets say. I wish to detect peak to peak exceptions exceeding a threshold of a certain value over each sliding window of a defined width. How can I accomplish it without using a for loop. - Narayana "Timothy " <narayanais@hotmail.com> wrote in message <jj87r4$68g$1@newscl01ah.mathworks.com>... > I have a vector with size (1x300000) lets say. I wish to detect peak to peak exceptions exceeding a threshold of a certain value over each sliding window of a defined width. How can I accomplish it without using a for loop. > >...

detecting a window from another window
Hi, I would like to find a better way of doing the following. I have a window (call it Win) that creates a new window (call it Win2). It detects if the window already exists and brings it to the front if it does (else it just creates it). Please study and try the code below to try it and then read on. The problem occurs when I reload window Win and hit the create-window button. The Win2 window is reset and reloads from scratch. I want it to just be brought to the top. In my work what I do is have the Order button bring up an order form from an item page. Then going to another item page hi...

How to maximize a window and can't be able to move it
Hi everyone, &nbsp; I'm doing an HMI and what I want to do is to maximize a window. I can do it in the VI proprieties -&gt; Window Run-Time Position -&gt; Position: Maximized. The problem I get is when I run it, the user can move the window with the title bar. &nbsp; I don't want to move the window. The window has to stay at the same place. Is there a way to do this (without taking off the title bar)? &nbsp; Thank you Stephanie Hi, &nbsp; I don't find this proprieties in the site. I only find "Move window with no titlebar". Could you please tell m...

Web resources about - How can I detect when a window has been moved or resized? - comp.lang.tcl

Darwin pool to be resized by 30 centimetres in $9m project
Federal Treasurer Joe Hockey has flown to Darwin to announce $4.5 million dollars worth of taxpayers' money will be spent on pool projects in ...


NY Solar Energy-resized-600.jpg
About Andrew I've been reporting and writing on a wide range of topics at the nexus of economics, technology, ecology/environment and society ...

These Resized Female Video Characters Aren't More 'Realistic' Than Before
Bulimia.com's resized female video game characters are a good-intentioned, but ultimately misguided, way to tackle eating disorders.

The Mortal Instruments Will Return, But Rebooted And Resized, For The Small Screen?
... you cast in the new TV series? Leave your comments below. [ Image Via Facebook ] The Mortal Instruments Will Return, But Rebooted And Resized, ...

Flurry_appDownloads_byCountry_Christmas_toNewYears2012-resized-600
Inside Network: Inside Facebook Inside Social Games Inside Mobile Apps Inside Social Commerce Research Explore Explore Popular Sections iOS Games ...

WW_AppRevenue_Ad_vs_Premium_andIAP-resized-600
TechCrunch is a leading technology media property, dedicated to obsessively profiling startups, reviewing new Internet products, and breaking ...

Aperture Wrench Opens and Closes Like a Camera Shutter, Can Be Resized for Any Job
Why bother with an entire set of wrenches, when just one can do the job? Introducing the "Aperture Wrench" by Jordan Steranka, a designer from ...


The browser's resized future in a fragmented www world
The safe option in a native jungle The Web @ 25 "We should work toward a universal linked information system, in which generality and portability ...

Resources last updated: 3/13/2016 1:46:44 PM