You probably have a lot more "signals" in GTK than you had "events" in VB. When the program first starts--assuming you're using C or C++, your main() function could be compared to using a "Sub Main" in VB. As for when the window or "Form" is loaded in GTK+, it depends.
If you want code to execute every time you show your window to the user, you could connect a callback to the "show" signal. Perhaps you just want to execute some code when the window is initially "realized" or when it's been "mapped" but not necessarily shown. Each of these states have a corresponding signal which you can attach to a callback singnal. You should read more about widget lifecycles to understand the concepts of realized, mapped, reference counting, etc.
Here's a quick snippet which you can build from and experiment with:
Code:
/* compile using:
cc -Wall -g `pkg-config --cflags --libs gtk+-2.0` -o example main.c
*/
#include <gtk/gtk.h>
void on_window_map (GtkWidget*, gpointer);
void on_window_realize (GtkWidget*, gpointer);
void on_window_show (GtkWidget*, gpointer);
int
main (int argc, char *argv[])
{
GtkWidget *window;
/* initialize the GTK+ library */
gtk_init (&argc, &argv);
/* create main window */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Example");
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
gtk_widget_set_size_request (window, 200, 100);
/* connect signals */
g_signal_connect (G_OBJECT(window), "destroy",
G_CALLBACK (gtk_main_quit), NULL);
g_signal_connect (G_OBJECT(window), "realize",
G_CALLBACK (on_window_realize), NULL);
g_signal_connect (G_OBJECT(window), "map",
G_CALLBACK (on_window_map), NULL);
g_signal_connect (G_OBJECT(window), "show",
G_CALLBACK (on_window_show), NULL);
/* show the main window, hide it, then show it again */
gtk_widget_show (window);
gtk_widget_hide (window);
gtk_widget_show (window);
gtk_main ();
return 0;
}
void
on_window_map (GtkWidget *w,gpointer user_data)
{
g_print("Window was mapped.\n");
}
void
on_window_realize (GtkWidget *w,gpointer user_data)
{
g_print("Window was realized.\n");
}
void
on_window_show (GtkWidget *w,gpointer user_data)
{
g_print("Window was shown.\n");
}