How do I set my extension's block's inputs to "Inline inputs"

In my extension, I want a few of the blocks to have "Inline Inputs" by default for a better view, how can I achieve it ?

Is it even possible to achieve this ?

This is not possible.

1 Like

Study the Open Source to see how it is done?

1 Like

No, I believe it cannot be achieved. It has to be done manually by the user. Maybe it is something that is defined in the Blockly library, and not accessible with Java code?

I imagine it might be a secondary set of Blocks for identical function? So although in App Inventor it is presented for the User to toggle, if the extension can't achieve the toggling perhaps it can just default to inline.......

1 Like

Is there any component whose block has inline inputs by default ?

If yes, I think it will be worth searching in the Open-Source-Code.

I don't think there is.

1 Like

Which of these directories contains the src of built-in blocks ?

I don't think they could help though, but its worth viewing.

P.S.

I found them, but they are all .js :sweat_smile:

A script defines them? Would that mean you could copy and edit a Block that is closest to your requirement?

Just thinking out loud - probably nonsense :roll_eyes:

1 Like

Inline versus external inputs is controlled by the block and it just has to do with how it is rendered. There aren't separate block types to achieve this effect. However, the inlined-ness of the block isn't something the extension can specify. It seems like it might be a useful property though for methods. If you would be interested in contributing a PR to the open source repo to add support for it, that would be helpful. We'd probably want to add it as a flag in the @SimpleFunction annotation, store that flag in the simple_components.json structure, and then have the component_method block handle it when initializing.

6 Likes

I know nothing about how to do that. :sweat_smile:

Can't understand a thing from the article that explains about pull requests.

Is this the article you are referring to, or something else?

1 Like

I was reading the GitHub Guide about Pull Requests.

I'll read this article now.

P.S.

It seems I can't fork a project from my Android.
Would be doing that after a month then.

You may be able to do it if you request the desktop version of the page in Chrome. However, I wouldn't recommend trying to edit the sources on an Android device since they typically don't come with all the software you need to build App Inventor.

1 Like

Ya OK Thanks.

I'll close the topic by marking the solution then.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.