Hola, hice una ventana con Glade, entre otras cosas, tiene un Label y un
Entry que quiero que inicialmente este ocultas, y dependiendo de lo que
haya ingresado en otro Entry, debe mostrarse u ocultarse, como puedo
hacer esto?
Gracias,
GVS
Aqui pego el codigo, tomado de tests\native\glade.prg, he intentado con
gtk_widget_hide(entCPsw:pWidget), pero nada.
/*
* $Id: glade.prg,v 1.2 2005/02/17 09:47:18 TheQuim Exp $
* Ejemplo de uso de control de widgets a traves de glade
* Porting Harbour to GTK+ power !
* (C) 2004-05. Rafa Carmona -TheFull-
* (C) 2004-05. Joaquim Ferrer
*/
#define CRLF HB_OsNewLine()
#include "gtkapi.ch"
func gtk_exit( widget ) ; gtk_main_quit() ; return( .f. )
function main( )
local xml, window, wndMain
local btnCanc, btnAcep, entUsua, entPswr, entCPsw, lblCPsw
*? "Probando"
*Wait
/* Cargando interface */
xml = glade_xml_new( "cu.glade" )
/* Recuperando widget ventana a partir de su identificador */
window = glade_xml_get_widget( xml, "wndAcceso" )
gtk_window_set_position(window,GTK_WIN_POS_CENTER)
/* Conectando salida controlada */
gtk_signal_connect( window, "delete_event", "Salida" )
/* Conectando salida directa */
gtk_signal_connect( window, "destroy", "gtk_exit" )
/* Recuperando widget's a partir de su identificador */
btnCanc = glade_xml_get_widget( xml, "btnCancelar" )
btnAcep = glade_xml_get_widget( xml, "btnAceptar" )
entUsua = glade_xml_get_widget( xml, "Entry1" )
entPswr = glade_xml_get_widget( xml, "Entry2" )
entCPsw = glade_xml_get_widget( xml, "Entry3" );
gtk_widget_hide(entCPsw:pWidget)
lblCPsw = glade_xml_get_widget( xml, "Label3" ); gtk_widget_hide(lblCPsw)
/* Conectando al menu_item una accion */
gtk_signal_connect( btnCanc, "clicked", "show_action" )
/* start the event loop */
gtk_main()
return 0
function Salida( widget )
if ( MsgBox( "Quieres salir", GTK_MSGBOX_OK+GTK_MSGBOX_CANCEL,;
GTK_MSGBOX_INFO ) == GTK_MSGBOX_OK )
return .f. // Salimos y matamos la aplicacion.
endif
return .t.
function show_action(widget)
local name := "El identificador en archivo XML de este widget es : "
name += glade_get_widget_name(widget) + CRLF + version()
msginfo( name )
return .t.