Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 24 Nov 2014, 17:37
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Gtkdialog: Child window always on top of parent
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [4 Posts]  
Author Message
thanius

Joined: 04 Feb 2014
Posts: 8

PostPosted: Thu 13 Feb 2014, 05:04    Post subject:  Gtkdialog: Child window always on top of parent  

Gtkdialog should really have some decent documentation, but I'm greatful this forum is here to help!

Anyways, is there any way to keep a child window launched from parent to stay on top layer above parent? In this case, an ABOUT window launched from MAIN window. Clicking on MAIN window should do nothing. When closing child parent regains consciousness.
Possible?
Cheers.
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1099

PostPosted: Thu 13 Feb 2014, 06:14    Post subject:  

Yep, for child window use:
Code:
<window modal="true">

https://developer.gnome.org/gtk2/2.24/GtkWindow.html#GtkWindow--modal

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
thanius

Joined: 04 Feb 2014
Posts: 8

PostPosted: Thu 13 Feb 2014, 06:41    Post subject:  

Thanks, that worked for the parent sleep part, but still the child loses focus when clicking on parent. There's a function in gtk for this, but how to apply it with gtkdialog?

https://developer.gnome.org/gtk2/2.24/GtkWindow.html#gtk-window-set-transient-for
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1099

PostPosted: Thu 13 Feb 2014, 07:55    Post subject:  

Hmm, no idea actually...
I tested it under Compiz/Emerald and the child window was staying above the parent there...

Anyway, a partial workaround that works also under (at least) JWM/IceWM, could be something like this:

Code:
#!/bin/sh

export GUI_ABOUT='
<window modal="true">
  <vbox>
    <text><label>about</label></text>
    <button ok>
      <action>closewindow:GUI_ABOUT</action>
    </button>
  </vbox>
 
  <variable>GUI_ABOUT</variable>
  <action signal="focus-out-event">presentwindow:GUI_ABOUT</action>
</window>'

export GUI_MAIN='
<window width-request="300" height-request="300">

  <vbox homogeneous="true">
    <text><label>Main GUI</label></text>
    <button>
      <input file stock="gtk-about"></input>
      <label>About</label>
      <action>launch:GUI_ABOUT</action>
    </button>
  </vbox>

</window>'

gtkdialog -cp GUI_MAIN

However, the child will be above every window, not only its parent.
Also, presentwindow requires Gtkdialog >= 0.8.1.

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0518s ][ Queries: 11 (0.0099s) ][ GZIP on ]