drawing a rectangle in a textview

"Jacques Le Normand" <[email protected]>
Newsgroups gmane.comp.lang.ocaml.lib.gtk
Message-ID <[email protected]>
Hello lablgtk,
I'd like to draw a coloured, transparent rectangle in a textview (to
highlight some text)
the following page gives a method (which I'm having trouble translating to
ocaml)


(from http://www.mail-archive.com/[email protected]/msg09087.html)


win = gtk_text_view_get_window(text,
      GTK_TEXT_WINDOW_WIDGET);
      gc = gdk_gc_new(win);
      gdk_color_parse("red", &color1);
      gdk_gc_set_foreground(gc, &color1);
      gdk_color_parse("black", &color2);
      gdk_gc_set_background(gc, &color2);
      gdk_gc_set_fill(gc, GDK_SOLID);

      gdk_draw_rectangle(win, gc, TRUE, 1, 1, 20, 20);


However, I can't figure out how to call get_window on textview (namely, how
to get a [> 'textview ] Gtk.obj). Feel free to warn me about other snags!
cheers
--Jacques

_______________________________________________
Lablgtk mailing list
[email protected]
http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.