[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

gtk_main



Hello gtk-app-devel-list,

I have little experience with GUI programming, I hope somebody offer
me a little help.

I am trying to write a procedure to pop up a simple input box (a text
box, an OK button and a CANCEL button), which returns the contents that
were typed to the textbox.  So it can be called like this:

	inputbox (s);    ==> user input copied into string s

I tried implementing it like this: 

	inputbox (char *s) 
	{
		...
		pack and show the window + widgets
		*** including a callback to make OK button call gtk_main_quit ()
		...
		gtk_main ();
		strcpy (s, gtk_entry_get_text (GTK_ENTRY (text_box)));
		return;
	}

This pops up the window just fine, but the call to gtk_entry_get_text
fails.  I'm guessing that I cannot access the widgets after gtk_main_quit
is called.

I hope you see what I'm trying to accomplish here.  How can I do this?
Opening an inner gtk_main() loop was the only way I could think of to make
control get back to the inputbox() function to create the return value.

Also, I see some other functions in gtkmain.h, but could not find
documentation for them.  How can I find out about them?

Alex.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]