This can be done easily inside a Terminal, just type: LIBOVERLAY_SCROLLBAR=0. As mentioned above, you can set the LIBOVERLAY_SCROLLBAR environment variable to 0 to temporarily disable Overlay Scrollbars. with or without Overlay Scrollbars) to make sure your UI looks correct. If allocation.width = 0 or allocation.height = 0 Thenįinally, you should always test both cases (i.e. scrollbar, we'll take either width or height being 0 as enough info need to know if we're dealing with a horizontal or vertical create a 0 width or height scrollbar, in which case we don't We'll make a blanket assumption that we'll never actually scrollbar is indeed an overlay scrollbar or not initialized = True At this point we have enough information to know whether or not the This means the widget probably isn't visible yet so we don't get the Dim s As String s 'Chilkat Software' The following 4 lines are case-sensitive Print InStr(s, 'Software') Prints 9 Print InStr(s, 'Chilkat') Prints 1 Print InStr(s, 'xyz') Prints 0 Print InStr(s, 'software') Prints 0 The following 3 lines are case-insensitive Print InStr(1, s, 'software', vbTextCompare. it will need updating if we switch to GTK+ 3Īllocation.StringValue(True) = mb.StringValue(36, allocation.Size) String Contains Substring Determine if a string contains a substring.
#Xojo instr code
Warning: this code assumes Xojo's Linux framework uses GTK+ 2, We want the GtkAllocation structure which is located 36 bytes If initialized Then Return detectedOverlayĭeclare Sub gtk_widget_realize Lib "libgtk-x11-2.0.so" ( widget As Integer )ĭim widget As Integer = ctl.Handle gtk_widget_realize( widget ) we don't get the correct information so we'll have to keep The problem is that if the control isn't actually visible yet, that one scrollbar uses overlays we can assume they all do. We really don't need to detect this more than once, if we find Here It is, implemented as an extension method for the ScrollBar: Function UsesOverlay(extends ctl As ScrollBar) As Boolean If for some reason you don’t trust environment variables or prefer added complexity, there’s another solution that will work, but be warned it has added drawbacks and dependencies (see comments in the code). This is what the application would look like after the repositioning: scrollbar thumb will magically appear when you hover! Position the scrollbar off the window and the If System.EnvironmentVariable("LIBOVERLAY_SCROLLBAR") "0" Then Even though a system supports Overlay Scrollbars, If Instr(System.EnvironmentVariable("GTK_MODULES"), _ Look at what additionaly GTK Modules have been loaded Thankfully there’s an easy to way to detect whether or not a system supports Overlay Scrollbars: Dim usesOverlayScrollbars As Boolean If you’re developing any kind of serious application on Linux, especially if you are targeting Ubuntu, you want to be able to detect whether or not the system supports Overlay Scrollbars.Īs you can see in the screenshots above, this application has not properly detected that the system supports Overlay Scrollbars and subsequently has not positioned the scrollbar properly. Overlay Scrollbars were meant to reduce the amount of clutter needed around content areas by showing up only when hovered over, and always outside the content area.
#Xojo instr update
That way, if the user types, the list will either update after 0.3s automatically, or immediately if the user types Return.Linux, especially Ubuntu, has quickly evolved, introducing core UI changes such as the global menu bar (akin to OS X’s single menubar system) as well as Overlay Scrollbars.