alejandroautalan / pygubu Goto Github PK
View Code? Open in Web Editor NEWA simple GUI builder for the python tkinter module
License: MIT License
A simple GUI builder for the python tkinter module
License: MIT License
By changing line 45 of stockimage.py to
_formats = ('.gif','.png',)
stock images normally used for kde buttons can really be used (not just .gif)
Thanks.
Expected behaviour, as shown by pygubu 0.94.1:
On Windows 8.1 with Python(x,y), the gui builder may be called by pygubu from command line shell, after installation with "python setup.py install" from the installation directory.
Bug #1 for pygubu 0.94.1:
Indeed on my system, in opposite to other python applications like "behave", which just execute as expected, here
the Pyscripter editor is called, loading the pygubu application.
So that I may call it.
Bug #2 for pygubu 0.95:
Watched behaviour, with pygubu 0.95:
this is not true anymore.
Pygubu is no valid command on commandline.
I don´t know how to call it, at all :-(
So I reinstalled 0.94.1 again...
I am not sure if this possibility does not exist or if I have not found it yet, but it would be nice to remove a widget from our project by simply typing for example delete or some other key, instead of needing to go to the top menu and Edit > Widget tree > delete item
.
in ui file, some column weight Properties were setted to 1.
but opened by pygubu-designer, all weigth properties were reset to 0.
When I first run pygubu
I had a problem saying something like this:
ValueError: unknown locale: UTF-8
I solved it adding some lines to the ~/.bash_profile
file:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
Yes, I am on a Mac OS X Yosemite, and I suppose you did not have the problem running it from Linux.
under windows xp sp3, python34.
Ctrl+N, Ctrl+O and Ctrl+S make pygubu quit the window.
Hi Alejandro!
I need your help!
Do you explain to me what I need to insert value on TreeView Column ?
Thank You!
Regards.
Husni Ali Husni
for example, set the col 0 weight to 1, code as below:
frame.columnconfigure(0, weight=1)
how to do it in pygubu? I can not find the weight option.
zaazbb commented:
1- I am under winows xp sp3, i installed pygubu using "python setup.py install". "c:\Python3.x\Scripts\pygubu" is not runable on windows, I rename "c:\Python3.x\Scripts\pygubu" to "c:\Python3.x\Scripts\pygubu.py", it running corrently.
Created from comment #2 (comment)
Hello,
I have a tk.text widget that I need to update.
Right now the builder widget appends the text in the properties of the builderobject
From TKText
def _set_property(self, target_widget, pname, value):
if pname == 'text':
target_widget.insert('0.0', value)
else:
super(TKText, self)._set_property(target_widget, pname, value)
Anyway my work around (since my text is disabled - this probably needs to be a property so that it can be managed by the builder) was to:
wgt.properties['text'] = text
logger.debug("widget id %s type property %s", wgt.objectid, wgt.properties)
#The pygubu tktext widget simply appends the text at the beginning of the
#line and doesn't allow text to be updated in a disabled widget
wtext = wgt.widget
wtext.config(state=tk.NORMAL)
wtext.delete(1.0, tk.END)
wtext.insert(tk.END, text)
wtext.config(state=tk.DISABLED)
Hello,
I checked the examples,
BUT I failed to generate the well known standard GUI application on any platform which usually combine:
and I did not find any example in the examples folder.
Indeed pygubu offers with "commands.ui" an example how to put menus at any place on the screen, but I don´t see that I can generate the same effect as done do with your "menuexample.ui" and as I know from the SpecTcl Designer
http://www.sourceforge.net/projects/spectcl
I already tested to move around some of the XML code, but without positive effect.
May you, the developer or the users, help me :-)?! With a working project example?
Or are there techncial Python Tkinter constrains which prevent that ?! As I said, SpecTCL designer generates code which does it, so it must be possible but who know if in the Tkinter mode used here...
Sincerely
Rolf
In the README.md
file of this repository, there's no specification on how to run the pygubu
application/GUI designer. There's just an example of an application created, I suppose, with pygubu
, and I was able to run it.
On my mac OS X, I cannot simply type pygubu
on the terminal and the GUI designer appears (like you did in the youtube video). I had to do a painful workaround.
If I install pygybu
using pip3
with the following command:
pip3 install pygubu
In my Python folder site-packages
, I have my pygubu
folder (and I can therefore import pygubu
from the IDLE
), but that folder is simply this: https://github.com/alejandroautalan/pygubu/tree/master/pygubu
Which is actually a subfolder of this repository (and not all the repository).
I couldn't run the pygubu
designer from that folder... there was not script to run it, or something similar.
I decided to clone this whole repository, and I finally discover that under /bin/
there's a script, which allows us to run pygubu
.
This was very painful for me, and I hope you provide a complete guide on how to run the pygubu
designer for various platforms, and not just for Ubuntu, where I suppose you can simply type magically pygubu
from the terminal.
Edit:
I had noticed that I can now run pygubu
from the terminal by simply typing pygubu-designer
instead of simply pygubu
...
Using version 0.9.7.6.
The TTKCombobox is missing the validate option. Without it the validatecommand cannot be called.
I installed pygubu from source tarball. Tried to run, got following error:
Running Python sys.version_info(major=3, minor=4, micro=2, releaselevel='final', serial=0) on 'linux'
Pygubu: v. 0.9.4.5
Traceback (most recent call last):
File "/usr/local/bin/pygubu", line 47, in
main.start_pygubu()
File "/usr/local/lib/python3.4/dist-packages/pygubudesigner/main.py", line 511, in start_pygubu
app = PygubuUI(root)
File "/usr/local/lib/python3.4/dist-packages/pygubu/init.py", line 17, in init
self._create_ui()
File "/usr/local/lib/python3.4/dist-packages/pygubudesigner/main.py", line 165, in _create_ui
self.properties_editor = WidgetPropertiesEditor(self)
File "/usr/local/lib/python3.4/dist-packages/pygubudesigner/propertieseditor.py", line 69, in init
self.arrayvar = PropertiesArray()
File "/usr/lib/python3.4/tkinter/init.py", line 249, in init
self.initialize(self._default)
File "/usr/local/lib/python3.4/dist-packages/pygubudesigner/util/init.py", line 87, in set
self._master.eval("array set {%s} {}" % self._name)
AttributeError: 'PropertiesArray' object has no attribute '_master'
Exception ignored in: <bound method PropertiesArray.del of <pygubudesigner.propertieseditor.PropertiesArray object at 0xb5ecab2c>>
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/pygubudesigner/util/init.py", line 56, in del
self._tk.globalunsetvar(self._name)
_tkinter.TclError: can't unset "PY_VAR1": no such variable
This happens in a virtualenv environment and when running directly from command line.
Sorry for posting this here, I couldn't find anywhere else to get help with pygubu.
zaazbb commented:
2-, when I first create ui, "Grid row/column options" in Panedwindow_1's Layout page have 3 line(2 rows and 1 column), as this:
-----Grid row/column options----------
| minisize pad weight |
| Row 0: 0 0 0 |
| Row 1: 0 0 0 |
when I save ui file, and reopen it use menu "File-Open", the grid option change to 2 line(1 rows and 1 column), as below:
-----Grid row/column options----------
| minisize pad weight |
| Row 0: 0 0 0 |
Created from comment: #2 (comment)
Hi, Following the other thread (thanks v much for the advice, really looking forward to trying it out!), I downloaded the latest version. There are 2 problems I think on Win32:
Running Python sys.version_info(major=2, minor=7, micro=1, releaselevel='final', serial=0) on 'win32'
Pygubu: v. 0.9.4
Traceback (most recent call last):
File "pygubu", line 45, in
from pygubudesigner import main
File "C:\Python27\pygubu-master\pygubudesigner\main.py", line 49, in
from .propertieseditor import WidgetPropertiesEditor
File "C:\Python27\pygubu-master\pygubudesigner\propertieseditor.py", line 31, in
from .widgets import ColorEntry, Textentry, TkVarEntry, ImageEntry
File "C:\Python27\pygubu-master\pygubudesigner\widgets__init__.py", line 5, in
from .sizeentry import SizeEntry
File "C:\Python27\pygubu-master\pygubudesigner\widgets\sizeentry.py", line 1
SyntaxError: Non-ASCII character '\xc3' in file C:\Python27\pygubu-master\pygubudesigner\widgets\sizeentry.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
I used the exact same download / unzip process as last time, but obviously something's upset it. I actually just deleted line 1 from the offending file, and all seems OK now. Is it a (C) symbol perhaps? I didn't see anything in my text editor (Sublime Text)...
Clicking on a widget in the list of instantiated widgets (underneath "Widget Id, Class, R, C") causes the Widget List (with tk and ttk controls) to creep in size to the right.
Platform: Windows 7, Python 3.3
Reproduction steps:
Observed: Widget List pane gets wider and wider by one pixel with each click.
Expected: Widget List pane keeps the same width.
Dumb question (maybe just a beginner question). I have set up a gui using pygubu and want to use a tk.message display. I have set up a string textvariable which I'm assuming I can set in the python script. I just can't work out how to set the variable. Please could you give an example?
(pygubu seems a great way of creating a gui by the way!)
Dave
Hi,
i want to use your tool in combination with py2exe. However, when i try to compile your example button_cb.py py2exe says it could not find tkinter and ElementC14N modules.
It is possible to use py2exe with a normal tkinter or ttk application without any problem.
I think it might be some problem with python 2.7 and 3.x compatibility.
Steps to reproduce:
install py2exe (http://www.py2exe.org/)
write a setup.py file
import sys
from distutils.core import setup
import py2exe
sys.argv.append("py2exe")
setup(console=['button_cb.py'],
data_files=[("",
["button_cb.ui" # copy the ui file
])])
the output of the setup script results in the message:
The following modules appear to be missing
['ElementC14N', 'tkinter']
I am using windows 7 and my ptython version is 2.7.9
Please have a look at this issue and let me know if you need any additional information
Thanks Florian
Hello
I've created a GUI and while it works fine, if i attempt to build to it an exe with Pyinstaller it succeeds, but fails to import:
https://github.com/alejandroautalan/pygubu/blob/master/pygubu/builder/ttkstdwidgets.py
Screenshot:
http://puu.sh/j8fjv/95b3faf5c2.png
Any way to get it working?
Thanks
Infinite loop when resizing window.
Scenary:
Tip: Does not happen if Text wrap is set to "char" or "word"
Example:
<?xml version='1.0' encoding='utf-8'?>
<interface>
<object class="tk.Toplevel" id="Toplevel_1">
<property name="height">200</property>
<property name="resizable">both</property>
<property name="width">200</property>
<child>
<object class="ttk.Labelframe" id="Labelframe_3">
<property name="height">200</property>
<property name="text" translatable="yes">Labelframe_3</property>
<property name="width">200</property>
<layout>
<property name="column">0</property>
<property name="propagate">True</property>
<property name="row">0</property>
<property name="sticky">nsew</property>
<rows>
<row id="0">
<property name="weight">1</property>
</row>
</rows>
<columns>
<column id="0">
<property name="weight">1</property>
</column>
</columns>
</layout>
<child>
<object class="pygubu.builder.widgets.scrolledframe" id="scrolledframe_1">
<property name="scrolltype">both</property>
<layout>
<property name="column">0</property>
<property name="propagate">True</property>
<property name="row">0</property>
<property name="sticky">nsew</property>
<rows>
<row id="0">
<property name="weight">1</property>
</row>
</rows>
<columns>
<column id="0">
<property name="weight">1</property>
</column>
</columns>
</layout>
<child>
<object class="ttk.Frame" id="Frame_1">
<property name="height">200</property>
<property name="width">200</property>
<layout>
<property name="column">0</property>
<property name="propagate">True</property>
<property name="row">0</property>
</layout>
<child>
<object class="pygubu.builder.widgets.scrollbarhelper" id="scrollbarhelper_1">
<property name="scrolltype">both</property>
<layout>
<property name="column">0</property>
<property name="propagate">True</property>
<property name="row">0</property>
<property name="sticky">nsew</property>
</layout>
<child>
<object class="tk.Text" id="Text_1">
<property name="height">10</property>
<property name="text" translatable="yes">WARNING:pygubu.designer:No selecciono item.
alejandro@sentey:~/tmp/pygubuimages$
alejandro@sentey:~/tmp/pygubuimages$
alejandro@sentey:~/tmp/pygubuimages$
alejandro@sentey:~/tmp/pygubuimages$
alejandro@sentey:~/tmp/pygubuimages$
alejandro@sentey:~/tmp/pygubuimages$
alejandro@sentey:~/tmp/pygubuimages$
alejandro@sentey:~/tmp/pygubuimages$
alejandro@sentey:~/tmp/pygubuimages$
alejandro@sentey:~/tmp/pygubuimages$
alejandro@sentey:~/tmp/pygubuimages$
alejandro@sentey:~/tmp/pygubuimages$
alejandro@sentey:~/tmp/pygubuimages$
alejandro@sentey:~/tmp/pygubuimages$
alejandro@sentey:~/tmp/pygubuimages$
alejandro@sentey:~/tmp/pygubuimages$ /home/alejandro/codigofuente/python/pygubu/bin/pygubu-designer
Running Python sys.version_info(major=3, minor=4, micro=2, releaselevel='final', serial=0) on 'linux'
Pygubu: v. 0.9.7.4</property>
<property name="width">50</property>
<property name="wrap">none</property>
<layout>
<property name="column">0</property>
<property name="propagate">True</property>
<property name="row">0</property>
<property name="sticky">nsew</property>
</layout>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
if you have got this “from appdirs import AppDirs ImportError: No module named 'appdirs'” error after installing pygubu, you should install “Determining appropriate platform-specific directories” from ubuntu software center.
I've just started with tk on Win32, and having a hard time creating a UI from scratch, searched for a builder. pygubu is by far the best of anything I've found, but I can't seem to follow a basic cycle of build, load, display.
My UI will need data, so I added a ttkFrame, ttkTreeview, 2 ttk.Treeview.Column s and a ttk.Button. On saving the .ui and loading it via the simple Application framework here: https://github.com/alejandroautalan/pygubu/wiki/Make-widget-resizable, I get the following error. It looks like it might be to do with whitespace in the XML not being stripped away. Is this a new user error, or something worse? I wrote a quick and dirty regex to remove whitespace from the .ui file, and all worked fine. But I wouldn't trust it with a real project, as it's likely to be a bit greedy in removing stuff :)
ERROR:pygubu.builderobject:Failed to set property 'selectmode'. TclError: bad selectmode "
extended
": must be none, browse, or extended
Steps to reproduce:
Open a ui file using File->Open, example: myapp.ui
Click File->New to create a new empty project.
Click File->Save, the previously opened file is overwriten.
under winxp sp3, open the cmd.exe, input "pip install pygubu", met a error when installing pygubu.
Downloading/unpacking pygubu
Running setup.py (path:c:\docume~1\jf\locals~1\temp\pip_build_jf\pygubu\setup.
py) egg_info for package pygubu
Installing collected packages: pygubu
Running setup.py install for pygubu
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --single-version-externally-managed not recognized
Complete output from command C:\Python33\python.exe -c "import setuptools, t
okenize;__file__='c:\\docume~1\\jf\\locals~1\\temp\\pip_build_jf\\pygubu\\setup.
py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n'
, '\n'), __file__, 'exec'))" install --record c:\docume~1\jf\locals~1\temp\pip-4
w66tl-record\install-record.txt --single-version-externally-managed --compile:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --single-version-externally-managed not recognized
----------------------------------------
Cleaning up...
Command C:\Python33\python.exe -c "import setuptools, tokenize;__file__='c:\\doc
ume~1\\jf\\locals~1\\temp\\pip_build_jf\\pygubu\\setup.py';exec(compile(getattr(
tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'
))" install --record c:\docume~1\jf\locals~1\temp\pip-4w66tl-record\install-reco
rd.txt --single-version-externally-managed --compile failed with error code 1 in
c:\docume~1\jf\locals~1\temp\pip_build_jf\pygubu
Storing debug log for failure in C:\Documents and Settings\jf\pip\pip.log
Steps to reproduce:
1- Create a ui file, add widgets, and configure image properties. The images are shown in the preview correctly.
2- Save the project file to example.ui
3- Close and reopen the designer and open example.ui again. The configured images are not shown in the preview.
Expected result:
Configured images should be visible in the preview at least for images located in a directory relative to the example.ui directory
For Example :
def on_close():
print ("Closed application")
root = tkinter.Tk()
root.protocol("WM_DELETE_WINDOW", on_close)
app = Application(root)
app.run()
Not sure how to catch window close event.
It will be helpful if anyone can suggest me on this.
(Big thanks for pygubu
For some reason, the 3 titlebar buttons (close, maximise, minimise), as well as the window border keep jumping back to Windows 2000 theme. Even stranger is when I preview the app in the designer, it generally uses the correct XP theme, but when I run the app standalone, it all goes very 1990s. The pygubu designer does this too, and I've tried all the ttk themes from the menu. That changes the controls' look, but not the window itself.
What's more odd is that when the window is first displayed, everything looks as it should (rounded XP titlebar buttons, red Close button), but as soon as I resize or move the app's window, those buttons are replaced with the old grey square ones from a previous version of windows - much like on the console window.
Any ideas? I realise this might be a tkinter problem rather than pygubu...
Thanks,
David.
How to access ( deselect, add, scroll, mark ) a Listbox respectively its contents ?
Tipp:
I found out how to get data from input field
_entry_1 = self.builder.get_object('Entry_1')
result = _entry_1.get()
while "Entry_1" is entered in pygubu for the "Entry" element as textvariable of type string.
So with the competitive Tkinter GUI editor "SpecTCL", I wrote
# Deselect the old last entry
self._listbox_1.select_clear(END)
# Add an entry
self._listbox_1.insert(END, text)
# Scroll at the end of the list
self._listbox_1.see(END)
# mark last item
self._listbox_1.selection_set(END)
So how to do that with pygubu?
Though I know other Tkinter GUI editors, and Tkinter, I can´t get the clue.
In general, the examples currently shipped with pygubu miss such basic cases.. in many cases. E.g. my example here of the use of a ttk_entry / tk_entry field is not yet documented in examples... nor that for a listbox.
Sincerely
Rolf
My problem: My application uses yourTkinter GUI framework GitHub "alejandroautalan/pygubu" and installs the application by distutils. If I call the application by commandline, there is the error message as “pygubu.py” is both the name of script in the folder “Scripts” ( which I don´t want to import, but which Python tries to import here ) and a name of a module of the application ( which I want to import here ).
The error message:
File "C:\Python27\lib\site-packages\codebreaker_package\pygubu_codebreaker.py", line 33, in <module>
import pygubu
File "C:\Python27\Scripts\pygubu.py", line 43, in <module>
print("Pygubu: v. %s" % (pygubu.__version__,))
AttributeError: 'module' object has no attribute '__version__'
My solution: Rename “Scripts/pygubu.py” to “Scripts/pygubu-script.py” and add a batch file “pygubut.bat” and “pygubu.sh” respectively, which just call “python pygubu-script.py”.
Sincerely
Rolf
When you place a resize handle in your project you cannot move it around like other widgets because it resizes the main window.
Environment: python3.3.2, windows xp sp3.
Operation steps:
1> download "pygubu / po / pygubu.pot" on github.com, and add chinese translations.
2> create "pygubu.mo" use "C:\Python33\Tools\i18n\msgfmt.py" script.
3> move "pygubu.mo" to "C:\Python33\Lib\site-packages\pygubudesigner\locale\zh_CN\LC_MESSAGES" dir.
4> run "C:\Python33\Scripts\pygubu.py", and met a error "UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0: ordinal not in range(128)"
ps: my language code is "zh_CN".
>>> import os
>>> os.environ.get('LANG', '')
'zh_CN'
>>> import locale
>>> locale.getdefaultlocale()
('zh_CN', 'cp936')
>>>
installing pygubu-0.9.4.1.tar.gz use pip, met a error. full message as below.
C:\Documents and Settings\jf>pip install pygubu
Downloading/unpacking pygubu
Running setup.py (path:C:\DOCUME~1\jf\LOCALS~2\Temp\pip_build_jf\pygubu\setup.
py) egg_info for package pygubu
Installing collected packages: pygubu
Running setup.py install for pygubu
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --single-version-externally-managed not recognized
Complete output from command C:\Python34\python.exe -c "import setuptools, t
okenize;__file__='C:\\DOCUME~1\\jf\\LOCALS~2\\Temp\\pip_build_jf\\pygubu\\setup.
py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n'
, '\n'), __file__, 'exec'))" install --record C:\DOCUME~1\jf\LOCALS~2\Temp\pip-p
w6eud3k-record\install-record.txt --single-version-externally-managed --compile:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --single-version-externally-managed not recognized
Hi - thanks again for your advice so far - I'm getting there slowly! I moved away from the helper class based on your example, and now have a progress dialog as well as the main app window. However, there are still a couple of things not right, and some errors from the designer.
Firstly, I can't seem to set the size of the dialog window - or maybe I'm not understanding how to do it. I've tried dragging the blue box in the designer, and it snaps back to the old size as soon as I do anything else (like change a property of one of the widgets on the dialog window). If I change the height or width in the General tab of the properties pane, I see an error in the console where I ran the designer from:
WARNING:pygubu.builderobject:Attempt to set an unknown property 'modal' on class '<class pygubudesigner.widgets.toplevelframe.ToplevelFramePreview at 0x01237DF8>'
I can add padding to the widgets on the dialog to make it grow a little, but that's all.
The other thing is more tkinter I suspect, but I can't get the order of initialising / creating / showing the windows to work properly. Is there a way to get the progress dialog displayed / updated without showing the mainWindow? It appears very large (not sure why - default width of treeview columns I suspect, which aren't set until the data is loaded and I know what width they need to be). It's also just an empty white box until the data is loaded...
Thanks again for your help and effort on pygubu - there's no way I'd have got this far without both!
Please change in ttkspinbox.py file:
import tkinter.ttk as ttk
to:
try:
import tkinter as tk
except:
import Tkinter as tk
under pygubu v0.9.6.3, make a wrong textvariable format when create ui file. wrong format as below:
<property name="textvariable">string:svPktDat</property>
the right variable format should be "svPktDat:string". right format as below:
<property name="textvariable">svPktDat:string</property>
now, under pygubu v0.9.6.3, met a KeyError, when running builder.get_variable().
I have used the code you are suggestion to run my "hello.ui" file, but it's not working, and raises the exception "raise Exception('Widget not defined.')" at line 322 of your init.py file under /builder.
This is my hello.ui:
<?xml version='1.0' encoding='utf-8'?>
<interface>
<object class="ttk.Frame" id="Frame_1">
<property name="height">200</property>
<property name="width">200</property>
<layout>
<property name="column">0</property>
<property name="propagate">True</property>
<property name="row">0</property>
</layout>
<child>
<object class="ttk.Button" id="Button_1">
<property name="text" translatable="yes">Button_1</property>
<layout>
<property name="column">0</property>
<property name="propagate">True</property>
<property name="row">0</property>
</layout>
</object>
</child>
</object>
</interface>
This is the code I am using to run the "hello.ui"
#test.py
import tkinter as tk
import pygubu
class Application:
def __init__(self, master):
#1: Create a builder
self.builder = builder = pygubu.Builder()
#2: Load an ui file
builder.add_from_file('hello.ui')
#3: Create the widget using a master as parent
self.mainwindow = builder.get_object('mainwindow', master)
if __name__ == '__main__':
root = tk.Tk()
app = Application(root)
root.mainloop()
I am running the application from the main folder of the project. I had also some problems in running the builder/designer, until I did not find the script under /bin in this github repository. I think you should clarify better how to run the builder/designer in your README file.
My OS is Darwin.
Apart from this, would be possible to contribute with my help to this project?
I was thinking also in developing something similar, but my knowledge of tkinter is still not so good, but I would like starting helping you in this project, of course if you don't mind.
If it's ok, it would be great if you could tell me more in details how can I understand better your application, how can study it further, how did you structure the project, so that I am also able to navigate through it without any problems.
http://imgur.com/HCQubOI
had a working version 0.9.6.7 and installed 0.9.7.3 over it.
now running .bat won't execute the application.
is it a wrong doing on my end? thanks.
running python 3.4.
The generated file contains the description of the deleted column. It should not.
I want widgets auto expand to max size when main window resizing. in the preview window, it can autoresize, but actual effect it can't.
here is the ui file as below and python main script:
<?xml version="1.0" ?>
<interface>
<object class="ttk.Panedwindow" id="Panedwindow_1">
<property name="height">200</property>
<property name="orient">vertical</property>
<property name="width">200</property>
<layout>
<property name="column">0</property>
<property name="propagate">True</property>
<property name="row">0</property>
<property name="sticky">nesw</property>
<columns>
<column id="0">
<property name="weight">0</property>
</column>
</columns>
<rows>
<row id="0">
<property name="weight">0</property>
</row>
<row id="1">
<property name="weight">0</property>
</row>
</rows>
</layout>
<child>
<object class="ttk.Panedwindow.Pane" id="Pane_1">
<property name="weight">1</property>
<child>
<object class="pygubu.builder.widgets.scrollbarhelper" id="scrollbarhelper_1">
<property name="scrolltype">both</property>
<layout>
<property name="column">0</property>
<property name="propagate">True</property>
<property name="row">0</property>
</layout>
<child>
<object class="tk.Text" id="Text_1">
<property name="height">10</property>
<property name="text" translatable="yes">Text_1</property>
<property name="width">50</property>
<property name="wrap">char</property>
<layout>
<property name="column">0</property>
<property name="propagate">True</property>
<property name="row">0</property>
</layout>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="ttk.Panedwindow.Pane" id="Pane_2">
<property name="weight">1</property>
<child>
<object class="pygubu.builder.widgets.scrollbarhelper" id="scrollbarhelper_2">
<property name="scrolltype">both</property>
<layout>
<property name="column">0</property>
<property name="propagate">True</property>
<property name="row">0</property>
</layout>
<child>
<object class="tk.Text" id="Text_2">
<property name="height">10</property>
<property name="text" translatable="yes">Text_2</property>
<property name="width">50</property>
<property name="wrap">char</property>
<layout>
<property name="column">0</property>
<property name="propagate">True</property>
<property name="row">0</property>
</layout>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
#test.py
import tkinter as tk
import pygubu
class Application:
def __init__(self, master):
#1: Create a builder
self.builder = builder = pygubu.Builder()
#2: Load an ui file
builder.add_from_file('111.ui')
#3: Create the widget using a master as parent
self.mainwindow = builder.get_object('Panedwindow_1', master)
if __name__ == '__main__':
root = tk.Tk()
app = Application(root)
root.mainloop()
Hello,
I just downloaded and tried to run pygubu but it does nothing when called pygubu or pygubu.pyw and when I try pygubu.pyc it returns an AttributeError.
D:\Python27\Scripts>pygubu
D:\Python27\Scripts>pygubu.pyw
D:\Python27\Scripts>pygubu.pyc
Running Python sys.version_info(major=2, minor=7, micro=3, releaselevel='final',
serial=0) on 'win32'
Running Python sys.version_info(major=2, minor=7, micro=3, releaselevel='final',
serial=0) on 'win32'
Traceback (most recent call last):
File "D:\Python27\Scripts\pygubu.pyw", line 42, in
import pygubu
File "D:\Python27\Scripts\pygubu.pyw", line 43, in
print("Pygubu: v. %s" % (pygubu.version,))
AttributeError: 'module' object has no attribute 'version'
D:\Python27\Scripts>
Any ideias?
Thanks,
JM
Hello! I am new to Pygubu, but already think it is amazing! So right now I am working on making a menu button. I would like to have the options be added in the python part to I can make it so it has all the user's usernames on it, Thanks for your help!
If someone has "C:\Python34\Scripts" in their env PATH and then imports pygubu, it will import "C:\Python34\Scripts\pygubu". This results in the python script failing.
By changing pygubu in C:\Python34\Scripts\ to any other name this can be avoided.
I think cx_freeze adds "C:\Python34\Scripts" to PATH so this will be a problem for a lot of users.
edit: I've forked pygubu and added two corrections to fix this problem.
Here it is - at first glance he cannot recognize UTF-8 locale. (Installed with pip on Python 2.7.5)
Running Python sys.version_info(major=2, minor=7, micro=5, releaselevel='final', serial=0) on 'darwin'
Pygubu: v. 0.9.7.6
Traceback (most recent call last):
File "/usr/local/bin/pygubu-designer", line 45, in
from pygubudesigner import main
File "/Library/Python/2.7/site-packages/pygubudesigner/main.py", line 44, in
from .uitreeeditor import WidgetsTreeEditor
File "/Library/Python/2.7/site-packages/pygubudesigner/uitreeeditor.py", line 31, in
from .widgeteditor import WidgetEditor
File "/Library/Python/2.7/site-packages/pygubudesigner/widgeteditor.py", line 28, in
from pygubudesigner.propertieseditor import PropertiesEditor
File "/Library/Python/2.7/site-packages/pygubudesigner/propertieseditor.py", line 31, in
from pygubudesigner.i18n import translator as _
File "/Library/Python/2.7/site-packages/pygubudesigner/i18n.py", line 32, in
lc, encoding = locale.getdefaultlocale()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 511, in getdefaultlocale
return _parse_localename(localename)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 443, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
Hi,
I've made some progress now with the XML workaround, and I need to prompt the user to enter a password when the application launches. All the examples I can find on using tk.Entry assume you're building the whole thing in code, rather than loading the UI via pygubu.
Do you have any advice on the best way to add things like popups (text input, confirmation dialogues, etc.)? I presume it's OK to mix straight tk code in with the pygubu.TkApplication class?
Thanks,
David.
( Really useful GUI builder for fast prototyping. Thanks ! )
System:
Macbook pro with Mavericks
Issue:
Scrolling bar freeze ( only seen in the "General" tab of the widget properties editor, although that might also happen with the "Layout" tab in a small application window configuration )
Initial Condition:
In the middle of configuring widget properties. somewhat hard to reproduce.
Other:
Sometimes, would recover on its own; sometimes wouldn't.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.