Problem with GtkRcFlags with win32/cygwin



Hi,
in my Linux program I use something like to change the background color of the mainWindow:

GtkRcStyle *rcStyle=gtk_rc_style_new();
rcStyle->bg[GTK_STATE_NORMAL]=bgColor;
rcStyle->color_flags[GTK_STATE_NORMAL]|=GTK_RC_BG;
gtk_widget_modify_style(mainWindow,rcStyle);

When I compile the same with dev-cpp/mingw/gcc on a win32 system, the compiler claims about invalid conversion from GtkRcFlags to int.

Changing to rcStyle->color_flags[GTK_STATE_NORMAL]|=(GtkRcFlags)GTK_RC_BG;
does not help.

Why?

From gtkrc.h:

typedef enum
{
  GTK_RC_FG             = 1 << 0,
  GTK_RC_BG             = 1 << 1,
  GTK_RC_TEXT           = 1 << 2,
  GTK_RC_BASE           = 1 << 3
} GtkRcFlags;

struct _GtkRcStyle
{
[...]
  GtkRcFlags color_flags[5];
[...]

The only solution I found was to change this line to:
int color_flags[5];

Then it's possible to compile the program and it does what I want to.

But I think it is not a good idea to change a header of GTK for my purposes.

Thanks for clearing up the mist in my head, why this is not working as expected.

Bernd


--
Bernd Münt                   Durchwahl: 030/69032-509
euroscript Deutschland GmbH  Zentrale:  030/69032-300
Abteilung IT-Management      Fax:       030/69032-505
Alt-Moabit 91                Mail:      Bernd Muent euroscript de
10559 Berlin                 Web:       http://www.euroscript.de



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]