Old 08-03-2018, 03:12 PM   #241
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,505
Default

Updated the library to use different fonts per OS - no more gross Arial for Mac users, and no Courier in the Textboxes for anybody anymore.

Downside: Any scripts made with GUI Builder that have a Textbox will probably break. It's a simple fix - in each Textbox's GUI.New, make sure font_b is set to monospace, or not at all.

Cheers.

This update also fixes some longstanding issues with the Textbox's caret position on Mac that I wasn't aware of.
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is offline   Reply With Quote
Old 08-04-2018, 08:08 AM   #242
Robert Randolph
Human being with feelings
 
Robert Randolph's Avatar
 
Join Date: Apr 2017
Location: St. Petersburg, FL
Posts: 758
Default

Quote:
Originally Posted by Lokasenna View Post
Updated the library to use different fonts per OS - no more gross Arial for Mac users, and no Courier in the Textboxes for anybody anymore.

Downside: Any scripts made with GUI Builder that have a Textbox will probably break. It's a simple fix - in each Textbox's GUI.New, make sure font_b is set to monospace, or not at all.

Cheers.

This update also fixes some longstanding issues with the Textbox's caret position on Mac that I wasn't aware of.
And list boxes are fixed too!
__________________
http://www.admiralbumblebee.com
Audio/DAW stuff, Woodworking, Programming and more... new posts every weekend.
Robert Randolph is offline   Reply With Quote
Old 08-05-2018, 02:13 AM   #243
solger
Human being with feelings
 
solger's Avatar
 
Join Date: Mar 2013
Posts: 3,055
Default

Quote:
Originally Posted by Lokasenna View Post
Updated the library to use different fonts per OS - no more gross Arial for Mac users, and no Courier in the Textboxes for anybody anymore ...
The listbox selection highlight issue on macOS (mentioned in post #201: https://forum.cockos.com/showpost.ph...&postcount=201) seems to be fixed too with this update.
Thanks!
__________________
ReaLauncher
solger is offline   Reply With Quote
Old 08-05-2018, 04:04 AM   #244
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 1,176
Default

Woop! That's awesome, that one was a real annoying bug
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is offline   Reply With Quote
Old 08-05-2018, 07:32 AM   #245
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 1,176
Default

@Solger:

does ReaLaunch need an update in order to fix that list bug or should it work out of the box?
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is offline   Reply With Quote
Old 08-05-2018, 08:03 AM   #246
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,505
Default

Other scripts will see the fix right away. The current version of ReaLauncher overwrites the code that was bugged, so it'll need an update, but he has one pending on the repo.
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is offline   Reply With Quote
Old 08-05-2018, 09:26 AM   #247
solger
Human being with feelings
 
solger's Avatar
 
Join Date: Mar 2013
Posts: 3,055
Default

Quote:
Originally Posted by _Stevie_ View Post
@Solger:

does ReaLaunch need an update in order to fix that list bug or should it work out of the box?
Yeah, as Lokasenna already mentioned above, the next update is already on the way (and is currently in the pull request)
__________________
ReaLauncher
solger is offline   Reply With Quote
Old 08-05-2018, 01:21 PM   #248
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 1,176
Default

Looking forward to it, you guys rock!
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is offline   Reply With Quote
Old 08-06-2018, 03:51 AM   #249
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 298
Default

Moved from another thread

Hi!

I have this senario:
When I left click in a listbox the item get selected and in a frame
some text is shown. When I right click in my listbox I get a dropdown-
menu BUT the item in listbox dont get selected.

How can I select an item in listbox when I right click?

AND is it possible to change color on selected item?


Answer from:

Quote:
Originally Posted by Lokasenna View Post
- Wrong thread. :P

- You could have the right-click method call the left-click method at the end, I think. Haven't tried.

Code:
function GUI.elms.my_listbox:onr_mouseup() -- or whatever the method is called, I forget

    ... do stuff...

    self:onmouseup()

end

I have tried calling the function "GUI.elms.lst_tksnmouseup()"
inside of the onmouser_down but no change - no item under the
mouse is selected.
__________________
ToDoList Donate Mark4Celest: Frid (i ditt hjärta) Eve & the Fisherman on Spotify

Last edited by tompad; 08-06-2018 at 03:59 AM.
tompad is online now   Reply With Quote
Old 08-06-2018, 04:14 AM   #250
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 298
Default

This is my code:

Code:
function GUI.elms.lst_tks:onmouser_down()

  --Calling onmouseup
  GUI.elms.lst_tks:onmouseup() -- 

  -- Getting coordinates of mouse for dropdown
  gfx.x = gfx.mouse_x
  gfx.y = gfx.mouse_y
 
  -- Show dropdown
  menu = gfx.showmenu("New|Edit|Done|Delete")

  --Checking what is selected
  if menu == 1
  then funNew()
    elseif menu == 2
  then funEdit()
    elseif menu == 3
  then funDone()
    elseif menu == 4
  then funDelete()
  end

  -- Needs to be added - dont ask me why
  GUI.Listbox.onmouser_down(self)

end
I am using a call to onmouseup() because when earlier
using onmousedown() nothing happened.
__________________
ToDoList Donate Mark4Celest: Frid (i ditt hjärta) Eve & the Fisherman on Spotify
tompad is online now   Reply With Quote
Old 08-06-2018, 05:18 AM   #251
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 298
Default

Hmmmm, it seems like the item IS selected but its not coloured,
its the previous item that keeps its colour. How can I make the
latest selected item coloured?
__________________
ToDoList Donate Mark4Celest: Frid (i ditt hjärta) Eve & the Fisherman on Spotify
tompad is online now   Reply With Quote
Old 08-06-2018, 05:42 AM   #252
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,505
Default

1. That's strange - it should be redrawing automatically. Try adding self:redraw() at the end.

2. It can just be self.onmouseup(). When you call a function with :, Lua secretly gives it the name to the left of the : as a parameter called self to work with.

3. You don't need to a call to GUI.Listbox.mouser_down in this case - that function doesn't exist. It is important to check though, and if it did that would be the correct thing to do. It's necessary when you want to add to an existing function - you run your own code, and then you tell it "do what you normally do".

4. onmouseup is the right one to call because onmousedown only affects the scrollbar. You can see which methods are used, and what they do, by looking in the class files.

If it's still giving you trouble, PM with me the script and I can have a look.
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is offline   Reply With Quote
Old 08-06-2018, 03:29 PM   #253
ThomasE
Human being with feelings
 
Join Date: Aug 2009
Location: Sweden
Posts: 36
Default

This is awesome work and really useful!

Quote:
Originally Posted by Lokasenna View Post
This update also fixes some longstanding issues with the Textbox's caret position on Mac that I wasn't aware of.
Both the caret position and selection is off in the Texteditor as well on OSX:



It works fine using the same fix as in Listbox:

Code:
function GUI.TextEditor:wnd_recalc()

	GUI.font(self.font_b)

	self.char_w, self.char_h = gfx.measurestr("i")
	--self.char_h = gfx.texth
	self.wnd_h = math.floor((self.h - 2*self.pad) / self.char_h)
	--self.char_w = gfx.measurestr("_")
	self.wnd_w = math.floor(self.w / self.char_w)

end
ThomasE is offline   Reply With Quote
Old 08-06-2018, 03:59 PM   #254
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,505
Default

What the hell... I thought I fixed that at the same time.

Thanks, updating.
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is offline   Reply With Quote
Old 08-07-2018, 02:03 AM   #255
ThomasE
Human being with feelings
 
Join Date: Aug 2009
Location: Sweden
Posts: 36
Default

Quote:
Originally Posted by Lokasenna View Post
What the hell... I thought I fixed that at the same time.

Thanks, updating.
Now it's working! Thanks!
ThomasE is offline   Reply With Quote
Old 08-08-2018, 03:08 AM   #256
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 298
Default

Quote:
Originally Posted by Lokasenna View Post
1. That's strange - it should be redrawing automatically. Try adding self:redraw() at the end.
No change. However I discovered that the second time I click with
right mouse the item is selected.
Quote:
2. It can just be self.onmouseup(). When you call a function with :, Lua secretly gives it the name to the left of the : as a parameter called self to work with.
Ok, learned something new again! :-)

Edit: Ooooops, got crash:

Code:
Error: Class - Listbox.lua:159: attempt to index a nil value (local 'self')

Stack traceback:
	Core.lua:72: in metamethod '__index'
	Class - Listbox.lua:159: in field 'onmouseup'
	DLT_ToDoList.lua:398: in field 'onmouseup'
	DLT_ToDoList.lua:439: in method 'onmouser_down'
	Core.lua:905: in field 'Update'
	Core.lua:419: in field 'Main_Update_Elms'
	Core.lua:286: in function <...am Scripts/Development/Lokasenna_GUI v2/Library/Core.lua:282>
		[C]: in function 'xpcall'
	Core.lua:282: in function <...am Scripts/Development/Lokasenna_GUI v2/Library/Core.lua:281>

Lokasenna_GUI:	v2.15.5
Reaper:       	5.93/linux64
Platform:     	Other
Quote:
3. You don't need to a call to GUI.Listbox.mouser_down in this case - that function doesn't exist. It is important to check though, and if it did that would be the correct thing to do. It's necessary when you want to add to an existing function - you run your own code, and then you tell it "do what you normally do".
I checked the class file for Listbox, and you are right, it doesn't exist.
BUT this makes me VERY confused - how can I show the dropdown with right
click in Listbox if onmouser_down doesn't exist!? It shows up just like I
expected, and the selection in dropdown is working fine.
Quote:
4. onmouseup is the right one to call because onmousedown only affects the scrollbar. You can see which methods are used, and what they do, by looking in the class files.

If it's still giving you trouble, PM with me the script and I can have a look.
I will look at this a bit more and if I cant solve it I PM you.
Im very grateful for your help!
__________________
ToDoList Donate Mark4Celest: Frid (i ditt hjärta) Eve & the Fisherman on Spotify
tompad is online now   Reply With Quote
Old 08-09-2018, 01:25 AM   #257
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 298
Default

Lokasenna - thanks for the help!

After I PM:ed you I remembered another question. Maybe its
better to take it here because other people maybe can benefit
on the answer.

What is the best practice if I need 2 windows in my script?
Is it to make one main window and load another separate window
(or using tabs in main window)

or

Is it to have one window and make use of z-index to show and
hide the different parts I want to use.
__________________
ToDoList Donate Mark4Celest: Frid (i ditt hjärta) Eve & the Fisherman on Spotify
tompad is online now   Reply With Quote
Old 08-09-2018, 03:13 AM   #258
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 298
Default

What is wrong with this? Suddenly my buttons dont run the functions
I told them to do. Not even msg!


Code:
GUI.New("btn_edit", "Button", {
  z = 11,
  x = 80,
  y = 256,
  w = 60,
  h = 24,
  caption = "Edit",
  font = 3,
  col_txt = "txt",
  col_fill = "elm_frame",
  func = fun_edit
})


function fun_edit ()
  msg("Edit")

  -- body...
  local selected = GUI.Val("lst_tasks")

  msg(selected)
  shiftWindow()

  str1 = items[selected][1]
  GUI.Val("txtbox_caption_tasks", str1)
  str2 = items[selected][2]
  GUI.Val("txt_editor_tasks", str2)

end
__________________
ToDoList Donate Mark4Celest: Frid (i ditt hjärta) Eve & the Fisherman on Spotify
tompad is online now   Reply With Quote
Old 08-09-2018, 05:13 AM   #259
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,505
Default

Quote:
Originally Posted by tompad View Post
What is the best practice if I need 2 windows in my script?
Is it to make one main window and load another separate window
(or using tabs in main window)

or

Is it to have one window and make use of z-index to show and
hide the different parts I want to use.
Do you mean two script windows (gfx.init) or two Window elements?

The first can't be done - scripts are limited to one window at a time, so you'd have to gfx.quit the first window, open a new one, and then do the same to re-open your original window after.

The second doesn't require anything special. Just make sure that the z-layers you define for the first window don't overlap with the z-layers for the second window, so they both have their own space to do stuff in.
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is offline   Reply With Quote
Old 08-09-2018, 05:14 AM   #260
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,505
Default

Quote:
Originally Posted by tompad View Post
What is wrong with this? Suddenly my buttons dont run the functions
I told them to do. Not even msg!
That's weird. I don't see anything there that would break it - can you send me the entire script?
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is offline   Reply With Quote
Old 08-09-2018, 04:47 PM   #261
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 298
Default

Quote:
Originally Posted by Lokasenna View Post
Do you mean two script windows (gfx.init) or two Window elements?
I think I mean two window elements - like a dialog window but with more elements on than button Yes/No.
Like a window with a dialog window for preferences.

Quote:
The second doesn't require anything special. Just make sure that the z-layers you define for the first window don't overlap with the z-layers for the second window, so they both have their own space to do stuff in.
So I cant have say 2 buttons on the same coordinates (x,y) but in different z-layers?
My scenario is some buttons, listbox, frames etc in z-layer 11 and some
similar elements hidden in layer 5 and when I shift the z-layer - the
elements that have z-layer 11 get 5 and vice versa.
__________________
ToDoList Donate Mark4Celest: Frid (i ditt hjärta) Eve & the Fisherman on Spotify
tompad is online now   Reply With Quote
Old 08-09-2018, 05:48 PM   #262
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,505
Default

Sorry, I misunderstood.

You can have as many Window elements in your script as you want - my GUI Builder has two at the moment, and will certainly pick up one or two more at some point.

I don't think it would break anything to have them share the OK and Cancel buttons, however:

1. You'd have to remember to move them to the appropriate z-layers all the time.

2. You'd have to change what function they're calling so the appropriate Window's :close is being run.

IMO it's way easier to have a separate pair of buttons for each window.
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is offline   Reply With Quote
Old 08-10-2018, 03:41 AM   #263
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 298
Default

Quote:
Originally Posted by Lokasenna View Post
That's weird. I don't see anything there that would break it - can you send me the entire script?
I solved it by removing the "func = fun_edit" in the element and made a "function GUI.elms.btn_editnmouseup()" instead.
__________________
ToDoList Donate Mark4Celest: Frid (i ditt hjärta) Eve & the Fisherman on Spotify
tompad is online now   Reply With Quote
Old 08-10-2018, 04:36 AM   #264
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 298
Default

Quote:
Originally Posted by Lokasenna View Post
Sorry, I misunderstood.

You can have as many Window elements in your script as you want - my GUI Builder has two at the moment, and will certainly pick up one or two more at some point.

I don't think it would break anything to have them share the OK and Cancel buttons, however:

1. You'd have to remember to move them to the appropriate z-layers all the time.

2. You'd have to change what function they're calling so the appropriate Window's :close is being run.

IMO it's way easier to have a separate pair of buttons for each window.
Ok, I go with the z-layering method this time then, but using window class
looked interesting.
__________________
ToDoList Donate Mark4Celest: Frid (i ditt hjärta) Eve & the Fisherman on Spotify
tompad is online now   Reply With Quote
Old 08-10-2018, 04:48 AM   #265
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 298
Default Spagetti in head and code

Hi again :-)

It's interesting to code in Reascript/lua - but I must admit it
gets bigger and bigger, so many different way to do different things!

I need to narrow down what I want to do - so I am breaking it down to small parts.
Right now I wanted to make an item in a listbox selected when I start the script
and show some text that is connected to the item in a separate frame.
What I come up with is this, but I am unsure if this is the best way to do it?
Many of my earlier coding suffered of what I call "spagetti-code"
and I guess this is just another spagetti-version:

Code:
function  GUI.elms.lst_tasks:init ()

-- Make the first item selected
    self.retval = {[1] = true}

    GUI.Listbox.init(self)

-- Put the connected text in frame
    str = items[1][2]
    GUI.Val("frm_details", str)
end

GUI.Init()
GUI.elms.lst_tasks:init ()
GUI.Main()
Is this the optimal way to do it or can it be done in a better way? Hit me!
__________________
ToDoList Donate Mark4Celest: Frid (i ditt hjärta) Eve & the Fisherman on Spotify

Last edited by tompad; 08-10-2018 at 04:56 AM.
tompad is online now   Reply With Quote
Old 08-10-2018, 12:58 PM   #266
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,505
Default

- Some elements end up calling their init methods more than once, for instance if they have to re-do some internal calculations. In that case your code would be resetting the listbox to 1 = true unintentionally. I'd suggest doing that in a separate function.

- I recommend using GUI.Val() as a general rule, again because some of the elements do internal calculations that you're bypassing if you set retval directly. In this case it's not an issue, but if you were doing the same thing after Main has started you'd have to manually call self:redraw().

- To save yourself some time and typing, you could make a function for setting the frame's text.

Code:
function set_frm_details()
    GUI.Val("frm_details", items[1][2]
end

function set_initial_state()
    -- If you don't specify any keys, Lua will just start the 
    -- table at 1 for you
    GUI.Val("lst_tasks", {true})
end

set_initial_state()
set_frm_details()
GUI.Init()
GUI.Main()
Spaghetti code is something everyone does, especially when learning - it can take a lot of practice to stop doing it. If you're interested, I highly recommend these books:

Refactoring - Martin Fowler - Even if you just read the example where he tidies up a video store's software.

Clean Code - Robert C. Martin

Or just Google "refactoring" and "clean code", find some sites that actually show examples rather than telling you "don't do this", watch a video or two, etc.
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is offline   Reply With Quote
Old 08-11-2018, 04:00 AM   #267
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 298
Default

Quote:
Originally Posted by Lokasenna View Post

- To save yourself some time and typing, you could make a function for setting the frame's text.

Code:
function set_frm_details()
    GUI.Val("frm_details", items[1][2]
end

function set_initial_state()
    -- If you don't specify any keys, Lua will just start the 
    -- table at 1 for you
    GUI.Val("lst_tasks", {true})
end

set_initial_state()
set_frm_details()
GUI.Init()
GUI.Main()
Works like a charm!! Thanks
Quote:
Spaghetti code is something everyone does, especially when learning - it can take a lot of practice to stop doing it. If you're interested, I highly recommend these books:

Refactoring - Martin Fowler - Even if you just read the example where he tidies up a video store's software.

Clean Code - Robert C. Martin

Or just Google "refactoring" and "clean code", find some sites that actually show examples rather than telling you "don't do this", watch a video or two, etc.
Will order books, starting with Refactoring.

Just Googled and have already put away some bad smell :-)

Thanks for the recommendation!
__________________
ToDoList Donate Mark4Celest: Frid (i ditt hjärta) Eve & the Fisherman on Spotify
tompad is online now   Reply With Quote
Old 08-11-2018, 11:31 AM   #268
solger
Human being with feelings
 
solger's Avatar
 
Join Date: Mar 2013
Posts: 3,055
Default

Hey Lokasenna,

I'm currently adapting the ReaLauncher code for Linux support and it seems like that Linux needs the same font scaling as OSX.
So it would be great if you could add this in a future update (see the bold part added to your code below). Thanks.

Quote:
Originally Posted by Core.lua
GUI.font = function (fnt)

local font, size, str = table.unpack( type(fnt) == "table"
and fnt
or GUI.fonts[fnt])

-- Different OSes use different font sizes, for some reason
-- This should give a roughly equal size on Mac
if string.find(reaper.GetOS(), "OSX") or string.find(reaper.GetAppVersion(), "Linux") then
size = math.floor(size * 0.7)
end

-- Cheers to Justin and Schwa for this
local flags = 0
if str then
for i = 1, str:len() do
flags = flags * 256 + string.byte(str, i)
end
end

gfx.setfont(1, font, size, flags)

end
Checking for a "Linux" version via reaper.GetAppVersion() seems to be the better (more readable code) option since reaper.GetOS() returns just "Other".

Quote:
reaper.GetAppVersion(): 5.941/linux64
reaper.GetOS(): Other
__________________
ReaLauncher
solger is offline   Reply With Quote
Old 08-11-2018, 11:45 AM   #269
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,505
Default

I can probably just check if not Windows, but sure. Updating.
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is offline   Reply With Quote
Old 08-11-2018, 11:45 AM   #270
solger
Human being with feelings
 
solger's Avatar
 
Join Date: Mar 2013
Posts: 3,055
Default

Quote:
Originally Posted by Lokasenna View Post
I can probably just check if not Windows, but sure. Updating.
Yeah, whatever works best Thanks.
__________________
ReaLauncher
solger is offline   Reply With Quote
Old 08-12-2018, 02:14 AM   #271
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 298
Default Curser placement

Hi again! :-)

I'm not sure if this have been discussed earlier, but I'm running
Reaper on linux and the cursor placement in Textbox and Texteditor
is strange. The cursor is visible in middle of text but if I backspace
it removes the last letters in end of text. A bug?
__________________
ToDoList Donate Mark4Celest: Frid (i ditt hjärta) Eve & the Fisherman on Spotify
tompad is online now   Reply With Quote
Old 08-12-2018, 06:12 AM   #272
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,505
Default

Are you running the newest version of the GUI? There were some font issues common to Mac and Linux that (AFAIK) were fixed recently.

Does your Linux have DejaVu Sans Mono? It looks for that because (according to the internet) 90%+ of Linux installations have it, but if you don't then you'll end up with Arial or Courier or something.
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is offline   Reply With Quote
Old 08-12-2018, 09:55 PM   #273
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 298
Default

Quote:
Originally Posted by Lokasenna View Post
Are you running the newest version of the GUI? There were some font issues common to Mac and Linux that (AFAIK) were fixed recently.
I am running 2.15.7.
Quote:
Does your Linux have DejaVu Sans Mono? It looks for that because (according to the internet) 90%+ of Linux installations have it, but if you don't then you'll end up with Arial or Courier or something.
I checked the system and DejaVu Sans Mono is installed.

Edit:
Can it be something with using GUI from an earlier version of Guibuilder?
__________________
ToDoList Donate Mark4Celest: Frid (i ditt hjärta) Eve & the Fisherman on Spotify

Last edited by tompad; 08-13-2018 at 03:32 AM.
tompad is online now   Reply With Quote
Old 08-13-2018, 04:31 AM   #274
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,505
Default

Maybe. Have a look in the script and see what the textbox's font_b is set to - it should be "monospace", but older ones might be "textbox".
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is offline   Reply With Quote
Old 08-13-2018, 11:01 AM   #275
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 298
Default

Quote:
Originally Posted by Lokasenna View Post
Maybe. Have a look in the script and see what the textbox's font_b is set to - it should be "monospace", but older ones might be "textbox".
Font_b is set to monospace. :-(
__________________
ToDoList Donate Mark4Celest: Frid (i ditt hjärta) Eve & the Fisherman on Spotify
tompad is online now   Reply With Quote
Old 08-13-2018, 11:54 AM   #276
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,505
Default

This may or may not help - it lets you specify a font, tries to draw some text with it, and shows rectangles for the reported character sizes. Save it, run it, click the window, enter "DejaVu Sans Mono", and see what happens.

https://www.dropbox.com/s/f7sxxqzy4f...uring.lua?dl=0
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is offline   Reply With Quote
Old 08-13-2018, 12:35 PM   #277
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 298
Default

Quote:
Originally Posted by Lokasenna View Post
This may or may not help - it lets you specify a font, tries to draw some text with it, and shows rectangles for the reported character sizes. Save it, run it, click the window, enter "DejaVu Sans Mono", and see what happens.

https://www.dropbox.com/s/f7sxxqzy4f...uring.lua?dl=0
It tells me "DejaVu Sans Mono is not a valid font face " in red.
__________________
ToDoList Donate Mark4Celest: Frid (i ditt hjärta) Eve & the Fisherman on Spotify
tompad is online now   Reply With Quote
Old 08-13-2018, 12:57 PM   #278
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,200
Default

Quote:
Originally Posted by tompad View Post
It tells me "DejaVu Sans Mono is not a valid font face " in red.
Try without the spaces: DejaVuSansMono.
cfillion is offline   Reply With Quote
Old 08-13-2018, 01:09 PM   #279
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 298
Default

Quote:
Originally Posted by cfillion View Post
Try without the spaces: DejaVuSansMono.
Same answer....
__________________
ToDoList Donate Mark4Celest: Frid (i ditt hjärta) Eve & the Fisherman on Spotify
tompad is online now   Reply With Quote
Old 08-13-2018, 01:29 PM   #280
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,200
Default

Quote:
Originally Posted by tompad View Post
Same answer....
Ah right, for some reason gfx.getfont() always returns an empty string on Linux (bug?). Try bypassing the check with "if false then" instead of "if retfont ~= font then".

libSwell on Linux finds fonts from their filename instead of the family name (DejaVu Sans Mono is usually installed as DejaVuSansMono.ttf without spaces). (It also appears to only scan inside /usr/share/fonts so I don't think it supports user fonts or exotic installs, but I digress...)

Last edited by cfillion; 08-13-2018 at 02:10 PM.
cfillion 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 11:06 PM.


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