DirectGui Designer

That last sounds quite interesting! I’m curious to see what you have in mind, should you come to present it at some stage. :slight_smile:

Hey all,

here are some updates on the editor. I’ve been using it and working on it every now and then and I think there is enough new stuff to post about it.

Aside of a lot of bugfixes, the property editor has been enhanced and gathered a few more properties to edit the gui elements. It now includes properties for DirectScrolledFrames, the transparency attribute and the state attribute.
Aside of that the properties panel has also been made more stable to not crash the whole application if something went wrong.

The python file exporter has been enhanced to now include a show, hide and delete function to simpler work with these common functions. It will respectively show, hide and delete all toplevel elements in the gui.

The filebrowser has been updated and can show and hide hidden files (unix style files with a leading dot) and also saw a few bugfixes.


The designer now has a very handy copy and paste functionality for widgets as well as widgets’ designs. Simply use the usual ctrl-c ctrl-v for copying full elements (including all child elements) and ctrl-shift-c and ctrl-shift-v for copying and pasting designs.

The properties panel also got a few improvements and more properties to set on the individual GUI elements.

Saving has also seen a fix where elements weren’t in the correct order in exported python scripts.

1 Like

Super Good! But it is a little laggy on my device. Also, can you make a tutorial on how to export it?

Thanks for the feedback. A tutorial is probably a good idea, maybe some short videos might work. As for the performance, I’m not sure what I can do here, but I’ll take a look into it.

1 Like

I think the performance is my computer’s problem. I currently running it on Windows 7. So I will try to run it on my Windows 10 computer.

Well, actually I think it is the directGUI system which just isn’t very optimized for such large UIs. Eben though it runs fluent in my system which isn’t the most modern either, it does tend to make the fans go really fast compared to running almost any other Software. So that’s definitely a point I have to and will investigate further in the future.

I am trying to export the file with an error:

(-0.1, 10.1, -0.3962500154972076, 1.087500011920929)
(-0.1, 10.1, -0.3962500154972076, 1.087500011920929)
Looking for Root: None
Looking for Root: <DirectGuiDesignerElementHandler.ElementInfo object at 0x0CC05F58>
Try to save file after unhandled exception. Please restart the app to automatically load the exception save file!
Looking for Root: None
Looking for Root: <DirectGuiDesignerElementHandler.ElementInfo object at 0x0CC05F58>
Traceback (most recent call last):
File “C:\DirectGuiDesigner-master\”, line 1188, in
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\showbase\”, line 3325, in run
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\task\”, line 541, in run
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\task\”, line 495, in step
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\showbase\”, line 49, in eventLoopTask
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\showbase\”, line 43, in doEvents
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\showbase\”, line 99, in processEvent
messenger.send(eventName, paramList)
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\showbase\”, line 337, in send
self.__dispatch(acceptorDict, event, sentArgs, foundWatch)
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\showbase\”, line 422, in __dispatch
result = method ((extraArgs + sentArgs))
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\gui\”, line 107, in commandFunc
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\showbase\”, line 337, in send
self.__dispatch(acceptorDict, event, sentArgs, foundWatch)
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\showbase\”, line 422, in __dispatch
result = method (
(extraArgs + sentArgs))
File “C:\DirectGuiDesigner-master\”, line 876, in export
DirectGuiDesignerExporterPy(os.path.join(self.lastDirPath, self.lastFileNameWOExtension + “.py”), self.elementDict, self.customWidgetsHandler, self.getEditorFrame,, not self.editorFrame.visEditorInAspect2D)
File “C:\DirectGuiDesigner-master\”, line 154, in init
self.dlgPathSelect = DirectGuiDesignerPathSelect(
File “C:\DirectGuiDesigner-master\”, line 93, in init
self.browser = DirectFolderBrowser(self.selectPath, True, os.path.dirname(filePath), os.path.split(filePath)[1], tooltip=tooltip)
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\DirectFolderBrowser\”, line 146, in init
self.btnFolderUp = DirectButton(
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\gui\”, line 66, in init
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\gui\”, line 253, in initialiseoptions
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\gui\”, line 210, in setImage
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\gui\”, line 572, in createcomponent
widget = widgetClass(*widgetArgs, **kw)
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\gui\”, line 60, in init
self.setImage(image, parent = parent, sort = sort)
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\gui\”, line 117, in setImage
tex = loader.loadTexture(image)
File “C:\Users\Rahul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\showbase\”, line 756, in loadTexture
raise IOError(message)
OSError: Could not load texture: ./icons/FolderUp.png

It seems the folder browser doesn’t find the icons. I thought I’ve fixed that a while ago. Will take a look into it.

The same thing happens when I try to save it.

When I run build_apps and run the .exe file, then I am able to export the project. But how do you implement it in a program?

That’s good to know. I still have no idea why it won’t find the icon folder as the setup should point to the icon folder on the path, where pip has installed the directFolderBrowser package.

Regarding the use of the exported, GUI, there is a sample description on the githubs readme. In short, simply import your exported python script and call it. Here’s the example from the readme:

from myGui import GUI as MyGui
myGui = MyGui()

Every exported script has a class called GUI which, if you instantiate will directly create and display the GUI.

This is totally cool. It is so helpful. How come no body told me about this before?

I’m glad you find it useful and I guess, as this project is relatively new, there aren’t that many who know it yet. It probably could use some more promotion.

There is one issue which I think that you can rectify. When a DirectLabel’s text is bigger than it’s container, The text is showing outside the container rather than the container resizing.

Automatically resizing the frame to the text is not a good idea. The frame may contain different information like background images which have a specific size and hence need to be specifically set. I could add a button to fit the frame to the text as a manual step though.

I am talking about a DirectLabel.

I know, but the by default gray background you’ll see on those DirectLabels or as you call it container is just a DirectFrame internally.


EDIT: But it is ruining the presentation, so how should I make it resized?

Hm, currently there is no simple way to recalculate the size to the text’s size, so either manually set it to a fitting size or hide/disable the background by either setting it to a transparent color and enable transparency or set the relief to None (note, that you won’t be able to select the item in the editor frame but only in the structure view with that relief style).
I’ll see if I can add a convenient function to resize the frame appropriately in the next release.