gnope php gtk gui gnope.org  

GTK Loop and New Input Windows

 
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners
View previous topic :: View next topic  
Author Message
rbertran



Joined: 03 Aug 2006
Posts: 2

PostPosted: Thu Aug 03, 2006 10:13 pm    Post subject: GTK Loop and New Input Windows Reply with quote

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!
Confused
Back to top
cweiske



Joined: 08 Dec 2005
Posts: 454
Location: Leipzig/Germany

PostPosted: Sun Aug 06, 2006 8:18 pm    Post subject: Reply with quote

- 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

PostPosted: Mon Aug 07, 2006 3:30 am    Post subject: Reply with quote

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

PostPosted: Mon Aug 07, 2006 6:53 pm    Post subject: Reply with quote

if we had an example of your code we could proboly see where you are going wrong.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Templates enhanced by DigiWiki. Hosting by Tradebit.