in the man pages i read that anchor is a allowed tag of pack, label,
etc... so i tried to create a menu with starts in the left top corner...
i used -anchor nw (in both label and pack) but the labels are still
centered :-(
any suggestions?
thanks.
bye
denis
Could you give us an example.
--
Paul Duffin
DT/6000 Development Email: pdu...@hursley.ibm.com
IBM UK Laboratories Ltd., Hursley Park nr. Winchester
Internal: 7-246880 International: +44 1962-816880
>
>
> Could you give us an example.
>
> --
> Paul Duffin
> DT/6000 Development Email: pdu...@hursley.ibm.com
> IBM UK Laboratories Ltd., Hursley Park nr. Winchester
> Internal: 7-246880 International: +44 1962-816880
hallo,
ok here is the example:
frame .mbar -relief raised
menubutton .mbar.file -text Datei -anchor nw -relief flat\
-underline 0 -menu .mbar.file.menu
menubutton .mbar.mark -text Auswahl -anchor nw -relief flat\
-underline 0 -menu .mbar.mark.menu
canvas .l
pack .mbar .l -side top -padx 3p
pack .mbar.file .mbar.mark -side left -anchor nw -fill y
the menu is still centered!
thanks for the help
denis
The way that I normally try and fix this problem is to make the
background of each component a different colour so that I can determine
the dimensions of them correctly.
e.g.
.mbar configure -bg red
.l configure -bg blue
.mbar.file configure -bg yellow
.mbar.mark configure -bg green
. configure -bg pink
If you do this you can see that the problem is that the mbar is centered
and does not extend across the top of the window. To fix this do the
following.
pack .mbar -expand 1 -fill x
I must say that I prefer using the grid geometry manager when I can as
I find it much easier to use especially when controlling resizing
behaviour.
Your problem is on the above line. It should be:
pack .mbar .l -side top -padx 3p -fill x
Though you probably (i.e. if you want good resizing behaviour) ought
to go with the following two lines instead:
pack .mbar -side top -padx 3p -fill x
pack .l -side top -padx 3p -fill both -expand 1
The problem was that .mbar wasn't filling the whole of the top of the
window, so although the menubuttons were at the left of the menubar,
the menubar wasn't the shape you expected. It is usually most
instructive to do the following when having packer problems:
. conf -bg green
(either that, or try raising the windows you can't see :^)
> pack .mbar.file .mbar.mark -side left -anchor nw -fill y
You definitely don't need the "-anchor nw" and you are probably better
off (under Tk8 at least) using the new menubar mechanism. It's easier
too...
Donal.
--
Donal K. Fellows http://www.cs.man.ac.uk/~fellowsd/ fell...@cs.man.ac.uk
Department of Computer Science, University of Manchester, U.K. +44-161-275-6137
--
If you staple a penguin to the head of a gnu, the result won't catch herring...