Re: How many *lines* are visible in a GtkText?



This is almost impossible in GtkText. The new widget (GtkTextView) in
upcoming Gtk 2.0 will
fix this and hundred of other problems in the old GtkText.

But until then try my GtkExText widget wish is line based.

Take a look at http://www.bahnhof.se/~mikeh/linux/gtkextext.php

Greats

M.H. 

On tor, 15 feb 2001 21:29:18 Eric M. Monsler wrote:
> Hi all,
> 
> I posted this to gtk-app-devel-list a few days back, with no replies.  I
> thought that I'd try here.  My apologies to those reading it twice.
> 
> I've got a window with a GtkText in it.  I add text at the bottom,
> discard it off the top, the operator can scroll up and down, as text is
> added the visible part stays visible if pulled from the bottom, and
> stays at the bottom as text is added once pulled to the bottom.  So far,
> all good.
> 
> Now, I want to sometimes add flush all the text out of the visible
> portion of the GtkText, but leave it accessable by scrolling.  The
> easiest way I could think of to do this is to just add as many newlines
> as are required to roll the old text off the top.  
> 
> My problem is, I don't know how many lines are visible.  The page_size
> attribute of the adjustment is I believe in pixels?  But how can I find
> out how many pixels/line the default font is?  
> 
> I use always the standard colors and font when adding test to the
> GtkText.
> 
> Is there some way of directly finding out the number of lines?
> 
> TIA,
> 
> Eric M. Monsler
> 
> _______________________________________________
> 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]