Bwidget Source Code
Check-in [027986893f]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:* mainframe.tcl: Fixed _destroy to unset ALL state variables, so that when a new MainFrame of the same name as an old one is created, it doesn't pick up residual state from the old one.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 027986893f12e3f2b3777c852bd7bcdf7b3228e3
User & Date: ericm 1999-09-19 22:40:00
Context
1999-09-21
01:50
Implemented the new configuration option -side, which allows the selection of the side for the notebook tabs. Possible values are "top" and "bottom". check-in: 5afb5e2005 user: sven tags: trunk
1999-09-19
22:40
* mainframe.tcl: Fixed _destroy to unset ALL state variables, so that when a new MainFrame of the same name as an old one is created, it doesn't pick up residual state from the old one. check-in: 027986893f user: ericm tags: trunk
1999-09-17
23:22
Removed unused call to SC_PROG_TCLSH check-in: fd7def4279 user: wart tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.







1
2
3
4
5
6
7




8
9
10
11
12
13





1999-09-17  Eric Melski  <[email protected]

	* mainframe.tcl: Modified menu creation/setmenustate functions to support
	a new model of menustate.  Instead of enabling/disabling a menu item 
	whenever any one of its tags changes state, now it only enables menu items
	if all of its tags are set.  This makes it really easy to, say, only enable
	the "New Action" entry if both a project is open and an element is selected.





1999-09-16  Eric Melski  <[email protected]>

	* notebook.tcl: Added some (non-functional) code for doing
	tab-notebooks with the tabs on the bottom.

>
>
>
>
>
>







>
>
>
>






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
1999-09-19  Eric Melski  <[email protected]>

	* mainframe.tcl:  Fixed _destroy to unset ALL state variables, so that
	when a new MainFrame of the same name as an old one is created, it doesn't
	pick up residual state from the old one.

1999-09-17  Eric Melski  <[email protected]

	* mainframe.tcl: Modified menu creation/setmenustate functions to support
	a new model of menustate.  Instead of enabling/disabling a menu item 
	whenever any one of its tags changes state, now it only enables menu items
	if all of its tags are set.  This makes it really easy to, say, only enable
	the "New Action" entry if both a project is open and an element is selected.

	* buttonbox.tcl: Added tagging mechanism to buttonbox.  When using
	$bbox add, the first parameter is a list of tags for the button.  Then
	use $bbox setbuttonstate to change the state of a tag.

1999-09-16  Eric Melski  <[email protected]>

	* notebook.tcl: Added some (non-functional) code for doing
	tab-notebooks with the tabs on the bottom.

Changes to mainframe.tcl.

1
2
3
4
5
6
7
8
9
10
11
...
359
360
361
362
363
364
365








366
367
368

369
370
371
372
373
374
375
# ------------------------------------------------------------------------------
#  mainframe.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: mainframe.tcl,v 1.2 1999/09/17 17:46:47 ericm Exp $
# ------------------------------------------------------------------------------
#  Index of commands:
#     - MainFrame::create
#     - MainFrame::configure
#     - MainFrame::cget
#     - MainFrame::getframe
#     - MainFrame::addtoolbar
................................................................................
# ------------------------------------------------------------------------------
proc MainFrame::_destroy { path } {
    variable _widget

    Widget::destroy $path
    catch {destroy [$_widget($path,top) cget -menu]}
    $_widget($path,top) configure -menu {}








    unset _widget($path,top)
    unset _widget($path,ntoolbar)
    unset _widget($path,nindic)

    rename $path {}
}


# ------------------------------------------------------------------------------
#  Command MainFrame::_create_menubar
# ------------------------------------------------------------------------------


|







 







>
>
>
>
>
>
>
>
|
|
|
>







1
2
3
4
5
6
7
8
9
10
11
...
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# ------------------------------------------------------------------------------
#  mainframe.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: mainframe.tcl,v 1.3 1999/09/19 22:40:00 ericm Exp $
# ------------------------------------------------------------------------------
#  Index of commands:
#     - MainFrame::create
#     - MainFrame::configure
#     - MainFrame::cget
#     - MainFrame::getframe
#     - MainFrame::addtoolbar
................................................................................
# ------------------------------------------------------------------------------
proc MainFrame::_destroy { path } {
    variable _widget

    Widget::destroy $path
    catch {destroy [$_widget($path,top) cget -menu]}
    $_widget($path,top) configure -menu {}

    # [email protected]
    # We really want to unset ALL of the state vars, not just some of them
    # Otherwise, if we ever create a MainFrame with the same pathname, it has
    # some residual (incorrect) state.
    foreach var [array names _widget $path*] {
	unset _widget($var)
    }
#    unset _widget($path,top)
#    unset _widget($path,ntoolbar)
#    unset _widget($path,nindic)
    # [email protected]
    rename $path {}
}


# ------------------------------------------------------------------------------
#  Command MainFrame::_create_menubar
# ------------------------------------------------------------------------------