GTK Frame Iconize

Hi,

    On GTK wxPython 2.8.0.1 I have a tool button that makes frame
iconize. This works on windows but not on linux. Is this a bug or is
it related to GTK ?

Murat Erten wrote:

Hi,

   On GTK wxPython 2.8.0.1 I have a tool button that makes frame
iconize. This works on windows but not on linux. Is this a bug or is
it related to GTK ?

Anything special about the frame? (Styles, etc.) A quick test in PyShell works for me:

  >>> import wx
  >>> f = wx.Frame(None)
  >>> f.Show()
  True

···

f.Iconize(True)

  >>> f.Iconize(False)

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

In pyshell it works. But it doesn't work by opening xterm and running
python and trying it from there. My frame's style is this:

style = (wx.CLIP_CHILDREN | wx.NO_FULL_REPAINT_ON_RESIZE |
wx.SYSTEM_MENU | wx.CLOSE_BOX | wx.MINIMIZE_BOX) & (~
wx.MAXIMIZE_BOX))

···

2007/1/24, Robin Dunn <robin@alldunn.com>:

Murat Erten wrote:
> Hi,
>
> On GTK wxPython 2.8.0.1 I have a tool button that makes frame
> iconize. This works on windows but not on linux. Is this a bug or is
> it related to GTK ?

Anything special about the frame? (Styles, etc.) A quick test in
PyShell works for me:

  >>> import wx
  >>> f = wx.Frame(None)
  >>> f.Show()
  True
  >>> f.Iconize(True)
  >>> f.Iconize(False)

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Murat Erten wrote:

···

2007/1/24, Robin Dunn <robin@alldunn.com>:

Murat Erten wrote:
> Hi,
>
> On GTK wxPython 2.8.0.1 I have a tool button that makes frame
> iconize. This works on windows but not on linux. Is this a bug or is
> it related to GTK ?

Anything special about the frame? (Styles, etc.) A quick test in
PyShell works for me:

  >>> import wx
  >>> f = wx.Frame(None)
  >>> f.Show()
  True
  >>> f.Iconize(True)
  >>> f.Iconize(False)

In pyshell it works. But it doesn't work by opening xterm and running
python and trying it from there.

Probably because you haven't started the App's MainLoop yet in that case.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

I am running into the same problem.

frame.Iconize(True) works a treat on WinowsXP but not on Ubuntu Linux
GTK (with latest wxPython)
Is there anything I should be doing to make the Iconize actually happen

···

on GTK? Robin Dunn wrote:

Murat Erten wrote:

2007/1/24, Robin Dunn <robin@alldunn.com>:

Murat Erten wrote:
> Hi,
>
> On GTK wxPython 2.8.0.1 I have a tool button that makes frame
> iconize. This works on windows but not on linux. Is this a bug or is
> it related to GTK ?

Anything special about the frame? (Styles, etc.) A quick test in
PyShell works for me:

  >>> import wx
  >>> f = wx.Frame(None)
  >>> f.Show()
  True
  >>> f.Iconize(True)
  >>> f.Iconize(False)

In pyshell it works. But it doesn't work by opening xterm and running
python and trying it from there.

Probably because you haven't started the App's MainLoop yet in that case.

--
Paul Sijben tel: +31334566488
Eemvalley Technology BV fax: +31334557523
the Netherlands http://eemvalley.com
-----------------------------------------------------
EemValley Technology werft python & wxpython
programmeurs: http://www.eemvalley.nl/jobs

Paul Sijben wrote:

I am running into the same problem.

frame.Iconize(True) works a treat on WinowsXP but not on Ubuntu Linux
GTK (with latest wxPython)
Is there anything I should be doing to make the Iconize actually happen
on GTK?
  
I can get it to iconize by binding the frame to EVT_ICONIZE and then putting frame.Hide() in the handler, but I'm not seeing how to get it restored. On Windows, I just call:

self.frame.Iconized(False)
self.frame.Show()
self.frame.Raise()

and it works. On Ubuntu, I see my frame appear and than disappear in a flash. It fires the EVT_ICONIZE event when I restore it, for some reason. It doesn't do that on Windows XP.

Fortunately, I don't have to support anything with these capabilities on Linux as of yet...

- Mike

···

Robin Dunn wrote:
  

Murat Erten wrote:
    

2007/1/24, Robin Dunn <robin@alldunn.com>:
      

Murat Erten wrote:
        

Hi,

   On GTK wxPython 2.8.0.1 I have a tool button that makes frame
iconize. This works on windows but not on linux. Is this a bug or is
it related to GTK ?
          

Anything special about the frame? (Styles, etc.) A quick test in
PyShell works for me:

  >>> import wx
  >>> f = wx.Frame(None)
  >>> f.Show()
  True
  >>> f.Iconize(True)
  >>> f.Iconize(False)
        

In pyshell it works. But it doesn't work by opening xterm and running
python and trying it from there.
      

Probably because you haven't started the App's MainLoop yet in that case.

Mike,

I found that frame.Hide() also removes the window from the gnome panel.
So the user can not getit back by clicking on the item there :frowning:

Have found a way around that?

Mike Driscoll wrote:

···

Paul Sijben wrote:

I am running into the same problem.

frame.Iconize(True) works a treat on WinowsXP but not on Ubuntu Linux
GTK (with latest wxPython)
Is there anything I should be doing to make the Iconize actually happen
on GTK?
  
I can get it to iconize by binding the frame to EVT_ICONIZE and then
putting frame.Hide() in the handler, but I'm not seeing how to get it
restored. On Windows, I just call:

self.frame.Iconized(False)
self.frame.Show()
self.frame.Raise()

and it works. On Ubuntu, I see my frame appear and than disappear in a
flash. It fires the EVT_ICONIZE event when I restore it, for some
reason. It doesn't do that on Windows XP.

Fortunately, I don't have to support anything with these capabilities
on Linux as of yet...

- Mike

Robin Dunn wrote:

Murat Erten wrote:
   

2007/1/24, Robin Dunn <robin@alldunn.com>:
     

Murat Erten wrote:
       

Hi,

   On GTK wxPython 2.8.0.1 I have a tool button that makes frame
iconize. This works on windows but not on linux. Is this a bug or is
it related to GTK ?
          

Anything special about the frame? (Styles, etc.) A quick test in
PyShell works for me:

  >>> import wx
  >>> f = wx.Frame(None)
  >>> f.Show()
  True
  >>> f.Iconize(True)
  >>> f.Iconize(False)
        

In pyshell it works. But it doesn't work by opening xterm and running
python and trying it from there.
      

Probably because you haven't started the App's MainLoop yet in that
case.

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

--
Paul Sijben tel: +31334566488
Eemvalley Technology BV fax: +31334557523
the Netherlands http://eemvalley.com
-----------------------------------------------------
EemValley Technology werft python & wxpython
programmeurs: http://www.eemvalley.nl/jobs

Paul Sijben wrote:

Mike,

I found that frame.Hide() also removes the window from the gnome panel.
So the user can not getit back by clicking on the item there :frowning:

Have found a way around that?
  
I think I mis-understood...I was thinking you wanted the application to minimize to the tray, not the panel (or taskbar). I don't do much on Linux yet, so I don't have any ideas off the top of my head. If I think of something, I'll let you know.

- Mike

···

Mike Driscoll wrote:
  

Paul Sijben wrote:
    

I am running into the same problem.

frame.Iconize(True) works a treat on WinowsXP but not on Ubuntu Linux
GTK (with latest wxPython)
Is there anything I should be doing to make the Iconize actually happen
on GTK?
  

I can get it to iconize by binding the frame to EVT_ICONIZE and then
putting frame.Hide() in the handler, but I'm not seeing how to get it
restored. On Windows, I just call:

self.frame.Iconized(False)
self.frame.Show()
self.frame.Raise()

and it works. On Ubuntu, I see my frame appear and than disappear in a
flash. It fires the EVT_ICONIZE event when I restore it, for some
reason. It doesn't do that on Windows XP.

Fortunately, I don't have to support anything with these capabilities
on Linux as of yet...

- Mike

Robin Dunn wrote:

Murat Erten wrote:
   

2007/1/24, Robin Dunn <robin@alldunn.com>:
     

Murat Erten wrote:
       

Hi,

   On GTK wxPython 2.8.0.1 I have a tool button that makes frame
iconize. This works on windows but not on linux. Is this a bug or is
it related to GTK ?
          

Anything special about the frame? (Styles, etc.) A quick test in
PyShell works for me:

  >>> import wx
  >>> f = wx.Frame(None)
  >>> f.Show()
  True
  >>> f.Iconize(True)
  >>> f.Iconize(False)
        

In pyshell it works. But it doesn't work by opening xterm and running
python and trying it from there.
      

Probably because you haven't started the App's MainLoop yet in that
case.

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
    

Paul Sijben wrote:

I am running into the same problem.

frame.Iconize(True) works a treat on WinowsXP but not on Ubuntu Linux
GTK (with latest wxPython)
Is there anything I should be doing to make the Iconize actually happen
on GTK?

Does this not work?

import wx

class Frame(wx.Frame):
     def __init__(self, *args, **kw):
         wx.Frame.__init__(self, *args, **kw)
         self.Iconize()
         wx.CallLater(5000, self.Iconize, False)

app = wx.App(redirect=False)
frm = Frame(None, title="Hello")
frm.Show()
app.MainLoop()

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Does this not work?

indeed. the window stays where it is. :frowning:

Python 2.5.2 (r252:60911, May 7 2008, 15:19:09)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import wx
wx.version()

'2.8.9.2 (gtk2-unicode)'

···

import wx

class Frame(wx.Frame):
    def __init__(self, *args, **kw):
        wx.Frame.__init__(self, *args, **kw)
        self.Iconize()
        wx.CallLater(5000, self.Iconize, False)

app = wx.App(redirect=False)
frm = Frame(None, title="Hello")
frm.Show()
app.MainLoop()

--
Paul Sijben tel: +31334566488
Eemvalley Technology fax: +31334557523
the Netherlands http://eemvalley.com

Here is one for the experts.

Im trying to use wx.EVT_ENTER_WINDOW and wx.EVT_LEAVE_WINDOW as a method to detect mouse hover over a panel.

I have attached a demo script of a window that fades up at the bottom right of the screen then fades away. I am trying to get it to stay fully faded in when the mouse hovers over any part of the frame/panels but the problem is I have static text, images etc within the panels.

Ss you move the mouse over static text,an image or any part other panel you get a EVT_LEAVE_WINDOW event etc. :( even though the mouse is still technically within the frame.

Is there any way to have a single enter or leave event no matter what panel/text/image the mouse hovers over within the frame.

I hope this is clear, try the demo and you will see what I mean (note as long as you keep moving the mouse over the window it will stay faded up, this was a backup if I couldn't get hover to work)

PS. (Please ignore the bad code)

Christopher McEwan

Crummock

Butlerfield Estate

Bonnyrigg

Midlothian

EH19 3JQ

Tel. 01875 823222

Fax. 01875 823444

Crummock (Scotland) Limited is a limited company registered in Scotland.

Registered company no.: 130376

Registered office: Crummock, Butlerfield Ind. Est., Bonnyrigg, Midlothian, EH19 3JQ

Crummock may monitor email traffic data and also the content of email for the purposes of security.

Scanned by MIMEDefang

fader.py (5.08 KB)

Paul Sijben wrote:

Robin Dunn wrote:
  

Does this not work?

indeed. the window stays where it is. :frowning:

Python 2.5.2 (r252:60911, May 7 2008, 15:19:09)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
  

import wx
wx.version()
        

'2.8.9.2 (gtk2-unicode)'

import wx

class Frame(wx.Frame):
    def __init__(self, *args, **kw):
        wx.Frame.__init__(self, *args, **kw)
        self.Iconize()
        wx.CallLater(5000, self.Iconize, False)

app = wx.App(redirect=False)
frm = Frame(None, title="Hello")
frm.Show()
app.MainLoop()

When I run that code on Ubuntu 8.10, it starts out with the program minimized and then it comes to the front. I'm using Python 2.5, wxPython 2.8.9.2.

···

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

`> When I run that code on Ubuntu 8.10, it starts
out with the program

minimized and then it comes to the front. I’m using Python 2.5, wxPython

2.8.9.2.


Mike Driscoll

`

Sorry,

Should have mentioned. Only tested on Windows XP as that is the only system I would be using it on (wx-2.7.2)

Cheers,

Christopher McEwan

Crummock (Scotland) Limited is a limited company registered in Scotland.

Registered company no.: 130376

Registered office: Crummock, Butlerfield Ind. Est., Bonnyrigg, Midlothian, EH19 3JQ

Crummock may monitor email traffic data and also the content of email for the purposes of security.

Scanned by MIMEDefang

I do this by binding the panel object to EVT_ENTER_WINDOW and EVT_LEAVE_WINDOW. I use a wx.Timer to fade the dialog in and out. So when I mouse over my panel, I stop the timer in my handler and set the transparency to 255. Then when I mouse out of the handler, I just start the timer again.

So here is what I changed in your code to make it work:

<code>

def onHoverEnter(self, event):
    print "Entered Window"
    self.timer.Stop()
    self.SetTransparent(255)

def onHoverLeave(self, event):
    print "Left Window"
    self.timer.Start(30)

</code>

By the way, you should start a brand-new thread when you ask a question. Maybe you did, but my email client thought it went under the "GTK Frame Iconize" thread...

Anyway, I hope that works for you.

···

chris.mcewan@crummock.com wrote:

Here is one for the experts.

Im trying to use wx.EVT_ENTER_WINDOW and wx.EVT_LEAVE_WINDOW as a method to detect mouse hover over a panel.

I have attached a demo script of a window that fades up at the bottom right of the screen then fades away. I am trying to get it to stay fully faded in when the mouse hovers over any part of the frame/panels but the problem is I have static text, images etc within the panels.

Ss you move the mouse over static text,an image or any part other panel you get a EVT_LEAVE_WINDOW event etc. :frowning: even though the mouse is still technically within the frame.
Is there any way to have a single enter or leave event no matter what panel/text/image the mouse hovers over within the frame.

I hope this is clear, try the demo and you will see what I mean (note as long as you keep moving the mouse over the window it will stay faded up, this was a backup if I couldn't get hover to work)

PS. (Please ignore the bad code)

Christopher McEwan

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

Actually, that last message was for Paul...I wrote a different one specifically for you...

Mike

···

chris.mcewan@crummock.com wrote:

> When I run that code on Ubuntu 8.10, it starts out with the program
> minimized and then it comes to the front. I'm using Python 2.5, wxPython
> 2.8.9.2.
>
> -------------------
> Mike Driscoll

Sorry,

Should have mentioned. Only tested on Windows XP as that is the only system I would be using it on (wx-2.7.2)

Cheers,

Christopher McEwan

Crummock (Scotland) Limited <http://www.crummock.com> is a limited company registered in Scotland.

Registered company no.: 130376
Registered office: Crummock, Butlerfield Ind. Est., Bonnyrigg, Midlothian, EH19 3JQ

Crummock may monitor email traffic data and also the content of email for the purposes of security.

Scanned by MIMEDefang <http://www.mimedefang.org>
------------------------------------------------------------------------

`> I do this by binding the panel object to EVT_ENTER_WINDOW
and

EVT_LEAVE_WINDOW. I use a wx.Timer to fade the dialog in and out.
So

when I mouse over my panel, I stop the timer in my handler and set
the

transparency to 255. Then when I mouse out of the handler, I just
start

the timer again.

So here is what I changed in your code to make it work:

def onHoverEnter(self, event):

print "Entered Window"
self.timer.Stop()
self.SetTransparent(255)

def onHoverLeave(self, event):

print "Left Window"
self.timer.Start(30)

By the way, you should start a brand-new thread when you ask a question.

Maybe you did, but my email client thought it went under the "GTK
Frame

Iconize" thread…

Anyway, I hope that works for you.


Mike Driscoll

Blog: [http://blog.pythonlibrary.org`](http://blog.pythonlibrary.org/)

Apologies,

Me and mailing lists just never get
on :slight_smile: I have started this as a new email to avoid further confusion.

I can handle the stop/start of the timers
no problem. It is if you hover the mouse over some wx.statictext or an
image (which I commented to stop the demo complaining of missing files)
or you move between panel1 and panel2 it generates a leave event.

If I catch the enter/leave events for
all panels/text/images in the frame it goes so fast the last event is always
a leave event even although the mouse is still within the frame.

I thought about putting a transparent
panel over the top of the frame so I would only get a single enter/leave
event but then I couldn’t press the close button that’s in the corner :frowning:

Thank you for the help. I have spent
a bit of time trying to research this but can’t find anyone trying to do
the same thing as me.

Christopher McEwan

Crummock

Butlerfield Estate

Bonnyrigg

Midlothian

EH19 3JQ

Tel. 01875 823222

Fax. 01875 823444

Crummock (Scotland) Limited is a limited company registered in Scotland.

Registered company no.: 130376

Registered office: Crummock, Butlerfield Ind. Est., Bonnyrigg, Midlothian, EH19 3JQ

Crummock may monitor email traffic data and also the content of email for the purposes of security.

Scanned by MIMEDefang

Mike Driscoll wrote:

When I run that code on Ubuntu 8.10, it starts out with the program
minimized and then it comes to the front. I'm using Python 2.5,
wxPython 2.8.9.2.

weird I'll check on my other linux system. This system is 8.04.
Maybe it is an interaction with the desktop effects (compiz)

···

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

--
Paul Sijben tel: +31334566488
Eemvalley Technology BV fax: +31334557523
the Netherlands http://eemvalley.com
-----------------------------------------------------
EemValley Technology werft python & wxpython
programmeurs: http://www.eemvalley.nl/jobs

Setting the StaticText items .Enabled(False) stops the Left Window events. It changes the look, though. Another way I would try is to capture the mouse on the initial ENTER event and calculate when it is over the window. Oh, better; calculate on LEAVE events and ignore them if it’s over the panel.

HTH, Phil

···

At 08:22 AM 3/10/2009, you wrote:

`> I do this by
binding the panel object to EVT_ENTER_WINDOW and

EVT_LEAVE_WINDOW. I use a wx.Timer to fade the dialog in and out. So

when I mouse over my panel, I stop the timer in my handler and set
the

transparency to 255. Then when I mouse out of the handler, I just
start

the timer again.

So here is what I changed in your code to make it work:

def onHoverEnter(self, event):

print "Entered Window"
self.timer.Stop()
self.SetTransparent(255)

def onHoverLeave(self, event):

print "Left Window"
self.timer.Start(30)

By the way, you should start a brand-new thread when you ask a
question.

Maybe you did, but my email client thought it went under the
"GTK Frame

Iconize" thread…

Anyway, I hope that works for you.


Mike Driscoll

Blog:
http://blog.pythonlibrary.org`

Apologies,

Me and mailing lists just never get on :slight_smile: I have started this as a new email to avoid further confusion.

I can handle the stop/start of the timers no problem. It is if you hover the mouse over some wx.statictext or an image (which I commented to stop the demo complaining of missing files) or you move between panel1 and panel2 it generates a leave event.

If I catch the enter/leave events for all panels/text/images in the frame it goes so fast the last event is always a leave event even although the mouse is still within the frame.

I thought about putting a transparent panel over the top of the frame so I would only get a single enter/leave event but then I couldn’t press the close button that’s in the corner :frowning:

Thank you for the help. I have spent a bit of time trying to research this but can’t find anyone trying to do the same thing as me.

indeed my 2 linux systems at home (both 8.10 I believe) it worked fine.

Paul Sijben wrote:

···

http://blog.pythonlibrary.orgwxpython-users@lists.wxwidgets.orghttp://lists.wxwidgets.org/mailman/listinfo/wxpython-users

I got a successrate of 50% now. Tried 4 linux machines all Ubuntu GTK 2
correctly handle Izonize and 2 ignore it, the last one I checked is
8.10, freshly installed and updated and it failed

Paul Sijben wrote:

···

http://blog.pythonlibrary.orgwxpython-users@lists.wxwidgets.orghttp://lists.wxwidgets.org/mailman/listinfo/wxpython-users

-- Paul Sijben tel: +31334566488
Eemvalley Technology fax: +31334557523
the Netherlands

http://eemvalley.com