GdkColor color;
gdk_color_parse ("red", &color);
gtk_widget_modify_fg (widget, GTK_STATE_NORMAL, &color);
METHOD SetColor( cColor ) INLINE GtkSetColor( ::hWnd, cColor )
#pragma BEGINDUMP
#include <hbapi.h>
#include <gtk/gtk.h>
HB_FUNC( GTKSETCOLOR )
{
GdkColor color;
gdk_color_parse( hb_parc( 1 ), &color );
gtk_widget_modify_fg( ( GtkWidget * ) hb_parnl( 1 ), GTK_STATE_NORMAL, &color );
}
#pragma ENDDUMP
btnSelect:SetColor("red")
METHOD SetColor( cColor ) INLINE MsgInfo( "red"), GtkSetColor( ::hWnd, cColor )
#pragma BEGINDUMP
#include <hbapi.h>
#include <gtk/gtk.h>
HB_FUNC( GTKSETCOLOR )
{
GdkColor color;
gdk_color_parse( "red", &color );
gtk_widget_modify_fg( ( GtkWidget * ) hb_parnl( 1 ), GTK_STATE_NORMAL, &color );
}
#pragma ENDDUMP
gtk_widget_modify_fg
gtk_widget_modify_bg
typedef enum
{
GTK_STATE_NORMAL,
GTK_STATE_ACTIVE,
GTK_STATE_PRELIGHT,
GTK_STATE_SELECTED,
GTK_STATE_INSENSITIVE
} GtkStateType;
gtk_widget_modify_fg ()
void gtk_widget_modify_fg (GtkWidget *widget,
GtkStateType state,
const GdkColor *color);
gtk_widget_modify_bg ()
void gtk_widget_modify_bg (GtkWidget *widget,
GtkStateType state,
const GdkColor *color);
gtk_widget_modify_text ()
void gtk_widget_modify_text (GtkWidget *widget,
GtkStateType state,
const GdkColor *color);
gtk_widget_modify_base ()
void gtk_widget_modify_base (GtkWidget *widget,
GtkStateType state,
const GdkColor *color);
METHOD SetColor( cColor ) INLINE MsgInfo( "red"), GtkSetColor( ::hWnd, cColor )
#pragma BEGINDUMP
#include <hbapi.h>
#include <gtk/gtk.h>
HB_FUNC( GTKSETCOLOR )
{
GdkColor color;
GdkColor acolor;
gdk_color_parse( "red", &color );
gdk_color_parse( "yellow", &acolor );
gtk_widget_modify_bg( ( GtkWidget * ) hb_parnl( 1 ), GTK_STATE_NORMAL, &color );
gtk_widget_modify_bg( ( GtkWidget * ) hb_parnl( 1 ), GTK_STATE_PRELIGHT, &acolor );
}
#pragma ENDDUMP
METHOD SetColor( cColor ) INLINE GtkSetColor( ::hWnd, cColor )
#pragma BEGINDUMP
#include <hbapi.h>
#include <gtk/gtk.h>
HB_FUNC( GTKSETCOLOR )
{
GdkColor color;
gdk_color_parse( hb_parc( 2 ), &color );
gtk_widget_modify_fg( ( GtkWidget * ) hb_parnl( 1 ), GTK_STATE_NORMAL, &color );
}
#pragma ENDDUMP
METHOD SetColor( cColor, iState ) INLINE GtkSetColor( ::hWnd, cColor, iState )
#pragma BEGINDUMP
#include <hbapi.h>
#include <gtk/gtk.h>
HB_FUNC( GTKSETCOLOR )
{
GdkColor color;
gdk_color_parse( hb_parc( 2 ), &color );
gtk_widget_modify_bg( ( GtkWidget * ) hb_parnl( 1 ), hb_parni( 3 ), &color );
}
#define GTK_NORMAL 1
#define GTK_ACTIVE 2
#define GTK_PRELIGHT 3
#define GTK_SELECTED 4
#define GTK_INSENSITIVE 5
#define GTK_NORMAL 0
#define GTK_ACTIVE 1
#define GTK_PRELIGHT 2
#define GTK_SELECTED 3
#define GTK_INSENSITIVE 4
METHOD SetColor( cForeColor[, cBackColor[, cTextColor[, cBaseColor [, nState]]]] )
#define GTK_FOREGROUND 1
#define GTK_BACKGROUND 2
#define GTK_TEXT 3
#define GTK_BASE 4
aGTK_Colors := ARRAY( 4 )
aGTK_Colors[GTK_BACKGROUND] := "red"
aGTK_Colors[GTK_TEXT] := "black"
btnEXAMPLE:SetColors( aGTK_Colors, GTK_PRELIGHT )
LOCAL iLen
iLen := LEN( aColors )
IF iLen < 0
RETURN
ENDIF
IF !Empty( a Colors[1] )
GtkSetFGColor( ::hWnd, aColors[1], iState )
ENDIF
IF iLen < 2
RETURN
ENDIF
IF !EMPTY( aColors[2] )
GtkSetBGColor( ::hWnd, aColors[2], iState )
ENDIF
Return to FiveLinux / FiveDroid (Android)
Users browsing this forum: No registered users and 2 guests