Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Mar 1995 11:47:38 -0700
From:      Gary Aitken <garya@boulder.openware.com>
To:        epkmat@kaepkcc1.ericsson.se, oi-users@freefall.cdrom.com
Subject:   Re: Columns in OI_scroll_menu
Message-ID:  <199503171847.LAA04401@garya.boulder.openware.com>

next in thread | raw e-mail | index | archive | help
> I have got a problem with column alignment in OI_scroll_menu.
> This occurred when we updated our OI version from 3.4 to 4.5.
> 
> Pseudo code for arranging column layout:
> menu cell font ="-*-lucidatypewriter-medium-r-normal-sans-*-120-*-*-*-*-*-*";
> scroll menu title font ="-*-lucidatypewriter-bold-r-normal-sans-*-120-*-*-*-*-*-*";
> 
> OI_scroll_menu* scroll_menu;
> OI_menu_cell* dummy_cell;
> char header[] = "Column1\tColumn2";
> OI_number tab_stop[2];
> >
> >
> tab_stop[1] = 10;
> tab_stop[2] = 10;
> scroll_menu->set_title(header);
> dummy_cell->set_label(header);
> scroll_menu->set_tabs_custom(tab_stop, 1);
> >
> >
> The result is that the space between Column1 and Column2 in the title is larger
> than the space between Column1 and Column2 in the menu cell. Why ???
> In OI 3.4 we got exactly the same space.

Not sure.  As Tom LaStrange posted a while ago, a test case goes a long
way.  So far, in attempting to replicate this, I've discovered that
you should probably use indices 0 and 1, not 1 and 2, in the tab_stop
vector :-)
In any case, here is a test case which I built against the 4.6 beta code
and it works fine.  There were a few changes in this area between 4.5
and 4.6, so it might be broken on 4.5.  Try it out and let me know.  If
it works in 4.5, you'll have to come up with a real test case.
========================================================================
#include <OI/oi.H>

 void main (int argc, char**argv)
 {
			OI_d_tech	*wp ;
			OI_scroll_menu	*smp ;
			OI_number	tab_stop[2];
		static	char		header[] = "Column1\tColumn2";
			OI_menu_cell	*dummy_cell;

	if (OI_init(&argc,argv,"OITest")) {
		wp = oi_create_box("main",300,300) ;
//		wp->set_layout(OI_layout_row) ;
		wp->set_associated_object(wp->root(),10,10,OI_ACTIVE) ;

		dummy_cell = oi_create_menu_cell("dmy", header) ;
		smp = oi_create_scroll_menu("sm", OI_scroll_bar_right, 5, OI_button_menu::clsp, 1, &dummy_cell, OI_vertical, header) ;
		tab_stop[0] = 10;
		tab_stop[1] = 10;
		smp->set_title(header);
		dummy_cell->set_label(header);
		smp->set_tabs_custom(tab_stop, 1);

		smp->set_font("-*-lucidatypewriter-bold-r-normal-sans-*-120-*-*-*-*-*-*") ;
		dummy_cell->set_font("-*-lucidatypewriter-medium-r-normal-sans-*-120-*-*-*-*-*-*") ;

//		smp->layout_associated_object(wp,10,10,OI_active) ;
		smp->set_associated_object(wp,10,10,OI_active) ;
		OI_begin_interaction() ;
	}
	return ;
 }




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199503171847.LAA04401>