Re: gtk2: Uneditable Texts in Entries/TextViews



On Tue, Jun 11, 2002 at 02:17:56PM -0400, Jay Bloodworth wrote:
I only want a single line worth of text, so I'd much prefer to use use a
GtkEntry.  Nonetheless, I'm willing to use a GtkTextView if necessary -
I've found I can almost do what i want by tagging text with
editable=FALSE tags; the problem is (using the above example) if I tag
the span from position 0 to position six, I can still insert in front of
the existing text, i.e. I can enter [my little green truck].

Hints and suggestions would be appreciated.  I'd prefer not to, but if I
have to resort to signal catching I'd appreciate pointers on the idiom
for heading off sample widget behavior.  I'm actually using pygtk, but
that list is very quiet and plus I don't think there is any particularly
python specific about this issue.

I think connecting to the "insert-at-cursor" signal and stopping
emission there if the cursor is in the wrong place would be sufficient
on a GtkEntry.

This would also allow you to allow [little truck] with one space while
disallowing [littlefoo truck], [little footruck], and [littletruck]--
possibilities you can't achieve with just non-editable text alone.

(What are you making?  Sounds neat.)

-- 
      Evan Martin
martine cs washington edu
  http://neugierig.org



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