Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

menubar
I am using a horizontal menubar (Tk8.x) for a gui based on the method
described by Brent Welch. I use the man pages a lot for checking syntax and
options but the menubar man page in fact covers the tk_menuBar procedure
which is deprecated from TK4.0 onwards not the widget.

Is this an error in the man pages or have I missed something?

Ian

Report this thread to moderator Post Follow-up to this message
Old Post
Ian Bell
04-27-05 01:58 AM


Re: menubar
Ian Bell wrote:
> I am using a horizontal menubar (Tk8.x) for a gui based on the method
> described by Brent Welch. I use the man pages a lot for checking syntax an
d
> options but the menubar man page in fact covers the tk_menuBar procedure
> which is deprecated from TK4.0 onwards not the widget.
>
> Is this an error in the man pages or have I missed something?
>
> Ian

Is _what_ an error? That tk_menuBar is deprecated? I doubt it's an
error. The recommended way to create a menubar these days is to create a
menu, then associate that with a toplevel. It's very simple:

menu .menubar
menu .menubar.fileMenu
menu .menubar.editMenu
...
.menubar add cascade -label File -menu .menubar.fileMenu ...
.menubar add cascade -label Edit -menu .menubar.editMenu ...
...
. configure -menu .menubar


Report this thread to moderator Post Follow-up to this message
Old Post
Bryan Oakley
04-27-05 01:58 AM


Re: menubar
Bryan Oakley wrote:

>
> Is _what_ an error? That tk_menuBar is deprecated?

No, that when I select the menubar man page I do not get a page describing
the menubar *widget* but instead one describing the tk_menuBar *proc*.

> I doubt it's an
> error. The recommended way to create a menubar these days is to create a
> menu, then associate that with a toplevel. It's very simple:
>
> menu .menubar
> menu .menubar.fileMenu
> menu .menubar.editMenu
> ...
> .menubar add cascade -label File -menu .menubar.fileMenu ...
> .menubar add cascade -label Edit -menu .menubar.editMenu ...
> ...
> . configure -menu .menubar

Yup, that's what I am doing. I realise now that I was confusing the naming
of the *menu* widget as .menubar and kept thinking of the *menubar* widget
rather than a menu widget *named* .menubar.

I think I will name the top menu something not similar to a widget name from
now on. So my code will look something like.

menu .topmenu
. config -menu .topmenu
foreach m {File Edit Help} {    # or whatever
set $m [menu .topmenu.m$m]
.topmenu add cascade -label $m -menu .topmenu.m$m
}
etc

Ian

Report this thread to moderator Post Follow-up to this message
Old Post
Ian Bell
04-27-05 01:58 AM


Re: menubar

Ian Bell wrote:
> Bryan Oakley wrote:
>
> 
>
>
> No, that when I select the menubar man page I do not get a page describing
> the menubar *widget* but instead one describing the tk_menuBar *proc*.
>
> 
>
>
> Yup, that's what I am doing. I realise now that I was confusing the naming
> of the *menu* widget as .menubar and kept thinking of the *menubar* widget
> rather than a menu widget *named* .menubar.
>
> I think I will name the top menu something not similar to a widget name fr
om
> now on. So my code will look something like.
>
> menu .topmenu
> . config -menu .topmenu
> foreach m {File Edit Help} {    # or whatever
>     set $m [menu .topmenu.m$m]
>     .topmenu add cascade -label $m -menu .topmenu.m$m
> }
> etc
>
> Ian

I think you have it now, but just to clarify -
there is NOT a menubar *widget*  in Tk.

Bruce


Report this thread to moderator Post Follow-up to this message
Old Post
Bruce Hartweg
04-27-05 08:59 AM


Re: menubar
Bruce Hartweg wrote:

>
> I think you have it now, but just to clarify -
> there is NOT a menubar *widget*  in Tk.
>
> Bruce

I just twigged that. What  me is that there is a man entry for
tk_menuBar AND plain menubar both of which end up at the *same* man page.

I am now going off to confuse myself further with message and messageBox
(tk_messageBox) ;-)

Thanks for your help.

Ian

Ian

Report this thread to moderator Post Follow-up to this message
Old Post
Ian Bell
04-27-05 09:00 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Tcl archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:33 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.