Query about gdk (draw) used along with GtkStyle.

  Sub : I have some problem with gdk (Drawing Rectangle) when changing Style.
  I have already posted this question as a non member. I am reposting it again.

  I used the following code to draw the border for the widget (over the parent widget, ie a GtkFixed). This is done to highlight the widget when it is clicked. But if I change the font of the contained widget the border not visible. Suggest me to over come this problem

  To draw a border for a widget to do so I wrote the following code.

Draw_Border(GtkWidget *SelectedWidget)
GdkWindow *window;
int w=0,h=0;

  /* Border Does not appear if this line is included*/
  window = (get_widget_window (SelectedWidget->parent, SelectedWidget));
  gdk_window_get_size (window, &w, &h);

  black_gc = SelectedWidget->parent->style->black_gc;
  gdk_gc_set_subwindow (black_gc, GDK_INCLUDE_INFERIORS);
  gdk_draw_rectangle (SelectedWidget->parent->window, black_gc, FALSE,
            SelectedWidget->allocation.width - 1, 
            SelectedWidget->allocation.width - 1);
  gdk_gc_set_subwindow (black_gc, GDK_CLIP_BY_CHILDREN);
  return ;

SetFont(GtkWidget *Widget, char *Font)
  GtkStyle *Style=gtk_style_copy(gtk_widget_get_default_style());
  gtk_widget_set_style(GTK_WIDGET(Widget), Style);
  return ;

  If this mail is to be redirected to someone else please do inform me.
  Thanking U


Get Your Free Email At, http://www.rediffmail.com

Participate in crazy Re.1 auctions at http://www.rediff.com/auctions

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