List Info

Thread: Re: Strange behaviour with SetSize




Re: Strange behaviour with SetSize
country flaguser name
Canada
2007-10-24 12:17:06
I guess. Thanks anyway. In some Linux distro the button does
not change 
the size at all.

Cheers

Paulo

Rickey, Kyle W wrote:
> Hmm...that's some strange behavior. Perhaps there's a
bug in the
> SetSize() function. I'm stumped. Sorry I can't be of
more help.
>
>
> Kyle Rickey
>
>
> -----Original Message-----
> From: Paulo Nuin [mailto:nuingenedrift.org] 
> Sent: Wednesday, October 24, 2007 10:40 AM
> To: wxPython-userslists.wxwidgets.org
> Subject: Re: [wxPython-users] Strange behaviour with
SetSize
>
> Hi Kyle
>
> The self.GetSize is returning the right value (600,
240) and then after 
> some clicks and when the window changes size (950,
240). I had tested 
> that before. I also have another SetSize in the code
after running a 
> bunch of functions that also fails sometimes.
>
> self.SetSize(size=(600, 600))
>
> Thanks for your help.
>
> Paulo
>
> Rickey, Kyle W wrote:
>   
>> The code also works for me on windows 2000. My
guess is that
>> self.GetSize() is not returning what you expect and
with your else
>> statement, it setting the size the same as the
window already is.
>>     
> Could
>   
>> you print the result of self.GetSize()? I don't
have a linux box handy
>> to test.
>>
>>
>> Kyle Rickey
>>
>>
>> -----Original Message-----
>> From: Paulo Nuin [mailto:nuingenedrift.org] 
>> Sent: Wednesday, October 24, 2007 10:16 AM
>> To: wxPython-userslists.wxwidgets.org
>> Subject: Re: [wxPython-users] Strange behaviour
with SetSize
>>
>> Sure
>>
>> class multiGUI(wx.Frame):
>>
>>     def __init__(self, parent, id):
>>         wx.Frame.__init__(self, parent, id, 
'MultiGUI', size=(600, 
>> 240), style=wx.DEFAULT_FRAME_STYLE ^
(wx.RESIZE_BORDER |
>> wx.MAXIMIZE_BOX))
>>         self.__do_layout()
>>         self.__do_binding()
>>
>>     def __do_layout(self):
>>         self.panel = wx.Panel(self)
>>         menubar = wx.MenuBar()
>>        
>>         #file menu
>>         filemenu = wx.Menu()
>>         self.seqmenu = filemenu.Append(-1, 'Set
Sequence file A')
>>         self.treemenu = filemenu.Append(-1, 'Set
tree file')
>>         self.treenooutmenu = filemenu.Append(-1,
'Set tree file w/o 
>> outgroup')
>>  
>>         #configuration menu      
>>         configmenu = wx.Menu()
>>         self.config = configmenu.Append(-1,
'Configure MultiGUI', '')
>>         self.checkconfig = configmenu.Append(-1,
'Check
>>     
> configuration')
>   
>>        
>>         menubar.Append(filemenu, 'File')
>>         menubar.Append(configmenu, 'Config')
>>         self.SetMenuBar(menubar)
>>
>>         #labels that show the selected files after
selection
>>         self.seqlabel = wx.StaticText(self.panel,
label='Choose the 
>> sequence file(s)', pos=(200,35))
>>         self.treelabel = wx.StaticText(self.panel,
label='Choose a
>>     
> tree 
>   
>> file', pos=(200,75))
>>         self.treenolabel =
wx.StaticText(self.panel, label='Choose a 
>> tree file (w/o outgroup)', pos=(200,115))
>>
>>         self.label2 = wx.StaticText(self.panel,
label='Select the
>>     
> input 
>   
>> files', pos=(15,10))
>>        
>>         #buttons to select files
>>         self.seqButton = wx.Button(self.panel,
label='Sequence
>>     
> file(s)',
>   
>> pos=(15, 30), size=(110, 30))
>>         self.treeButton = wx.Button(self.panel,
label='Tree file w/ 
>> Outgroup', pos=(15, 70), size=(150, 30))
>>         self.treeNoOutButton =
wx.Button(self.panel, label='Tree file 
>> w/o Outgroup', pos=(15, 110), size=(150, 30))
>>    
>>         #first run button
>>         self.initialButton = wx.Button(self.panel,
label='Run initial 
>> analysis', pos=(400, 150), size=(130, 30))
>>        
>>         #parameters
>>         self.label2 = wx.StaticText(self.panel,
label='Parameters', 
>> pos=(15, 210))
>>
>>         self.label2 = wx.StaticText(self.panel,
label='Number of 
>> samples', pos=(15, 245))
>>         self.numsamps = wx.TextCtrl(self.panel, -1,
'', pos=(150,
>>     
> 240), 
>   
>> size=(110,25))
>>         self.label2 = wx.StaticText(self.panel,
label='Number of 
>> cycles', pos=(15, 275))
>>         self.sampfreq = wx.TextCtrl(self.panel, -1,
'', pos=(150,
>>     
> 270), 
>   
>> size=(110, 25))
>>         self.label2 = wx.StaticText(self.panel,
label='Burnin',
>>     
> pos=(15,
>   
>> 305))
>>         self.burnin = wx.TextCtrl(self.panel, -1,
'', pos=(150, 300), 
>> size=(110, 25))
>>        
>>         self.label2 = wx.StaticText(self.panel,
label='Root age', 
>> pos=(15, 335))
>>         self.rttm = wx.TextCtrl(self.panel, -1, '',
pos=(150, 330), 
>> size=(110, 25))
>>         self.label2 = wx.StaticText(self.panel,
label = 'std dev', pos
>>     
>
>   
>> =(270, 335))
>>         self.rttmsd = wx.TextCtrl(self.panel, -1,
'', pos=(330, 330), 
>> size=(50, 25))
>>
>>         self.label2 = wx.StaticText(self.panel,
label='Root change 
>> rate', pos=(15, 365))
>>         self.rtrate = wx.TextCtrl(self.panel, -1,
'', pos=(150, 360), 
>> size=(110, 25))
>>         self.label2 = wx.StaticText(self.panel,
label = 'std dev', pos
>>     
>
>   
>> =(270, 365))
>>         self.rtratesd = wx.TextCtrl(self.panel, -1,
'', pos=(330,
>>     
> 360), 
>   
>> size=(50, 25))
>>        
>>         #button to run the applications
>>         self.runButton = wx.Button(self.panel,
label='Run
>>     
> multidivtime',
>   
>> pos=(400, 500), size=(150, 30))
>>        
>>         #log box (can be hidden) and show/hide
button
>>         style = (wx.TE_MULTILINE | wx.TE_READONLY
|wx.TE_RICH2 | 
>> wx.TE_DONTWRAP)
>>         self.logText = wx.TextCtrl(self.panel,
pos=(600, 15), 
>> size=(320,180), style=style)
>>        
>>         self.logButton = wx.Button(self.panel,
label='Show log', 
>> pos=(480, 15), size=(100, 30))
>>
>>     def __do_binding(self):
>>         self.Bind(wx.EVT_BUTTON, self.OnSeq,
self.seqButton)
>>         self.Bind(wx.EVT_BUTTON, self.OnTree,
self.treeButton)
>>         self.Bind(wx.EVT_BUTTON, self.OnTreeNoOut,
>>     
> self.treeNoOutButton)
>   
>>         self.Bind(wx.EVT_BUTTON, self.OnRun,
self.runButton)
>>        
>>         self.Bind(wx.EVT_BUTTON,
self.OnInitialRun,
>>     
> self.initialButton)
>   
>>        
>>         self.Bind(wx.EVT_BUTTON, self.OnShowLog,
self.logButton)
>>        
>>         self.Bind(wx.EVT_MENU, self.OnSeq,
self.seqmenu)
>>         self.Bind(wx.EVT_MENU, self.OnTree,
self.treemenu)
>>         self.Bind(wx.EVT_MENU, self.OnTreeNoOut,
self.treenooutmenu)
>>        
>>         self.Bind(wx.EVT_MENU, self.OnConfig,
self.config)
>>         self.Bind(wx.EVT_MENU, self.OnCheckConfig,
self.checkconfig)
>>  
>>     def OnShowLog(self, event):
>>         if self.GetSize() == (600, 240):
>>             self.SetSize(size=(950, 240))
>>         else:
>>             self.SetSize(size=(600, 240))
>>
>> Some part of the code has been omitted. The problem
occurs on the last
>>     
>
>   
>> function, OnShowLog, that on Linux does not work
sometimes. You see
>>     
> the 
>   
>> window flicking and sometimes you need more than
one attempt to 
>> increase/decrease the size. On Windows (Vista) it
works like a charm. 
>> Any help is appreciated.
>>
>> Thanks in advance
>>
>> Paulo
>>
>>
>> Rickey, Kyle W wrote:
>>   
>>     
>>> Could you post some sample code that we can
run?
>>>
>>>
>>> Kyle Rickey
>>>
>>>
>>> -----Original Message-----
>>> From: Paulo Nuin [mailto:nuingenedrift.org] 
>>> Sent: Wednesday, October 24, 2007 9:22 AM
>>> To: wxPython-userslists.wxwidgets.org
>>> Subject: [wxPython-users] Strange behaviour
with SetSize
>>>
>>> Hello everyone
>>>
>>> A form in my application that has a button that
increases/decreases
>>>     
>>>       
>> the 
>>   
>>     
>>> size of the form when it is clicked. Basically,
I check for the size 
>>> with GetSize() and depending on the tuple value
I set a new size with
>>>       
>
>   
>>> self.SetSize(size=(x,y)).
>>>
>>> The problem is that sometimes the form does not
change in size. On
>>>     
>>>       
>> Linux
>>   
>>     
>>> it blinks on what is supposed to be size
determined by the button 
>>> (either larger or smaller) and you need to
click again for the change
>>>     
>>>       
>> to
>>   
>>     
>>> happen. Is there any other way to achieve the
same thing without this
>>>       
>
>   
>>> glitch?
>>>
>>> Thanks in advance for any help.
>>>
>>> Cheers
>>>
>>> Paulo
>>>
>>>
>>>
>>>
>>>
------------------------------------------------------------
---------
>>> To unsubscribe, e-mail:
>>>       
> wxPython-users-unsubscribelists.wxwidgets.org
>   
>>> For additional commands, e-mail:
>>>     
>>>       
>> wxPython-users-helplists.wxwidgets.org
>>   
>>     
>>>
------------------------------------------------------------
---------
>>> To unsubscribe, e-mail:
>>>       
> wxPython-users-unsubscribelists.wxwidgets.org
>   
>>> For additional commands, e-mail:
>>>     
>>>       
>> wxPython-users-helplists.wxwidgets.org
>>   
>>     
>>>   
>>>     
>>>       
>>
------------------------------------------------------------
---------
>> To unsubscribe, e-mail:
wxPython-users-unsubscribelists.wxwidgets.org
>> For additional commands, e-mail:
>>     
> wxPython-users-helplists.wxwidgets.org
>   
>>
------------------------------------------------------------
---------
>> To unsubscribe, e-mail:
wxPython-users-unsubscribelists.wxwidgets.org
>> For additional commands, e-mail:
>>     
> wxPython-users-helplists.wxwidgets.org
>   
>>   
>>     
>
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: wxPython-users-unsubscribelists.wxwidgets.org
> For additional commands, e-mail:
wxPython-users-helplists.wxwidgets.org
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: wxPython-users-unsubscribelists.wxwidgets.org
> For additional commands, e-mail:
wxPython-users-helplists.wxwidgets.org
>
>   


------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-users-unsubscribelists.wxwidgets.org
For additional commands, e-mail: wxPython-users-helplists.wxwidgets.org


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )