Active Topics

 


Reply
Thread Tools
Posts: 23 | Thanked: 11 times | Joined on Feb 2010 @ Finland
#1
(check my last msg)

hi,

I created new hello world maemo5 project in ESbox (to use as a template later). There's still one thing i didn't understand at all.

can someone please explain what these lines do?

Code:
  if (!strcmp (method, "top_application"))
      gtk_window_present (GTK_WINDOW (data));
I tried searching and found this. So does this mean my application receives top_application message every time it's started or minimized while running? Why window is shown (gtk_window_present) when method != top_application, shouldnt it be the opposite?

thanks for any help .

Last edited by durazell; 2010-08-17 at 19:12.
 
pH5's Avatar
Posts: 138 | Thanked: 375 times | Joined on Aug 2009 @ Berlin
#2
Originally Posted by durazell View Post
So does this mean my application receives top_application message every time it's started or minimized while running?
The top_application method will be called on your application when it is started and whenever it is brought to the top.

Originally Posted by durazell View Post
Why window is shown (gtk_window_present) when method != top_application, shouldnt it be the opposite?
That's not how strcmp works. A return value of 0 means that both strings are equal.
 

The Following User Says Thank You to pH5 For This Useful Post:
Posts: 23 | Thanked: 11 times | Joined on Feb 2010 @ Finland
#3
thanks for fast reply. This cleared everything since i was thinking strcmp would be equal when it wasn't 0 but this wasnt the case. Looks lot more logical now .

EDIT: One more question: i thought maemo sends the top_application, but it wasnt the case (no message was received after minimizing / maximizing application) so is this message used some other way or is it deprecated?

sending msg with dbus-send works as expected.

Last edited by durazell; 2010-08-17 at 17:51.
 
pH5's Avatar
Posts: 138 | Thanked: 375 times | Joined on Aug 2009 @ Berlin
#4
Originally Posted by durazell View Post
EDIT: One more question: i thought maemo sends the top_application, but it wasnt the case (no message was received after minimizing / maximizing application) so is this message used some other way or is it deprecated?
No, that's right. The message isn't sent when maximizing a running application from the task switcher, but when selecting it from the app menu again.
 

The Following User Says Thank You to pH5 For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 14:19.