ich wünsche ein frohes und erfolgreiches neues Jahr allen hier im Forum.
Aktuell spiele ich mit der neuen Funktion "CreateDialog" unter Linux.
Soweit funktioniert das auch.
Jedoch vermisse ich bei den XML Deklarationen in der Doku, die Möglichkeit, eine StatusBar zu definieren.
Habe ich hier was übersehen oder ist das noch nicht implementiert ?
Wie kann ich dem ganzen eine StatusBar spendieren ?
Der Eintrag "<statusbar id='statusbar'/>" im XML Code wird nicht angemeckert aber es passert auch nichts.
Statusbar bleibt unsichtbar.
Für Hinweise oder einen leichten Schlag auf den Hinterkopf wäre ich sehr dankbar.
Grüße
Alen
Aktueller Code:
Code: Alles auswählen
EnableExplicit
CompilerIf #PB_Compiler_Unicode
#XmlEncoding = #PB_UTF8
CompilerElse
#XmlEncoding = #PB_Ascii
CompilerEndIf
#Dialog = 0
#Xml = 0
Define.s XML
Define.l Event
Runtime Enumeration Gadget
#output
#statusbar
EndEnumeration
Procedure RunMe(cmd.s, parms.s, workdir.s = "")
Define.l flags, pid
Define.s cmd, params
flags = #PB_Program_Open | #PB_Program_Read | #PB_Program_Connect
flags = flags | #PB_Program_Error | #PB_Program_UTF8
pid = RunProgram(cmd, parms, workdir, flags)
If pid
While ProgramRunning(pid)
If AvailableProgramOutput(pid)
AddGadgetItem(#output, -1, ReadProgramString(pid))
EndIf
Wend
If ProgramExitCode(pid) <> 0
AddGadgetItem(#output, -1, "")
AddGadgetItem(#output, -1, "Exitcode: " + Str(ProgramExitCode(pid)))
EndIf
AddGadgetItem(#output, -1, "")
CloseProgram(pid)
EndIf
EndProcedure
Runtime Procedure RunAction(line.s)
;RunMe("hostname", "-f")
;RunMe("uname", "-a")
;RunMe("uptime", "")
RunMe("du", "-hs " + GetHomeDirectory())
RunMe("tree", "-d --du --si -s " + GetHomeDirectory())
EndProcedure
Runtime Procedure ClearOutput()
SetGadgetText(#output, "")
EndProcedure
XML.s = "<window id='#PB_Any' name='test' text='RunCommand Test' minwidth='800' minheight='600' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
" <vbox expand='item:2'>" +
" <hbox>" +
" <button text='Run Command' onevent='RunAction()'/>" +
" <button text='Clear Output' onevent='ClearOutput()'/>" +
" </hbox>" +
" <editor id='output' text='' height='150'/>" +
" </vbox>" +
" <statusbar id='statusbar'/>" +
"</window>"
If CatchXML(#Xml, @XML, StringByteLength(XML), 0, #XmlEncoding) And XMLStatus(#Xml) = #PB_XML_Success
If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "test")
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
Else
SetGadgetText(#output, "Dialog error: " + DialogError(#Dialog))
EndIf
Else
SetGadgetText(#output, "XML error: " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")")
EndIf