Suppose I have an array of sizers, each size containing a
button or textctrl widget and I want to be able to gather all the changes to
this array of sizers after the user have changed in colors or text in widget in
the sizer. How would I be able to know gather information on whether a widget
inside the sizer is a button or textctrl and get its colors/text? Basically,
how would I know an item inside a sizer is a widget and that it’s a
textctrl or button?
Statement Of Confidentiality:
This electronic message transmission, and all attachments, contains information from Extron Electronics which is confidential and privileged. The information is for the exclusive viewing or use of the intended recipient. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic transmission in error, please notify the sender immediately by a “reply to sender only” message and destroy all electronic and hard copies of the communication, including attachments.
Suppose I have an array of sizers, each size containing a button or textctrl
widget and I want to be able to gather all the changes to this array of
sizers after the user have changed in colors or text in widget in the sizer.
First, you would not have one item per sizer, usually. In most cases, you
would have a group of widgets in each sizer. Second, if the user changed
colors or text in a widget, there would be *no* changes to the *sizers*,
only changes to the widgets themselves.
How would I be able to know gather information on whether a widget inside
the sizer is a button or textctrl and get its colors/text? Basically, how
would I know an item inside a sizer is a widget and that it’s a textctrl or
button?
Based on this and your other message about this topic, I am not totally
sure you are understanding the purpose of sizers, or maybe you are
approaching them from a new or unorthodox perspective that I don't
understand. Could you just plainly state what ultimately your goal is?
That is, what, simply put, do you want to happen?
Che
Other than that, as I mentioned before,
···
On Wed, Oct 7, 2009 at 8:12 PM, Qui Le <qle@extron.com> wrote:
Statement Of Confidentiality:
This electronic message transmission, and all attachments, contains
information from Extron Electronics which is confidential and privileged.
The information is for the exclusive viewing or use of the intended
recipient. If you are not the intended recipient, be aware that any
disclosure, copying, distribution or use of the contents of this information
is prohibited. If you have received this electronic transmission in error,
please notify the sender immediately by a "reply to sender only" message and
destroy all electronic and hard copies of the communication, including
attachments.
>
For each button/textctrl, I'm implementing a right-click menu that
allows color changes or label changes. After all the changes, I want to
be able to export all these data to a file that can be imported later.
I'm trying to use sizer mainly because of its 'nicely layout capability'
compared to manual positioning all the widgets. Of course, when I
generate this array of widgets within sizers, I can store the widget
objects somewhere. I'm just curious, suppose I 'forgot' to store the
widget objects. Can these widget objects be retrieved from the sizers
themselves so I can get the widget's colors/labels? Yes, I know it is
unorthodox trial..
···
-----Original Message-----
From: wxpython-users@googlegroups.com
[mailto:wxpython-users@googlegroups.com] On Behalf Of C M
Sent: Wednesday, October 07, 2009 5:32 PM
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: Get info from items inside a sizer
On Wed, Oct 7, 2009 at 8:12 PM, Qui Le <qle@extron.com> wrote:
Hi,
Suppose I have an array of sizers, each size containing a button or
textctrl
widget and I want to be able to gather all the changes to this array
of
sizers after the user have changed in colors or text in widget in the
sizer.
First, you would not have one item per sizer, usually. In most cases,
you
would have a group of widgets in each sizer. Second, if the user
changed
colors or text in a widget, there would be *no* changes to the *sizers*,
only changes to the widgets themselves.
How would I be able to know gather information on whether a widget
inside
the sizer is a button or textctrl and get its colors/text? Basically,
how
would I know an item inside a sizer is a widget and that it's a
textctrl or
button?
Based on this and your other message about this topic, I am not totally
sure you are understanding the purpose of sizers, or maybe you are
approaching them from a new or unorthodox perspective that I don't
understand. Could you just plainly state what ultimately your goal is?
That is, what, simply put, do you want to happen?
Che
Other than that, as I mentioned before,
Statement Of Confidentiality:
This electronic message transmission, and all attachments, contains
information from Extron Electronics which is confidential and
privileged.
The information is for the exclusive viewing or use of the intended
recipient. If you are not the intended recipient, be aware that any
disclosure, copying, distribution or use of the contents of this
information
is prohibited. If you have received this electronic transmission in
error,
please notify the sender immediately by a "reply to sender only"
message and
destroy all electronic and hard copies of the communication, including
attachments.
>
[ Button1 TextCtrl1 ] [Button2 TextCtrl2 ] [ Button TextCtrl3 ] [Button2
TextCtrl4 ]
[ Button5 TextCtrl5 ] [Button2 TextCtrl6 ] [ Button TextCtrl7 ] [Button2
TextCtrl8 ]
I'm trying to use sizer mainly because of its 'nicely layout capability'
compared to manual positioning all the widgets.
Yes, that's the right way to do it.
generate this array of widgets within sizers, I can store the widget
objects somewhere. I'm just curious, suppose I 'forgot' to store the
widget objects. Can these widget objects be retrieved from the sizers
themselves so I can get the widget's colors/labels? Yes, I know it is
unorthodox trial..
You can use sizer.GetChildren() to get a list of the child widgets of
a sizer. But, maybe I am just not getting it, but I am unsure why you
can't just have a list of the widget objects and appeal to that. That is,
if you know you will have 5 "units" of a button and a textctrl, when you
want to know the properties, you have a list of those 5 widgets and
you can use .GetValue() or GetBackgroundColour() or whatever the
method is right on the widgets themselves and skip the bit about the
sizer entirely.
Che
···
On Wed, Oct 7, 2009 at 8:58 PM, Qui Le <qle@extron.com> wrote:
-----Original Message-----
From: wxpython-users@googlegroups.com
[mailto:wxpython-users@googlegroups.com] On Behalf Of C M
Sent: Wednesday, October 07, 2009 5:32 PM
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: Get info from items inside a sizer
On Wed, Oct 7, 2009 at 8:12 PM, Qui Le <qle@extron.com> wrote:
Hi,
Suppose I have an array of sizers, each size containing a button or
textctrl
widget and I want to be able to gather all the changes to this array
of
sizers after the user have changed in colors or text in widget in the
sizer.
First, you would not have one item per sizer, usually. In most cases,
you
would have a group of widgets in each sizer. Second, if the user
changed
colors or text in a widget, there would be *no* changes to the *sizers*,
only changes to the widgets themselves.
How would I be able to know gather information on whether a widget
inside
the sizer is a button or textctrl and get its colors/text? Basically,
how
would I know an item inside a sizer is a widget and that it's a
textctrl or
button?
Based on this and your other message about this topic, I am not totally
sure you are understanding the purpose of sizers, or maybe you are
approaching them from a new or unorthodox perspective that I don't
understand. Could you just plainly state what ultimately your goal is?
That is, what, simply put, do you want to happen?
Che
Other than that, as I mentioned before,
Statement Of Confidentiality:
This electronic message transmission, and all attachments, contains
information from Extron Electronics which is confidential and
privileged.
The information is for the exclusive viewing or use of the intended
recipient. If you are not the intended recipient, be aware that any
disclosure, copying, distribution or use of the contents of this
information
is prohibited. If you have received this electronic transmission in
error,
please notify the sender immediately by a "reply to sender only"
message and
destroy all electronic and hard copies of the communication, including
attachments.
>
Of course, the easy way would be to have a separate list of widget objects. I was curious if there was a way to go backward and retrieve the widget objects from the sizers themselves.
···
-----Original Message-----
From: wxpython-users@googlegroups.com [mailto:wxpython-users@googlegroups.com] On Behalf Of C M
Sent: Wednesday, October 07, 2009 8:27 PM
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: Get info from items inside a sizer
On Wed, Oct 7, 2009 at 8:58 PM, Qui Le <qle@extron.com> wrote:
[ Button1 TextCtrl1 ] [Button2 TextCtrl2 ] [ Button TextCtrl3 ] [Button2
TextCtrl4 ]
[ Button5 TextCtrl5 ] [Button2 TextCtrl6 ] [ Button TextCtrl7 ] [Button2
TextCtrl8 ]
I'm trying to use sizer mainly because of its 'nicely layout capability'
compared to manual positioning all the widgets.
Yes, that's the right way to do it.
generate this array of widgets within sizers, I can store the widget
objects somewhere. I'm just curious, suppose I 'forgot' to store the
widget objects. Can these widget objects be retrieved from the sizers
themselves so I can get the widget's colors/labels? Yes, I know it is
unorthodox trial..
You can use sizer.GetChildren() to get a list of the child widgets of
a sizer. But, maybe I am just not getting it, but I am unsure why you
can't just have a list of the widget objects and appeal to that. That is,
if you know you will have 5 "units" of a button and a textctrl, when you
want to know the properties, you have a list of those 5 widgets and
you can use .GetValue() or GetBackgroundColour() or whatever the
method is right on the widgets themselves and skip the bit about the
sizer entirely.
Che
-----Original Message-----
From: wxpython-users@googlegroups.com
[mailto:wxpython-users@googlegroups.com] On Behalf Of C M
Sent: Wednesday, October 07, 2009 5:32 PM
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: Get info from items inside a sizer
On Wed, Oct 7, 2009 at 8:12 PM, Qui Le <qle@extron.com> wrote:
Hi,
Suppose I have an array of sizers, each size containing a button or
textctrl
widget and I want to be able to gather all the changes to this array
of
sizers after the user have changed in colors or text in widget in the
sizer.
First, you would not have one item per sizer, usually. In most cases,
you
would have a group of widgets in each sizer. Second, if the user
changed
colors or text in a widget, there would be *no* changes to the *sizers*,
only changes to the widgets themselves.
How would I be able to know gather information on whether a widget
inside
the sizer is a button or textctrl and get its colors/text? Basically,
how
would I know an item inside a sizer is a widget and that it's a
textctrl or
button?
Based on this and your other message about this topic, I am not totally
sure you are understanding the purpose of sizers, or maybe you are
approaching them from a new or unorthodox perspective that I don't
understand. Could you just plainly state what ultimately your goal is?
That is, what, simply put, do you want to happen?
Che
Other than that, as I mentioned before,
Statement Of Confidentiality:
This electronic message transmission, and all attachments, contains
information from Extron Electronics which is confidential and
privileged.
The information is for the exclusive viewing or use of the intended
recipient. If you are not the intended recipient, be aware that any
disclosure, copying, distribution or use of the contents of this
information
is prohibited. If you have received this electronic transmission in
error,
please notify the sender immediately by a "reply to sender only"
message and
destroy all electronic and hard copies of the communication, including
attachments.
>
Of course, the easy way would be to have a separate list of widget objects. I was curious if there was a way to go backward and retrieve the widget objects from the sizers themselves.
Curiosity is good. Then again, two from The Zen of Python:
Simple is better than complex.
There should be one-- and preferably only one--obvious way to do it.
(I'm working up to this myself...)
Che
···
On Thu, Oct 8, 2009 at 12:06 PM, Qui Le <qle@extron.com> wrote:
-----Original Message-----
From: wxpython-users@googlegroups.com [mailto:wxpython-users@googlegroups.com] On Behalf Of C M
Sent: Wednesday, October 07, 2009 8:27 PM
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: Get info from items inside a sizer
On Wed, Oct 7, 2009 at 8:58 PM, Qui Le <qle@extron.com> wrote:
[ Button1 TextCtrl1 ] [Button2 TextCtrl2 ] [ Button TextCtrl3 ] [Button2
TextCtrl4 ]
[ Button5 TextCtrl5 ] [Button2 TextCtrl6 ] [ Button TextCtrl7 ] [Button2
TextCtrl8 ]
I'm trying to use sizer mainly because of its 'nicely layout capability'
compared to manual positioning all the widgets.
Yes, that's the right way to do it.
generate this array of widgets within sizers, I can store the widget
objects somewhere. I'm just curious, suppose I 'forgot' to store the
widget objects. Can these widget objects be retrieved from the sizers
themselves so I can get the widget's colors/labels? Yes, I know it is
unorthodox trial..
You can use sizer.GetChildren() to get a list of the child widgets of
a sizer. But, maybe I am just not getting it, but I am unsure why you
can't just have a list of the widget objects and appeal to that. That is,
if you know you will have 5 "units" of a button and a textctrl, when you
want to know the properties, you have a list of those 5 widgets and
you can use .GetValue() or GetBackgroundColour() or whatever the
method is right on the widgets themselves and skip the bit about the
sizer entirely.
Che
-----Original Message-----
From: wxpython-users@googlegroups.com
[mailto:wxpython-users@googlegroups.com] On Behalf Of C M
Sent: Wednesday, October 07, 2009 5:32 PM
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: Get info from items inside a sizer
On Wed, Oct 7, 2009 at 8:12 PM, Qui Le <qle@extron.com> wrote:
Hi,
Suppose I have an array of sizers, each size containing a button or
textctrl
widget and I want to be able to gather all the changes to this array
of
sizers after the user have changed in colors or text in widget in the
sizer.
First, you would not have one item per sizer, usually. In most cases,
you
would have a group of widgets in each sizer. Second, if the user
changed
colors or text in a widget, there would be *no* changes to the *sizers*,
only changes to the widgets themselves.
How would I be able to know gather information on whether a widget
inside
the sizer is a button or textctrl and get its colors/text? Basically,
how
would I know an item inside a sizer is a widget and that it's a
textctrl or
button?
Based on this and your other message about this topic, I am not totally
sure you are understanding the purpose of sizers, or maybe you are
approaching them from a new or unorthodox perspective that I don't
understand. Could you just plainly state what ultimately your goal is?
That is, what, simply put, do you want to happen?
Che
Other than that, as I mentioned before,
Statement Of Confidentiality:
This electronic message transmission, and all attachments, contains
information from Extron Electronics which is confidential and
privileged.
The information is for the exclusive viewing or use of the intended
recipient. If you are not the intended recipient, be aware that any
disclosure, copying, distribution or use of the contents of this
information
is prohibited. If you have received this electronic transmission in
error,
please notify the sender immediately by a "reply to sender only"
message and
destroy all electronic and hard copies of the communication, including
attachments.
>
I found out a way to find the objects inside the sizers for my case.
After GetChildren(), call GetWindow() for each wxSizerItem
···
-----Original Message-----
From: wxpython-users@googlegroups.com [mailto:wxpython-users@googlegroups.com] On Behalf Of C M
Sent: Thursday, October 08, 2009 10:45 AM
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: Get info from items inside a sizer
On Thu, Oct 8, 2009 at 12:06 PM, Qui Le <qle@extron.com> wrote:
Of course, the easy way would be to have a separate list of widget objects. I was curious if there was a way to go backward and retrieve the widget objects from the sizers themselves.
Curiosity is good. Then again, two from The Zen of Python:
Simple is better than complex.
There should be one-- and preferably only one--obvious way to do it.
(I'm working up to this myself...)
Che
-----Original Message-----
From: wxpython-users@googlegroups.com [mailto:wxpython-users@googlegroups.com] On Behalf Of C M
Sent: Wednesday, October 07, 2009 8:27 PM
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: Get info from items inside a sizer
On Wed, Oct 7, 2009 at 8:58 PM, Qui Le <qle@extron.com> wrote:
[ Button1 TextCtrl1 ] [Button2 TextCtrl2 ] [ Button TextCtrl3 ] [Button2
TextCtrl4 ]
[ Button5 TextCtrl5 ] [Button2 TextCtrl6 ] [ Button TextCtrl7 ] [Button2
TextCtrl8 ]
I'm trying to use sizer mainly because of its 'nicely layout capability'
compared to manual positioning all the widgets.
Yes, that's the right way to do it.
generate this array of widgets within sizers, I can store the widget
objects somewhere. I'm just curious, suppose I 'forgot' to store the
widget objects. Can these widget objects be retrieved from the sizers
themselves so I can get the widget's colors/labels? Yes, I know it is
unorthodox trial..
You can use sizer.GetChildren() to get a list of the child widgets of
a sizer. But, maybe I am just not getting it, but I am unsure why you
can't just have a list of the widget objects and appeal to that. That is,
if you know you will have 5 "units" of a button and a textctrl, when you
want to know the properties, you have a list of those 5 widgets and
you can use .GetValue() or GetBackgroundColour() or whatever the
method is right on the widgets themselves and skip the bit about the
sizer entirely.
Che
-----Original Message-----
From: wxpython-users@googlegroups.com
[mailto:wxpython-users@googlegroups.com] On Behalf Of C M
Sent: Wednesday, October 07, 2009 5:32 PM
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: Get info from items inside a sizer
On Wed, Oct 7, 2009 at 8:12 PM, Qui Le <qle@extron.com> wrote:
Hi,
Suppose I have an array of sizers, each size containing a button or
textctrl
widget and I want to be able to gather all the changes to this array
of
sizers after the user have changed in colors or text in widget in the
sizer.
First, you would not have one item per sizer, usually. In most cases,
you
would have a group of widgets in each sizer. Second, if the user
changed
colors or text in a widget, there would be *no* changes to the *sizers*,
only changes to the widgets themselves.
How would I be able to know gather information on whether a widget
inside
the sizer is a button or textctrl and get its colors/text? Basically,
how
would I know an item inside a sizer is a widget and that it's a
textctrl or
button?
Based on this and your other message about this topic, I am not totally
sure you are understanding the purpose of sizers, or maybe you are
approaching them from a new or unorthodox perspective that I don't
understand. Could you just plainly state what ultimately your goal is?
That is, what, simply put, do you want to happen?
Che
Other than that, as I mentioned before,
Statement Of Confidentiality:
This electronic message transmission, and all attachments, contains
information from Extron Electronics which is confidential and
privileged.
The information is for the exclusive viewing or use of the intended
recipient. If you are not the intended recipient, be aware that any
disclosure, copying, distribution or use of the contents of this
information
is prohibited. If you have received this electronic transmission in
error,
please notify the sender immediately by a "reply to sender only"
message and
destroy all electronic and hard copies of the communication, including
attachments.
>
Yes, but why bother? It would be more flexible if you separate the UI from your data. You are already binding events to the widgets in order to be able to use them to change colors, etc. So instead of depending on the ability to store and retrieve those values from the widgets themselves, just store the values as they change in some other data structure that the rest of the program uses whenever it wants to access one of the data items.
For each button/textctrl, I'm implementing a right-click menu that
allows color changes or label changes. After all the changes, I want to
be able to export all these data to a file that can be imported later.
I'm trying to use sizer mainly because of its 'nicely layout capability'
compared to manual positioning all the widgets. Of course, when I
generate this array of widgets within sizers, I can store the widget
objects somewhere. I'm just curious, suppose I 'forgot' to store the
widget objects. Can these widget objects be retrieved from the sizers
themselves so I can get the widget's colors/labels?
You can get a list of wx.SizerItem objects, and from those you can get the windows or subsizers that each item is managing. Keep in mind that if you have nested sizers then you'll need to use recursion to get all the child windows. You can also use the parent window's GetChildren to do the same thing without having to go through the wx.SizerItem middlemen or do recursion.
···
On 10/8/09 9:06 AM, Qui Le wrote:
Of course, the easy way would be to have a separate list of widget objects. I was curious if there was a way to go backward and retrieve the widget objects from the sizers themselves.
Yes, I know. I just need to step out of my embedded world where using
more memory storage usually annoys me =)
···
-----Original Message-----
From: wxpython-users@googlegroups.com
[mailto:wxpython-users@googlegroups.com] On Behalf Of Robin Dunn
Sent: Thursday, October 08, 2009 11:59 AM
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: Get info from items inside a sizer
For each button/textctrl, I'm implementing a right-click menu that
allows color changes or label changes. After all the changes, I want
to
be able to export all these data to a file that can be imported later.
I'm trying to use sizer mainly because of its 'nicely layout
capability'
compared to manual positioning all the widgets. Of course, when I
generate this array of widgets within sizers, I can store the widget
objects somewhere. I'm just curious, suppose I 'forgot' to store the
widget objects. Can these widget objects be retrieved from the sizers
themselves so I can get the widget's colors/labels?
Yes, but why bother? It would be more flexible if you separate the UI
from your data. You are already binding events to the widgets in order
to be able to use them to change colors, etc. So instead of depending
on the ability to store and retrieve those values from the widgets
themselves, just store the values as they change in some other data
structure that the rest of the program uses whenever it wants to access
one of the data items.
--
Robin Dunn
Software Craftsman
Statement Of Confidentiality:
This electronic message transmission, and all attachments, contains information from Extron Electronics which is confidential and privileged. The information is for the exclusive viewing or use of the intended recipient. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic transmission in error, please notify the sender immediately by a "reply to sender only" message and destroy all electronic and hard copies of the communication, including attachments.
-----Original Message-----
From: wxpython-users@googlegroups.com [mailto:wxpython-users@googlegroups.com] On Behalf Of C M
Sent: Thursday, October 08, 2009 10:45 AM
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: Get info from items inside a sizer
On Thu, Oct 8, 2009 at 12:06 PM, Qui Le <qle@extron.com> wrote:
Of course, the easy way would be to have a separate list of widget objects. I was curious if there was a way to go backward and retrieve the widget objects from the sizers themselves.
Curiosity is good. Then again, two from The Zen of Python:
Simple is better than complex.
There should be one-- and preferably only one--obvious way to do it.
(I'm working up to this myself...)
Che
-----Original Message-----
From: wxpython-users@googlegroups.com [mailto:wxpython-users@googlegroups.com] On Behalf Of C M
Sent: Wednesday, October 07, 2009 8:27 PM
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: Get info from items inside a sizer
On Wed, Oct 7, 2009 at 8:58 PM, Qui Le <qle@extron.com> wrote:
[ Button1 TextCtrl1 ] [Button2 TextCtrl2 ] [ Button TextCtrl3 ] [Button2
TextCtrl4 ]
[ Button5 TextCtrl5 ] [Button2 TextCtrl6 ] [ Button TextCtrl7 ] [Button2
TextCtrl8 ]
I'm trying to use sizer mainly because of its 'nicely layout capability'
compared to manual positioning all the widgets.
Yes, that's the right way to do it.
generate this array of widgets within sizers, I can store the widget
objects somewhere. I'm just curious, suppose I 'forgot' to store the
widget objects. Can these widget objects be retrieved from the sizers
themselves so I can get the widget's colors/labels? Yes, I know it is
unorthodox trial..
You can use sizer.GetChildren() to get a list of the child widgets of
a sizer. But, maybe I am just not getting it, but I am unsure why you
can't just have a list of the widget objects and appeal to that. That is,
if you know you will have 5 "units" of a button and a textctrl, when you
want to know the properties, you have a list of those 5 widgets and
you can use .GetValue() or GetBackgroundColour() or whatever the
method is right on the widgets themselves and skip the bit about the
sizer entirely.
Che
-----Original Message-----
From: wxpython-users@googlegroups.com
[mailto:wxpython-users@googlegroups.com] On Behalf Of C M
Sent: Wednesday, October 07, 2009 5:32 PM
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: Get info from items inside a sizer
On Wed, Oct 7, 2009 at 8:12 PM, Qui Le <qle@extron.com> wrote:
Hi,
Suppose I have an array of sizers, each size containing a button or
textctrl
widget and I want to be able to gather all the changes to this array
of
sizers after the user have changed in colors or text in widget in the
sizer.
First, you would not have one item per sizer, usually. In most cases,
you
would have a group of widgets in each sizer. Second, if the user
changed
colors or text in a widget, there would be *no* changes to the *sizers*,
only changes to the widgets themselves.
How would I be able to know gather information on whether a widget
inside
the sizer is a button or textctrl and get its colors/text? Basically,
how
would I know an item inside a sizer is a widget and that it's a
textctrl or
button?
Based on this and your other message about this topic, I am not totally
sure you are understanding the purpose of sizers, or maybe you are
approaching them from a new or unorthodox perspective that I don't
understand. Could you just plainly state what ultimately your goal is?
That is, what, simply put, do you want to happen?
Che
Other than that, as I mentioned before,
Statement Of Confidentiality:
This electronic message transmission, and all attachments, contains
information from Extron Electronics which is confidential and
privileged.
The information is for the exclusive viewing or use of the intended
recipient. If you are not the intended recipient, be aware that any
disclosure, copying, distribution or use of the contents of this
information
is prohibited. If you have received this electronic transmission in
error,
please notify the sender immediately by a "reply to sender only"
message and
destroy all electronic and hard copies of the communication, including
attachments.
>
Yes, I know. I just need to step out of my embedded world where using
more memory storage usually annoys me =)
you're not keeping copies, only references, so it's not much extra memory, certainly not compared to everything else you're using here!
-Chris
···
-----Original Message-----
From: wxpython-users@googlegroups.com
[mailto:wxpython-users@googlegroups.com] On Behalf Of Robin Dunn
Sent: Thursday, October 08, 2009 11:59 AM
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: Get info from items inside a sizer
For each button/textctrl, I'm implementing a right-click menu that
allows color changes or label changes. After all the changes, I want
to
be able to export all these data to a file that can be imported later.
I'm trying to use sizer mainly because of its 'nicely layout
capability'
compared to manual positioning all the widgets. Of course, when I
generate this array of widgets within sizers, I can store the widget
objects somewhere. I'm just curious, suppose I 'forgot' to store the
widget objects. Can these widget objects be retrieved from the sizers
themselves so I can get the widget's colors/labels?
Yes, but why bother? It would be more flexible if you separate the UI from your data. You are already binding events to the widgets in order to be able to use them to change colors, etc. So instead of depending on the ability to store and retrieve those values from the widgets themselves, just store the values as they change in some other data structure that the rest of the program uses whenever it wants to access one of the data items.
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Haha exactly. That's why I need to get out of that mindset.
···
-----Original Message-----
From: wxpython-users@googlegroups.com
[mailto:wxpython-users@googlegroups.com] On Behalf Of Christopher Barker
Sent: Thursday, October 08, 2009 12:46 PM
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: Get info from items inside a sizer
Qui Le wrote:
Yes, I know. I just need to step out of my embedded world where using
more memory storage usually annoys me =)
you're not keeping copies, only references, so it's not much extra
memory, certainly not compared to everything else you're using here!
-Chris
-----Original Message-----
From: wxpython-users@googlegroups.com
[mailto:wxpython-users@googlegroups.com] On Behalf Of Robin Dunn
Sent: Thursday, October 08, 2009 11:59 AM
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: Get info from items inside a sizer
For each button/textctrl, I'm implementing a right-click menu that
allows color changes or label changes. After all the changes, I want
to
be able to export all these data to a file that can be imported
later.
I'm trying to use sizer mainly because of its 'nicely layout
capability'
compared to manual positioning all the widgets. Of course, when I
generate this array of widgets within sizers, I can store the widget
objects somewhere. I'm just curious, suppose I 'forgot' to store the
widget objects. Can these widget objects be retrieved from the sizers
themselves so I can get the widget's colors/labels?
Yes, but why bother? It would be more flexible if you separate the UI
from your data. You are already binding events to the widgets in
order
to be able to use them to change colors, etc. So instead of depending
on the ability to store and retrieve those values from the widgets
themselves, just store the values as they change in some other data
structure that the rest of the program uses whenever it wants to
access
one of the data items.
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
Statement Of Confidentiality:
This electronic message transmission, and all attachments, contains information from Extron Electronics which is confidential and privileged. The information is for the exclusive viewing or use of the intended recipient. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic transmission in error, please notify the sender immediately by a "reply to sender only" message and destroy all electronic and hard copies of the communication, including attachments.