[Mono-dev] GTK# Window Display Issue Outside of Main.cs

Oskar Berggren oskar.berggren at gmail.com
Wed Nov 7 08:23:32 UTC 2012


2012/11/6 Johnnie Odom <jodom at escambia.k12.fl.us>

 I have taken to using the debugger and break points to isolate the
> behavior. If I set a breakpoint immediately after the window is created, it
> is still blank -- that is, I do not think it is a case that the window is
> just not keeping pace with any updates I am sending. I
>

Showing a window basically sets a flag. And the window manager will
apparently be notified, since it draws the border etc. But the window
itself isn't rendered until the gui loop gets around to it.




> The function from the calling class:
>
>  public string radiazerMain(string radiazerGroup, string radiazerProfile){
>
> Progression MarathonBar = new Progression();
>
> MarathonBar.Show();
>
> string monologger = "";
>
> string lastLine = "Radiazer completed current run." + Environment.NewLine;
>
> Array usersToModify = getGroupMembers(radiazerGroup);
>
> string[] radiusAttribs = new
> string[]{"dialupAccess","radiusArapFeatures","radiusArapSecurity","radiusArapZoneAccess","radiusAuthType","radiusCallbackId","radiusCallbackNumber","radiusCalledStationId","radiusCallingStationId","radiusCheckItem","radiusClass","radiusClientIPAddress","radiusExpiration","radiusFilterId","radiusFramedAppleTalkLink","radiusFramedAppleTalkNetwork","radiusFramedAppleTalkZone","radiusFramedCompression","radiusFramedIPAddress","radiusFramedIPNetmask","radiusFramedIPXNetwork","radiusFramedMTU","radiusFramedProtocol","radiusFramedRoute","radiusFramedRouting","radiusGroupName","radiusHint","radiusHuntgroupName","radiusIdleTimeout","radiusLoginIPHost","radiusLoginLATGroup","radiusLoginLATNode","radiusLoginLATPort","radiusLoginLATService","radiusLoginService","radiusLoginTCPPort","radiusLoginTime","radiusPasswordRetry","radiusPortLimit","radiusProfileDn","radiusPrompt","radiusProxyToRealm","radiusRealm","radiusReplicateToRealm","radiusReplyItem","radiusServiceType","radiusSessionTimeout","radiusSimultaneousUse","radiusStripUserName","radiusTerminationAction","radiusTunnelAssignmentId","radiusTunnelClientEndpoint","radiusTunnelMediumType","radiusTunnelPassword","radiusTunnelPreference","radiusTunnelPrivateGroupId","radiusTunnelServerEndpoint","radiusTunnelType","radiusUserCategory","radiusVSA"};
>
> LdapAttributeSet profileTemplate =
> LdapAttributeSetFiltered(radiazerProfile, radiusAttribs);
>
> profileTemplate.Add(new LdapAttribute("radiusProfileDn", radiazerProfile));
>
>
>  int totalUsersCount = usersToModify.Length;
>
> int currentUserCount = 0;
>
> int errorCount = 0;
>
> MarathonBar.Show();
>


Here, you keep holding the thread. So it can never get back into the GTK
main loop and thus it will never get around to rendering your window.
Unless this is a different thread, but in that case you shouldn't handle
GUI elements at all, since the GUI framework is not designed to be used by
more than one thread.


You might want to have a look at the BackgroundWorker class to place the
work on a separate thread, but leave the GUI interaction to the GUI thread.

/Oskar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20121107/5137b068/attachment.html>


More information about the Mono-devel-list mailing list