Re: FG: Help Me

Linux Developer wrote:
> 1) How can I change background
>    and foreground color
>    of label, button and columned list and
>    ofcourse other widgets.  I have tried
>    the .rc file approach and some other
>    approaches but failed.

There's a FAQ entry on this:

> 2) how can we change the widget colors
>    dynamically, is it possible

Havoc posted this scrap of code as the approved way to do it:

  rc_style = gtk_rc_style_new ();
  rc_style->bg[GTK_STATE_NORMAL].red = 65535;
  rc_style->bg[GTK_STATE_NORMAL].green = 0;
  rc_style->bg[GTK_STATE_NORMAL].blue = 0;
  rc_style->color_flags[GTK_STATE_NORMAL] = GTK_RC_BG;
  gtk_widget_modify_style (widget, rc_style);
  gtk_rc_style_unref (rc_style);

> 3) I have marked all my labels to align
>    left in glade but all label are center
>    align when the program runs, can
>    someone help me in this

There's a FAQ entry:

> 4) Can I capture the click event on a window
>    widget if yes then how
> 5) Can I capture the click event on a pixmap
>    widget if yes then how

Connect to the "event" signal. The scribble program in the tutorial does
this for a drawing_area.

> 6) how can I draw rectangle on a window with
>    red color filled in it, yes I mean filled
>    rectangle

You need to make a GdkGC, set a red colour, and do gdk_draw_rectangle().

> 7) how can I change the size of font for
>    my program I need slightly small font
>    then the default font for all widgets

You can set this in your .rc file.

> I would appreciate if someone who know how
> to do this all can make a project and send
> it to me as attachment.

Sorry, not that bored at work :-)


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