widget?
En el contexto de la programación de aplicaciones visuales, los widgets tienen un significado más amplio como componente o control visual que el programador reutiliza y tienen un gran valor para el usuario, idea íntimamente ligada con el concepto de interfaz gráfica de usuario (GUI por sus siglas en inglés). Veamos algunos detalles al respecto:
Desde esta perspectiva, un widget, también conocido como artilugio o control, es un componente gráfico, o control, con el cual el usuario interactúa, como por ejemplo, una ventana, una barra de tareas o una caja de texto.
Aquí la palabra widget, vista como la posible unión de window-gadget, adquiere un significado curioso y ciertamente adecuado como artilugio o dispositivo de ventana, en este caso la ventana de una interfaz gráfica.
Los widgets a veces se califican como virtuales para distinguirlos de sus equivalentes físicos. Por ejemplo: los botones virtuales pueden oprimirse con el cursor del mouse, mientras los botones físicos pueden presionarse con los dedos.
Por regla general, suelen reunirse varios widgets en juegos de herramientas de widgets. Los programadores los usan para construir interfaces gráficas de usuario (GUI).
tomado de wikipedia en: http://es.wikipedia.org/wiki/Widgets#Origen_de_la_palabra_Widget
La clase gWidget
Asociada a la GtkWidget de GTK.
CONSTRUCTOR
No tiene un constructor.
DESCRIPTION
Es la clase básica de la que parte cualquier otro widget de GTK+, esta clase en sí misma no hace nada específico (por ejemplo: un cuadro de texto, un botón, …) para ello existen clases específicas, como las ventanas o los contenedores. Estas clases más específicas heredan de la clase GtkWidget las funciones, atributos y señales básicas que les hacen ser clases válidas para poder usarse en GTK+.
Partes esenciales de un widget
Como cualquier clase de cualquier lenguaje de programación orientado a objetos, la clase de un widget se divide en:
- Funciones: Son las funciones que permiten trabajar con dicha clase. Aquí las llamo funciones porque estamos trabajando sobre C, si fuera sobre cualquier lenguaje de programación orientado a objetos las llamaría métodos.
- Atributos (o propiedades): Son variables asociadas a la clase que identifican propiedades de ésta, por ejemplo: el color, la altura, …
- Señales: Muchos lenguajes de programación orientada a objetos no usan señales, pero en GTK+ son necesarias para controlar los eventos.
Las señales identifican el evento que se ha producido, y se deben asociar a alguna función para que GTK+ al interceptar la señal ejecute dicha función, por ejemplo: al pulsar un botón que se escriba un mensaje en un cuadro de texto, la señal sería la pulsación del botón y la función asociada a ella la escritura del mensaje en el cuadro de texto.
De este modo, en la documentación de la API de GTK+, se puede observar que cada widget se descompone en estas partes para que sepamos claramente qué se puede hacer y/o qué tareas realiza dicho widget.
tomado de: http://blog.4bits.es/aprendiendo-gtk-destripando-widgets/
FILES
/src/gclass/gwidget.prg. Librería libgclass.a
DATA
- cText
- oFont
- pCursorEnter
- nTypeCursor
- cMsgBar
- oBar
- bConfigure_Event
- bExpose_Event
- bSizeAllocate
- bFocus
- bButtonPressEvent
- bKeyPressEvent
METHODS
- Register() VIRTUAL
- Show() --> gtk_widget_show()
- Hide() --> gtk_widget_hide()
- SetBorder( nBorder ) --> gtk_container_set_border_width()
- Quit() --> gtk_main_quit()
- CheckGlade( cId )
- SetFocus() --> gtk_widget_grab_focus()
- Enable() --> gtk_widget_set_sensitive()
- Disable() --> gtk_widget_set_sensitive()
- End() --> gtk_widget_destroy()
- SetEvents( uEvents ) --> gtk_widget_set_events()
- AddEvents( uEvents ) --> gtk_wiget_add_events()
- SetFont( oFont ) --> gtk_widget_modify_font()
- Size( nWidth, nHeight ) --> gtk_widget_set_usize()
- Style( cColor, iComponent, iState )
- AddContainer( oParent ) --> gtk_container_add()
- Box_Pack_Start( oBox, lExpand, lFill, nPadding )
- Box_Pack_End( oBox, lExpand, lFill, nPadding )
- AddChild( oParent, lExpand, lFill, nPadding, lContainer, x, y, lEnd )
- Refresh() --> gtk_widget_queue_draw()
- CursorEnter()
- CursorLeave()
- ActivateCursor( nCursor )
- MsgLeave()
- MsgEnter()
- SetMsg( cMsgBar, oBar )
- OnAccelClosuresChanged( oSender ) VIRTUAL
- OnButtonPressEvent( oSender, pGdkEventButton )
- OnButtonReleaseEvent( oSender, pGdkEventButton )
- OnCanActivateAccel( oSender, nSignal_Id )
- OnChildNotify( oSender, pGParamSpec )
- OnClientEvent( oSender, pGdkEventClient )
- OnConfigure_Event( oSender, pGdkEventConfigure )
- OnDestroyEvent( oSender, pGdkEvent )
- OnDirectionChanged( oSender, nGtkTextDirection ) VIRTUAL
- OnEnterNotifyEvent( oSender, pGdkEventCrossing )
- OnEvent( oSender, pGdkEvent )
- OnEventAfter( oSender, pGdkEvent ) VIRTUAL
- OnExpose_Event( oSender, pGdkEventExpose )
- OnFocus( oSender, nGtkDirectionType )
- OnFocus_In_Event( oSender , pGdkEventFocus )
- OnFocus_Out_Event( oSender, pGdkEventFocus )
- OnGrabBrokenEvent( oSender, pGdkEvent )
- OnGrabFocus( oSender )
- OnGrabNotify( oSender, lArg1 ) VIRTUAL
- OnHide( oSender ) VIRTUAL
- OnHierarchyChanged( oSender, pWidget2 ) VIRTUAL
- OnKeyPressEvent( oSender, pGdkEventKey )
- OnKeyReleaseEvent( oSender, pGdkEventKey )
- OnLeaveNotifyEvent( oSender, pGdkEventCrossing )
- OnMap( oSender ) VIRTUAL
- OnMapEvent( oSender, pGdkEvent )
- OnMnemonicActivate( oSender, lArg1 )
- OnMotionNotifyEvent( oSender, pGdkEventMotion )
- OnNoExposeEvent( oSender, pGdkEventNoExpose )
- OnParentSet( oSender, pGtkObject ) VIRTUAL
- OnPopupMenu( oSender )
- OnRealize( oSender ) VIRTUAL
- OnPropertyNotifyEvent( oSender, pGdkEventProperty )
- OnProximityInEvent( oSender, pGdkEventProximity )
- OnProximityOutEvent( oSender, pGdkEventProximity )
- OnScreenChanged( oSender, pGdkScreen ) VIRTUAL
- OnScrollEvent( oSender, pGdkEventScroll )
- OnSelectionClearEvent( oSender, pGdkEventSelection )
- OnSelectionGet( oSender, pGtkSelectionData, nInfo, nTime )
- OnSelectionNotifyEvent( oSender, pGdkEventSelection )
- OnSelectionReceived( oSender, pGtkSelectionData, nTime )
- OnSelectionRequestEvent( oSender, pGdkEventSelection )
- OnShow( oSender ) VIRTUAL
- OnShowHelp( oSender, nGtkWidgetHelpType )
- OnSizeAllocate( oSender, GtkAllocation )
- OnSizeRequest( oSender, pGtkRequisition ) VIRTUAL
- OnStateChanged( oSender, nGtkStateType ) VIRTUAL
- OnStyleSet( oSender, pGtkStyle_previous_style ) VIRTUAL
- OnUnMap( oSender ) VIRTUAL
- OnUnMapEvent( oSender, pGdkEvent )
- OnUnRealize( oSender ) VIRTUAL
- OnVisibilityNotifyEvent( oSender, pGdkEventVisibility )
- OnWindowStateEvent( oSender, pGdkEventWindowState )






