Translations:Workbench creation/15/zh-tw: Difference between revisions

From FreeCAD Documentation
No edit summary
No edit summary
 
Line 1: Line 1:
如果你打算要用Python來寫你的workbench程式碼,你只需要將其他Python檔案跟Init.py 和InitGui.py放在一起就好了,而不用再去煩惱其他事情。不過當你是使用C++來撰寫workbench的時候,你必須特別留意並且遵守FreeCAD的一個基本規則:你必須將你的workbench分成App(可以在命令列介面下執行而不需要任何圖形使用者介面)和Gui(只有在FreeCAD在圖形使用者介面下執行時才會被載入)兩個部份。 所以用C++撰寫workbench你幾乎就像是在開發兩個modules,也就是App和Gui這兩個。這兩個模組當然必須能被Python呼叫。任何 FreeCAD module(App或Gui)至少都包含一個module的init 檔 This is a typical AppMyModuleGui.cpp file:
如果你打算要用Python來寫你的workbench程式碼,你只需要將其他Python檔案跟Init.py 和InitGui.py放在一起就好了,而不用再去煩惱其他事情。不過當你是使用C++來撰寫workbench的時候,你必須特別留意並且遵守FreeCAD的一個基本規則:你必須將你的workbench分成App(可以在命令列介面下執行而不需要任何圖形使用者介面)和Gui(只有在FreeCAD在圖形使用者介面下執行時才會被載入)兩個部份。 所以用C++撰寫workbench你幾乎就像是在開發兩個modules,也就是App和Gui這兩個。這兩個模組當然必須能被Python呼叫。任何 FreeCAD module(App或Gui)至少都包含一個module的init 檔。這是典型AppMyModuleGui.cpp

Latest revision as of 09:07, 8 March 2016

Information about message (contribute)
This message has no documentation. If you know where or how this message is used, you can help other translators by adding documentation to this message.
Message definition (Workbench creation)
If you are going to code your workbench in python, you don't need to take special care, and can simply place your other python files together with your Init.py and InitGui.py files. When working with C++, however, you should take greater care, and start with respecting one fundamental rule of FreeCAD: The separation of your workbench between an App part (that can run in console mode, without any GUI element), and a Gui part, which will only be loaded when FreeCAD runs with its full GUI environment. So when developing a C++ workbench, you will actually most likely create two modules, an App and a Gui. These two modules must of course be callable from python. Any FreeCAD module (App or Gui) consists, at the very least, of a module init file. This is a typical AppMyModuleGui.cpp file:

如果你打算要用Python來寫你的workbench程式碼,你只需要將其他Python檔案跟Init.py 和InitGui.py放在一起就好了,而不用再去煩惱其他事情。不過當你是使用C++來撰寫workbench的時候,你必須特別留意並且遵守FreeCAD的一個基本規則:你必須將你的workbench分成App(可以在命令列介面下執行而不需要任何圖形使用者介面)和Gui(只有在FreeCAD在圖形使用者介面下執行時才會被載入)兩個部份。 所以用C++撰寫workbench你幾乎就像是在開發兩個modules,也就是App和Gui這兩個。這兩個模組當然必須能被Python呼叫。任何 FreeCAD module(App或Gui)至少都包含一個module的init 檔。這是典型AppMyModuleGui.cpp檔 :