Hi Livio,
Thanks for your answer, unfortunately this doesn't solve my problem. The 
reason is that widget do permit two different 'states'. One you can set with 
'set_enabled()' and control it with 'is_enabled()' - just as you explained. 
This only unables a widget but doesn't touch the visibility - it is still 
shown on your form. 
If you want to hide a widget and only show it on certain circumstances you can 
do:

hk_thisform.get_pyvisible(mywidget).hide_widget()

and to make it visible you can do 

hk_thisform.get_pyvisible(mywidget).show_widget()

What I didn't find until now is a routine corresponding to 'is_enabled' which 
controls if a widget is visible or hidden (for example something 
like 'is_visible()).

Regards,
MIchael




There is another possibility 
Am Donnerstag, 13. März 2008 schrieb archimede:
> [Hk-classes-discuss] on controlling the 'visiblity' of a widget
>
> hi, if i understand your problem, i prepared this:
>
> a form with one text label field_0
>               button     field_4      with label 'enabler'
>               button     field_2      with label 'state'
>
>
> code for the 'on open' action of the form
>
>       TxtLbl=hk_thisform.get_pyvisible('field_0')
>       BtnEna=hk_thisform.get_pyvisible('field_4')
>       BtnSta=hk_thisform.get_pyvisible('field_2')
>
>
> code for button enabler
>
>       lbl_state=TxtLbl.is_enabled()
>       if lbl_state==1:
>       TxtLbl.set_enabled(0)
>       elif lbl_state==0:
>       TxtLbl.set_enabled(1)
>
>
> code for the button state
>
>       show_state=TxtLbl.is_enabled()
>       if show_state==1:
>               msg='enable '+str(show_state)
>       elif show_state==0:
>               msg='disable '+str(show_state)
>       show_warningmessage(msg)
>
> white the enabler button you can change the state of the text label
> and whit the button state a message box show you the enable state of
> the
> text label
>
> i hope answer your question
>
> about horst he doesn't appear from many times
> i'm afraid something bad happend
> knoda is strong, i use its for my administration daily
> a hope someone in future going on with the development
>
> ciao livio
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Hk-classes-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/hk-classes-discuss



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Hk-classes-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hk-classes-discuss

Reply via email to