<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 1.3FLTK構件簡介 FLTK作為GUI開發包,包含了常用的圖形用戶接口需要的一些構件,視覺表現非常豐富,如下兩圖所示: ![](https://box.kancloud.cn/2016-01-09_5690737db50b4.png) ![](https://box.kancloud.cn/2016-01-09_5690737ddc9e4.png) 常用按鈕構件 | 按鈕名稱 | 頭文件 | 按鈕名稱 | 頭文件 | | --- | --- | --- | --- | | Fl_Button | Fl_Button.H | Fl_Check_Button | Fl_Check_Button.H | | Fl_Light_Button | Fl_Light_Button.H | Fl_Repeat_Button | Fl_Repeat_Button.H | | Fl_Return_Button | Fl_Return_Button.H | Fl_Round_Button | Fl_Round_Button.H | 對于具有Fl_Check_Button、Fl_Loght_Button和Fl_Round_Button當狀態為off時value() =0 ,On時value()返回1。 處理按鈕時間可以使用回調(callback)函數,參見后面的事件處理。 文本處理構件 | 構件名稱 | 頭文件 | 構件名稱 | 頭文件 | | --- | --- | --- | --- | | Fl_Input | Fl_Input.H | Fl_Output | Fl_Output.H | | Fl_Multiline_Input | Fl_Multiline_Input.H | Fl_Multiline_output | Fl_Multiline_output.H | 設置和取得文本內容使用value(); 如: ``` (new Fl_Input(x,y,width,height,"Label"))->value("Hello World!"); ``` 其他構件參見FLTK.org的 文檔說明。 寫一個簡單的FLTK程序 ``` #include <FL/Fl.H> #include <FL/Fl_Window.H> #include <FL/Fl_Box.H> int main(int argc, char **argv) { Fl_Window *window = new Fl_Window(300,180); Fl_Box *box = new Fl_Box(20,40,260,100,"Hello, World!"); box->box(FL_UP_BOX); box->labelsize(36); box->labelfont(FL_BOLD+FL_ITALIC); box->labeltype(FL_SHADOW_LABEL); window->end(); window->show(argc, argv); return Fl::run(); } ``` 包含了需要的頭文件后,該程序創建了一個窗口 ``` Fl_Window *window = new Fl_Window(300,180); ``` 還創建了一個box類,標簽是“Hello World!” ``` Fl_Box *box = new Fl_Box(20,40,260,100,"Hello, World!"); ``` 下一步,我們設置了box的類型,大小,字體和標簽的類型 ``` box->box(FL_UP_BOX); box->labelsize(36); box->labelfont(FL_BOLD+FL_ITALIC); box->labeltype(FL_SHADOW_LABEL); ``` 最后,我們顯示該窗口并進入FLTK 事件循環 ``` window->end(); window->show(argc, argv); return Fl::run(); ``` 運行該程序得到的界面如下,你能直接關閉該窗口退出,也可以按ESC鍵退出 ![](https://box.kancloud.cn/2016-01-09_5690737f0acd3.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看