Data exchange Mainscript (SCRIPT) with script block (DAC)

Is there any way to exchange data beetwen a Mainscript (SCRIPT) with
user-dialoges and script block (DAC) in this way that the script in
scriptblock can access to this data?
Background: I write a DAC-Application with some script-blocks for
reading and writing data to/from real devices. During the development
I'd like to simulate all device accesses because I don'd have the
devices in my office. I write all scripts with a branch for simulation
an real measurement on startup.
How can I execute a swich (simulation / mesurement) without changing
all my scripts all times? Can a script read a variable anyway (Variable
from Mainscript, Diadem-Uservariable or "Hilfsvariable" like L1)? 
Can I fill "DeviceParam1V" with content of a variable?
I could use a input channel connected with a formula-block for it. (The
formula-block can read a variable.) But this way is uncomfortable an
don't work for input blocks.
Martin Bohm
[email protected]

Because the DAC Script is executed in its own runtime environment you cannot use the DIAdem variables as in a normal VBS or a SUD.
Still, there are ways to exchange information.
First of all by an extra channel as Input (you named it)
Secondly, there are several variables you can use. Have a look at the Script DAC block. There are two fields called Parameter1 and Parameter2. And each signal you configure has a parameter of its own.
Prior to starting the scheme, you can use a script to change the value of those parameters:
Call DACObjOpen("Script-in1")
  VBSSignalParam(1) = "abc"
Call DACObjClose("Script-in1")
Is changing the parameter of the first signal that is configured.
Call DACObjOpen("Script-in1")
  VBSParameter1 = "1st device parameter"
  VBSParameter2 = "2nd device parameter"
Call DACObjClose("Script-in1")
is changing the global device parameters.
On the side of the Script DAC driver VBS you cann use the paramP funtion to access the signal parameter that corresponds to the actual channel (as referenced by ChannelnumberP)
' SFD_ReadChannel
' Zweck               : Lesen eines Wertes für den Kanal "ChannelNumberP"
' ChannelNumberP      | Kanalnummer aus dem Block-Dialog
' ParamP              | Vom Anwender definierte Variable aus dem Block-Dialog
' DataP               | Variable zur Rückgabe des neuen Kanalwertes. Diese
'                     | Variable sollte zumindest auf einen gültigen Wert
'                     | initialisiert werden.
' ErrorP              | Variable zur Rückgabe einer Fehlermeldung. Wird diese
'                     | Variable gesetzt, stoppt DIAdem die Messung
Sub SFD_ReadChannel( ChannelNumberP, ParamP, DataP, ErrorP )
End Sub
To acces the device Parameters, use the init function:
' SFD_Init
' Zweck               : Diese Prozedur wird während des Messungsstarts aufgerufen
' DeviceParam1V       | Erster Parameter, der vom Anwender im DAC-Block
'                     | eingegeben werden kann
' DeviceParam2V       | Zweiter Parameter, der vom Anwender im DAC-Block
'                     | eingegeben werden kann
' ErrorP              | Variable zur Rückgabe einer Fehlermeldung. Wird diese
'                     | Variable gesetzt, stoppt DIAdem die Messung
Sub SFD_Init( DeviceParam1V, DeviceParam2V, ErrorP )
End Sub
Ingo Schumacher
Systems Engineer Sound&VibrationNational Instruments Germany

Similar Messages

  • Firefox has crashed numerous times on me tonight, and I keep getting an unresponsive script error (Script: chrome://devany/content/main.js:254) regardless of what website I'm on. NoScript will not block this script, and it's popping up with an increasing

    Firefox has crashed numerous times on me tonight, and I keep getting an unresponsive script error (Script: chrome://devany/content/main.js:254) regardless of what website I'm on. NoScript will not block this script, and it's popping up with an increasing and alarming frequency. It's completely crippled my Firefox, and getting the a large enough window between unresponsive script warnings to get the Troubleshooting Information from Firefox took me a good 20 minutes. It's a very persistent script. I've already re-installed Firefox and restarted my computer, and scanned for viruses/malware. I'm on a Mac, if it makes a difference.
    == This happened ==
    Every time Firefox opened
    == Tonight. I can't say what site I was on, though I first noticed it on DeviantArt and thought it was their new layout producing problems. ==
    == User Agent ==
    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7

    yay, I had this same issue, and I too browsed deviantArt and also have got Deviantanywhere add-on installed. : D
    I'm so glad that You've found a solution and shared it with us.
    I was really getting worried that I'd done something to get malware installed on my 'puter. *Phew* !!
    I'm going to disable DeviantAnywhere after I post this and hopefully this will be fixed for me too!
    I actually hadn't kept my firefox up to date. but.. *shh...*
    I updated it and after I did, it told me that there was a script running that was not responding. : )
    yay for FireFox~
    ~QuinsY.

  • Help - lost motherboard, auto save saved older script, newer script actually with older date.

    Adobe story team:
    I had a best script to date, on an older hard drive and the motherboard failed on my HP tower.  The sony laptop has a more recent dated script, but not the one I want.  How do I replace an "older" date script, one that I want for a newer script.  I don't want the newer script, I want the older one that is on a "pulled" hard drive again, from a tower that failed.
    Do I save the older file on an offline, using a new ID, new password, forever changed or what can I do?
    I need a fairly quick response, timing is critical.  HP tower is the problem.
    drgm
    thanks

    You have it half right.  the issue is the HP tower I had failed.  The mother board failed, I pulled the hard drive which is windows 7, I have a sony laptop which is in 32 bit vista, I am not sure if the different versions will be an issue.  can i take a file off the pulled hard drive and put it somewhere in a directory even with the different windows vista vs windows 7 if so which file should i copy on the pulled hard drive and where do i put it on the laptop, directory plus I will go back on online save it in the clouds and reformat the laptop and go to windows 7 then go back to adobe story  and go from there. thank you for your quick attention in this matter.
    Respectfully,
    drgm
    doug morrow
    Date: Tue, 24 May 2011 22:10:24 -0600
    From: [email protected]
    To: [email protected]
    Subject: Help - lost motherboard, auto save saved older script, newer script actually with older date.
    Hi
    I am not sure if I understand your problem correctly, but as far as I can make out you had been working on a script and then it got autosaved and now you wish to go back to the "older" script.
    In order to do so you may visit your document's history through the View->History option. There you will see older versions of your document (if you had not turned off autoversioning). You may then open an older version of the document from the panel by double clicking on it. Once on an older version you will get to see the "Make Latest" option. Clicking on that will make the "older" state of your document your "current" state and then you may proceed to edit the document as usual.
    I hope this is helpful to your situation. In case you face any issues in following the mentioned steps do let us know.
    Thanks
    Ali
    Adobe Story Team
    >

  • Problem with script Test-ExchangeServerHealth

    Have been using Paul Cunningham's most excellent Test-ExchangeServerHealth script.  It has been running flawlessly on Exchange 2010 for sometime.  I moved it to 2013 and immediately encountered errors.  The error occurs down in the DAG test
    routine.  The error I get:
    Get-DatabaseAvailabilityGroup : Could not load file or assembly 'Microsoft.Exchange.Data, Version=14.0.0.0, Culture=neutral,PublicKeyToken=xxxxxxxxx' or one of its dependencies. The system cannot find the file specified. At C:\Scripts\TestExchangeServerHealth\Test-ExchangeServerHealth.ps1:1159
    char:15
    +     $tmpdags = @(Get-DatabaseAvailabilityGroup -Status)
    +                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Get-DatabaseAvailabilityGroup], FileNotFoundException
        + FullyQualifiedErrorId : [Server=CAS2,RequestId=xxxxx,TimeStamp=4/30/2014 1:04:38 PM] [FailureCategory=Cmdlet-FileNotFoundException] CB830B58, Microsoft.Exchange.Management.SystemConfigurationTasks.GetDatabaseAvailabilityGroup
    Hoping this is an easy fix.  Also making sure SP1 is supported with the script?
    Skip
    Skippy

    So it seems if I start Exchange Management Shell as administrator and call the script from the shell it works perfectly fine.  I now have another script with the same exact problem.  I'm trying to run this from a batch file via Task Scheduler...
    Here is the syntax that isn't working (exchange 2013)
    Inside BAT file:
    PowerShell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\V15\Bin\ExShell.psc1" -Command "C:\Scripts\TestExchangeServerHealth\Test-ExchangeServerHealth.ps1" -sendemail -log
    Executing the BAT file from task scheduler.
    Is there something I need to do different with 2013 in order to execute a script via task scheduler?
    Skippy

  • If firefox automatically updates my computer past 3.6 I'm inundated with Script Freezes..how do I stop new automatic updates?

    Everytime I'm automatically updated past 3.6 my computer is inundated with Script Freezes..especially on the email page of gmail.
    This has happened many many times. As far as I can determine these Script Freezes (Says: A script is attempting to write on this page.."Continue"..Stop Script etc) are coming from Internet Explorer (I'm not sure of this) and it's tricky to delete any elements of Internet Explorer. But at any rate my computer freezes up until the Script problem is settled..I check the don't ask me again block..but it does no good.
    My real question is: Since things work fine in 3.6...how can I avoid any automatic updates?
    Also, why isn't there a Timer Window (or a timer bar)for Firefox?...sometimes I have to wait 5 minutes for it to load! If there was a timer at least I'd know that something is happening and I'd be willing to wait. When it does take forever to load..it seems to help if I delete all Prefetch and temporary files.
    Is there a safe way of turning off Internet Explorer temporarily?
    Thanks for your help
    Matthew
    [email protected]

    I tried this today, and it is working now:
    Click Firefox > Options > Options > Advanced ... then Uncheck the option "Use hardware acceleration when available"

  • Problem with scripts

    Certain sites, most recently The Daily Show, will not load for me. I get a box that says:
    "Warning: unresponsive script
    A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
    Script: resource://gre/modules/ConsoleAPIStorage.jsm:157
    [Continue] [Stop script]"
    Whether I click to continue or stop the script, nothing happens except that the box goes away and then comes up again. If I try to close the tab, it just hangs and then finally shows the box again.
    Finally, Firefox just gets completely hung up, and I have to close it out with the task manager.
    Meanwhile, everything runs fine in Internet Explorer.
    Can anyone please help me solve this problem?
    Thanks,
    Ellen

    Is DOM storage enabled?
    You can check the value of the dom.storage.enabled pref on the about:config page.
    *http://kb.mozillazine.org/about:config
    You can also try to delete the webappsstore.sqlite file in the Firefox Profile Folder to remove all data (cookies) stored in DOM storage.
    You can use this button to go to the Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    You can try to reset Firefox and create a new profile.
    *https://support.mozilla.org/kb/reset-firefox-easily-fix-most-problems

  • Maxl Clear Script with Substitution Variables

    Hi,
    I am new to Maxl and I am trying to write a clear script with Maxl on an ASO Cube. The script should only clear data on a certain version and year that changes every month. I am using the following syntax and it doesn't work.
    alter database ASOSamp.Sample clear data in region '{[&SV_CurrentPeriod]}';
    What is the correct syntax here?
    thanks,

    alter database ASOSamp.Sample clear data in region '{[&Test]}';...with the subvar 'Test' set to Jan...works on my 11.1.2 test system.
    Incidentally, when you say "it doesn't work", do you mean you get a MaxL error, or it doesn't clear the expected region? I was assuming the former, but you don't say.

  • RFSG 5673 streaming with script

    Hi All,
    I'm trying to build ARB baseband data on my PC, a rack mount controller in this case, then transmit as quickly as possible with the 5673 (VSG) for real time transmission in a TDD.  The best solution I've found is the following, but it doesn't seem to work properly. ... and I'm not sure why.  Shouldn't it work? 
    I don't really understand the interaction between the script and streaming waveform. 
    Put generation mode into script;
    Set the data transfer property to streaming;
    Allocate and initialize VSG memory for the corresponding number of samples in my waveform;
    Program a script like the following:  ( I put comments after the '//' )
    script myScript1
       Generate wf0  // play waveform once to open up stream buffer
       Repeat forever
         Clear scriptTrigger0
         Wait until scriptTrigger0   // (*) download next waveform, then use scriptTrigger0 to transmit
         Generate wf0
       end repeat
    end script
    FYI: Sample rate is in the 10's of MHz.  (I've been using 80 MHz)
    After initiating I can't do anything.  I can't even query the device to check 'SpaceAvailableInStreamingWaveform'.  Any subsequenct command gives the following error:
    The data being written to the streaming waveform cannot keep up with the output.<LF/>Decrease the sample rate or write data to the streaming waveform more frequently.
    Waveform Name: wf0
    Status Code: -219106
    So then I have to reset / reconnect.  This seems faulty in that my streaming data is keeping up with the output since the VSG should be waiting.
    Interestingly enough I can do the following and things actually work. It seems that an error is only produced when the VSG buffer is "mostly" empty.  So if I pad enough zeros on my waveform, then play 3/4 of the entire buffer per trigger, things seem to work well.  It's just a pain in the butt and I'm intruducing more latency then I'd like.  The following script works:
    script myScript1
      Generate wf0 subset (0, 750000)  // empty 3/4 of buffer
            Repeat forever
                Clear scriptTrigger0           
                Wait until scriptTrigger0         // download new data prior to trigger and play a 3/4 cyclic piece of the buffer
                  Generate wf0 subset (750000, 250000)     
                  Generate wf0 subset (0, 500000)
                Clear scriptTrigger0
                Wait until scriptTrigger0
                  Generate wf0 subset (500000, 500000)
                  Generate wf0 subset (0, 250000)
                Clear scriptTrigger0
                Wait until scriptTrigger0
                  Generate wf0 subset (250000, 750000)
                Clear scriptTrigger0
                Wait until scriptTrigger0
                  Generate wf0 subset (0, 750000)
            end repeat
    end script
    There has to be a better way to do this... 
    Any thoughts are apreciated. 
    Thanks in advance.
    Clayton_A

    So...  after more thought about my application, I'm really not so concerned with small latency involved with additional buffer space. 
    I'm going to define a buffer that's twice the length of my waveform and simply ping-pong between to subsets.  Like this:
    script myScript1
       Repeat forever
         Clear scriptTrigger0
         Wait until scriptTrigger0  
         Generate wf0 subset (0, waveform_length)
         Clear scriptTrigger0
         Wait until scriptTrigger0  
         Generate wf0 subset (waveform_length, waveform_length)
       end repeat
    end script
    Then I'll just write to one subset while transmitting from the other.
    I'm still interested in hearing any thoughts on the matter.
    I'm also interested in why errors are produced when the VSG hasn't read all data in the stream buffer.  Or 'at what point' are errors produced.  Is there a non-zero difference between read and write pointers that is too close?
    For example, the following gives an error prior to the first trigger:
    script myScript1
       Generate wf0 subset (0, (waveform_length - 100) )  
       Repeat forever
         Clear scriptTrigger0
         Wait until scriptTrigger0   // Any device query or command gives an error while waiting for this trigger.
         Generate wf0 subset ((waveform_length - 100), 100)
         Generate wf0 subset (0, (waveform_length - 100))
       end repeat
    end script

  • Cursor postion with scripting in Adobe LiveCycle ES

    Hi,
    I have a textfield that populates editable text when we click pdf preview. when I tab the cursor moves to the end of the pharagraph. we are using some screen readers that reads the text. Our requirement is to bring the cursor at the begining of the text when tabbed.
    Is it possibe to bring the cursor at the begining of text with scripting.
    please post the steps if possible.
    Your help on this would be highly appriciated.
    Thanks,
    Ramesh Punugubati.

    Hello Jasmin
    The "Results" variable need to declared out of the try and catch block, otherwise it won't be recognized when it comes to "close" at the end.
    Here is a modified version of your script.
    Greetings,
    Yasser
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import javax.sql.DataSource;
    import javax.naming.InitialContext;
    import java.sql.CallableStatement;
    CallableStatement proc_stmt = null;
    InitialContext context = new InitialContext();
    Connection connection = ((DataSource)context.lookup("java:/IDP_DS")).getConnection();
    proc_stmt = connection.prepareCall("{ call CalculateTotal() }");
    ResultSet results;
    try
    results = proc_stmt.executeQuery();
    if (results.next())
      patExecContext.setProcessDataStringValue("/process_data/@Total",results.getString(1));
    catch(Exception ex)
         ex.printStackTrace();
    results.close();
    proc_stmt.close();
    connection.close();

  • Ssrs and script from was blocked due to mime type mismatch

    Hi
    I'm trying to add a script to my header on my SSRS report. I've been following this link:
    http://blogs.infosupport.com/reporting-services-javascript-injection/
    I get error stating:
    SEC7112: Script from http//####/HCCReportsServer?/ReportsLibrary/script.js was blocked due to mime type mismatch
    My code:
    ="<a href=""javascript:eval(unescape('function addScript(scriptFile){var head = document.getElementsByTagName(\'HEAD\')[0]; var script = document.createElement(\'script\'); script.setAttribute(\'language\', \'JScript\'); script.setAttribute(\'type\', \'text/Javascript\'); script.setAttribute(\'src\', scriptFile); head.appendChild(script);} addScript(\'http://dc1-sqlrs-d02/HCCReportsServer?/ReportsLibrary/script.js\');'))"">inject</a>"
    Please help. This is urgent to get it working for a demo.
    Thanks

    Hi Sunette,
    Based on my understanding, you come across an SEC7112 error when you inject JavaScript into the Reporting Services.
    In your scenario, you should remove the below setting in the web.config file(Location: C:\inetpub\wwwroot\wss\VirtualDirectories\<your port>).
    <add name="X-Content-Type-Options" value="nosniff" />
    As we tested in our environment(SQL Server 2012,SharePoint 2013,IE 11), we can inject JavaScript successfully. Please refer our test steps and results:
    1. Delete “X-Content-Type-Options" with value "nosniff" within the web.config file (Location: C:\inetpub\wwwroot\wss\VirtualDirectories\80).
    2. Design the report as below, then deploy the report to the SharePoint site.
    3. Create the script.js file with code below, and upload to the SharePoint site.
    function test()
    alert("The CHANGEME textbox will actually change…");
    //var doc = window.frames[1][1].document;
    var el = document.getElementsByTagName('span');
    for (var nr=0; nr<el.length; nr++)
    if (el[nr].innerHTML == "CHANGEME")
    el[nr].innerHTML = "I FEEL LIKE A CHANGED TEXTBOX";
    4. Run the report. Click the “inject”->”test”, the final results should look like below:
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Script with 2 pages

    hi there,
    I have a script with two pages.........
    both the pages have windows..... header,main,footer.
    script is triggering well with header in both pages. But i can see footer only in second page but not in the first page. How to get the footer in first page also???
    And in the main window apart from the data that flows into second page i also have field headings and eventually they are seen in the first page. I want them to be seen in the second page also. How can I do this?
    any help is appreciated.
    thanks

    yeah santhosh.
    i have created the windows .its working now.
    like u said if i have feild headings in main window.....they are repeating for each and every row....as main window is put in a loop.
    so i created a small window which just carries the field headings.....and then placed in it both the pages. here it solved.
    And coming to footer.......well I have called the write_form for footer after the main window. So technically it has to tigger after main window is triggered. main window is done only in second page  as contents flow to page2 and hence footer was not triggered in first page.
    So i called the write_form of footer before the write_form of main window. eventually footer triggered in both the pages.
    Anyways thanks for your concern and i rewarded the points for your help.

  • Is DIAdem script with Extended Classification functionality of DIAdem Professional executable by DIAdem Base?

    The Professional license adds 3D model data mapping and Extended Classification functionality to DIAdem. If I make a script that uses the 3D model data mapping functionality in DIAdem Professional it is possible to use this same script on a PC with only DIAdem Base (according to http://sine.ni.com/ds/app/doc/p/lang/nl/id/ds-263)
    Is this also true for the Extended Classification functionality? Is it possible to make a script with DIAdem Professional and execute this same script on a PC with only DIAdem Base to generate a report?
    Thanks,
    Roger

    Hi Roger,
    My understanding is that the VBScript you create that uses the extended classification function will work fine in DIAdem Base.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Assitance with Script

    Here’s my situation:
    We are presently printing our photographs for court using PowerPoint using the Handout page with two images per page.  The problem is the images are small and the Noritsu printer is capable of printing PowerPoint presentations using its printer drivers, but this is not an ideal situation.  As we can save our PowerPoint presentation in a JPEG file I want to utilize Photoshop with the application of an action to do batch processing of the files.
    To date, I have been unsuccessful in writing and action which will take two different photographs and place them onto a single 8x10 page in a specific orientation. All images are the same file size and format coming from a single file folder.  There may be anywhere from 20 to 200 or more images in sequential order which need to be placed two to a page ( photo 1 on top of 8x10 page, photo 2 on bottom of 8x10 page and so on).   I have been successful in getting two images on a page in the correct orientation however; I can not get the sequencing to work, which means Photoshop doesn’t understand that images 1 & 2 go on page 1, images 3 & 4 go on page 2 and so on until the end.  It is now my understanding from another forum that the only way Photoshop may detect which two files to process is to have a script written to work along with the rest of the action.  At this point I am totally clueless on whether this will work let alone on how to write a script.  
    I’m working with CS4 Extended on Windows XP and upgrading to CS5 Extended soon.
    Can anyone offer suggestions or a script (with basic directions) to help me out here?

    Have you tried the "Contact Sheet" function? It's under the "File:Automate" menu. It will create documents with multiple images based on the options you choose. You can specify the columns and rows, and you can rotate to fit. It should place the images in order based on their file names, so assuming your files are named the way you want them to show up, it should work.

  • Scripting with FTP and HTTP

    Hi All,
    To help us with future planning, we would like to get a feel for how many developers are using the FTP and HTTP objects that are available with scripting in CS3 (through webaccesslib). If you are using them could you send me a quick email describing how you use the component? My email address is [email protected]
    Thanks in advance.
    Alan Morris
    Dev Tech Engineer
    Adobe Systems

    Yeah, this is so aggrevating!
    Adobe builds all of these cool ideas, then doesnt test them.
    The HTTPConnection object does not do POST at all. I have tried nearly every possibility. The documentation is either way off or the object just does not work. I can see the post in raw form and the POST variables are not coming across.
    After working on this for a few hours i thought to myself, hey maybe i should just create a flash pane instead and load the files into it, then have the flash object upload. Well i ran into a big fat wall there too! As it is with patchpanel and bridge, these technologies only accept swf objects. This whole concept of using SWF and crossscripting has a huge flaw. The SWF file's security format does not allow for local file access for doing simple things like upload. If i can't synchronize file data to web based clouds, then i cant do much worth talking about.
    I love these products and their possibilities but i have to have the ability to communicate with the world. HTTP is the way!
    Also a side note, FTP is an insecure/inflexible solution and looks like a lot more time was spent on this aspect of the scriptable product.
    PLEASE HELP ADOBE!!!!!

  • Zenity shutdown script with Consolekit

    Somehow we are at the new stage hal deprecated and its  changes is not easy for newbies to follows.  also changing sudoers is a dirty and not safe trick So:
    The need for zenity script with these feature:
    @ Consolekit +dbus
    @Logout
    @shoutdown
    @restart
    @suspend { should we add resume to rc.conf daemons arry? if yes where? at the end?}
    @my be cancel
    is really being felt.
    So if someone how is able to change the old zentiy openbox script comes forward and do the job; we are all appreciating.

    Here's my logout script, it's an edited version of one of the Openbox logout scripts. It requires python2 and pygtk, so no zenity, but I thought it might be useful for someone nonetheless. Oh, the suspend/sleep needs pm-utils installed.
    #!/usr/bin/env python2
    import pygtk
    pygtk.require('2.0')
    import gtk
    import os
    class DoTheLogOut:
    # Cancel/exit
    def delete_event(self, widget, event, data=None):
    gtk.main_quit()
    return False
    # Suspend
    def suspend(self, widget):
    os.system("pm-suspend")
    # Hibernate
    def hibernate(self, widget):
    os.system("pm-hibernate")
    # Reboot
    def reboot(self, widget):
    os.system("dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart")
    # Shutdown
    def shutdown(self, widget):
    os.system("dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop")
    def __init__(self):
    # Create a new window
    self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
    self.window.set_title("Afsluiten? Kies een optie:")
    self.window.set_resizable(False)
    self.window.set_position(1)
    self.window.connect("delete_event", self.delete_event)
    self.window.set_border_width(20)
    # Create a box to pack widgets into
    self.box1 = gtk.HBox(False, 0)
    self.window.add(self.box1)
    # Create cancel button
    self.button1 = gtk.Button("_Annuleren")
    self.button1.set_border_width(10)
    self.button1.connect("clicked", self.delete_event, "Changed me mind :)")
    self.box1.pack_start(self.button1, True, True, 0)
    self.button1.show()
    # Create suspend button
    self.button2 = gtk.Button("_Sluimerstand")
    self.button2.set_border_width(10)
    self.button2.connect("clicked", self.suspend)
    self.button2.connect("clicked", self.delete_event, "Force removal :(")
    self.box1.pack_start(self.button2, True, True, 0)
    self.button2.show()
    # Create hibernate button
    self.button3 = gtk.Button("S_laapstand")
    self.button3.set_border_width(10)
    self.button3.connect("clicked", self.hibernate)
    self.box1.pack_start(self.button3, True, True, 0)
    self.button3.show()
    # Create reboot button
    self.button4 = gtk.Button("_Opnieuw opstarten")
    self.button4.set_border_width(10)
    self.button4.connect("clicked", self.reboot)
    self.box1.pack_start(self.button4, True, True, 0)
    self.button4.show()
    # Create shutdown button
    self.button5 = gtk.Button("A_fsluiten")
    self.button5.set_border_width(10)
    self.button5.connect("clicked", self.shutdown)
    self.box1.pack_start(self.button5, True, True, 0)
    self.button5.show()
    self.box1.show()
    self.window.show()
    def main():
    gtk.main()
    if __name__ == "__main__":
    gogogo = DoTheLogOut()
    main()
    Last edited by Unia (2011-08-20 11:01:46)

Maybe you are looking for