I like to share with you a simple library that I create to automatically read images from an specific path, the porpuse is to simplify how to include images in our controls, also to be easy to maintain, so if you want to include a new image you just have to copy the image into a path and then tell the library where to search
Example:
from imagenes import imageEmbed
imag = imageEmbed(path=‘.’, size=(32, 32)) # the pixels size, by default search in the current path
colombia_image = imag.colombia # colombia is the name of an image located in the current path
colombia_as_bitmap = colombia_image.bitmap
colombia_as_image = colombia_image.imag
colombia_as_icon = colombia_image.icon
colombia_as_wxImage = colombia_image.wxImage
The code was test under python 2.7 and wxpython 3.0.2.0 it would be nice if i you feed back ant test it under python 3.5 and wxpython phoenix
imagenes.zip (51.1 KB)
The second topic is about how to expres the items creation.
#------> Excecuting this
from easyDialog import Ctrl
class Panel(wx.Panel):
def init_(self, parent, id, *args, **kwargs):
wx.Panel.init(self, parent, id, *args, **kwargs)
self.text_ctrl = Ctrl.TextCtrl(‘’).\
tooltip(“What’s your name?”).\
Bind(wx.EVT_TEXT, lambda evt: self.bitmap_btn.Enable(True))
self.bitmap_btn = Ctrl.BitmapButton(imagenes.colombia).\
tooltip(‘A tool tip’).\
Enable(False).\
Bind(wx.EVT_BUTTON, lambda evt: wx.MessageBox(self.text_ctrl.Value))
main_sizer = Ctrl.sizer([self.text_ctrl, self.bitmap_btn], horzCenter=True, title=‘Input the name’, horz=wx.HORIZONTAL)
self.SetSizer(main_sizer)
— > Obtain this

so if I instroduce some code the button is the enabled

finally if I press the button the obtain this

-----> Own analysis:
-
I guess there should be a simple way to create and maintain wxpython GUIs
-
The control container should feed which parent the control has, but implicit.
-
The syntaxis of the control could be express in terms of its properties i.e the tooltip, Bind, …
-
it should exist a way to obtain the value of a control in a simple and generic way so for example the text control should has a Value property to get and set its value.
-
We can make an interface under python dealing with this problems.
Finally
It would be nice if the comunity will develop an interface that could help developers to be more productive, so in my case I create an app that helps me to interact with the controls and experiment with the python shell

but it has its owner.
···
El domingo, 6 de noviembre de 2016, 16:44:15 (UTC-5), sebastián lópez escribió:
The second topic is about how to expres the items creation.
#------> Excecuting this
from easyDialog import Ctrl
class Panel(wx.Panel):
def init_(self, parent, id, *args, **kwargs):
wx.Panel.init(self, parent, id, *args, **kwargs)
self.text_ctrl = Ctrl.TextCtrl(‘’).\
tooltip(“What’s your name?”).\
Bind(wx.EVT_TEXT, lambda evt: self.bitmap_btn.Enable(True))
self.bitmap_btn = Ctrl.BitmapButton(imagenes.colombia).\
tooltip(‘A tool tip’).\
Enable(False).\
Bind(wx.EVT_BUTTON, lambda evt: wx.MessageBox(self.text_ctrl.Value))
main_sizer = Ctrl.sizer([self.text_ctrl, self.bitmap_btn], horzCenter=True, title=‘Input the name’, horz=wx.HORIZONTAL)
self.SetSizer(main_sizer)
— > Obtain this

so if I instroduce some code the button is the enabled

finally if I press the button the obtain this

-----> Own analysis:
- I guess there should be a simple way to create and maintain wxpython GUIs
- The control container should feed which parent the control has, but implicit.
- The syntaxis of the control could be express in terms of its properties i.e the tooltip, Bind, …
- it should exist a way to obtain the value of a control in a simple and generic way so for example the text control should has a Value property to get and set its value.
- We can make an interface under python dealing with this problems.