Yes, the only way to refer to aliases existing in several toplevels is
to use 'TopLevel1.Somealias' (this is new in 1.5)

If you only use 'Somealias' it will point to the widget in the last
toplevel
where this alias was defined.

If you only use one toplevel though, it is fine to use 'Somealias'. Or,
after you copy the widget into another toplevel, you could change its
alias.

The difference between widget(MyButton) and MyButton:

$widget(MyButton) gives the widget name which is by extension its command;
so you can write:
     $widget(MyButton) configure -background red
or
     if {[winfo exists $widget(MyButton)]} ...

MyButton is the widget command, it cannot be used as a widget path; so you
can
write:
     MyButton configure -background red
but you cannot write:
          if {[winfo exists MyButton]} ...

     but you can write:
          if {[winfo exists $widget(MyButton)]} ...

It is possible some settings are lost while copying/pasting, but I would
really
like a sample to reproduce it.

Scrollbar widths are now never saved, this is to improve cross-platform
support.
If you do want your scrollbar widths to be saved, however, edit the file
scrollbar.wgt and remove the following line:

DontSaveOptions -width

CG



|--------+------------------------------------->
|        |          Stef Pillaert              |
|        |          <[EMAIL PROTECTED]>  |
|        |          Sent by:                   |
|        |          [EMAIL PROTECTED]|
|        |          eforge.net                 |
|        |                                     |
|        |                                     |
|        |          03/27/2001 04:59 AM        |
|        |          Please respond to vtcl-user|
|        |                                     |
|--------+------------------------------------->
  
>-----------------------------------------------------------------------------------------------------------|
  |                                                                                    
                       |
  |       To:     [EMAIL PROTECTED]                                      
                       |
  |       cc:                                                                          
                       |
  |       Fax to:                                                                      
                       |
  |       Subject:     [vtcl-user] aliases and copied toplevels: is my style bad?      
                       |
  |                                                                                    
                       |
  
>-----------------------------------------------------------------------------------------------------------|




(Using CVS from 27 march...)
When copying a toplevel (automatic aliasing on), the new toplevel indeed
gets
a new alias (e.g. Toplevel1), thanks. All the aliases of the widgets in
both
toplevels stay the same (probably as desired). But I had the habbit of
writing
things like:

$widget(Button_to_exit) invoke

Now, since two widgets have this alias (both in the original toplevel as in
the copied toplevel), there is confusion (and so: errors...).

Is (was?) this a bad coding style I was using, so, is writing
"Toplevel1.Somealias" the only way aliases can be used in a safe way? It
probably is...

BTW, what exactly is the difference between writing "$widget(Somealias)"
and "Somealias", since both seem to be advised in the startup tips? Is the
$widget(...) notation only necesarry inside procedures (because "widget"
can be
declared global)?

Thanks,
Stef.

P.S. copying toplevels also loses some settings of subwidgets (sizes of
comboboxes, sizes of scrollbars,...)


_______________________________________________
vtcl-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/vtcl-user




_______________________________________________
vtcl-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/vtcl-user

Reply via email to