[Gtk-sharp-list] FW: Help needed on Window's TransientFor Property.

libin libin.mohanan at wipro.com
Thu Mar 5 01:19:30 EST 2009


 
Hi Chris,

We wanted to implement MDI feature in our application.
So what we did is everytime when the user is clicking on new window button
we are launching a dialog window.
We are using transientfor property to make this window lie on parent window.

We were planning to use dialog windows as MDI Workaround as they are giving
the functionality like minimizing to the parent window in Windows platform.

In windows for these separate windows no taskbar button is coming. When
minimized, the dialog windows happens to minimize to the parent window.(I
wrongly stated the minimized single icon in the parent window as taskbar
button, Sorry for that..)

But in case of linux even after using the transientfor property the windows
are minimizing to the task bar and separate taskbar buttons are coming for
each window.(seems like transentfor property is not working there)



//code
 public partial class ModuleWindow : Gtk.Window
    {
        public delegate void MyWindowState(object sender,
Gtk.ConfigureEventArgs args);
        public event MyWindowState MyWindowStateEvent;
        private Gtk.ScrolledWindow moduleScrolledWindow;
        private Gtk.Viewport moduleWindowViewport;
       

        public ModuleWindow(): base(Gtk.WindowType.Toplevel)
        {
            this.DeleteEvent += new
Gtk.DeleteEventHandler(this.OnDeleteEvent);
            this.Title = "Module Window";       

          

            this.TransientFor = Main.MainWindow;// where MainWindow is the
parent window.
		
		// changed this code to get the windows minimized to parent.

            //this.Parent = Main.MainWindow;
            //this.ParentWindow = Main.MainWindow.GdkWindow;

            moduleScrolledWindow = new Gtk.ScrolledWindow();
            this.Add(moduleScrolledWindow);

            moduleWindowViewport = new Gtk.Viewport();
            moduleScrolledWindow.Add(moduleWindowViewport);
            
            this.DestroyWithParent = true;

            this.WindowStateEvent += new
Gtk.WindowStateEventHandler(ModuleWindow_WindowStateEvent);
            this.ConfigureEvent += new
Gtk.ConfigureEventHandler(ModuleWindow_ConfigureEvent);
            
            InitializeModuleWindow();
           
        }

	}

Another thing we are implementing here is we are restricting these diaog
windows inside a frame. We are pushing back the windows when it is going
outside the frame.
We are using frame.allocation for getting the postion and we are moving back
using window.move.

Is  there any other workaround for this? 

I want to tile windows(horizontally and vertically) inside this frame. Now
do I need to resize each dialog window and move them to corresponding
positions or any other go?

Any help will be appreciated.

Thanks a lot!!!

Libin



-----Original Message-----
From: Chris Howie [mailto:cdhowie at gmail.com]
Sent: Tuesday, February 24, 2009 11:40 AM
To: libin
Cc: gtk-sharp-list at lists.ximian.com
Subject: Re: FW: [Gtk-sharp-list] Help needed on Window's TransientFor
Property.

On Tue, Feb 24, 2009 at 12:23 AM, libin <libin.mohanan at wipro.com> wrote:
> Hi Chris,
>
> I tried to solve the problem using  window.SkipTaskbarHint = true, but 
> the problem in windows is, I cant get back the minimized window 
> without making another new window as I don't have the taskbar button.
>
> Also in linux the problem of having separate taskbar buttons remains 
> even after using this code. This taskbar Buttons are actually coming 
> on the desktop taskbar and not on the parent window.

I'm not sure what you mean by this.  Did you expect the parent window to
have its own taskbar of children or something?


> Earlier In Windows It was working fine with only one taskbar 
> buttonthat too when minimized it gets minimized on the parent window.I 
> am calling it taskbar button but when it is minimized it is showing 
> only on the parent window and not on the windows taskbar.
>
> And In case of linux every window was having a separate taskbar button 
> in the taskbar itself.
>
> I think the problem in linux is the OS is considering every new window 
> as a separate process.

The GNOME panel is seeing every window as a window.  Usually SkipTaskbarHint
is enough to make it not show up in the taskbar.  You might have to subclass
Dialog instead of Window to get this behavior.

Perhaps you could back up a bit and explain the overall goal here?
Maybe there is another approach you have not thought of.

--
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers



Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. 

www.wipro.com


More information about the Gtk-sharp-list mailing list