| View previous topic :: View next topic |
| Author |
Message |
rbertran
Joined: 03 Aug 2006 Posts: 2
|
Posted: Thu Aug 03, 2006 10:13 pm Post subject: GTK Loop and New Input Windows |
|
|
I have a general layout question on how to handle an Application with multiple User Input Windows in regards to the Gtk::main() listening loop.
Below is an example of how I coded a simple application:
The first Window is shown after it is setup and the Gtk:main() loop is called.
Now the User completes the Form and submits the first Window. This closes the first Window and calls a function which opens up the next Window.
In order to get this next Window to be displayed, I had to start another Gtk:main() listening loop at the end of this called function. Before I called this 2nd Gtk::main(), I close the first loop via Gtk:main_quit()
If I did not close the previous loop, I sometimes got a "Memory could not be written" error when the Application Closed so I make sure I have a Gtk:main_quit() for each Gtk::main() initiated.
Is this how the Program Flow should be handled for these types of Applications? I feel like this is not really how this should be coded.
Thanks for your inputs!
 |
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
Posted: Sun Aug 06, 2006 8:18 pm Post subject: |
|
|
- You don't need two loops for two windows, all windows can run with one main loop.
- main loops can be nested. |
|
| Back to top |
|
 |
rbertran
Joined: 03 Aug 2006 Posts: 2
|
Posted: Mon Aug 07, 2006 3:30 am Post subject: |
|
|
I thought I should be able to handle opening and closing multiple windows with just one main loop but I can't get the 2nd window to be displayed unless I start another loop. If I was trying to display multiple windows at the same time, then one main loop works fine but I am calling up the 2nd window after the Main Loop has been started. Does this mandate starting another Loop or is there a way to handle this scenario with just one Main Loop?
Thanks, |
|
| Back to top |
|
 |
leon_pegg
Joined: 12 Jun 2006 Posts: 113 Location: hemel / UK
|
Posted: Mon Aug 07, 2006 6:53 pm Post subject: |
|
|
| if we had an example of your code we could proboly see where you are going wrong. |
|
| Back to top |
|
 |
|