Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8815685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:26:22+00:00 2026-06-14T04:26:22+00:00

Gridded toplevel windows in Windows XP doesn’t seem to restrict the user from resizing

  • 0

Gridded toplevel windows in Windows XP doesn’t seem to restrict the user from resizing in multiples of a number. It works in X, but not in Windows. I can resize to any pixel size.

Doesn’t the Windows windows manager support it? Can i do it manually, maybe by binding some commands to the resize event of the toplevel?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:26:23+00:00Added an answer on June 14, 2026 at 4:26 am

    You’re correct that it doesn’t really work on Windows (this is also true for Mac OS X/Aqua) and it is because the window manager itself doesn’t support the feature. You have to synthesize it with some scripts. However the real complication is that a typical gridded window is more than just the one gridded window; there’s some extra space around it which can make the updated size go into the next grid size up and that makes the window expand a bit and resize again… and again and again…

    Thus, we need a two-stage initialization, first measuring the real size of the extra space we have to allow for and only then applying the enforcement code.

    package require Tk
    
    proc initGrid {window w h} {
        # Do nothing for subwindows
        if {$window ne [winfo toplevel $window]} return
    
        lassign [wm grid $window] xcount ycount xstep ystep
        set wExtra [expr {$w - $xcount*$xstep}]
        set hExtra [expr {$h - $ycount*$ystep}]
        bind $window <Configure> [list resizeGrid $wExtra $hExtra %W %w %h]
    }
    proc resizeGrid {wExtra hExtra window w h} {
        # Do nothing for subwindows
        if {$window ne [winfo toplevel $window]} return
    
        lassign [wm grid $window] xcount ycount xstep ystep
        if {$w-$wExtra != $xcount*$xstep || $h-$hExtra != $ycount*$ystep} {
            set w [expr {($w - $wExtra)/$xstep}]
            set h [expr {($h - $hExtra)/$ystep}]
            wm grid $window $w $h $xstep $ystep
        }
    }
    
    pack [text .t -setgrid 1] -fill both -expand 1
    bind . <Configure> {initGrid %W %w %h}
    

    As you can see, this isn’t particularly simple to get right!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have xyz textfiles that need to be gridded. For each xyz file i
I have requirements to prompt the user for confirmation when dragging and dropping a
I'd like to hava a Dojo dojox.grid.DataGrid with its data from a servlet. Problem:
I want to be able to drag items from Grid1 to Grid2 and then
I am looking for a good storage format for large, gridded datasets. The application
I have an application which reads in gridded coordinate data with values (i.e. lat,
I would like to drag a row from a JQGrid to a text input
I am trying to map an irregularly gridded dataset (raw satellite data) with associated
I've been playing with Scipy's inline tool (via weave) for fun, but I'm running
I am using MVC and jquery to pull in a function from the server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.