Old 08-07-2022, 09:03 AM   #1
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,902
Default Q: How to loop in list view header with js_reascriptAPI ?

Hi,


How do we loop in ListView header with JS_ReaScript API ?


I can see these two functions


Code:
  file_list_header = reaper.JS_ListView_GetHeader( file_LV )
  file_list_header_count = reaper.JS_Header_GetItemCount( file_list_header )

But these doesnt get the header text.
It seems we miss a Header_GetChild function or something ?


Best,
X-Raym is offline   Reply With Quote
Old 08-08-2022, 02:18 AM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,902
Default

Or maybe it is a Header_GetItem / Header_GetItemText function that we missed ?


Anyway, here is some code for testing


Code:
reaper.ClearConsole()
function Msg( value )
  reaper.ShowConsoleMsg( tostring( value ) .. "\n" )
end

function GetMediaExplorer()
  local title = reaper.JS_Localize("Media Explorer", "common")
  local arr = reaper.new_array({}, 1024)
  reaper.JS_Window_ArrayFind(title, true, arr)
  local adr = arr.table()
  for j = 1, #adr do
    local hwnd = reaper.JS_Window_HandleFromAddress(adr[j])
    -- verify window by checking if it also has a specific child.
    if reaper.JS_Window_FindChildByID(hwnd, 1045) then -- 1045:ID of volume control in media explorer.
      return hwnd
    end
  end
end

explorer = GetMediaExplorer()


file_LV = reaper.JS_Window_FindChildByID(explorer, 1001)

header = reaper.JS_ListView_GetHeader( file_LV )
count = reaper.JS_Header_GetItemCount( header )
for i = 0, count - 1 do
  -- text, state = reaper.JS_ListView_GetItem( header, 0, i ) -- this returns state = 0
  cell = reaper.JS_Window_FindChildByID( header, i ) -- this reutrns nul
  Msg(cell)
end

Thx!
X-Raym is offline   Reply With Quote
Old 03-27-2023, 09:12 AM   #3
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,902
Default

Answer from Julian:


https://forum.cockos.com/showpost.ph...ostcount=1824*


Quote:
Originally Posted by Julian
Unfortunately, AFAIK, Header_GetItem has not yet been implemented in WDL/swell.

Consider this as a FR
X-Raym is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:45 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.