gnope php gtk gui gnope.org  

modal window from glade

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



Joined: 12 May 2006
Posts: 46
Location: Hamburg

PostPosted: Sat Jul 15, 2006 1:04 pm    Post subject: modal window from glade Reply with quote

Hmmm, i really dont know why, but i cant create a MODAL window in my application (winXp). Every method, i used by now, could not make the popups modal.

What methods should i use, to let a popup never switch to background eg. a filedialog.

Another thing, i dont get by now. If i create a popup and hit the [X] close-button, how can i handle this action.

Regards,
andreas
Back to top
cweiske



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

PostPosted: Sat Jul 15, 2006 1:41 pm    Post subject: Reply with quote

You have to use set_modal(true) and set_transient_for($parentwindow).

The signals to handle close events are destroy and delete, delete is called before and can be cancelled by returning true or false in the handler
Back to top
syn



Joined: 12 May 2006
Posts: 46
Location: Hamburg

PostPosted: Sun Jul 16, 2006 9:43 pm    Post subject: Reply with quote

Hi, that works fine.

Thank you
Back to top
syn



Joined: 12 May 2006
Posts: 46
Location: Hamburg

PostPosted: Mon Jul 31, 2006 1:29 pm    Post subject: Reply with quote

Ok.. another problem.

i use use set_modal(true) and set_transient_for($parentwindow) for my open_win_confirm() method.

I have problems, if i open more than one window (or one popup opens another popup). If i close the last window, everything looks fine, but if i close the first window opened, the main-application complete loose his focus an is complete in backround off all other windows on desctop.

Maybe there is a problem with $parentwindow?
Back to top
squirrel



Joined: 02 May 2006
Posts: 10
Location: Switzerland

PostPosted: Wed Aug 02, 2006 10:52 pm    Post subject: Reply with quote

I'm using the following work around for this problem:

Code:
...
// $win is the dialog
gtk::main_quit();
if ($win->get_transient_for()) {
    $win->get_transient_for()->present();
}
...
Back to top
syn



Joined: 12 May 2006
Posts: 46
Location: Hamburg

PostPosted: Fri Aug 25, 2006 9:40 am    Post subject: Reply with quote

Hi,
this doesn´t work for me... is there any other way to create a modal window?

Regards,
andreas
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.