[表示 : 全て 最新50 1-99 101- 201- 301- 401- 501- 601- 701- 801- 901- 1001- 2chのread.cgiへ]
Update time : 05/08 22:45 / Filesize : 338 KB / Number-of Response : 1002
[このスレッドの書き込みを削除する]
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧] [類似スレッド一覧]


↑キャッシュ検索、類似スレ動作を修正しました、ご迷惑をお掛けしました

【GUIライブラリ】wxWindowsでのひょーん



1 名前:デフォルトの名無しさん mailto:sage [03/05/06 11:04]
クロスプラットフォームGUIライブラリのwxWindowsについて語りましょう。

本家
 www.wxwindows.org/
dW : Linux : wxWindowsの概要
 www-6.ibm.com/jp/developerworks/linux/010413/j_l-wxwin.html
SunWorld Online:wxWindows――無名だが成熟したGUIツールキット
 www.idg.co.jp/sw/back/200102/20010219_01_report.html
メルマガ
 www.mag2.com/m/0000108320.htm

1はこれからインストールします

68 名前:65 mailto:sage [03/05/21 22:14]
ついでに。allocating and deleting wxWindows objects.(前半にょ)

> In general, classes derived from wxWindow must dynamically allocated
with new and deleted with delete. If you delete a window, all of its
children and descendants will be automatically deleted, so you don't
need to delete these descendants explicitly.

ふつー、wxWindowから派生したクラスはnewで動的にアロケートしてdelete
で逝ってしまわないといけないんだよもん。ウィンドウを削除したら、その
子も子孫も自動的に氏ぬから、こいつらを明示的に殺す必要はないもん。

# 難しい……

> When deleting a frame or dialog, use Destroy rather than delete so
that the wxWindows delayed deletion can take effect. This waits until
idle time (when all messages have been processed) to actually delete the
window, to avoid problems associated with the GUI sending events to
deleted windows.

フレームやダイアログを頃すにはdeleteじゃなくてDestroyを使ってくださいお
まいら。wxWindowsが、あぼーんの執行を送らせられるよーに。これは、ウィン
ドウの削除をアイドルタイム(全てのメッセージが処理されたとき)まで遅らせて、
GUIがあぼんされたウィンドウにイベントを投げちまうことによる問題を避ける
ためでつ。

> Don't create a window on the stack, because this will interfere with
delayed deletion.

ウィンドウをスタックに作るなゴルァ。削除の遅延が出来なくなるじゃねーか。


69 名前:65 mailto:sage [03/05/21 22:21]
後半にょ。

> If you decide to allocate a C++ array of objects (such as wxBitmap)
that may be cleaned up by wxWindows, make sure you delete the array explicitly
before wxWindows has a chance to do so on exit, since calling delete on array
members will cause memory problems.
wxWindowsがあぼーんするかもしんないオブジェクト(wxBitmapとかな)のC++ の配列
(STLのarrayのことか?)をC++でアロケートするんなら、終了時にwxWindows がそうする
前に、絶対、その配列を明示的にあぼんすれ。配列のメンバについてdelete を呼ぶと
メモリの問題が発生するからな。

> wxColour can be created statically: it is not automatically cleaned up
and is unlikely to be shared between other objects; it is lightweight enough
for copies to be made.
wxColourは静的に作成できまつ。自動的に削除されず、オブジェクト間で共有されるこ
ともあんまないでつ。十分軽いのでコピー作ってもおkでつ。

> Beware of deleting objects such as a wxPen or wxBitmap if they are
still in use. Windows is particularly sensitive to this: so make sure you make
calls like wxDC::SetPen(wxNullPen) or wxDC::SelectObject(wxNullBitmap) before
deleting a drawing object that may be in use. Code that doesn't do this will
probably work fine on some platforms, and then fail under Windows.
wxPenやwxBitmapといったオブジェクトを削除する際は、それらがまだ使用中でないか
気を付けよ。Windowsはこの点にたいへんウルサイ。であるから、使用中かも知れない
オブジェクトを削除する前には、必ず、確実にwxDC::SetPen(wxNullPen) もしくは
wxDC::SelectObject(wxNullBitmap)を呼ぶようにせよ。これを怠ったコードはいくつか
のプラットフォームではちゃんと動くだろうが、Windowsではダメなんである。

文体バラバラや。推敲して下さい。
あと、見直して気付いたんですが>>65の「指定」は「仕様」かも知れませぬ。
長くてスマソ >皆様。







[ 続きを読む ] / [ 携帯版 ]

次100 最新50 [ このスレをブックマーク! 携帯に送る ] 2chのread.cgiへ
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧](;´∀`)<338KB

read.cgi ver5.27 [feat.BBS2 +1.6] / e.0.2 (02/09/03) / eucaly.net products.
担当:undef