<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>2024r1 &#8211; Xojo Programming Blog</title>
	<atom:link href="https://blog.xojo.com/tag/2024r1/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.xojo.com</link>
	<description>Blog about the Xojo programming language and IDE</description>
	<lastBuildDate>Wed, 07 Jan 2026 16:01:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Android Design Extensions 2.5 for Xojo 2024r1 +</title>
		<link>https://blog.xojo.com/2024/03/26/android-design-extensions-2-5-for-xojo-2024r1/</link>
		
		<dc:creator><![CDATA[Martin T.]]></dc:creator>
		<pubDate>Tue, 26 Mar 2024 15:40:00 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Guest Post]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[2024r1]]></category>
		<category><![CDATA[Declares]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=12818</guid>

					<description><![CDATA[The first Xojo version in 2024 is ready and so it's time again for an update of the Android Design Extensions, which are now available in version 2.5. This version runs for all Xojo versions from 2024r1 upwards and offers over 70 new declares. The focus of this release was on the integration of pictures in controls, such as MobileButton, MobileDateTimePicker, MobileTextFields, MobileSlider etc.]]></description>
										<content:encoded><![CDATA[
<p>The first Xojo version in 2024 is ready and so it&#8217;s time again for an update of the Android Design Extensions, which are now available in version 2.5. This version runs for all Xojo versions from 2024r1 upwards and offers over 70 new declares.</p>



<p>The focus of this release was on the integration of pictures in controls, such as MobileButton, MobileDateTimePicker, MobileTextFields, MobileSlider etc.</p>



<p>Let&#8217;s take a look at some new possibilities using examples.</p>



<h2 class="wp-block-heading">Create a MobileButton with a Picture</h2>



<p>This is a feature that is in demand in Xojo Issue Tracker and has not yet found its way into the Android framework. So let&#8217;s just do it ourselves with the help of the Android Design Extensions.</p>



<p>Create a new Android project. Now copy the Android Design Extensions folder into the project or drag and drop it into the Navigator. Now select Screen1 in the Navigator and add a MobileButton &#8211; Button1 &#8211; and give it the Opening event. Add the following code to the Opening event: </p>



<pre id="xojo" class="wp-block-code"><code>Me.SetIconXC(SaveSystemImage("camera")) 
Me.SetIconGravityXC(IconGravity.TextStart)</code></pre>



<p><em>SaveSystemImage </em>is an extension method that returns a <em>FolderItem </em>and saves a <em>Picture.SystemImage </em>with the specified name (here „camera“) in the Documents folder. Why? Xojo Declares do not support Picture as a data type and therefore we have to take the detour and save images once in order to load them into controls via the file path.</p>



<p>You can of course also use any other image and are not restricted to Picture.SystemImage. All Android Design Extensions extension methods that have to do with the display of pictures are prepared for this and expect a FolderItem as a parameter, which must of course be a picture (PNG, JPEG etc.).</p>



<p><em>SetIconGravityXC </em>ensures that the Picture is displayed in front of the button text. And that&#8217;s all there is to it. Execute the project and you have a button with an image.</p>



<figure class="wp-block-image size-large is-style-default"><img fetchpriority="high" decoding="async" width="1024" height="531" src="https://blog.xojo.com/wp-content/uploads/2024/03/untitled-1024x531.png" alt="" class="wp-image-12821" srcset="https://blog.xojo.com/wp-content/uploads/2024/03/untitled-1024x531.png 1024w, https://blog.xojo.com/wp-content/uploads/2024/03/untitled-300x156.png 300w, https://blog.xojo.com/wp-content/uploads/2024/03/untitled-768x398.png 768w, https://blog.xojo.com/wp-content/uploads/2024/03/untitled.png 1080w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>Tip: </strong>If you create a MobileButton subclass, you can cache the FolderItem via Static to create the image file only once. Of course, this only applies to the fact that all button instances of this subclass should always display the same image.</p>



<p>To see how to add an image to a MobileScreen, MobileSlider or MobileSwitch, simply take a look at the Android Design Extensions sample app.</p>



<h2 class="wp-block-heading">TabPanel Badge Extension</h2>



<p>MobileTabPanel tabs now also support text badges. How is it done?</p>



<p>Add a MobileTabPanel &#8211; TabPanel1 &#8211; to your project and add the Opening event to it with the following code: </p>



<pre class="wp-block-code"><code>Me.SetBadgeTextAtXC(0, "Exclusive")</code></pre>



<p>And that&#8217;s all there is to it. The result is as follows:</p>



<figure class="wp-block-image size-large is-style-default"><img decoding="async" width="1024" height="474" src="https://blog.xojo.com/wp-content/uploads/2024/03/jewlery-1024x474.png" alt="" class="wp-image-12820" srcset="https://blog.xojo.com/wp-content/uploads/2024/03/jewlery-1024x474.png 1024w, https://blog.xojo.com/wp-content/uploads/2024/03/jewlery-300x139.png 300w, https://blog.xojo.com/wp-content/uploads/2024/03/jewlery-768x356.png 768w, https://blog.xojo.com/wp-content/uploads/2024/03/jewlery.png 1080w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>There are other MobileTabPanel extension methods with which you can customize the badges (color, position, etc.). Give it a try!</p>



<h2 class="wp-block-heading">TextFields on a New Level</h2>



<p>TextFields can also be enhanced with the new Android Design Extensions version.</p>



<p>The <em>SetBoxCornerFamilyXC </em>call now offers the option of choosing whether you want rounded or flattened corners. You can also use <em>SetCursorColorXC </em>to define the color of the cursor for each individual TextField.</p>



<p>TextFields can now also have leading or trailing icons. The helper methods for this are <em>SetStartIconXC </em>and <em>SetEndIconXC</em>, which in turn expect a FolderItem (Picture) as a parameter.</p>



<figure class="wp-block-image size-large is-style-default"><img decoding="async" width="1024" height="289" src="https://blog.xojo.com/wp-content/uploads/2024/03/defaut-text-1024x289.png" alt="" class="wp-image-12819" srcset="https://blog.xojo.com/wp-content/uploads/2024/03/defaut-text-1024x289.png 1024w, https://blog.xojo.com/wp-content/uploads/2024/03/defaut-text-300x85.png 300w, https://blog.xojo.com/wp-content/uploads/2024/03/defaut-text-768x217.png 768w, https://blog.xojo.com/wp-content/uploads/2024/03/defaut-text.png 1080w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>There are many other new declares. Have a look here too.</p>



<p>Feel free to take a look at the developer repository, create feature requests, and provide feedback on extending this extension library.</p>



<p>I’m happy to receive any voluntary financial support for the work I’ve done so far, which you are welcome to <a href="https://www.paypal.com/paypalme/MTrippensee">share</a> here. You can download the project with many examples <a href="https://github.com/XojoGermany/AndroidDesignExtensions">here</a>.</p>



<p>Happy Coding.</p>



<p><em>Martin T. is a Xojo MVP and has been very involved in testing Android support.</em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Popovers for Xojo Desktop, Web and iOS</title>
		<link>https://blog.xojo.com/2024/03/26/popovers-for-xojo-desktop-web-and-ios/</link>
		
		<dc:creator><![CDATA[Javier Menendez]]></dc:creator>
		<pubDate>Tue, 26 Mar 2024 15:27:47 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Xojo Cloud]]></category>
		<category><![CDATA[2024r1]]></category>
		<category><![CDATA[Multi-Platform Development]]></category>
		<category><![CDATA[Popovers]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[User Interface]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=12707</guid>

					<description><![CDATA[Starting with Xojo 2024r1 there's a new Window type in Xojo's UI/UX bag: Popovers. Popovers are kind of a Modal window with a more transient behavior and associated with a Parent control. A Popover will display the chosen content or layout, the same as when you design the user interface of a window or a Container control that will be included as part of another more complex design or displayed at runtime.]]></description>
										<content:encoded><![CDATA[
<p>Starting with Xojo 2024r1 there&#8217;s a new Window type in Xojo&#8217;s UI/UX bag: Popovers. Popovers are kind of a Modal window with a more transient behavior and associated with a Parent control. A Popover will display the chosen content or layout, the same as when you design the user interface of a window or a Container control that will be included as part of another more complex design or displayed at runtime.</p>



<span id="more-12707"></span>


<div class="wp-block-image is-style-default">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="1024" height="558" src="https://blog.xojo.com/wp-content/uploads/2024/03/Popover-1024x558.png" alt="" class="wp-image-12708" srcset="https://blog.xojo.com/wp-content/uploads/2024/03/Popover-1024x558.png 1024w, https://blog.xojo.com/wp-content/uploads/2024/03/Popover-300x164.png 300w, https://blog.xojo.com/wp-content/uploads/2024/03/Popover-768x419.png 768w, https://blog.xojo.com/wp-content/uploads/2024/03/Popover-1536x837.png 1536w, https://blog.xojo.com/wp-content/uploads/2024/03/Popover-2048x1116.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>And what do we mean by the transitory character of Popover windows? Well, and here comes one of the first differences from Modal windows. When a Popover is visible and the user clicks or taps on any other element of the graphical interface not contained in the Popover itself it will close, hence transitory. So, you don&#8217;t have to include the typical &#8220;Close window&#8221; button in a Popover (though you can), since it will close when the user clicks outside of it, i.e. when the Popover loses focus.</p>



<h3 class="wp-block-heading">Where are the Popover Window Contents?</h3>



<p>Where do you define the content displayed in a Popover window? While in your Web app, you can do it on any Container control added to the project. In the case of Desktop and iOS apps, you can do it on either the designs of a Container Control or any Window or Screen added to the project.</p>



<p>For example, here you can see that the content shown as a Popover in the previous screenshot is actually that of a Window (Window2) added to the project:</p>


<div class="wp-block-image is-style-default">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="1024" height="558" src="https://blog.xojo.com/wp-content/uploads/2024/03/PopoverUI-1024x558.png" alt="" class="wp-image-12709" srcset="https://blog.xojo.com/wp-content/uploads/2024/03/PopoverUI-1024x558.png 1024w, https://blog.xojo.com/wp-content/uploads/2024/03/PopoverUI-300x163.png 300w, https://blog.xojo.com/wp-content/uploads/2024/03/PopoverUI-768x418.png 768w, https://blog.xojo.com/wp-content/uploads/2024/03/PopoverUI-1536x837.png 1536w, https://blog.xojo.com/wp-content/uploads/2024/03/PopoverUI-2048x1116.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>This introduces additional flexibility allowing your app&#8217;s logic to decide when to display a Window or Container instance as you have been doing until now, or display it as a Popover.</p>



<h3 class="wp-block-heading">Showing a Popover</h3>



<p>Displaying a Popover is very straightforward, whether it is created from a Container or a Window, the method is the same:</p>



<pre class="wp-block-preformatted">DesktopContainer.ShowPopover(parentControl As DesktopUIControl, facing As DesktopWindow.DisplaySides = DesktopWindow.DisplaySides.Bottom, detachable As Boolean = True)</pre>



<p>The explanation of the expected parameters is as follows:</p>



<ul class="wp-block-list">
<li><strong>ParentControl:</strong> The control that will act as the parent, or on which the Popover will be pointing to.</li>



<li><strong>Facing:</strong> The direction in which the Popover will point on the parent control; by default it will appear under the parent control, but you can use any of the values available in the DesktopWindow.DisplaySides enumerator (or the iOS equivalent).</li>



<li><strong>Detachable:</strong> This value only applies to macOS Popovers, since said operating system has the ability for the user to &#8220;detach&#8221; the Popover from the parent control as long as this value is defined as True. To detach, drag the Popover with the mouse cursor.</li>
</ul>



<p>Let&#8217;s say we have a window called Window2 and a button called MyButton. In the Pressed event of MyButton we can use the following lines of code to display Window2 as a Popover:</p>



<pre class="wp-block-preformatted">Var w As New Window2
w.ShowPopover(me)</pre>



<p>And that&#8217;s all!</p>



<figure class="wp-block-image is-style-default"><img loading="lazy" decoding="async" width="1280" height="720" src="https://blog.xojo.com/wp-content/uploads/2024/03/PopoverDettach.gif" alt="" class="wp-image-12710"/></figure>



<h3 class="wp-block-heading">Platform Differences</h3>



<p>In the previous section we already pointed out the first: macOS is the only operating system that acts on the value indicated in the Detachable parameter. But there are some other considerations to keep in mind so you don&#8217;t get caught off guard:</p>



<ul class="wp-block-list">
<li><strong>Beyond the limits.</strong> Although in Windows and macOS Popovers can exceed the limits of the window on which the parent control is located, the position of the popover in Linux is restricted to the limits of the window that contains the parent control. This is the same for iOS and for Web pages.</li>



<li><strong>iPhone and iPad.</strong> When a Popover is displayed on an iPhone, it will look like a modal window; while if the same application is run on an iPad, the appearance will be the typical one expected from Popovers: the window pointing to the parent control in the indicated direction.</li>



<li><strong>On the Web.</strong> The contents of a Popover are those defined in a Container control, while on the rest of the platforms you can use both Container controls and Windows / Screens.</li>
</ul>



<h3 class="wp-block-heading">Why the Popover doesn&#8217;t &#8220;point&#8221; in the configured direction?</h3>



<p>By default it will try to do so according to the value that has been set in the &#8220;facing&#8221; parameter, but if it does not find enough space on the margins of the screen, then it will be displayed on the next side of the parent control in which there is available space for display the Popover in its full width and height; This is true on macOS, Linux, Web and iOS.</p>



<h3 class="wp-block-heading">Can I reuse a Popover?</h3>



<p>No, You can not. Whether you use a Container control or a window as the source of the UI design to be displayed by the Popover, do not lose sight of the fact that the Popover is just another type of window; and therefore behaves as such. That is, once it is closed either because it has lost focus or because you have closed it explicitly through code invoking the Close method, all the displayed controls and the rest of the internal structures will be closed / invalidated, so that although the instance If a Popover is not Nil (because, for example, you keep a reference to the window or container instance used as the UI source), you will not be able to invoke the ShowPopover method again on said instance but you will have to create a new instance of the Container/ Window used as the source of the UI to be displayed by the Popover.</p>



<h3 class="wp-block-heading">How can I communicate with the UI elements contained in the Popover?</h3>



<p>You would do so just as you would do with any other type of window that you have been using so far in your Xojo projects.</p>


<div class="wp-block-image is-style-default">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="1280" height="720" src="https://blog.xojo.com/wp-content/uploads/2024/03/PopoverComm.gif" alt="" class="wp-image-12712"/></figure>
</div>


<h3 class="wp-block-heading">Conclusion</h3>



<p>Without a doubt, Popovers are a new way to improve the design of your apps&#8217; user interfaces, providing a more direct relationship between the user interface elements displayed in the Popover and the &#8220;parent&#8221; control in charge of displaying it. Furthermore, since you can use any window or container you want as the source of the UI to be displayed by the Popover, you will have greater flexibility about when you want to display them in a Popover or display them using any other of the available window types or, in the case of Containers, embedding them as part of other UI elements at runtime.</p>



<p><em>Javier Menendez is an engineer at Xojo and has been using Xojo since 1998. He lives in Castellón</em>, <em>Spain and hosts regular Xojo hangouts en español. Ask Javier questions on Twitter at <a href="https://twitter.com/xojoes" target="_blank" rel="noreferrer noopener">@XojoES</a> or on the <a href="https://forum.xojo.com/u/javier_menendez/summary" target="_blank" rel="noreferrer noopener">Xojo Forum</a>.</em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQLite 3.45.1</title>
		<link>https://blog.xojo.com/2024/03/26/sqlite-3-45-1/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Tue, 26 Mar 2024 15:27:31 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[2024r1]]></category>
		<category><![CDATA[Database Applications]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[SQLite]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=12700</guid>

					<description><![CDATA[Xojo 2024 Release 1 includes an updated version of SQLite for your Desktop, Web, Console and iOS apps. We have upgraded the library from 3.39.4 (which is from 2022-09-29) to 3.45.1 (released 2024-01-30). Here are a few of the improvements.]]></description>
										<content:encoded><![CDATA[
<p>Xojo 2024 Release 1 includes an updated version of SQLite for your Desktop, Web, Console and iOS apps. We have upgraded the library from 3.39.4 (which is from 2022-09-29) to 3.45.1 (released 2024-01-30). Here are a few of the improvements.</p>



<h2 class="wp-block-heading">Functions</h2>



<p>There are a few new SQLite functions that can now be used in your SQL statements.</p>



<p><strong>concat()</strong></p>



<p>The <a href="https://www.sqlite.org/lang_corefunc.html#concat">concat()</a> function takes an arbitrary number of string parameters and concatenates them all together. Previous versions of SQLite required you to instead use the concat operator, this is the double-pipe: ||. Concat() is a standard function on many other databases (PostgreSQL, MySQL and SQL Server) so it is nice to finally see it available on SQLite as it allow more consistent SQL code.</p>



<p>Using the Chinook sample database, this SQL concatenates the Name and Composer columns from the Track table:</p>



<pre class="wp-block-code"><code>SELECT concat(Name, ‘ by ‘, Composer) FROM Track</code></pre>



<p>Here is the output:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="652" src="https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-1024x652.png" alt="" class="wp-image-12701" srcset="https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-1024x652.png 1024w, https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-300x191.png 300w, https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-768x489.png 768w, https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-1536x978.png 1536w, https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-2048x1304.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>concat_ws()</strong></p>



<p>The <a href="https://www.sqlite.org/lang_corefunc.html#concat_ws">concat_ws()</a> method is <strong>concat</strong> but <strong>w</strong>ith a <strong>s</strong>eparator. Strange naming aside, it works the same except that the first parameter is used a separator that is inserted between each string. This SQL separates the Name, Composer and Milliseconds with &#8220;&#8212;&#8220;:</p>



<pre class="wp-block-code"><code>SELECT concat_ws(‘---‘, Name, Composer, Milliseconds) FROM Track</code></pre>



<p>Here is the output:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="652" src="https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-1-1024x652.png" alt="" class="wp-image-12702" srcset="https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-1-1024x652.png 1024w, https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-1-300x191.png 300w, https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-1-768x489.png 768w, https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-1-1536x978.png 1536w, https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-1-2048x1304.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>timediff()</strong></p>



<p>The <a href="https://www.sqlite.org/lang_datefunc.html#tmdif">timediff()</a> function calculates the elapsed time between two dates and returns the result in a human-readable format.</p>



<p>This SQL displays the time difference between Dec 12, 2023 and March 26, 2024:</p>



<pre class="wp-block-code"><code>SELECT timediff('2023-12-12','2024-03-26')</code></pre>



<p>Here is the output of 3 months and 14 days (note that it is negative because the earlier date is first in the parameter list):</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="652" src="https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-2-1024x652.png" alt="" class="wp-image-12703" srcset="https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-2-1024x652.png 1024w, https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-2-300x191.png 300w, https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-2-768x489.png 768w, https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-2-1536x978.png 1536w, https://blog.xojo.com/wp-content/uploads/2024/03/Pasted-Graphic-2-2048x1304.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">Other Changes</h2>



<p>Overall I didn&#8217;t notice many other other significant new features. However, many bugs have been fixed, especially around  database integrity checks and the somewhat <a href="https://blog.xojo.com/2022/12/13/sqlite-new-features-in-xojo-2022r4">new JSON support</a>.</p>



<p>You can find the full list of SQLite changes on their <a href="https://www.sqlite.org/changes.html">Release History page</a>.</p>



<p><em>Paul learned to program in BASIC at age 13 and has programmed in more languages than he remembers, with Xojo being an obvious favorite. When not working on Xojo, you can find him talking about retrocomputing at <a href="https://goto10.substack.com" target="_blank" rel="noreferrer noopener">Goto 10</a> and </em>on Mastodon @lefebvre@hachyderm.io.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Don&#8217;t throw that Pi into the garbage</title>
		<link>https://blog.xojo.com/2024/03/26/dont-throw-that-pi-into-the-garbage/</link>
		
		<dc:creator><![CDATA[William Yu]]></dc:creator>
		<pubDate>Tue, 26 Mar 2024 15:27:20 +0000</pubDate>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[2024r1]]></category>
		<category><![CDATA[Bookworm]]></category>
		<category><![CDATA[DesktopHTMLViewer]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Pi]]></category>
		<category><![CDATA[Workaround]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=12692</guid>

					<description><![CDATA[The most recent iteration of Pi, operating on the Bookworm OS, may cause Xojo's DesktopHTMLViewer to appear like garbage, but that's no reason to discard either the Pi or Xojo!]]></description>
										<content:encoded><![CDATA[
<p>The most recent iteration of Pi, operating on the Bookworm OS, may cause Xojo&#8217;s DesktopHTMLViewer to appear like garbage, but that&#8217;s no reason to discard either the Pi or Xojo!</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="602" height="461" src="https://blog.xojo.com/wp-content/uploads/2024/03/DesktopHTMLViewerOnPi5.png" alt="" class="wp-image-12694" srcset="https://blog.xojo.com/wp-content/uploads/2024/03/DesktopHTMLViewerOnPi5.png 602w, https://blog.xojo.com/wp-content/uploads/2024/03/DesktopHTMLViewerOnPi5-300x230.png 300w" sizes="auto, (max-width: 602px) 100vw, 602px" /></figure>
</div>


<p>If you&#8217;re encountering display anomalies with the DesktopHTMLViewer on a Pi 5 running Bookworm OS, rest assured you&#8217;re not alone. This issue stems from the version of WebKitGTK the DesktopHTMLViewer relies on.  While efforts to address this persist, a viable workaround exists: disabling hardware acceleration when utilizing WebKitGTK.  Fortunately, in Xojo, we&#8217;ve facilitated this by exposing an environment variable.  You can conveniently set this variable before the creation of the DesktopHTMLViewer, such as within your App.Opening event.</p>



<p>To turn hardware acceleration OFF, you can assign that to the WEBKIT_HARDWARE_ACCELERATION environment variable:</p>



<pre id="Xojo" class="wp-block-code"><code>System.EnvironmentVariable("WEBKIT_HARDWARE_ACCELERATION") = "OFF"</code></pre>



<p>By default, hardware acceleration is enabled/disabled as requested by web contents, but you can also force hardware acceleration to be enabled even for websites not requesting it:</p>



<pre id="Xojo" class="wp-block-code"><code>System.EnvironmentVariable("WEBKIT_HARDWARE_ACCELERATION") = "ON"</code></pre>



<p>To revert it to its default state, simply assign any value other than ON/OFF. While we remain optimistic that this issue will be resolved at some point, in the interim, this environment variable stands ready to function as a temporary solution.</p>



<p><em><em><em>William Yu grew up in Canada learning to program BASIC on a Vic-20. He is Xojo’s resident Windows and Linux engineer, among his many other skills. Some may say he has joined the dark side here in the USA, but he will always be a Canadian at heart.</em></em></em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Improvements to Xojo Web in Xojo 2024r1</title>
		<link>https://blog.xojo.com/2024/03/26/popovers-and-other-improvements-in-xojo-web/</link>
		
		<dc:creator><![CDATA[Ricardo Cruz]]></dc:creator>
		<pubDate>Tue, 26 Mar 2024 15:27:06 +0000</pubDate>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[2024r1]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[Xojo IDE]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=12684</guid>

					<description><![CDATA[Our web framework continues improving, with interesting new features and tons of bug fixes. Let’s take a look to some highlighted 2024r1 changes!]]></description>
										<content:encoded><![CDATA[
<p>Our web framework continues improving, with interesting new features and tons of bug fixes. Let’s take a look to some highlighted 2024r1 changes!</p>



<h2 class="wp-block-heading">Popovers</h2>



<p>Similar to WebDialogs, popovers give you the opportunity to improve your apps’ UX. They are ephemeral screens where you can place text and controls.</p>



<p>Unlike the WebDialog, which is always centered and prevents the user to interact with other controls, Popovers can be placed on specific controls, where that information matters.</p>



<p>Think about them as enhanced “contextual menus” but, instead of just plain text menus, you can add anything you like. Have you ever dreamed of adding a WebMapViewer into some sort of contextual menu? Now you can!</p>



<p>The API is very simple. Create a container, add some controls and that’s it, really. You will just have to create a new instance of that container and show it as a Popover, specifying the control it should be pointing to.</p>



<p>Let’s say you have a container, called “MyTextFieldContainer”, and you want to display it below a WebLabel called “MyLabel”. Here is the code:</p>



<pre class="wp-block-code"><code>Var c As New MyTextFieldContainer
c.ShowPopover(MyLabel)</code></pre>



<p>By default, it will be shown below the specified control, but if you want to show it in a different place, you can use the new DisplaySides enumeration. As easy as this:</p>



<pre class="wp-block-code"><code>Var c As New TextFieldContainer
c.ShowPopover(MyLabel, WebContainer.DisplaySides.Top)</code></pre>



<p>As you can see, Web Projects’ Popovers are just container instances that you will show dynamically. That gives you the opportunity to raise events, add custom computed properties or implement the Observer interface. If you are already familiar with Containers, you already know how to use Popovers. Learn more about <a href="https://blog.xojo.com/2024/03/26/popovers-for-xojo-desktop-web-and-ios/">Popovers</a>.</p>



<h2 class="wp-block-heading">Displaying contextual menus programmatically</h2>



<p>Sometimes Popovers could be overkill for the task. If you just want to display a menu with some textual items inside, a contextual menu might be enough.</p>



<p>Imagine you have a WebTextLabel where you want to display the contextual menu whenever the user Presses on it. In its Opening event you could define the ContextualMenu:</p>



<pre class="wp-block-code"><code>Var menu As New WebMenuItem
menu.AddMenuItem("Foo")
menu.AddMenuItem("Bar")
menu.AddMenuItem("Baz")

Me.ContextualMenu = menu</code></pre>



<p>Implement the WebLabel.Pressed event and add this code:</p>



<pre class="wp-block-code"><code>Me.ContextualMenu.PopUp</code></pre>



<p>As easy as that.</p>



<h2 class="wp-block-heading">New RemoveControl method</h2>



<p>WebViews controls, like WebPage and WebContainer, now supports removing controls. This gives you the missing piece to create GUIs programmatically, as AddControl was already supported .</p>



<p>This can be useful when you are presenting a form to your end user with an unknown amount of fields.</p>



<p>For example, your user is filling the profile and you want to support having multiple contact fields. Some users will want to add 1 phone, others 2, and others would prefer to be contacted just by email.</p>



<p>Adding and removing controls dynamically gives you the opportunity to build this kind of features. Instead of adding a fixed amount of contact methods, you can adapt your app to what your user really needs.</p>



<h2 class="wp-block-heading">Performance and memory usage improvements</h2>



<p>We’re landing at my favorite part, improvements that nobody will see… unless you want to share your server monitoring stats, which is cool.</p>



<p>2024r1 comes with less Disk I/O usage. In my own benchmarks, Xojo Web is now able to serve about 1200 requests per second via the WebApplication.HandleURL event. That’s around a nice 20% more, compared to the previous version.</p>



<p>Also, thanks to Jeremie Leroy (one of our Xojo MVPs) and Bruno Fréchette, we’ve managed to identify and fix some memory leaks. In 2024r1, your web application will be doing a better job at cleaning up after processing requests.</p>



<h2 class="wp-block-heading">Bug fixes</h2>



<p>The list of fixes is big, you can inspect the whole list in the <a href="https://documentation.xojo.com/resources/release_notes/2024r1.html">2024r1 Release Notes</a> page.</p>



<p><strong>Web fixes by category:</strong></p>



<ul class="wp-block-list">
<li>Compiler: 1</li>



<li>IDE: 7</li>



<li>Framework: 40</li>
</ul>



<p>18 extra regressions were reported and fixed during the beta period. A huge thank you to everyone taking the time to test our releases and reporting issues before the final release becomes available.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>We hope you are as excited as we are for this release. I’m personally looking forward to see what you’re building, please remember to mention us on your favorite social network so we all can see what you’re working on.</p>



<p>In the meantime, we are already working hard preparing our next release, 2024r2. Spoilers: You will love it!</p>



<p>Happy coding!</p>



<p><em>Ricardo has always been curious about how things work. Growing up surrounded by computers</em> he became interested in <em>web technologies in the dial-up connections era. Xojo has been his secret weapon and language of preference since 2018. When he’s not online, chances are he will be scuba diving … or crocheting amigurumis. Find Ricardo on Twitter <a href="https://web.archive.org/web/20220805000833/https://www.twitter.com/piradoiv" target="_blank" rel="noreferrer noopener">@piradoiv</a>.</em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>TabPanel has Finally Joined the Dark Side</title>
		<link>https://blog.xojo.com/2024/03/26/tabpanel-has-finally-joined-the-dark-side/</link>
		
		<dc:creator><![CDATA[William Yu]]></dc:creator>
		<pubDate>Tue, 26 Mar 2024 15:26:49 +0000</pubDate>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[2024r1]]></category>
		<category><![CDATA[DarkMode]]></category>
		<category><![CDATA[DesktopXAMLContainer]]></category>
		<category><![CDATA[TabPanel]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=12752</guid>

					<description><![CDATA[Xojo's TabPanel on Windows has fought hard to stay on the light side by making the dark mode transition annoyingly difficult, but at long last it has given up the fight and has embraced the dark side.]]></description>
										<content:encoded><![CDATA[
<p>Xojo&#8217;s TabPanel on Windows has fought hard to stay on the light side by making the dark mode transition annoyingly difficult, but at long last it has given up the fight and has embraced the dark side.</p>



<figure class="wp-block-video"><video height="1080" style="aspect-ratio: 1920 / 1080;" width="1920" autoplay controls loop src="https://blog.xojo.com/wp-content/uploads/2024/03/LightToDarkRepeat.mp4"></video></figure>



<p>Supporting dark mode with Win32 controls is never an easy exercise, but if you&#8217;ve been following along with our work to modernize our Windows framework with XAML, then you may have already updated your apps with the XAML TabView control that natively supports dark mode.</p>



<figure class="wp-block-video"><video height="1080" style="aspect-ratio: 1920 / 1080;" width="1920" autoplay controls loop src="https://blog.xojo.com/wp-content/uploads/2024/03/XAMLTabPanel.mp4"></video></figure>



<p>Simply plug this bit of XAML into our DesktopXAMLContainer Content property and you&#8217;ve got yourself a modern looking TabPanel that already supported dark mode even before we did.</p>



<pre class="wp-block-code"><code>&lt;winui:TabView&gt;
	&lt;winui:TabView.TabItems&gt;
		&lt;winui:TabViewItem Header="Tab 1"&gt;
			&lt;StackPanel&gt;
				&lt;TextBlock Text="This is Tab 1" Margin="5"/&gt;
				&lt;Button Content="Button 1" Margin="5"/&gt;
				&lt;CheckBox Content="Checkbox 1" IsChecked="True" Margin="5"/&gt;
			&lt;/StackPanel&gt;
		&lt;/winui:TabViewItem&gt;
		&lt;winui:TabViewItem Header="Tab 2"&gt;
			&lt;StackPanel&gt;
				&lt;TextBlock Text="This is Tab 2" Margin="5"/&gt;
				&lt;TextBox Text="Enter text here" Margin="5"/&gt;
				&lt;ComboBox Margin="5"&gt;
					&lt;ComboBoxItem Content="Item 1"/&gt;
					&lt;ComboBoxItem Content="Item 2"/&gt;
					&lt;ComboBoxItem Content="Item 3"/&gt;
				&lt;/ComboBox&gt;
			&lt;/StackPanel&gt;
		&lt;/winui:TabViewItem&gt;
	&lt;/winui:TabView.TabItems&gt;
&lt;/winui:TabView&gt;</code></pre>



<p>While people debate on which mode (light or dark) they prefer to work in, you can ultimately control whether you want to support dark mode or not in your app by toggling the &#8220;Supports Dark Mode&#8221; build setting.  For an example on how to dynamically switch between dark and light mode in your app using XAML, see the XAML ButtonStyling example project and the RequestedTheme property.</p>



<p><em><em><em>William Yu grew up in Canada learning to program BASIC on a Vic-20. He is Xojo’s resident Windows and Linux engineer, among his many other skills. Some may say he has joined the dark side here in the USA, but he will always be a Canadian at heart.</em></em></em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		<enclosure url="https://blog.xojo.com/wp-content/uploads/2024/03/LightToDarkRepeat.mp4" length="1852724" type="video/mp4" />
<enclosure url="https://blog.xojo.com/wp-content/uploads/2024/03/XAMLTabPanel.mp4" length="801534" type="video/mp4" />

			</item>
		<item>
		<title>Free Xojo Linux and Raspberry Pi for Everyone</title>
		<link>https://blog.xojo.com/2024/03/26/free-linux-builds/</link>
		
		<dc:creator><![CDATA[Xojo]]></dc:creator>
		<pubDate>Tue, 26 Mar 2024 15:26:18 +0000</pubDate>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Source Control]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[2024r1]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[Beginner Tips]]></category>
		<category><![CDATA[Binary]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[GitLab]]></category>
		<category><![CDATA[Rapid Application Development]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Version Control]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=12631</guid>

					<description><![CDATA[Now with Xojo 2024r1 you can use Xojo's free IDE to build Linux desktop and console apps from Linux, macOS, or Windows, no license required.]]></description>
										<content:encoded><![CDATA[
<p>Beginning with Xojo 2024r1 you can use Xojo&#8217;s free IDE to build Linux desktop and console apps from Linux, macOS, or Windows, no license required.</p>



<h2 class="wp-block-heading" id="free-linux">Xojo Linux is Free</h2>



<p>We have made building for Linux free and included in the Xojo IDE! This means that on Linux you get a version control ready IDE, along with the ability to build desktop and console Linux apps (including Raspberry Pi), all for free. Launch Xojo 2024r1 (or any later release of <a href="https://xojo.com/download/" target="_blank" rel="noreferrer noopener">Xojo</a>) and open any desktop or console project, go to Build Settings, select Linux and in the Inspector choose the appropriate Architecture that matches the Linux OS you want your app to work on, either ARM or x86. Click Build to compile your project to a standalone app that you can then run on Linux &#8211; no license required.</p>



<h2 class="wp-block-heading">Wrapping Up</h2>



<p>All these changes were made based on feedback from the Xojo community and to better match the changing ways that people develop and share software projects. With this change Xojo continues its dedication to supporting Linux.</p>



<p><a href="https://xojo.com/download/">Download Xojo</a> to get started.</p>



<p>Edited 07/2025 to reflect changes to licensing. </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Make Your Apps Super Smart, Start Calling ChatGPT in Xojo</title>
		<link>https://blog.xojo.com/2024/03/26/make-your-apps-super-smart-start-calling-chatgpt-in-xojo/</link>
		
		<dc:creator><![CDATA[Geoff Perlman]]></dc:creator>
		<pubDate>Tue, 26 Mar 2024 15:00:00 +0000</pubDate>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[2024r1]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[ChatGPT]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=12783</guid>

					<description><![CDATA[Being able to call ChatGPT from inside your apps for specific purposes opens up a world of new possibilities. ChatGPT is an AI or more specifically a Large Language Model (LLM). To make using ChatGPT in Xojo easier, you can use the new ChatGPTConnection class. You can find an example project showing you how by launching Xojo, clicking on Examples in the Project Chooser and then looking in the AI section. Using this class, you can make use of ChatGPT from within your Xojo projects. ]]></description>
										<content:encoded><![CDATA[
<p>Being able to call ChatGPT from inside your apps for specific purposes opens up a world of new possibilities. ChatGPT is an AI or more specifically a Large Language Model (LLM). To make using ChatGPT in Xojo easier, you can use the new ChatGPTConnection class. You can find an example project showing you how by launching Xojo, clicking on Examples in the Project Chooser and then looking in the AI section. Using this class, you can make use of ChatGPT from within your Xojo projects. </p>



<p>As an example of how you might use ChatGPT in Xojo, I looked for a way to turn statements into questions. So I ask ChatGPT:</p>



<p><em>Turn &#8220;numerical limits of double in xojo&#8221; into a sentence.</em></p>



<p>ChatGPT&#8217;s response is:</p>



<p><em>What are the numerical limits of the double data type in XOJO?</em></p>



<h2 class="wp-block-heading">Getting Started</h2>



<p>Before you can run the example to test out the ChatGPTConnection class or use it in your own projects, you&#8217;ll need to do three things:</p>



<ol class="wp-block-list">
<li>Create an account at <a href="https://openai.com">OpenAI.com</a>. This is free.</li>



<li>Add a payment method to your account (to use ChatGPT via an API, you need pay &#8211; more on that in a bit).</li>



<li>Get an <a href="https://platform.openai.com/api-keys">API key</a>. You&#8217;ll need to have added a payment method before you can get an API key.</li>
</ol>



<p>One you have done this, open the ChatGPT Example project, open the ChatGPTConnection class and in the Inspector assign your API key to the APIKey constant. Now you can run the example. The example presents a window where you converse with ChatGPT.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="882" src="https://blog.xojo.com/wp-content/uploads/2024/03/chatgpt-1024x882.png" alt="" class="wp-image-12791" srcset="https://blog.xojo.com/wp-content/uploads/2024/03/chatgpt-1024x882.png 1024w, https://blog.xojo.com/wp-content/uploads/2024/03/chatgpt-300x258.png 300w, https://blog.xojo.com/wp-content/uploads/2024/03/chatgpt-768x661.png 768w, https://blog.xojo.com/wp-content/uploads/2024/03/chatgpt-1536x1322.png 1536w, https://blog.xojo.com/wp-content/uploads/2024/03/chatgpt.png 1812w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Each window is a separate context. Try choosing File > New Conversation. Referring to questions you asked in another window won&#8217;t work because in this example each has its own context.</p>



<h2 class="wp-block-heading">Using the ChatGPT Classes in Your Project</h2>



<p>To use the ChatGPTConnection class in your project, copy both the ChatGPTConnection and the ChatGPTException classes to your project.</p>



<p>To use the ChatGPTConnection class, either drag it onto a window, webpage or mobile screen or create an instance in code. Most of the work is done by a single method: ReplyToPrompt. The syntax for ReplyToPrompt is:</p>



<pre id="xojo" class="wp-block-code"><code>ReplyToPrompt(prompt As String, Optional MaintainContext As Boolean = False) As String</code></pre>



<p>In its simplest form, just pass your prompt and the class will return ChatGPT&#8217;s response. For example:</p>



<pre id="xojo" class="wp-block-code"><code>Var gpt As New ChatGPTConnection
Var response As String = gpt.ReplyToPrompt("Where were the 1980 Olympic Games held?")
MessageBox(response)</code></pre>



<p>When you want ChatGPT to consider past requests in the same session, pass True for the MaintainContext parameter. This  tells the ChatGPTConnection class to keep a history of all your requests and the responses from ChatGPT which it then sends along with your new request each time you call the ReplyToPrompt method. The amount of text you can send is not unlimited so only set MaintainContext to True when you really do need it to consider previous requests and responses. ChatGPTConnection defaults to GPT 3.5 Turbo which has a maximum limit of 16,385 tokens per context. A <em>token</em> is a number of characters. The conversion is approximately 4 characters per token. Think of a token as a typical word. When you set the MaintainContext property to True, the ChatGPTConnection class monitors your usage of tokens. When it gets to 90% of the allowed maximum for the model you are using, it will start trimming the oldest requests and responses from your history (stored in the ContextHistory property) to avoid you going over the limit.</p>



<h2 class="wp-block-heading">ChatGPTConnection Class Properties</h2>



<p>You don&#8217;t need to set any of the properties in the ChatGPTConnection class as they all have useful default values. However, if you want to use a model different from the default (gpt-3.5-turbo), you can set the Model property before calling the ReplyToPrompt method. You can find a list of models <a href="https://platform.openai.com/docs/models/overview">here</a>. Models have different limits as to how many tokens you can use so when you change the Model property, make sure to also change the MaximumTokensPerContext property to the appropriate value for the model. The Temperature property indicates how creative ChatGPT will be. Another way of saying this is how much it will <a href="https://en.wikipedia.org/wiki/Hallucination_(artificial_intelligence)#:~:text=In%20the%20field%20of%20artificial,based%20on%20a%20fake%20URL">hallucinate</a>. Its value range is from 0 (don&#8217;t hallucinate at all) to 2 (hallucinate all you want). The default is 0.5. Finally, the TimeOut property is how long ReplyToPrompt will wait for a response. The default is 30 seconds.</p>



<p>If anything goes wrong, the ChatGPTConnection class will raise a ChatGPTException so make sure to put your calls to the ReplyToPrompt method in a Try Catch statement:</p>



<pre id="xojo" class="wp-block-code"><code>Try
   Var gpt As New ChatGPTConnection
   Var response As String = gpt.ReplyToPrompt("Where were the 1980 Olympic Games held?")    MessageBox(response)
Catch e As ChatGPTException
  MessageBox("Error: " + e.Message)
End Try</code></pre>



<p><a href="https://openai.com/pricing">Pricing for ChatGPT</a> is by millions of tokens. Chat GPT 3.5 is relatively inexpensive so if it gives you the results you want, use it. As of this writing, every 1 million words/tokens you send it will only cost 50 cents in US dollars. Every 1 million words/tokens you get back in response will cost $1.50 USD. If you need higher quality responses, consider Chat GPT 4. </p>



<p><em>Geoff Perlman is the Founder and CEO of Xojo. When he’s not leading the Xojo team he can be found playing drums in Austin, Texas and spending time with his family.</em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Create and Scan Barcodes and QR Codes on Mac, Windows and iOS</title>
		<link>https://blog.xojo.com/2024/03/26/create-and-scan-barcodes-and-qr-codes-on-mac-windows-and-ios/</link>
		
		<dc:creator><![CDATA[Javier Menendez]]></dc:creator>
		<pubDate>Tue, 26 Mar 2024 15:00:00 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[2024r1]]></category>
		<category><![CDATA[Barcode]]></category>
		<category><![CDATA[Multi-Platform Development]]></category>
		<category><![CDATA[QR Code]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=12742</guid>

					<description><![CDATA[Xojo 2024r1 introduces the Barcode class for Windows, macOS and iOS. Now you can create barcodes and QR codes and scan up to twelve other types of codes with your Mac, Windows or iOS cameras. In addition, you can now identify codes from an image provided as a parameter.]]></description>
										<content:encoded><![CDATA[
<p>Xojo 2024r1 introduces the Barcode class for Windows, macOS and iOS. Now you can create barcodes and QR codes and scan up to twelve other types of codes with your Mac, Windows or iOS cameras. In addition, you can now identify codes from an image provided as a parameter.</p>



<span id="more-12742"></span>



<h2 class="wp-block-heading">Generate Codes</h2>



<p>The ability to generate codes and identify them from images is available as a shared method for the indicated platforms, in desktop and console apps. The latter is interesting because it means that you can use this functionality in web apps deployed on Windows or Mac servers.</p>



<p>Creating QR or Bar128 codes couldn&#8217;t be simpler. Since it uses a shared method, it is not even necessary to have previously created an instance of the class, you only need to invoke the method:</p>



<pre class="wp-block-code"><code>Barcode.Image(value As String, width As Integer, height As Integer, type As Barcode.Types = Barcode.Types.QR) As Picture</code></pre>



<p>Where the expected parameters are the following:</p>



<ul class="wp-block-list">
<li><strong>Value:</strong> Source text string that will be converted to the indicated code type</li>



<li><strong>Width:</strong> Width of the resulting image with the generated code</li>



<li><strong>Height:</strong> Height of the resulting image with the generated code</li>



<li><strong>Type:</strong> The type of code you want to generate. It can be QR or Bar128; these values are available in the Barcode.Types enumerator</li>
</ul>



<p>Once the method is invoked, you will obtain an image (Picture) that you can use in your app; or you will receive an InvalidArgumentException if some of the parameters provided are invalid, such as passing an empty text string as the data source.</p>


<div class="wp-block-image is-style-default">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="990" height="930" src="https://blog.xojo.com/wp-content/uploads/2024/03/CreateCode.gif" alt="" class="wp-image-12743"/></figure>
</div>


<p>For example, the following line of code generates a 120 x 120 image corresponding to a QR code with the text provided:</p>



<pre class="wp-block-code"><code>Var p As Picture = Barcode.Image("Xojo Rocks!", 120, 120, Barcode.Types.QR)</code></pre>



<h2 class="wp-block-heading">Recognize Codes in Images</h2>



<p>In the same way it is possible to generate code images from text, it is also possible to recognize up to twelve different types of codes from an image. To do this we will use another shared method of the Barcode class:</p>



<pre class="wp-block-code"><code>Barcode.FromImage(image As Picture) As String()</code></pre>



<p>As you can see, in this case the method will return an array of Strings with the values of the recognized codes. It is possible that the image contains more than one code; but it is also possible that no code could be recognized in the provided image, so it is advisable to check the limits of the received array before proceeding.</p>


<div class="wp-block-image is-style-default">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="990" height="930" src="https://blog.xojo.com/wp-content/uploads/2024/03/CodeFromImage.gif" alt="" class="wp-image-12744"/></figure>
</div>


<p>For example, this line of code will recognize the codes available in the MyPicture image and return the values in the RecognizedCodes() array:</p>



<pre class="wp-block-code"><code>Var RecognizedCodes() As String = Barcode.FromImage(MyPicture)</code></pre>



<h2 class="wp-block-heading">Scan Codes</h2>



<p>Scanning QR codes (or any of the other supported codes) on desktop is only available for macOS and Windows platforms. This is due to desktop presenting a user interface where you can preview the image captured by the selected camera. You can select the camera to use to scan from those connected to the computer (including, for example, iOS devices in the case of Mac, through Continuity; or Android devices paired with your Windows computer). In the case of Mac, the ability to scan images is only available using macOS 10.15 or higher.</p>



<p>To scan codes directly using any of the cameras connected to the computer it is necessary to have previously created an instance of the Barcode class (for example, drag the class from the IDE Library onto the tray area in the Layout Editor window):</p>



<figure class="wp-block-image is-style-default"><img loading="lazy" decoding="async" width="2798" height="1768" src="https://blog.xojo.com/wp-content/uploads/2024/03/Barcode.png" alt="" class="wp-image-12745" srcset="https://blog.xojo.com/wp-content/uploads/2024/03/Barcode.png 2798w, https://blog.xojo.com/wp-content/uploads/2024/03/Barcode-300x190.png 300w, https://blog.xojo.com/wp-content/uploads/2024/03/Barcode-1024x647.png 1024w, https://blog.xojo.com/wp-content/uploads/2024/03/Barcode-768x485.png 768w, https://blog.xojo.com/wp-content/uploads/2024/03/Barcode-1536x971.png 1536w, https://blog.xojo.com/wp-content/uploads/2024/03/Barcode-2048x1294.png 2048w" sizes="auto, (max-width: 2798px) 100vw, 2798px" /></figure>



<p>Doing so will add it to the Project Browser where we can select it and implement any of the three available Event Handlers:</p>



<ul class="wp-block-list">
<li><strong>ScanCancelled:</strong> The user has canceled the code scanning operation, such as by closing the presented UI window</li>



<li><strong>ScanCompleted:</strong> Receive the value as String corresponding to the code detected by the camera</li>



<li><strong>ScanFailed:</strong> Raised when some type of error has occurred, such as the fact that no camera is detected</li>
</ul>



<p>To display the code scanning UI, invoke the StartScan method on the created Barcode instance. For example:</p>



<pre id="xojo" class="wp-block-code"><code>Barcode1.StartScan</code></pre>


<div class="wp-block-image is-style-default">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="1424" height="1148" src="https://blog.xojo.com/wp-content/uploads/2024/03/ScanUI.png" alt="" class="wp-image-12748" srcset="https://blog.xojo.com/wp-content/uploads/2024/03/ScanUI.png 1424w, https://blog.xojo.com/wp-content/uploads/2024/03/ScanUI-300x242.png 300w, https://blog.xojo.com/wp-content/uploads/2024/03/ScanUI-1024x826.png 1024w, https://blog.xojo.com/wp-content/uploads/2024/03/ScanUI-768x619.png 768w" sizes="auto, (max-width: 1424px) 100vw, 1424px" /></figure>
</div>


<p>The scan UI does not close automatically when a code is recognized to allow scanning a series of codes (such as in the case of inventory), so it is also possible to stop the operation by code by calling the StopScan method. For example, you can include this line of code in the ScanCompleted event of the Barcode1 instance after the received value has been processed:</p>



<pre id="xojo" class="wp-block-code"><code>me.StopScan</code></pre>



<p>As expected, invoking the StopScan method from code will close the code scanning UI.</p>



<figure class="wp-block-video"><video controls src="https://blog.xojo.com/wp-content/uploads/2024/03/CodeScan.mp4"></video></figure>



<h2 class="wp-block-heading">Conclusion</h2>



<p>Now you can create all types of applications on macOS, Windows and iOS with the ability to generate and scan QR codes, Barcodes and other types of codes, opening up a wide field of possibilities for Xojo users.</p>



<p><em>Javier Menendez is an engineer at Xojo and has been using Xojo since 1998. He lives in Castellón</em>, <em>Spain and hosts regular Xojo hangouts en español. Ask Javier questions on Twitter at <a href="https://twitter.com/xojoes" target="_blank" rel="noreferrer noopener">@XojoES</a> or on the <a href="https://forum.xojo.com/u/javier_menendez/summary" target="_blank" rel="noreferrer noopener">Xojo Forum</a>.</em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		<enclosure url="https://blog.xojo.com/wp-content/uploads/2024/03/CodeScan.mp4" length="2575174" type="video/mp4" />

			</item>
	</channel>
</rss>
