def askUserForNewFileName(self, fullPath):
     base = basename(fullPath)
     defaultValue, extension = splitext(base)
     dialog = InputDialog('Renaming %s' % defaultValue,
                          self.out,
                          self.system,
                          label='Name this file or forever hold your peace:',
                          defaultValue=defaultValue,
                          imageFileName=fullPath)
     response = dialog.show()
     if not response:
         result = fullPath
     else:
         result = '%s/%s%s' % (dirname(fullPath), response, extension.lower())
     return result
Exemplo n.º 2
0
                              like    <----    this.
                          and another go...
                          the free text\nand more free text
                          this is where the netsync contents will be....
                          like    <----    this.
                          
                          and another go...
                          
                          the free text
                          and more free text
                          this is where the netsync contents will be....
                              like    <----    this.
                          and another go...
                          ''')
print 'showing InputWindow()'
result = inputWindow.show()
print 'InputWindow got result: "%s"' % result

print '\nTEST 4: Input window with a list of default values'
system = PySystemGui(out, 'PySystemGui Test Run')
inputWindow = InputDialog('Test Input Window',
                          out,
                          system,
                          "A question to ask the user:",
                          ['default value 1', 'default value 2', 'default value 3', 'default value 4'],
                          '/home/luke/Reference/Code/Windows/Netsync/Netsync/logo-luke.png',
                          '''
                          the free text\nand more free text
                          this is where the netsync contents will be....
                          like    <----    this.
                          ''')