From owner-oi-users Fri Mar 17 11:08:11 1995 Return-Path: oi-users-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id LAA06487 for oi-users-outgoing; Fri, 17 Mar 1995 11:08:11 -0800 Received: from marvin.boulder.openware.com (marvin.boulder.openware.com [192.245.99.138]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id LAA06481 for ; Fri, 17 Mar 1995 11:08:07 -0800 Received: from garya.boulder.openware.com (garya.boulder.openware.com [198.135.223.34]) by marvin.boulder.openware.com (8.6.9/8.6.9) with ESMTP id MAA19349; Fri, 17 Mar 1995 12:05:48 -0700 Received: (from garya@localhost) by garya.boulder.openware.com (8.6.9/8.6.9) id LAA04401; Fri, 17 Mar 1995 11:47:38 -0700 Date: Fri, 17 Mar 1995 11:47:38 -0700 From: Gary Aitken Message-Id: <199503171847.LAA04401@garya.boulder.openware.com> To: epkmat@kaepkcc1.ericsson.se, oi-users@freefall.cdrom.com Subject: Re: Columns in OI_scroll_menu Sender: oi-users-owner@FreeBSD.org Precedence: bulk > 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 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 ; }