Sdl / gtk question (with a twist)

suppose i have a gtk notebook (a widget with “pages”. each page can
contain a vbox or hbox with its own set of widgets).

i don’t have the gtk calls memorized, so i’m paraphrasing here:

GtkWidget *notebook, *1stpage, *2ndpage;
notebook = gtk_notebook_new();
gtk_notebook_append_page( notebook, 1stpage );
gtk_notebook_append_page( notebook, 2ndpage );

now if i wanted an SDL screen on both pages, i assume all i would need
to do is:

/* Called back when user changes active notebook page */
notebook_callback(GtkWidget *notebook)
{
char SDL_windowhack[32];

  if (firstpage is active)
     snprintf(SDL_windowhack, "SDL_WINDOWID=%ld",
        GDK_WINDOW_XWINDOW(notebook->1stpage);
  else
     snprintf(SDL_windowhack, "SDL_WINDOWID=%ld",
        GDK_WINDOW_XWINDOW(notebook->2ndpage);

  putenv(SDL_windowhack);

}

is this about correct?

i haven’t thought much about this beyond what i have here, so i’m not
sure what to expect. is it possible to have a number of SDL screens
within a gtk interface?

pete

now if i wanted an SDL screen on both pages, i assume all i would need
to do is:

/* Called back when user changes active notebook page */
notebook_callback(GtkWidget *notebook)
{
char SDL_windowhack[32];

  if (firstpage is active)
     snprintf(SDL_windowhack, "SDL_WINDOWID=%ld",
        GDK_WINDOW_XWINDOW(notebook->1stpage);
  else
     snprintf(SDL_windowhack, "SDL_WINDOWID=%ld",
        GDK_WINDOW_XWINDOW(notebook->2ndpage);
  putenv(SDL_windowhack);

}

is this about correct?

Nope, SDL doesn’t support multiple screen surfaces at this time.
You’re probably better off using a gtk draw area and doing things
through GTk yourself.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment