| Store | Cart

Re: [TCLCORE] RE : CFV: TIP #454: Automatically Resize Frames After Last Child Removed

From: Koen Danckaert <Koen...@synopsys.com>
Wed, 26 Oct 2016 15:53:18 +0000
Hi,

These 2 tests are failing because after the [pack forget] the window has collapsed to 1x1, as expected. The tests then use [place .t] to put the text widget back, but the [place] window manager does not propagate sizes to its master window. So, to  make the tests succeed again, the root window size should be configured before [place], e.g. with [. configure -width 400 -height 200].

I have to say though that I'm getting less sure about this TIP. I found some comments in the code indicating that the old behaviour was not so much a design choice, but rather an implementation issue. Specifically, this comment in tkGrid.c:1735.

    /*
     * If the master has no slaves anymore, then don't do anything at all:
     * just leave the master's size as-is. Otherwise there is no way to
     * "relinquish" control over the master so another geometry manager can
     * take over.
     */

The current patch for TIP 454 bypasses this by doing the Tk_GeometryRequest() immediately instead of at idle time. The result is that another geometry manager can still take over, but it introduces some flickering (collapse + expand):

  pack [text .t]
  pack forget .t; grid .t
  grid forget .t; pack .t

Regards,
Koen


> -----Original Message-----> From: Harald Oehlmann [mailto:hara...@elmicron.de]> Sent: 26 October 2016 10:44> To: Francois Vogel <fvog...@free.fr>; tcl-...@lists.sourceforge.net> Subject: Re: [TCLCORE] RE : CFV: TIP #454: Automatically Resize Frames> After Last Child Removed> > Am 25.10.2016 um 21:16 schrieb Francois Vogel:> >> Test cases proposal committed to branch [tip-454].> >> > What I don't clearly understand is why we need a test for each widget> > that can be packed/gridded, i.e. frame and labelframe and so on. The> > change is in the pack and grid command implementation, not in those> > widgets themselves.> > Ok, I will delete the ttk::frame and ttk::labelframe tests.> > >> > I would rather have focussed on each path leading to the changed code.> > Is it the case with the tests you are proposing?> > Ok, inspeced the code and tried to cover all pathes:> grid/pack forget with/without propagation> destroy> configure -in ;-)> Comitted by [aac88748]> > We have the following new test failures compared to current> core-8-6-branch [564436a8] (all with tcl8.6.6 release) (current> core-8-6-branch has no failures on Win Vista 32 bit by the way):> > ==== textWind-11.1 EmbWinDisplayProc procedure, geometry transforms> FAILED> ==== Contents of test case:> >      .t insert 1.0 "Some sample text">      pack forget .t>      place .t -x 30 -y 50>      frame .f -width 30 -height 20 -bg $color>      .t window create 1.12 -window .f>      update>      winfo geom .f> > ---- Result was:> 1x1+0+0> ---- Result should have been (exact matching):> 30x20+119+55> ==== textWind-11.1 FAILED> > > > ==== textWind-11.2 EmbWinDisplayProc procedure, geometry transforms> FAILED> ==== Contents of test case:> >      .t insert 1.0 "Some sample text">      pack forget .t>      place .t -x 30 -y 50>      frame .t.f -width 30 -height 20 -bg $color>      .t window create 1.12 -window .t.f>      update>      winfo geom .t.f> > ---- Result was:> 1x1+0+0> ---- Result should have been (exact matching):> 30x20+89+5> ==== textWind-11.2 FAILED> > Could someone comment on those ?> > Thank you,> Harald> > ------------------------------------------------------------------------------> The Command Line: Reinvented for Modern Developers> Did the resurgence of CLI tooling catch you by surprise?> Reconnect with the command line and become more productive.> Learn the new .NET and ASP.NET CLI. Get your free copy!> http://sdm.link/telerik> _______________________________________________> Tcl-Core mailing list> Tcl-...@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/tcl-core

------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Tcl-Core mailing list
Tcl-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcl-core

Recent Messages in this Thread
Francois Vogel Oct 25, 2016 07:16 pm
Harald Oehlmann Oct 26, 2016 08:44 am
Koen Danckaert Oct 26, 2016 03:53 pm
Harald Oehlmann Oct 26, 2016 04:04 pm
Harald Oehlmann Oct 26, 2016 04:56 pm
Harald Oehlmann Oct 31, 2016 11:33 am
Francois Vogel Oct 31, 2016 01:17 pm
Brian Griffin Oct 31, 2016 01:31 pm
Harald Oehlmann Oct 31, 2016 01:44 pm
Francois Vogel Nov 07, 2016 09:36 pm
Harald Oehlmann Nov 08, 2016 08:25 am
Messages in this thread