Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

GTK source editing

by nonsequitur (Pilgrim)
on Jun 10, 2015 at 19:19 UTC ( [id://1129922]=perlquestion: print w/replies, xml ) Need Help??

nonsequitur has asked for the wisdom of the Perl Monks concerning the following question:

I want to use syntax highlighting in a text editor window in GTK. The obvious solution would seem to be GtkSourceView however I have had no luck getting it to work in Perl on the Ubuntu system that I am stuck with.

Before I went into details on the difficulties I am having I thought that I would check and see if anyone had ideas for better solutions or familiarity with problems using Gtk2::SourceView or Gtk2::SourceView2.

Thank you.

Replies are listed 'Best First'.
Re: GTK source editing
by thanos1983 (Parson) on Jun 10, 2015 at 20:00 UTC

    Hello nonsequitur,

    I do not understand exactly what you mean by: I want to use syntax highlighting in a text editor window in GTK. but I found this How do I add a syntax highlighter format to Gedit?. It contains a solution regarding Ubuntu and similar to your question.

    Regarding Gtk2::SourceView, I can not say much because I never used it. But recently I tried to help another monk that was asking something similar to your question: Gtk2::Notebook with large tabs. There is a sample of working code, and also I have added some useful links that I found online.

    I am also using Ubuntu and to be 100% honest it was one of the easiest module to install but I think it is not impossible.

    I hope the links will help you to overcome your problem(s).

    Linux rules!!!!! ;)

    Seeking for Perl wisdom...on the process of learning...not there...yet!

      Thank you so much for your reply.

      I am trying to build my own source editor because due to oddness in the way my mind works there a very few things that work the way I expect them too which causes me much frustration.

      I am sorry that I did not give sufficient detail. It was due partly to embarrasment, I had installed Gtk2::SourceView2 first from RPM and when it seemed broken, uninstalled it and installed in from CPAN. When I run the sample code from the CPAN page I get the error "Can't locate object method "new" via package "Gtk2::SourceView2"". I read SourceView2.pm and found nothing that helped. I tried to install Gtk2::SourceView but ran into trouble because it relies on old libraries. I finally looked in the source folder of Gtk2::SourceView2 and found an example that works and will help a lot (it does not use Gtk2::SourceView2->new()).

        By all means reinvent the wheel. I'll cheer you on. But why? There is vim/gvim, emacs, gedit, and so on. What feature are you looking for? Perhaps there is a plugin that would work for one of the editors that already exist.

        Jason L. Froebe

        Tech Blog

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1129922]
Approved by sundialsvc4
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-28 14:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found