Welcome, Guest
Python Scripts for ComicRack

TOPIC: Help with forms...

Help with forms... 8 years 1 month ago #4269

  • perezmu
  • perezmu's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1114
  • Thank you received: 64
  • Karma: 51
Hello,

I am almost done with the new version of the comicvine script... just a few edges to polish, though...

I have problems launching forms (for cover display and progress bars...): they appear in the background and do not seem to get focus even if clicked... after some interactions they finally appear on top... also, for progressbars if I change focus, they stop updating and get a "Not responding" message in the window title, though the process keep on correctly...

Can anyone, please, give some pointers on how to launch and manage these forms?... I've tried different combinations of both the following:
Monitor.Enter(ComicRack.MainWindow)
XXXXForm.Show()

and
XXXXForm.Show(ComicRack.MainWindow)

This latter one seems to show the forms properly, but then the progress bars stop working as stated above :(
The administrator has disabled public write access.

Re: Help with forms... 8 years 1 month ago #4271

  • cYo
  • cYo's Avatar
  • Offline
  • Moderator
  • Posts: 3476
  • Thank you received: 675
  • Karma: 181
if you want to keep the window in front try XXXXForm.ShowDialog (ComicRack.MainWindow).

You can forget about the Monitor.Enter
The administrator has disabled public write access.

Re: Help with forms... 8 years 1 month ago #4273

  • perezmu
  • perezmu's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1114
  • Thank you received: 64
  • Karma: 51
That does the trick of showing the forms right... using Show instead of ShowDialog, since they are just information forms, with no interaction...

But for the simple forms (just a progressbar in them), when I click on them or move them around they keep getting unresponsive...
The administrator has disabled public write access.

Re: Help with forms... 8 years 1 month ago #4275

  • perezmu
  • perezmu's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1114
  • Thank you received: 64
  • Karma: 51
Some further research has showed that I might actually need to use the backgroundworker class for this...
The administrator has disabled public write access.

Re: Help with forms... 8 years 1 month ago #4276

  • cYo
  • cYo's Avatar
  • Offline
  • Moderator
  • Posts: 3476
  • Thank you received: 675
  • Karma: 181
if you want to start some background processing you have to do it with background worker, or simpler call Application.DoEvents() in your loop. You just have to call it often enough to not starve the message loop.
The administrator has disabled public write access.

Re: Help with forms... 8 years 1 month ago #4280

  • perezmu
  • perezmu's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1114
  • Thank you received: 64
  • Karma: 51
So many thanks, cYo, the Application.DoEvents() did the trick!... but I cannot claim I understand why!

The important thing is that it is working now!
The administrator has disabled public write access.
Time to create page: 0.176 seconds

Who's Online

We have 168 guests and 5 members online