source: branches/properties/lib/macros/demo__toggle_color.amc

Last change on this file was 17364, checked in by westram, 6 years ago
  • updated example macros in ARBHOME/lib/macros
    • fixed broken identifiers
    • deleted useless ones (replamb+test)
    • renamed rest (prefix demo__)
    • added comments
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 659 bytes
Line 
1#!/usr/bin/perl -w
2use lib "$ENV{'ARBHOME'}/lib/";
3use ARB;
4
5$gb_main = ARB::open(":","r");
6if (! $gb_main ) {
7    $error = ARB::await_error();
8    print ("Error: $error\n");
9    exit 0;
10}
11
12# example macro:
13# - has been modified manually
14# - demonstrates howto toggle a GUI-toggle via script
15
16BIO::remote_action($gb_main,'ARB_NT','props_tree');
17BIO::remote_action($gb_main,'ARB_NT','COLOR_DEF/EDIT_COLOR_GROUP');
18# BIO::remote_awar($gb_main,'ARB_NT','color_groups/use','0'); # original record
19
20$new_val = 1 - BIO::remote_read_awar($gb_main,"ARB_NT","color_groups/use");
21BIO::remote_awar($gb_main,"ARB_NT","color_groups/use", $new_val);
22
23ARB::close($gb_main);
Note: See TracBrowser for help on using the repository browser.