Re: [gtk-list] horizontal scrolling incorrectly with scrolled window
- From: Lars Hamann <lars gtk org>
- To: gandalf pobox com
- Cc: gtk-list redhat com
- Subject: Re: [gtk-list] horizontal scrolling incorrectly with scrolled window
- Date: Sat, 17 Apr 1999 00:36:30 +0200
On Thu, Apr 15, 1999 at 10:14:05PM -0400, gandalf@pobox.com wrote:
> I don't remember if this was mentioned before (didn't see it in the
> archive) but there seems to be some problems with the way gtk decides
> how/when to scroll horizontally. It will allow a lot of text to be
> clipped off, without giving the ability to scroll. In fact playing with
> resizing the window, it only seems to allow you to scroll if the size
> becomes less than the width of the titlebar.
>
> Here is a code snippet which creates a scrolled window and a clist, and
> then sets the scrolling in both directions to automatic. The vertical
> has no problems, but the horizontal is all wacked out:
>
> listTitles[0] = g_malloc(sizeof(gchar) *13 );listTitles[0] = "Machine\0";
> machinelist = gtk_clist_new_with_titles( 1, listTitles);
> gtk_clist_set_column_width( GTK_CLIST ( machinelist),0,45);
You set the column width to 45 Pixels - no matter how wide the cell contents
are. So Clist clips the cell contents itself. Scrolled window has nothing
to do with that effect. You should try something like :
gtk_clist_set_column_auto_resize (GTK_CLIST (machinelist), 0, TRUE);
instead.
> machineframe = gtk_scrolled_window_new(NULL, NULL);
> gtk_container_add(GTK_CONTAINER(machineframe), machinelist);
> gtk_box_pack_start(GTK_BOX(hbox), machineframe, TRUE, TRUE, 0);
> gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (machineframe),
> GTK_POLICY_AUTOMATIC,
> GTK_POLICY_AUTOMATIC);
> gtk_widget_show(machineframe);
> gtk_widget_show(machinelist);
bye,
Lars
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]