Label
Is this possible?
Thanks
John
Please Log in or Create an account to join the conversation.
The answer is basically an event handler
www.linuxcnc.org/docview/devel/html/gui/...user_defined_actions
seems to cover it in respect of glade and there is even an example for changing label text based upon button presses.
This is the same way C/C++ gui programs work, pressing or checking something creates an event and handlers are written and linked to those events to perform the required actions.
emc2_2.5xxx/configs/gladevcp/complex also shows an example
Anything more detailed best ask Michael H, I am trying to keep away from python, lest I scramble what my brain still remembers of C/C++ !!
regards
Please Log in or Create an account to join the conversation.
I'm building my GladeVCP panel for the BP and I'm wondering if you can have a label that changes the text based on an input. For example if the spindle is off display OFF, if running in the forward direction display FWD, and if running in reverse display REV.
Is this possible?
Yes, it is.
The basic scheme is:
- define a HAL pin with halcomp.newpin()
- associate a 'value-changed' handler with that pin, which will be called when the HAL pin's value is changed
- in that handler, set the widget as appropriate,
I suggest you look at the configs/gladevcp/complex example, the example_trigge pin shows how to do it.
Let me know if it works out, otherwise I'll cook up an example
-Michael
Please Log in or Create an account to join the conversation.
- associate a 'value-changed' handler with that pin, which will be called when the HAL pin's value is changed
- in that handler, set the widget as appropriate, l
Is there no standard widget that will do this? It sounds like a combo-box but in reverse, where an input integer chooses from a list of entries (whereas with a combo-box choosing an entry sets an integer output).
Please Log in or Create an account to join the conversation.
in your case if speed is 0 then label.in is 0 -> text is 'STOP' or whatelse.
label.in<0 -> text is 'REV'
label.in>0 -> text is 'FWD'.
Davide.
Please Log in or Create an account to join the conversation.
git.mah.priv.at/gitweb/emc2-dev.git/shor...s/heads/custom-label
-Michael
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
git.mah.priv.at/gitweb/emc2-dev.git/shor...s/heads/custom-label
-m
Please Log in or Create an account to join the conversation.