Re: [gtk-list] Gtk_Text customization?



>>>>> "M" == Some Guy <guy@mikepery.pr.mcs.net> writes:

 M> Hello I was playing around with the text widget and thinking about
 M> making a C/C++ IDE in Gtk(--).  I have two ideas for it that would
 M> require the text widget to be more customizable (I think, unless
 M> it has features I don't know about).  Here are my ideas:

Funny, I am currently working on a source editor widget (a subclass of
the text widget). I have only done syntax highlighting now, but plan
on looking at parenthesis matching and indenter soon. If you are
interested, let me know.

 M> - comment links: I've never actually tried this, but in theory I
 M>   think it would be neat if you could put comments in links to
 M>   text.  It would be a hotlink just like in an HTML browser, and when
 M>   you click on the text, the comment pops up (it could be embedded in
 M>   the source code in the for of a comment like /*@link@(<x>, <y>)
 M>   <comment> */)

 M> Is the text widget capable of handling these features? Or do I
 M> have to extend it and add these features myself? If so, how easy
 M> would that be (using gtk--)? If anyone has any ideas on how to
 M> implement these two, please tell me.

I have uploaded a patch (gtk-mailund-980713-0.patch) to ftp.gtk.org,
which makes it possible to add user data to text properties in the
text widget. Using that, you could add comments as user data to,
e.g. a "/*<comment>*/" text, and when clicking on the text, extract
the comment and insert it instead of the /*<comment>*/ text.

I have only used the user data in gtktext for highlighting (I save the
state in the regex automaton), so I don't know if this is useful for
these comments. But you could take a look.

/mailund

-- 
| Thomas Mailund                  |            Office B2.18 at DAIMI |
| Ny Munkegade 62 3. tv.          |      Email: mailund@daimi.aau.dk |
| 8000 Aarhus, Denmark            | http://www.daimi.aau.dk/~mailund |
| Phone (+45) 21 45 13 95         |         Phone: (+45) 89 42 32 80 |



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