GtkEntry Question



I'm selecting from a list of names in a GtkClist, and the name and path is
then placed in a GtkEntry widget.

It is likely that the name+path will be longer than the Entry widget,
and this is fine, but I would like to automatically show the last part
of the name, not the first part.

Default:                         What I'm trying to get:
|------------------------|       |------------------------|
|/path/to/signal/name/ver|       |to/signal/name/very/long|
|------------------------|       |------------------------|

So, in the select_row callback, I get the text for the entry, prepend
the path, and then do:

gtk_entry_set_text (GTK_ENTRY (SignalEntry), buf);
gtk_entry_set_position (GTK_ENTRY (SignalEntry), strlen (buf));
gtk_entry_adjust_scroll (GTK_ENTRY (SignalEntry));

This should work, but it appears a draw or expose event needs to be
generated (if I drag a window across the GtkEntry, the app will redraw
the entry such that the end of the string is displayed, but doesn't do
it by default).

So, do I need to emit a signal after I adjust the scroll in order to get
what I'm looking for?  Or is there an easier way I'm not seeing?

Brandon
-- 
 Brandon Long             "Moral indignation is jealousy with a halo."
 MD6 Crash Test Dummy               -- H. G. Wells
 Intel Corporation       
          I'm too low on the totem pole to speak for Intel.
		  http://www.fiction.net/blong/



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