ScreenGadget bugs

Post bugreports for the Windows version here
drgolf
Enthusiast
Enthusiast
Posts: 116
Joined: Tue Mar 03, 2009 3:40 pm
Location: france

ScreenGadget bugs

Post by drgolf »

Hello,

In the example : screengadgetmultiplewindow, on window2, tab splitter, move splitter on max right or max left : the app freeze.

I have an error message : accès mémoire invalide, ligne 217.

Very good lib.

Tested with pb 6.30 b3 x64 windows 11 pro.
Fred
Administrator
Administrator
Posts: 18335
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: ScreenGadget bugs

Post by Fred »

Moved to regular bug forums, you can put all your ScreenGadget related bugs here so pf-shadoko have a quick overall.
User avatar
Bisonte
Addict
Addict
Posts: 1316
Joined: Tue Oct 09, 2007 2:15 am

Re: ScreenGadget bugs

Post by Bisonte »

Fred wrote: Mon Oct 06, 2025 10:36 am Moved to regular bug forums, you can put all your ScreenGadget related bugs here so pf-shadoko have a quick overall.
Todo so, a little doc was very helpful... ;)
Functions, their parameters ... and what they should do.
Or missed I the posts about that ?
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
User_Russian
Addict
Addict
Posts: 1579
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: ScreenGadget bugs

Post by User_Russian »

drgolf wrote: Mon Oct 06, 2025 10:11 amIn the example : screengadgetmultiplewindow, on window2, tab splitter, move splitter on max right or max left : the app freeze.
Doesn't freeze.
I guess this happens under certain circumstances.

I found this bug. When entering non-english text, the text cursor is moved to the right of the text.
Image
pjay
Enthusiast
Enthusiast
Posts: 276
Joined: Thu Mar 30, 2006 11:14 am

Re: ScreenGadget bugs

Post by pjay »

No crashes to report here on x64.

I echo Bisonte's sentiment that a simple list of the new commands, parameters & flags would be really useful in testing.

A few points regarding the ScreenGadgetMultipleWindow.pb sample:

The progress bars have a cosmetic issue when the values are down towards the lower end (you can see it in the video posted above).
The shift key has input lag, so keying something that contains occasional capitals (such as your name) will often miss the capitals.
Typical shift-select of multiple characters on an input box doesn't work, so you can't clear the box quickly & easily.
Keyboard inputs aren't repeating, so clearing an input took many presses of the backspace key.
Adjusting the rotation slider & clicking the 'show / hide' button a few times eventually caused Window 2 to just hide & re-appear instead of it animating on & off the screen.

What's the command to rename a ScreenWindows title?
Are tooltips implemented / going to be implemented?
User_Russian
Addict
Addict
Posts: 1579
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: ScreenGadget bugs

Post by User_Russian »

pjay wrote: Mon Oct 06, 2025 2:17 pmI echo Bisonte's sentiment that a simple list of the new commands, parameters & flags would be really useful in testing.
This information can be retrieved from the screen library.

Code: Select all

AddScreenGadgetItem(#ScreenGadget, Position, Text$) ; Adds an item to a gadget (ListView, ComboBox etc.)
ButtonImageScreenGadget(#ScreenGadget, x, y, Width, Height, ImageID [, Flags]) ; Creates a button image gadget in the current screen or screen window.
ButtonScreenGadget(#ScreenGadget, x, y, Width, Height, Text$ [, Flags]) ; Creates a button gadget in the current screen or screen window.
CheckBoxScreenGadget(#ScreenGadget, x, y, Width, Height, Text$ [, Flags]) ; Creates a checkbox gadget in the current screen or screen window.
CloseScreenGadgetList(#ScreenGadget [, GadgetItem]) ; Closes the current screen gadget list and go back to the previous one.
CloseScreenWindow(#ScreenWindow) ; Closes the specified screen window.
ComboBoxScreenGadget(#ScreenGadget, x, y, Width, Height [, Flags]) ; Creates a combobox gadget in the current screen or screen window.
ContainerScreenGadget(#ScreenGadget, x, y, Width, Height, [, Flags]) ; Creates a container gadget in the current screen or screen window.
DisableScreenGadget(#ScreenGadget) ; Disables or enables the #ScreenGadget.
DisableScreenWindow(#ScreenWindow, State) ; Disable or enable all user input in the window.
EditorScreenGadget(#ScreenGadget, x, y, Width, Height [, Flags]) ; Creates an editor gadget in the current screen or screen window.
EventScreenGadget() ; Returns the screen gadget number (#ScreenGagdet) which triggered the event.
FreeScreenGadget(#ScreenGadget) ; Frees the specified screen gadget
GetScreenGadgetState(#ScreenGadget) ; Gets the state of the #ScreenGadget.
GetScreenGadgetText(#ScreenGadget) ; Gets the text of the #ScreenGadget.
HideScreenGadget(#ScreenGadget) ; Hides or shows the specified screen gadget.
HideScreenWindow(#ScreenWindow, State) ; Hide or show the specified #ScreenWindow.
ImageScreenGadget(#ScreenGadget, x, y, Width, Height, ImageID [, Flags]) ; Creates a image gadget in the current screen or screen window.
InitScreenGadgets() ; Intialize the screen gadget library for the current screen.
IsScreenGadget(#ScreenGadget) ; Tests if the given screen gadget is a valid screen gadget object.
ListViewScreenGadget(#ScreenGadget, x, y, Width, Height [, Flags]) ; Creates a listview gadget in the current screen or screen window.
OpenScreenGadgetList(#ScreenGadget [, GadgetItem]) ; Makes the #ScreenGadget the current screen gadget list.
OpenScreenWindow(#ScreenWindow, x, y, Width, Height [Title$ [, Flags]]) ; Open a new window on the current screen.
OptionScreenGadget(#ScreenGadget, x, y, Width, Height, Text$) ; Creates an option gadget in the current screen or screen window.
PanelScreenGadget(#ScreenGadget, x, y, Width, Height) ; Create a panel gadget in the current screen or screen window.
ProgressBarScreenGadget(#ScreenGadget, x, y, Width, Height, Min, Max [, Flags]) ; Creates a progressbar gadget in the current screen or screen window.
RemoveScreenGadgetItem(#ScreenGadget, Position, Text$) ; Removes the item at the specified position from the #ScreenGadget.
RenderScreenGadgets() ; Renders the screen window and gadgets on the current screen.
ResizeScreenGadget(#ScreenGadget, x, y, Width, Height) ; Moves and resizes the specified #ScreenGadget to the given position and dimensions.
ResizeScreenWindow(#ScreenWindow, x, y, Width, Height) ; Moves and resizes the specified #ScreenWindow to the given position and dimensions.
ScreenEventType() ; After ScreenWindowEvent(), use this function to determine of which type the event is.
ScreenGadgetHeight(#ScreenGadget) ; Returns the height of the #ScreenGadget, in pixels. 
ScreenGadgetSkin(SkinPart, #Image [, FreePrevious]) ; Set an image for a specific skin part. 
ScreenGadgetType(#ScreenGadget) ; Returns the type of the specified #ScreenGadget.
ScreenGadgetWidth(#ScreenGadget) ; Returns the width of the #ScreenGadget, in pixels.
ScreenGadgetX(#ScreenGadget) ; Returns the X position of the #ScreenGadget, in pixels.
ScreenGadgetY(#ScreenGadget) ; Returns the Y position of the #ScreenGadget, in pixels.
ScreenWindowAnimation(#ScreenWindow, Way, Duration, [, Fading [, Zoom, [x, [y, [, Angle]]]]) ; Setup an animation to open the window.
ScreenWindowEvent() ; Check if an event has occurred on any of the opened screen windows.
ScrollAreaScreenGadget(#ScreenGadget, x, y, Width, Height, ScrollAreaWidth, ScrollAreaHeight, ScrollStep [, Flags]) ; Creates a scrollarea gadget in the current screen or screen window.
ScrollBarScreenGadget(#ScreenGadget, x, y, Width, Height, Min, Max, PageLength [, Flags]) ; Creates a scrollbar gadget in the current screen or screen window.
SetScreenGadgetFont(#ScreenGadget, FontID) ; Changes the font which will be used by newly created gadgets.
SetScreenGadgetState(#ScreenGadget, State) ; Changes the state of the #ScreenGadget.
SetScreenGadgetText(#ScreenGadget, Text$) ; Changes the text of the #ScreenGadget.
SplitterScreenGadget(#ScreenGadget, x, y, Width, Height, #ScreenGadget1, #ScreenGadget2 [, Flags]) ; Creates a splitter gadget in the current screen or screen window.
StringScreenGadget(#ScreenGadget, x, y, Width, Height, Text$ [, Flags]) ; Creates a string gadget in the current screen or screen window.
TextScreenGadget(#ScreenGadget, x, y, Width, Height, Text$ [, Flags]) ; Creates a text gadget in the current screen or screen window.
TrackBarScreenGadget(#ScreenGadget, x, y, Width, Height, Min, Max [, Flags]) ; Creates a trackbar gadget in the current screen or screen window.
Fred
Administrator
Administrator
Posts: 18335
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: ScreenGadget bugs

Post by Fred »

This lib is a mimic of the regular gadget lib so it should be easy for PB coders to get a grip of it. Doc will be ready a bit later
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 403
Joined: Thu Jul 09, 2015 9:07 am

Re: ScreenGadget bugs

Post by pf shadoko »

Hi coders,

Other bugs:

- If you click on an unused area, the last gadget (or window) selected is affected.

- Animations don't always work.

Regarding:

- splitterstringgadget (drgolf): strange, I don't have this bug, do other users have this problem?

- stringscreengadget (User_Russian): maybe it's related to the alphabet used.
Can you try with skins 1 and 2 (first line of code in the example)?
I'm using 2ddrawing here.
Can you check if drawtext is in sync with textwith (using the same font)?

- Problem reported by pjay: this will be fixed.
The cursor offset relative to the text (string and editor) seems more complicated.
It depends on the font.
Can you tell me if you have the same problem with skin 1 (first line of code in the example)?
User_Russian
Addict
Addict
Posts: 1579
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: ScreenGadget bugs

Post by User_Russian »

pf shadoko wrote: Tue Oct 07, 2025 10:12 amCan you try with skins 1 and 2 (first line of code in the example)?
The problem is only when choosing a skin 3. It's probably a font issue "ink free".
For some reason the function SetScreenGadgetFont() not work. I added after the line

Code: Select all

StringScreenGadget(40,180,460,250,34,"blablabla blabla bla",0)
this line

Code: Select all

SetScreenGadgetFont(40, LoadFont(100, "Arial", 24))
but the font did not change.
Mesa
Enthusiast
Enthusiast
Posts: 441
Joined: Fri Feb 24, 2012 10:19 am

Re: ScreenGadget bugs

Post by Mesa »

Everything is fine.
Windows 10 64b with Mesa3D openGL drivers.

M.
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 403
Joined: Thu Jul 09, 2015 9:07 am

Re: ScreenGadget bugs

Post by pf shadoko »

@ User_Russian:
For now, only PB_default is supported by SetScreenGadgetFont
(and before the creation of gadgets).

but the problem comes from SetScreenGadgetFont, I'll fix it
Last edited by pf shadoko on Tue Oct 07, 2025 4:36 pm, edited 1 time in total.
drgolf
Enthusiast
Enthusiast
Posts: 116
Joined: Tue Mar 03, 2009 3:40 pm
Location: france

Re: ScreenGadget bugs

Post by drgolf »

Hello Pf,

Here an example of the splitter bug (windows 11 pro) : ima (freeze the exe)

Click bug left or bug right button, on win2.

There is no event of the splitter : not detected by eventscreengadget

AND

getscreengadgetstate for the splitter is always 0

Code: Select all

#HelloWindow = 0
#QuitButton = 0

InitSprite()
InitKeyboard():InitMouse()

ExamineDesktops():dx=DesktopWidth(0)*0.8:dy=DesktopHeight(0)*0.8

OpenWindow(0, 0, 0, DesktopUnscaledX(dx),DesktopUnscaledY(dy), "[Escape] to quit", #PB_Window_BorderLess | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, dx, dy, 0, 0, 0)

; Create the Screen UI
InitScreenGadgets()

TextScreenGadget(#PB_Any, 50, 0,500, 24, "The screen is a container, you can put gadgets without windows")

OpenScreenWindow(#HelloWindow, 100, 100, 300, 100, "Screen UI")
ScreenWindowAnimation(#HelloWindow, 0, 1000, 1, 0, -1, 0, -1)

TextScreenGadget(#PB_Any, 10, 25, 300, 24, "Hello World !")
ButtonScreenGadget(#QuitButton, 70, 60, 160, 32, "Quit")
;
OpenScreenWindow(2, 300, 200, 700, 300, "win2")
ListViewScreenGadget(10,20,20,200,100,0):For i=0 To 25:AddScreenGadgetItem(10,-1, "item number "+i+" wwwwwwww "):Next:SetScreenGadgetState(10,3)
ListViewScreenGadget(11,350,20,200,100,0):For i=0 To 25:AddScreenGadgetItem(11,-1, "item number "+i+" iiiiiii"):Next:SetScreenGadgetState(11,5)
SplitterScreenGadget(12,20,20,500,100,10,11,#PB_Splitter_Vertical):SetScreenGadgetState(12,250)
TextScreenGadget(13, 10, 240, 300, 24, "0")
ButtonScreenGadget(14, 10, 260, 160, 32, "BUG LEFT !")
ButtonScreenGadget(15, 200, 260, 160, 32, "BUG RIGHT !")
;
Repeat
  ; Top Window
  While WindowEvent() : Wend
  
  ClearScreen(RGB(0,0,0))
  
  ExamineMouse()
  ExamineKeyboard()
  
  ; Handle the screen UI events
  If ScreenWindowEvent()= #PB_Event_Gadget
    ga= EventScreenGadget()
    SetScreenGadgetText(13,Str(ga))
    Select ga ;EventScreenGadget()
      Case 14
        SetScreenGadgetState(12,0)
      Case 15
        SetScreenGadgetState(12,500)
      Case #QuitButton
        End
    EndSelect
  EndIf
  
  RenderScreenGadgets()
  
  FlipBuffers()
Until KeyboardReleased(#PB_Key_Escape) Or MouseButton(3)

User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 403
Joined: Thu Jul 09, 2015 9:07 am

Re: ScreenGadget bugs

Post by pf shadoko »

No crashes for me.
(I'm running PB6.30 x32 - Windows 10)

For now, only essential events are being managed.
User avatar
Comtois
Addict
Addict
Posts: 1432
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: ScreenGadget bugs

Post by Comtois »

pf shadoko wrote: Tue Oct 07, 2025 4:25 pm No crashes for me.
(I'm running PB6.30 x32 - Windows 10)

For now, only essential events are being managed.
i get this, using PB 6.30 beta 3 x64
[17 :40 :10] [ERREUR] Ligne: 54
[17 :40 :10] [ERREUR] Accès mémoire invalide. (erreur de lecture à l'adresse 288)
[17 :40 :17] Le programme a été arrêté.
Please correct my english
http://purebasic.developpez.com/
User avatar
STARGÅTE
Addict
Addict
Posts: 2250
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: ScreenGadget bugs

Post by STARGÅTE »

Comtois wrote: Tue Oct 07, 2025 4:42 pm i get this, using PB 6.30 beta 3 x64
[17 :40 :10] [ERREUR] Ligne: 54
[17 :40 :10] [ERREUR] Accès mémoire invalide. (erreur de lecture à l'adresse 288)
[17 :40 :17] Le programme a été arrêté.
Same here, IMA at line 54 on RenderScreenGadgets()

PB 6.30 B3 x64, Windows x64
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
Post Reply