C++ dialog boxes

I am so sadly weak at making C++ interact with the world outside of VCV. :confused: I need to create a dialog box to allow the user to enter a number for a set and forget type parameter (it would not be good to just have a knob for this).

Is there an easy OS-independent way of doing this? Just asking before I dive into Rack’s code since it is done there :slight_smile:

A textbox on the context menu won’t work?

?? well, I plan on opening said dialog box from context menu?

I mean enter the number right in a textbox on the context menu of the module, like the context menu of a parameter where you can enter a value.

1 Like

wow, that would be even better! Is there an example I can find of this?

This is how it’s done for ParamWidget:

2 Likes

thank you so much!!!

2 Likes

before I dive too deep, does this work ok on the main context menu? This is a global parameter

You mean on the context menu of the module? Then yes.

actually, I am going to take a quick look at your intermix module - the way you set up “display brightness” would be perfect :slight_smile:

You have two options: Open a native OS dialog box, or open a menu with Rack containing a text field.

  1. osdialog doesn’t support “prompt” style dialogs yet (similar to JavaScript’s prompt()). That project is open-source and I am accepting feature requests to the project, and possibly PRs after the task is discussed.
  2. You can open a menu with createMenu() and put a TextField subclass in it. Override the onSelectKey() method to call the superclass’s method and then respond to the Enter key to accept the user input.
1 Like