背景(長方形など)に描画してから、その上にコンポーネントをレンダリングしてもらいたいです。コンポーネントは、私が描いたものの上にあります。これを行う方法はありますか?
コンセプトの例を次に示します。これは長方形のみを表示します。だから...コンポーネントもレンダリングするように指示する方法が必要です。
{-# LANGUAGE PackageImports #-}
import Graphics.UI.Gtk
import Graphics.UI.Gtk.Gdk.EventM
import Graphics.UI.Gtk.Gdk.GC
import "mtl" Control.Monad.Trans(liftIO)
main = do
initGUI
window <- windowNew
window `onDestroy` mainQuit
windowSetDefaultSize window 800 600
windowSetPosition window WinPosCenter
table <- tableNew 3 3 False
button <- buttonNewWithLabel "Test Button"
tableAttachDefaults table button 1 2 1 2
containerAdd window table
table `on` exposeEvent $ update
widgetShowAll table
widgetShowAll window
mainGUI
update = do
win <- eventWindow
liftIO $ do
gc <- gcNew win
drawRectangle win gc False 10 10 90 90
return True