Skip to content

Commit ea6e55e

Browse files
authored
Merge pull request #2434 from hansu/gladevcp-window1
gladevcp: updated docs regarding naming "window1"
2 parents 159a615 + ff8cfa7 commit ea6e55e

4 files changed

Lines changed: 11 additions & 8 deletions

File tree

docs/src/gui/gladevcp.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,20 +245,20 @@ Either modify an existing UI component by running +glade <file>.ui+
245245
or start a new one by just running the +glade+ command from the shell.
246246

247247
- If LinuxCNC was not installed from a package, the LinuxCNC shell environment needs to be set up with
248-
+<linuxcncdir>/scripts/rip-environment+, otherwise Glade won't find the LinuxCNC-specific widgets.
248+
`source <linuxcncdir>/scripts/rip-environment`, otherwise Glade won't find the LinuxCNC-specific widgets.
249249
- When asked for unsaved preferences, just accept the defaults and hit 'Close'.
250-
- From 'Toplevel' (left pane), pick 'Window' (first icon) as top level window, which
251-
by default will be named 'window1'. Do not change this name - GladeVCP relies on it.
252-
- In the left tab, scroll down and expand 'HAL Python' and 'VCP Actions'.
253-
- add a container like a HAL_Box or a HAL_Table from 'HAL Python' to the frame
254-
- pick and place some elements like LED, button, etc. within a container
250+
- From 'Toplevels' (toolbar), pick 'GtkWindow' (first entry) as top level window. Set 'window1' as ID in the
251+
right pane under the tab 'General'. This naming is important because GladeVCP relies on it.
252+
- From the button with the three dots you can find the LinuxCNC specific widgets.
253+
- Add a container like a HAL_Box or a HAL_Table from 'HAL Python' to the frame.
254+
- Pick and place some elements like LED, button, etc. within a container.
255255

256-
This will look like so:
256+
This will look like this:
257257

258258
image::images/glade-manual-small.png[]
259259

260260
Glade tends to write a lot of messages to the shell window, which
261-
mostly can be ignored. Select 'FileSave as', give it a name like
261+
mostly can be ignored. Select 'File'→'Save as', give it a name like
262262
'myui.ui' and make sure it's saved as 'GtkBuilder' file (radio button
263263
left bottom corner in Save dialog). GladeVCP will also process the
264264
older 'libglade' format correctly but there is no point in using it. The
11.2 KB
Loading
18.6 KB
Loading

src/hal/user_comps/gladevcp.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ def main():
212212
sys.exit(0)
213213

214214
window = builder.get_object("window1")
215+
if window is None:
216+
print('*** GLADE VCP ERROR: No window named "window1" found. The toplevel windows has to be named "window1"!')
217+
sys.exit(0)
215218

216219
window.set_title(opts.component)
217220

0 commit comments

Comments
 (0)