as far as I know, you canât.
I asked for it may be two years ago. it is in the same state today.
same as a search field in the toolbar.
should be done but lots of web framework seems not finished.
if you need it, you should look into making your own websdk for it
I tried the icon, which did work for small icons that seemed to be limited to a square the height of the web toolbar. I need to display a wide logo. Should it work for that or is there a better way?
I am newly returning to Xojo, and Iâm not ready to dive into the websdk option yet.
Thanks for sharing the example. Shouldnât the other menu items be more centered/aligned as well when the logo height exceeds 30px? Or can that be done easily?
In the example, the height of the logo is forced to be 30px, so the âTestingâ title should be aligned. What browser are you using so I can review it?
Iâm using an SVG company logo in my Web2 Toolbar to set the Icon and had to make extra space in the tollbar to make it the size I wanted changing width, height and padding for the Toolbar Icon.
This is from the module for returning the SVG logo as a Web Picture that I use to set the Toolbar Icon, tb.Icon = LoadWhiteLogo), in my session method to create the Toolbar. My bootstrapmin file I have modified to make the toolbar 90 pixels in height.
Public Function LoadWhiteLogo() As WebPicture
If LogoWhite Is Nil Then
// Open the White Logo
Var logoSVGFile As FolderItem = New FolderItem("C:\WebApps\Resources\jostens-logo-w.svg")
Var svgData as string
// Check to see if the file exisits and load the file into the variable svgData
If logoSVGFile <> Nil And logoSVGFile.Exists Then
Var t As TextInputStream
Try
// As SVG consists of XML-based instructions, we can read it like text
t = TextInputStream.Open( logoSVGFile )
t.Encoding = Encodings.UTF8
svgData = t.ReadAll
Catch e As IOException
MessageBox("Error accessing the SVG")
End Try
t.Close
end if
Logo_Wht_svgData = svgData
LogoWhite = new WebPicture
LogoWhite.MIMEType = "image/svg+xml"
// important to make the picture available to all sessions of the running app
LogoWhite.Session = Nil
LogoWhite.Data = Logo_Wht_svgData
End If
Return LogoWhite
End Function
If you look at the code in my sample below you can modify the App HTML Headers and change the padding to the right of the icon and that will modify where the other menus begin. Also you add a flexible space so that menus are right justified or you can add the Flexible space after first adding menus and then the remaining menus you add will be right justified. I did it that way on my toolbar example for Login, Prefs and Logs buttons with Icons.
// Add a flexible space so that icon buttons are right justified
Var flexspace As New WebToolbarButton
flexspace.Style = WebToolbarButton.ButtonStyles.FlexibleSpace
tb.AddItem(flexspace)