Page 1 of 1
Hide Columns of a ListIconGadget???
Posted: Wed Aug 19, 2015 9:24 am
by stefanpape
If I set the ColumnWidth of a column in a ListIconGadget to zero, in Windows you see nothing of the column.
If you make the same in MacOSX, the ColumnWidth isn't zero, you see the column.
Has somebody an idea, how I can hide a column of a ListIconGadget in Mac OS X?
Thank you very much for the help.
Re: Hide Columns of a ListIconGadget???
Posted: Wed Aug 19, 2015 9:44 am
by wilbert
Code: Select all
If OpenWindow(0, 100, 100, 300, 100, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(0, 5, 5, 290, 90, "Name", 100, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
AddGadgetColumn(0, 1, "Address", 250)
AddGadgetItem(0, -1, "Harry Rannit"+Chr(10)+"12 Parliament Way, Battle Street, By the Bay")
AddGadgetItem(0, -1, "Ginger Brokeit"+Chr(10)+"130 PureBasic Road, BigTown, CodeCity")
Columns = CocoaMessage(0, GadgetID(0), "tableColumns")
Column0 = CocoaMessage(0, Columns, "objectAtIndex:", 0)
CocoaMessage(0, Column0, "setHidden:", #YES)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
Re: Hide Columns of a ListIconGadget???
Posted: Wed Aug 19, 2015 10:37 am
by stefanpape
Cool, Thank you very much!
Re: Hide Columns of a ListIconGadget???
Posted: Tue Jul 19, 2016 11:22 pm
by deseven
Thanks!
I wrapped it into procedure for simplicity:
Code: Select all
Procedure ListIconGadgetHideColumn(gadget.i,index.i,state.b)
Protected column = CocoaMessage(0,CocoaMessage(0,GadgetID(gadget),"tableColumns"),"objectAtIndex:",index)
If column
If state
CocoaMessage(0,column,"setHidden:",#YES)
Else
CocoaMessage(0,column,"setHidden:",#NO)
EndIf
EndIf
EndProcedure
Re: Hide Columns of a ListIconGadget???
Posted: Sun Sep 29, 2019 2:34 pm
by Lebostein
deseven wrote:Thanks!
I wrapped it into procedure for simplicity:
Code: Select all
Procedure ListIconGadgetHideColumn(gadget.i,index.i,state.b)
Protected column = CocoaMessage(0,CocoaMessage(0,GadgetID(gadget),"tableColumns"),"objectAtIndex:",index)
If column
If state
CocoaMessage(0,column,"setHidden:",#YES)
Else
CocoaMessage(0,column,"setHidden:",#NO)
EndIf
EndIf
EndProcedure
It seems this not work, if you add icons to the ListIconGadget. If you add an icon, PureBasic adds a new undefined column at the first position of the ListIconGadget and the gadget gets a column offset - very strange. Can somebody explain that?
Re: Hide Columns of a ListIconGadget???
Posted: Sun Sep 29, 2019 6:25 pm
by C87
Hi stefanpape,
Don't know if these Topic Headers will help, or if any use on Mac. But here they are anyway
Listicon, Hide-Unhide columns by clicking on Listicon Header
Clear columns from list icon gadget?
Re: Hide Columns of a ListIconGadget???
Posted: Sun Sep 29, 2019 10:15 pm
by mk-soft
Icons and CheckBoxes have their own Columns, so the other Columns move to the back.
Re: Hide Columns of a ListIconGadget???
Posted: Sun Sep 29, 2019 10:45 pm
by Lebostein
mk-soft wrote:Icons and CheckBoxes have their own Columns, so the other Columns move to the back.
But how I find out, if these extra columns are active? It seems these colums are added and removed "on the flow"?
Re: Hide Columns of a ListIconGadget???
Posted: Sun Sep 29, 2019 11:14 pm
by mk-soft
Its late, i go to sleep...
Show here:
viewtopic.php?f=19&t=72124
Code: Select all
*Column0 = CocoaMessage(0, CocoaMessage(0, *TableView, "tableColumns"),
"objectAtIndex:", 0)
Ident = PeekS(CocoaMessage(0, CocoaMessage(0, *Column0, "identifier"),
"UTF8String"), -1, #PB_UTF8)
If Ident = "Image"
ColumnOffset + 1
ElseIf Ident = "CheckBox"
ColumnOffset + 1
Re: Hide Columns of a ListIconGadget???
Posted: Mon Sep 30, 2019 5:45 am
by Lebostein
Great! Exactly what I was looking for! Thanks!!!!