Convert a string to a component object in MIT App Inventor - app-inventor

I am building an app in MIT App Inventor. I have several textboxes. If I click on a textbox, the colorpicker screen opens and the user can choose a color. Like here:
The variable "component" (recognition of the clicked textbox) is parsed to the Screen and after the color was picked and button1 was clicked, the rgb value and the "component" is returned back to the previus screen.
The Screen is changed back and now the textbox should show the rgb value as a text in the box. Thats why the app need the information, which textbox called the color picker screen before.
The component is stored back as string, but it should be parsed as a textbox component, so the program is able to know, which textbox the RGB Value should be filled in.
com.google.appinventor.components.runtime.TextBox#7b920d1
Is there a solution to convert the string "com.google.appinventor.components.runtime.TextBox#7b920d1" to this format: com.google.appinventor.components.runtime.TextBox#7b920d1

Related

Remove ugly grey from NSButton when using image and text

In interface builder I have an image button with the text set to "Save"
Here is a screenshot of how it looks when the app is run. The button on the right is one without text so you can see what it should look like. As you can see with text it looks bad as the App is throwing in that ugly grey color on it's own.

Change Label Text Alignment in App Inventor 2 code block

I would like to know wether we can change the Text Alignment of a label using the App Inventor 2's Code Block. I would like to make a button to select the text alignment position of a label or button.
You can't change the text alignment of a label programmatically in App Inventor
As workaround for example define 2 Labels, one having an alignment left and another having an alighment right and hide the second label. Then after button click copy the text of the label and display the other label instead, see screenshot.

XCode: Graphical button with invisible title

I have a bunch of buttons. They appears as an graphical image. If a user clicked on a button I can determine with
sender.titleLabel!.text!
which button the user pressed. But the title of the button appears in the view. I want only to show the image and give the button a invisible title. But I think that is not possible.
Me second solution is to create for each button an outlet. But I think with 30 buttons that is a very bad solution.
Option 1:
For the button text color property set opacity to 0. The text is there, but fully transparent.
Option 2:
You may use the tag value to identify a button so you do not have to rely on the button title. You can set the tag value in interface builder (Xcode) or in code. (The tag is an integer.)
I usually prefer option 2 as it is resilient to text changes over time (think of typos, translations for other languages etc.).

Navigation Controller back button image manipulation

I am, no matter what I try, unable to change the back button colour and default image.
Here is what it looks like rite now:
The leftmost arrow is the default and the right most is my custom arrow.
This is how I set it up in storyboard:
How do I remove that pesky default image and replace it with my own?
The button you are adding is overriten by the default back button provided by the navBar. The only way you could do that is by adding it from within the code and by creating an UIButton inside the UIBarButton with an image and/or text, you should set its action a popViewController.

How to show the picture box in front of textbox, combo box inside the Frame?

Using VB 6
Am using Frame, Inside that frame am using textbox, combo box, labels.
When I am running the project it will show like "processing".
So I used the picuture box also inside that frame. But Picture box is not showing in the front of textbox, combobox, labels.
I tried, but it is showing only the picture layout, it is not showing the label “processing”
How to set a property for this condition.
Exactly i need, while executing the program it will show like processing then it will display a output.
Need VB 6 Help
A label component does not have a window handle -- hWnd, but instead is drawn right on its parent (in this case, the frame component it sounds like).
A combobox, a textbox, and a picturebox all have a window handle (hWnd), so can have a zOrder and appear behind/in front of other components.
I believe the answer to your question is to place the label component inside a picturebox, and then set the zOrder of the picturebox as needed.
It sounds like your label is underneath one of the other controls (your question isn't particular clear) - if that is the case, you need to play with the ZOrder property of your controls to be able to decide which control gets to be on top (i.e. to be displayed). This link gives you an example of how to use this property.

Resources