Re: Designing a 'console' with GtkTextViewer



Two applications that do something very similar based on the GtkTextView widget are:
You need to overload lots of bindings to get it to behave as a terminal. Just look at the source to get the idea.

Regards,
Dov

2009/3/7 Vivien Malerba <vmalerba gmail com>


2009/3/7 Dutta, Seemanta <seemanta qualcomm com>


Hi,
I want to design a console based interface to my application. The console would enable the user to manually give commands to my application. Something akin to the python console that you get in RhythmBox.

I am planning to use GtkTextViewer widget for this. My main requirement for the console is that It should not allow the user to 'scroll-back' and edit past commands, which would be very inconsistent. In other words it should behave just like a terminal command line, allowing line editing for the current line only. I am not thinking of readline support right now but that can be added later as an enhancement.

My question: Is that possible in GtkTextViewer? I always thought that I can set the entire widget as editable or non editable. But if I set it as editable, then I don't want the user to be able to scroll up and fiddle with text that is present above.

Can anyone please advise?

I had written something similar for Gnome-DB a while back, have a look at it:  http://svn.gnome.org/viewvc/libgnomedb/trunk/libgnomedb-extra/gnome-db-sql-console.c?revision=1747&view=markup

Basically I had to tag some parts of the text as read-only along with some scrolling...

Vivien


_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list




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