Text alignment feature / bug



Hello,
	Recently I have been helping with a GTK, and now GNOME, IRC client
called YagIRC.
	Basically the problem is this: in the window where the
conversation takes place the scrollbar jumps up from the bottom of the
screen a few pixels every time the window is resized, or hidden then drawn
again.
	
In more detail:
	In this application text is inserted into a window
at the bottom. If the window was scrolled all the way to the bottom of the
window before the text was printed, then we scroll it down again after it
is printed, so that new information is available to be read. But if the
window was not scrolled to the bottom before the text was printed, then we
leave it alone so that the user can read information that occured farther 
up in the conversation without having the window yanked down away from
him.
	This situation seems to work fine, most of the time. The problem
arises when gtk redraws the widgets. In our program this can occur when
the user resizes the window, changes between hidden chat windows (text
mode IRC users should be familiar with this), or when the nick list is 
redrawn (the nick list has a set width whilst the text window is set to 
fill the rest of the space. If the nick list is redrawn, it causes the 
text window to  redraw itself too). The nick list is redrawn whenever the 
user joins or leaves a channel. I have fixed the code so that the whole 
widget isn't redrawn when other users join or leave the current channel. 	 
	Finally I come to the fundamental problem - the gtk problem. 
Whenever the widget is redrawn, gtk aligns the text at the _top_ of the 
window, which pulls the scrollbar up a few pixels, muddles the display,
and thwarts our nice scrollbar action! Is there a way to prevent gtk from
doing this? It happens with gtk_widget_show(), gtk_widget_set_usize(), and
all the other methods that I have tried to hide and draw widgets with.
This is a pain for all apps that output information in a terminal like
manner. While I can completely understand the reason for aligning the text
at the top of windows, there needs to be a way to turn it off. I have
looked at the gtk sources and got lost.
	I am not the main developer of YagIRC, and I am *very* new to gtk.
Fixing this scrollbar bug in yagirc has been my first introduction to gtk,
so if something I have said is a little wacky, blame me and don't knock
yagirc - its a damn good IRC client :)

~Paul Laufer




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