ColumnInfo widths

This forum is for general developer support questions.
Post Reply
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

ColumnInfo widths

Post by mritter0 »

I have a ColumnInfo with 3 columns:

Code: Select all

	if (!(ContentCI=IListBrowser->AllocLBColumnInfo(3,
		LBCIA_Column,						0,
			LBCIA_Title,						"",
			LBCIA_Width,						38,
			LBCIA_Sortable,						FALSE,
			LBCIA_DraggableSeparator,			FALSE,
			LBCIA_UserData,						0,
		LBCIA_Column,						1,
			LBCIA_Title,						SAK_LocaleString(MSG_TITLE_NAME),
			LBCIA_Weight,						100,
			LBCIA_Sortable,						TRUE,
			LBCIA_SortArrow,					TRUE,
			LBCIA_SortDirection,				!Prefs->ContentSortDirection,
			LBCIA_DraggableSeparator,			FALSE,
			LBCIA_UserData,						1,
		LBCIA_Column,						2,
			LBCIA_Title,						"",
			LBCIA_Width,						185,
			LBCIA_Sortable,						FALSE,
			LBCIA_DraggableSeparator,			FALSE,
			LBCIA_UserData,						2,
	TAG_DONE)))
		return(FALSE);
I want the first and last columns to be fixed-width, and the center column to be max width (minus the width of the other 2). But it doesn't. It acts like I told it LBCIA_Width, not LBCIA_Weight.

Is there a way to make this happen?
Workbench Explorer - A better way to browse drawers
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

Re: ColumnInfo widths

Post by mritter0 »

I figured it out. I had to put a CHILD_MinWidth on the listbrowser gadget. Not a big fan of that, it should just do it regardless.
Workbench Explorer - A better way to browse drawers
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: ColumnInfo widths

Post by broadblues »

How is the listbrowser added to the layout?

In order for wht you describe to be aceivable the listbrowser width would require setting, then the column widths calculated, but if you've set LAYOUT_WeightedWith,0 or some such it would collapse to the smalles size.

There so many variables it's difficult to advise further without seeing more code.

Just as a random thought looking at a listrbroswer I have where I had fixed width column, the others have the weight set to 0 not 100
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: ColumnInfo widths

Post by broadblues »

mritter0 wrote:I figured it out. I had to put a CHILD_MinWidth on the listbrowser gadget. Not a big fan of that, it should just do it regardless.
You replied while I was posting.

That would do it but, as theat implies set window size, perhaps you should try CHILD_NominalWidth ?

Unfrtunatly the nearest equivalent layout I can find in my own codes is wider than the window, so doesn't really apply.
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

Re: ColumnInfo widths

Post by mritter0 »

Well, it is working the way I wanted now. It has to be LBCIA_Width,100, not 0.

I came up with another idea in the mean time, and you touched on it, and OS4Coding.net has another tidbit to tweak it.

Off for more tweaking....Thanks
Workbench Explorer - A better way to browse drawers
Post Reply