Delivered-To: lablgtk at yquem.inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=TEZVIccZQiB5O5wkz8g8u7nFMffwa2ROo3tU4y0LTvQ=; b=ikF3YB965zg+L4QrC4pEHE8A7b1U1TyOkG4z44HeB63gs6KZOzHo/od26wVU4ckIiNOuwQ5hopnYy+04KGjA9hMUG4f2t5wiK0OEUJkwpPZOEcKLft89wDHJdoMVemgP7amvLLBbqv1ZKMtWdIUe/Ve8OGA6n1ORbSTCFSemzwQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=FA2JcI3Kdrurdwe7PRR2u/lEvkUYYuYN6DkjqPO+72oeLnP8KLZx6L/xFWZ+snljuQIAYb7ywzxYnuYGC3boa53V+8oldrOqhFNjb0wlF7SBgX4yKpqPW3OReh64z9PaC8RVO4+5dvCzaQvuFlik+X8zGaf6Z5N/IfdBVXJHaMg= Message-ID: Date: Tue, 13 May 2008 21:07:48 -0400 From: "Jacques Le Normand" To: lablgtk at yquem.inria.fr MIME-Version: 1.0 Subject: [Lablgtk] drawing a rectangle in a textview Mime-version: 1.0 Content-Type: multipart/mixed; boundary="===============0595123405==" Content-Length: 2676 --===============0595123405== Content-Type: multipart/alternative; boundary="----=_Part_19267_17912498.1210727268781" ------=_Part_19267_17912498.1210727268781 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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/gtk-app-devel-list@gnome.org/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 ------=_Part_19267_17912498.1210727268781 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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/gtk-app-devel-list@gnome.org/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
------=_Part_19267_17912498.1210727268781-- --===============0595123405== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk --===============0595123405==--