Jump to content


Photo

error message


  • Please log in to reply
8 replies to this topic

#1 Raegae

Raegae

    Local Chief Member

  • Normal Members
  • PipPipPipPipPip
  • 240 posts
  • Gender:Male
  • Location:Turku Finland

Posted 07 June 2018 - 23:08

myfirstoolhelp.png
when I click on the bitmap image I get that error message ?

#2 Raul (ulneiz)

Raul (ulneiz)

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1525 posts
  • Gender:Male
  • Location:Spain

Posted 07 June 2018 - 23:50

attachicon.gifmyfirstoolhelp.png
when I click on the bitmap image I get that error message ?

 

It would be good if you shared the code, to be able to talk about it.

 

The line 95 is calling a variable named "show_status" that is not declared or defined previously.


:excl: Development of my tools: KangarooX120SamRenderPhraseTouch  |  GT16-Colors (old)

 

:excl: My API wishlist R3.1 (updated 24 July 2017):

Spoiler

 

:excl: My Renoise 3.1 wishlist (updated 26 September 2017):

Spoiler

#3 dblue

dblue

    Dodgy Geezer

  • Admins
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5815 posts
  • Gender:Male
  • Location:Berlin
  • Interests:Code. Music. Graphics.

Posted 08 June 2018 - 00:05

Note that show_status() is a function of the renoise.app() class, so you must use a semicolon ":" to call the function itself, rather than a period "." which you'd use when reading/writing basic properties.

Incorrectly using a period as if reading a property of the class:
renoise.app().show_status("This will never be seen!")
Correctly using a semicolon to access/call a function within the class:
renoise.app():show_status("Hello world!")
Perhaps something like this was to blame?

Would be much easier if we could see your code, as Raul already said ;)

#4 Raegae

Raegae

    Local Chief Member

  • Normal Members
  • PipPipPipPipPip
  • 240 posts
  • Gender:Male
  • Location:Turku Finland

Posted 08 June 2018 - 01:46

ok, this is very whacky then ...
renoise.tool():add_menu_entry {
  name = "Main Menu:Tools:Available",
  invoke = function() available_controls() end 
}


function available_controls()

 -- now we create a dialog with all available controls (things that let the 
  -- user change "values"), so you get an idea how all the views look like, 
  -- which views to choose from when creating a new custom GUIs.
  --
  -- but one note about controls & "values" in general first: as you'll see 
  -- below, we do attach notifiers to the values of the controls. Notifiers are
  -- callback functions that are called as soon as the user changed the views 
  -- value through the GUI. To maintain something like an external state that
  -- you are going to use outside the view, make sure you do keep the views value
  -- and "your" value in sync.
  --
  -- here is a somple example on how to sync an external value with "your" value:
  --
  -- current_velocity = 0x7f -- used in other places like your processing functions
  --
  -- vb:slider {
  --   value = current_velocity, -- initialize the GUI with your value
  --   notifier = function(slider_value) -- update your value when the GUI changed
  --     current_velocity = slider_value
  --   end,
  --   min = 0,
  --   max = 0x7f
  -- }
  --
  -- there is another way of dealing with "values", which we will describe in the 
  -- next example more in detail. Basically you can also pass over an Observable 
  -- object to the view (not the raw number, boolen), which then will be used by 
  -- the view instead of its onw value. Any changes to this value can then tracked 
  -- outside of this view. This often is very useful to seperate the GUI code from
  -- the controller and data. Here is a simple example:
  --
  -- -- (the controller part of your script)
  -- options.current_velocity = 0x7f
  -- options.current_velocity.add_notifier(current_value_changed_function)
  
  -- -- (and the GUI)
  -- vb:slider {
  --   bind = options.current_velocity, -- only gets a reference passed
  --   min = 0,
  --   max = 0x7f
  -- }

  -- we memorize a reference to the dialog this time, to close it
  local control_example_dialog = nil
  
  local vb = renoise.ViewBuilder()
  
  local DIALOG_MARGIN = 
    renoise.ViewBuilder.DEFAULT_DIALOG_MARGIN
  
  local CONTENT_SPACING = 
    renoise.ViewBuilder.DEFAULT_CONTROL_SPACING
  
  local CONTENT_MARGIN = 
    renoise.ViewBuilder.DEFAULT_CONTROL_MARGIN
  
  local DEFAULT_CONTROL_HEIGHT = 
    renoise.ViewBuilder.DEFAULT_CONTROL_HEIGHT
  
  local DEFAULT_DIALOG_BUTTON_HEIGHT =
    renoise.ViewBuilder.DEFAULT_DIALOG_BUTTON_HEIGHT
  
  local DEFAULT_MINI_CONTROL_HEIGHT = 
    renoise.ViewBuilder.DEFAULT_MINI_CONTROL_HEIGHT
  
  local TEXT_ROW_WIDTH = 80


  ---- CONTROL ROWS
 


  
  -- bitmapview 
  local bitmapview_row = vb:row {
    vb:text {
      width = TEXT_ROW_WIDTH,
      text = "rægæ:bitmap"
    },
    vb:bitmap {
      -- recolor to match the GUI theme:
      mode = "body_color",
      -- bitmaps names should be specified with a relative path using
      -- your tool script bundle path as base:
      bitmap = "Bitmaps/RenoiseLua.bmp",
      notifier = function()
        show_status("bitmapview was pressed")
      end
    },
    --[[ TODO vb:bitmap {
      mode = "alpha",
      bitmap = "Bitmaps/RenoiseLua.png",
      notifier = function()
        show_status("bitmapview was pressed")
      end
    } ]]
  }
  


  

  
  -- close button
    
  local close_button_row = vb:horizontal_aligner {
    mode = "right",
    
    vb:button {
      text = "Close",
      width = 60,
      height = DEFAULT_DIALOG_BUTTON_HEIGHT,
      notifier = function()
        control_example_dialog:close()
      end,
    }
  }
    
    
  ---- MAIN CONTENT & LAYOUT
  
  local dialog_content = vb:column {
    margin = DIALOG_MARGIN,
    spacing = CONTENT_SPACING,
    
    vb:row{
      spacing = 4*CONTENT_SPACING,

      vb:column {
        spacing = CONTENT_SPACING,
        
       
      
        bitmapview_row
      },

      vb:column {
        spacing = CONTENT_SPACING,
  
       
        
        vb:space {height = DEFAULT_CONTROL_HEIGHT},
      
        
        vb:space {height = DEFAULT_CONTROL_HEIGHT},
       
        
     
      },

      vb:column {
        spacing = CONTENT_SPACING,

       
        
        
      }
    },
    
    -- close
    close_button_row
  }
  
  
  -- DIALOG
  
  control_example_dialog = renoise.app():show_custom_dialog(
    "Hei Maailma", dialog_content
  )

end


#5 dblue

dblue

    Dodgy Geezer

  • Admins
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5815 posts
  • Gender:Male
  • Location:Berlin
  • Interests:Code. Music. Graphics.

Posted 08 June 2018 - 02:44

Ah, I see you took a snippet of code from ExampleToolGui, and then built on top of that.

If you look again at main.lua from ExampleToolGui, near the top it defines the following helper function:
 
local function show_status(message)
  renoise.app():show_status(message)
  print(message)
end
This is just a handy shortcut that is used throughout the tool itself, which your own derived code is obviously lacking.

So you can either simply add that helper function back to your own main.lua file, or you can change the references from the shortcuts show_status() back to the full line of code instead renoise.App():show_status()

#6 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1816 posts
  • Gender:Not Telling

Posted 08 June 2018 - 16:25

Note that show_status() is a function of the renoise.app() class, so you must use a semicolon ":" to call the function itself, rather than a period "." which you'd use when reading/writing basic properties.


renoise.app().show_status(renoise.app(), "I can see myself!")
just for lols ;)
  • dblue likes this

#7 Raegae

Raegae

    Local Chief Member

  • Normal Members
  • PipPipPipPipPip
  • 240 posts
  • Gender:Male
  • Location:Turku Finland

Posted 02 August 2018 - 03:56

Can u help me a bit out more? how the code should look like if i want to only show image that chages when u click on it?

#8 Raegae

Raegae

    Local Chief Member

  • Normal Members
  • PipPipPipPipPip
  • 240 posts
  • Gender:Male
  • Location:Turku Finland

Posted 04 August 2018 - 19:53

ok, I start my own investigations ... 



#9 Raegae

Raegae

    Local Chief Member

  • Normal Members
  • PipPipPipPipPip
  • 240 posts
  • Gender:Male
  • Location:Turku Finland

Posted 10 August 2018 - 17:15

local function show_status(message)
  renoise.app():show_status(message)
  print(message)
end
This is just a handy shortcut that is used throughout the tool itself, which your own derived code is obviously lacking.

So you can either simply add that helper function back to your own main.lua file.

 

 

i really try to wrap myself around this, do you mean that "show_status" function: -->

vb:bitmap {
-- recolor to match the GUI theme:
mode = "body_color",
-- bitmaps names should be specified with a relative path using
-- your tool script bundle path as base:
bitmap = "Bitmaps/RenoiseLua.bmp",
notifier = function()
show_status("bitmapview was pressed")
end
},

if u get wadai mean