Bwidget Source Code
View Ticket
Not logged in
Ticket UUID: 378209fe023935a5308af7e6a345ab945bc36202
Title: Unknown options error for ProgressDlg and PasswdDlg
Type: Bug Version: main
Submitter: oehhar Created on: 2025-02-21 17:29:16
Subsystem: bwidget 1.x Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2025-08-05 15:13:55
Resolution: None Closed By: nobody
    Closed on:
Description:

Reported by private E-Mail:

% ProgressDlg .p
% .p configure
unknown option "-geometry"
% PasswdDlg .d
% .d configure
unknown option "-anchor"

Thanks, Harald

User Comments: anonymous (claiming to be TWu) added on 2025-08-05 15:13:55:
Hello Harald,

yes, my proposal was only a quick-and-dirty-solution and You was right to stop it.
Please revert/delete the commit.
I go very deep inside BWidget and think to know the right way now.

First, the constructs with "#<classname>" is mainly for widgets from old 1.9.x BWidget,
which construct and divide with it their data-arrays in global level/namespace.
(Sorry, my proposal comes from my old ActiveTcl 8.6.4.1.)
New version 1.10.x use other algorithms, own namespaces, and there inside data-arrays
for each widget instance.

Second, both widgets *LEFT* a call to "Widget::init".
They only do a "Widget::initFromODB", which is not enough.
This is the part, why we do not get all data structures and proc's up, and
no checks of parameters and values.
By the way, the "init" does much more than "initFromODB".
So we should *ADD* it just before "initFromODB", to get the priority
default-value -> ODB-value -> parameter-value (-> this is used).

The same is for the new Calendar proposal (I send it separate)!

Hope, this helps to fix all BWidgets version 1.10.x.
Best greetings to You,
Thomas W.

oehhar added on 2025-06-24 18:45:01:

Thank you for the proposal. Here is the test branch for ProgressDlg and PasswdDlg: commit [1119d44d62] in branch [378209fe-map-to-parent-class].

Then, only the options of Dialog are returned by the configure method:

% ProgressDlg .p
.p
% join [lsort [.p configure]] \n
-anchor anchor Anchor c e
-background background Background SystemButtonFace SystemButtonFace
-bg background
-bitmap bitmap Bitmap {} {}
-cancel cancel cancel -1 -1
-class class Class Dialog ProgressDlg
-default default Default -1 -1
-geometry geometry geometry {} {}
-homogeneous homogeneous homogeneous 1 1
-image image Image {} image1
-modal modal modal local none
-padx padX Pad 10 1
-pady padY Pad 1 1
-parent parent parent {} {}
-place place place center center
-separator separator separator 0 0
-side side side bottom bottom
-spacing spacing spacing 10 10
-state state State normal normal
-title title title {} {}
-transient transient transient 1 1

The documentation lists the following options:

  • STANDARD OPTIONS: -font -textvariable
  • OPTIONS from Dialog: -background -bg -parent -separator -title
  • OPTIONS from ProgressBar: -background -bg -borderwidth -bd -foreground -fg -maximum -relief -troughcolor -type -variable
  • WIDGET-SPECIFIC OPTIONS: -command -height -stop -width

This is not in-line with the returned options. The returned options are those from the Dialog command. See the default class "Dialog" and the current class "ProgressDlg".

Here a bit of archelogy:

% parray Widget::_class
Widget::_class(.help_shell)    = DynamicHelp
Widget::_class(.p)             = Dialog
Widget::_class(.p#ProgressDlg) = ProgressDlg
Widget::_class(.p.bbox)        = ButtonBox
Widget::_class(.p.frame.pb)    = ProgressBar

By querying ".p", the Dialog class is used. By querying ".p#ProgressDlg", the right class is used, but an error is thrown.

About the "SelectColor::use" in pckIndex.tcl, this is moved to new ticket [c847b2c6].

THanks for all, Harald


anonymous (claiming to be (TWu)) added on 2025-06-24 08:21:03:
Solution is deleting the "#class-name" from the calls of ::Widget::cget and ::Widget::configure, but only outside of "create" command. This is needed for passwddlg.tcl, progressdlg.tcl and font.tcl.

Second, for BWidget knows the command "use" for SelectColor, please add in pkgInit.tcl the command "::SelectColor::use" right at the end of the definition list for it.

oehhar added on 2025-02-21 17:59:37:

To make this work, I have to remove all dialog options from those widgets:

From (passwddlg.tcl, Line 16)

namespace eval PasswdDlg {
    Widget::define PasswdDlg passwddlg Dialog LabelEntry

    Widget::bwinclude PasswdDlg Dialog :cmd \
	    remove     {-image -bitmap -side -default -cancel -separator} \

to

namespace eval PasswdDlg {
    Widget::define PasswdDlg passwddlg Dialog LabelEntry

    Widget::bwinclude PasswdDlg Dialog :cmd \
	    remove     {-image -bitmap -side -default -cancel -separator\
	    -anchor -geometry ....
	    } \

This is IMHO not a solution. There is something else not working.

Any proposal appreciated, Harald