Tooltips not working/showing for gadgets inside a frame?

Just starting out? Need help? Post your questions and find answers here.
Nudgy
User
User
Posts: 10
Joined: Mon May 27, 2024 8:11 pm

Tooltips not working/showing for gadgets inside a frame?

Post by Nudgy »

Hi,

Does anyone know how I can get tooltips to display even if the gadget with the tooltip (e.g. a button) is inside a frame?

Example: If I create a simple form with a button that has a tooltip, the tooltip will display just fine. If I then add a separate frame with a button inside, and that button has a tooltip, this 2nd tooltip does not show for the new button. For the 1st button outside the frame, the tooltip will still work.

In case it makes a difference, I am running Linux.

Thanks,
Nudgy
User avatar
TI-994A
Addict
Addict
Posts: 2698
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Tooltips not working/showing for gadgets inside a frame?

Post by TI-994A »

Nudgy wrote: Sun Dec 01, 2024 10:27 am...frame with a button inside, and that button has a tooltip, this 2nd tooltip does not show for the new button..

Hi @Nudgy. It should work if the frame has the container flag applied:

Code: Select all

FrameGadget(0, 10, 10, 200, 100, "Frame", #PB_Frame_Container)

Tested and working on Ubuntu 24.10 with PureBasic v6.12.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
mk-soft
Always Here
Always Here
Posts: 6201
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Tooltips not working/showing for gadgets inside a frame?

Post by mk-soft »

Looks like a bug.
If you create the frame later it works.

Code: Select all

;-TOP

Procedure UpdateWindow()
  Protected dx, dy
  dx = WindowWidth(0)
  dy = WindowHeight(0) - StatusBarHeight(0) - MenuHeight()
  ; Resize Gadgets
  ResizeGadget(0, 10, 10, dx - 20, dy - 20)
EndProcedure

Procedure Main()
  Protected dx, dy
  
  #WinStyle = #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget
  
  If OpenWindow(0, #PB_Ignore, #PB_Ignore, 600, 400, "Test Window", #WinStyle)
    ; MenuBar
    CreateMenu(0, WindowID(0))
    MenuTitle("&File")
    MenuItem(99, "E&xit")
    
    ; StatusBar
    CreateStatusBar(0, WindowID(0))
    AddStatusBarField(#PB_Ignore)
    
    ; Gadgets
    dx = WindowWidth(0)
    dy = WindowHeight(0) - StatusBarHeight(0) - MenuHeight()
    ;FrameGadget(0, 10, 10, dx - 20, dy -20, " Frame ", #PB_Frame_Container) ; <- ToolTip work
    ;FrameGadget(0, 10, 10, dx - 20, dy -20, " Frame ") ; <- ToolTip not work
    ButtonGadget(1, 20, 30, 120, 25, "Button 1")
    GadgetToolTip(1, "This is a button")
    ;CloseGadgetList()
    FrameGadget(0, 10, 10, dx - 20, dy -20, " Frame ") ; <- ToolTip work
    
    ; Bind Events
    BindEvent(#PB_Event_SizeWindow, @UpdateWindow(), 0)
    
    ; Main Loop
    Repeat
      Select WaitWindowEvent()
        Case #PB_Event_CloseWindow
          Select EventWindow()
            Case 0
              Break
          EndSelect
          
        Case #PB_Event_Menu
          Select EventMenu()
            Case 99
              PostEvent(#PB_Event_CloseWindow, 0, 0)
              
          EndSelect
          
        Case #PB_Event_Gadget
          Select EventGadget()
              
          EndSelect
          
      EndSelect
    ForEver
    
  EndIf
  
EndProcedure : Main()
Last edited by mk-soft on Sun Dec 01, 2024 11:53 am, edited 1 time in total.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Nudgy
User
User
Posts: 10
Joined: Mon May 27, 2024 8:11 pm

Re: Tooltips not working/showing for gadgets inside a frame?

Post by Nudgy »

Thanks to both of you for your quick replies.

#PB_Frame_Container could be a temporary fix, but since I am mostly editing the form with the standard GUI form editor and that removes such custom edits/flags, I guess that I will have to keep my fingers crossed that the issue will be fixed in a future update.

Edit: Moving the frame creation code to the end as suggested by mksoft also seems to work and won't be modified by the GUI form editor.
Last edited by Nudgy on Sun Dec 01, 2024 12:31 pm, edited 1 time in total.
User avatar
mk-soft
Always Here
Always Here
Posts: 6201
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Tooltips not working/showing for gadgets inside a frame?

Post by mk-soft »

Create bug report ...
Link: viewtopic.php?t=85821
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
TI-994A
Addict
Addict
Posts: 2698
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Tooltips not working/showing for gadgets inside a frame?

Post by TI-994A »

Nudgy wrote: Sun Dec 01, 2024 11:50 am...#PB_Frame_Container could be a temporary fix, but since I am mostly editing the form with the standard GUI form editor and that removes such custom edits/flags...
Yes. The frame gadget is originally meant for UI aesthetics. Changing it to a container would really mess up the positioning of the "containing" gadgets. :lol:
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
Post Reply