Web 2.0 ImageButton

In web 1.0, I was able to fake imagebuttons using a webimageviewer and some specific styles that would mimick the appearance and behavior of a button. I vastly prefer imagebuttons to buttons with captions.

Now, the styling direction taken by Xojo with Web 2.0 makes that approach pretty much impossible. Or at least, fiddling with this since Web 2.0 came out in beta, I have still to find a way to do it completely.

The next option would be to add an image to the webbutton. The image would need to be specific to the button of course. In the course of my research on this, I was able to create a button with an image using HTML in the app HTMLHeader. The button looked about right, but I was unable to place it where I want it, nor was I able to implement event handlers for it. So, back to adding an image to a webbutton. I suppose that I could inject the svg icon (or Xojo picture) with some javascript, but being pretty inept at javascript, this is something that is beyond me.

If anyone has an idea on how this could be achieved, I would greatly appreciate the help!

use the websdk and make your own control.

That is one way. Failing to achieve what I want some other way, I may venture there.

I know that it is possible to add FontAwsome icons to a button as a caption, using the “raw”

" tag. I don’t want to use FontAwsome, nor stock Bootstrap icons, but instead the icon collection I paid handsome money to assemble. I am looking for some similar method.

edit: RAW in brackets (>< in the reverse order) did not show on the forum.

Have you made progress on this. I flipped through the docs but decided that I have no time for it currently …

yes I have to send the content of the input group back to xojo, but I know how to do it.
also I will use fontawesome instead of bootstrap icons that I don’t know how to render properly (color, etc) … and make some web page to sell it at low price !

1 Like

Take my money! :slight_smile: - I like small “plugins” doing one thing perfectly.

1 Like

I would not mind at all if one of the Xojo architects, who decided we should go down the Bootstrap road, would chime in to tell us how to do it in Web 2.0. This is something that we could do easily in 1.0 and that seems difficult in 2.0 at best.

Xojo, you now have the talking stick.

1 Like

bootstrap road is “easy”, bootstrap icons are not (except loading the icon in a webPicture)

I beg to differ. After several weeks of fiddling with a Bootstrap theme, I am nowhere near achieving what I could do easily on 2019 R3.1.

Yes, if you want generic stuff, if you like your program with someone elses design preferences, Bootstrap is easy. Otherwise, it is a mess and a real maze that just keeps you away from your goal of making an app quickly.

As a workaround, we can use the segmentbutton with just one segment. Not ideal, but workable.