Menu

#2714 pack propagate not working correctly

obsolete: 8.5.7
open
50. [pack] (10)
5
2009-11-22
2009-11-22
No

Using Tcl/Tk 8.5.7, I have troubles making pack propagate work correctly. It does not seem to work back and forth. I have to set the width / height property on a packed widget after calling pack propagate xxx to have the pack propagate command effective. I will attach some code demonstrating this. In this code, if you remove the width property setting command, then it no longer works.

Discussion

  • Thomas MENEZ

    Thomas MENEZ - 2009-11-22
     
  • Peter Spjuth

    Peter Spjuth - 2009-11-22

    It's not clear to me what you want to achieve, and what it is that
    is not working.

    In general you should never have -width or -height set
    in a frame where you use propagation.

    If you need to toggle propagation I'd recommend setting -width/-height
    when propagation is turned off and setting them to 0 when propagation
    is turned on.

     
  • Thomas MENEZ

    Thomas MENEZ - 2009-11-24

    I'm simply using "pack propagate .myFrame yes" / "pack propagate .myFrame no" and expecting to see the consequence of the 'propagate' option. I'm actually designing a tcl/tk GUI design tool. See : https://sourceforge.net/projects/puretkgui/
    This tool allows to set the propagate attribute and, pureTkGUI being a WYSIWYG, you would want to see it working as soon as you select propagate yes or no. But this does not work, as I do not set the width nor height of the widget .myFrame after having called the "pack propagate .myFrame" command. Does it make sense to you ?

     
  • Peter Spjuth

    Peter Spjuth - 2011-04-04

    I can't see anything out of the ordinary here.
    When propagation is turned on, the window adapts as it should when I test it without needing to do anything else.
    When propagation is turned off, the frame is left without a manager so there really is not much to do. The user must in that case take charge and tell it what it wants, e.g. by setting width/height on the frame.

    My previous recommendation stands if you want a certain size when propagation is turned off.