How to get rid of GTK4: warning: "Gtk-WARNING: GtkGizmo (slider) reported min height -2, but sizes must be >= 0"
05:10 26 Dec 2023

I'm not using any object called a slider so I'm guessing that's generic term for something that can be adjusted in size manually, probably the "GtkPaned" object since you can grab it and slide it.

I've looked on the net and found some discussions about the properly min-width and min-height seemingly related to this warning but adding a property tag like just gives me a property unknown error no matter what I add it to. I haven't tried it in CSS yet mainly because I'm brand new to GTK and my reading so far has suggested that CSS is something you can add for styling but don't actually need.

I've tried adding height/width-request on various widgets and that didn't help.

Here's what happens, in the code below if I use gtk4-builder-tool validate file.ui on it I get no errors.

If I look at it with gtk4-builder-tool preview file.ui & then I get these errors on startup

Gtk-WARNING: GtkGizmo (slider) reported min width  -2, but sizes must be >= 0
Gtk-WARNING: GtkGizmo (slider) reported min height -2, but sizes must be >= 0

If I open up the menu and move around it I get these errors on the menu events:

Gtk-WARNING: GtkGizmo (slider) reported min width  -2, but sizes must be >= 0
Gtk-WARNING: GtkGizmo (slider) reported min height -2, but sizes must be >= 0

so the same however even without a menu in the file I get the first two errors when the file is previewed.

I'm sure if I wasn't so new at GTK I would know how to identify the object and fix this but right now I'm a little green.

The menu is just something generic I found and used to learn how to put one in a .ui file so I don't mind if it's not complete.




  
  
  
  
  
    925
    1200
    Settings
    
      
        GTK_ORIENTATION_VERTICAL
        
          
            start
            10
            menu
            General Menu
            start
          
        
        
          
            
              
                Settings
                
                  
                    start
                    900
                    pages
                    start
                  
                
              
            
            
              
                
                  
                    Timezone
                    
                      
                        
                          
                            20
                            50
                            50
                            20
                            Timezone
                            
                              
                                True
                                start
                                10
                                alpha
                                Timezone
                                America/Phoenix
                                Enter your timezone
                                center
                                50
                              
                            
                          
                        
                        General Setup
                        General Setup
                      
                    
                  
                
              
            
          
        
      
    
  
  
    
      File
      
app.new New app.quit Quit
Edit
win.copy Copy win.paste Paste
Choices Shapes
win.shape Line line win.shape Triangle triangle win.shape Square square win.shape Polygon polygon win.shape Circle circle
app.state On on app.state Off off
app.awesome Awesome
Help
win.about About
gtk gtk4