Set Toggle Button selected in a UI plugin

   2015   1   0
User Avatar
Member
4 posts
Joined: Feb. 2017
Offline
Hi,

I'm trying to create a UI plugin following the Native UI Programming documentation, and using the ui/cmd_ui.C as a guide:

https://www.sidefx.com/docs/hdk/_h_d_k__u_i_native.html [www.sidefx.com]

One thing I can't seem to figure out is how to set a toggle button to be selected before the window opens. I can set strings and int gadgets, but not toggle buttons.

Using cmd_ui.C as an example, if I put this in the open() method:

getValueSymbol("geometry.val")->setValue(1);

The "geometry" toggle is never selected. Am I doing this incorrectly? I'm trying this on linux, with Houdini 19.0.561 (python 3).

Thanks!
Ian
User Avatar
Staff
1471 posts
Joined: July 2005
Offline
You need to notify the UI about the value change:
    getValueSymbol("geometry.val")->setValue(1);
    getValueSymbol("geometry.val")->changed(this);
  • Quick Links