Hi all,<br><br>For a network manager of sorts I&#39;m working on, I want to derive a SettingsWindowClass from the WindowClass present in Gtk2Hs:<br><br>I want (the) instance(s) of the SettingsWindowClass to have a field to store connection settings:<br>
<br>1) Is it safe to do it like this?<br><br><span style="font-family: courier new,monospace;">class WindowClass self $B"M(B SettingsWindowClass self where<br>&nbsp; settingsWindowGetSettings :: self $B"*(B IO [ConnectionSetting]<br>&nbsp; settingsWindowSetSettings :: self $B"*(B [ConnectionSetting] $B"*(B IO ()<br>
<br>newtype SettingsWindow = SettingsWindow (Window,[ConnectionSetting])<br><br>mkSettingsWindow = SettingsWindow<br>unSettingsWindow (SettingsWindow o) = o<br><br>settingsWindowNew :: IO SettingsWindow<br>settingsWindowNew = do<br>
&nbsp; win $B"+(B windowNew<br>&nbsp; return $ mkSettingsWindow (win,[])<br></span><br>2)  Is this a common practice in gtk2hs usage?<br>3) And will GC properly free the memory allocated for the Window object? How is this ensured, do ForeignPtr&#39;s always call delete on the underlying C ptr when they get garbage collected?<br>
<br>Best Regards,<br>CS<br>