Search Unity

GUIClips problem I don't get

Discussion in 'Immediate Mode GUI (IMGUI)' started by Tom163, Dec 22, 2007.

  1. Tom163

    Tom163

    Joined:
    Nov 30, 2007
    Posts:
    1,290
    I get the "you are pushing more GUIClips than you are popping" error with this code:

    And I really don't see what the problem is.

    If I comment out two of the Labels, it works fine. With 2 or 3 enabled, I get that error. What am I missing?
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Should be fine...must be something in the other OnGUI code?

    --Eric
     
  3. shaun

    shaun

    Joined:
    Mar 23, 2007
    Posts:
    728
    It's probably something in the fields[] array - if there is a null value/out of range, it can throw a GUI exception.
     
  4. Tom163

    Tom163

    Joined:
    Nov 30, 2007
    Posts:
    1,290
    I found it.

    Indeed, the problem was that if fields[1] isn't set, it breaks.

    I didn't think it could, because fields is set through splitting up the lines and they have a known syntax, but I forgot that while it's loading them, the only line is actually "loading". :-(