It is currently Sat Dec 16, 2017 7:47 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: App with multiple windows
PostPosted: Thu Nov 02, 2017 12:36 pm 
Online
User
User

Joined: Thu Aug 10, 2017 7:35 am
Posts: 25
Hello,

I want to write an application that has one main window (and when it is closed I do NOT want
the whole application to exit but e.g. minimize to the system tray instead) and the main
window will have a few buttons, list icon gadgets, etc.

Double clicking a list icon gadget item / clicking on a button would open another window, that
itself can have gadgets as well.

What is the best way to handle several windows (that partially depend on another) when designing
the application, should each window reside in it's own procedure and how should events
for such a (sub)-window be handled?

Sorry, newbie here. I want to bring my application over from AutoHotkey to PureBasic...


Top
 Profile  
Reply with quote  
 Post subject: Re: App with multiple windows
PostPosted: Thu Nov 02, 2017 12:41 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Oct 09, 2007 2:15 am
Posts: 873
Create your window, place all gadgets, hide it. Do this with all your windows at the beginning.

If you need to show a window, "unhide" it.

Only one Eventloop.

Thats all.

_________________
PureBasic 5.45 LTS / 5.61 (Windows x86/x64) | Windows10 Pro x64 | Z87-PLUS | i7 4770k | 32GB RAM | iChill GeForce GTX 980 X4 Ultra | HAF XF Evo​​
English is not my native language...


Top
 Profile  
Reply with quote  
 Post subject: Re: App with multiple windows
PostPosted: Wed Nov 08, 2017 11:41 am 
Online
User
User

Joined: Thu Aug 10, 2017 7:35 am
Posts: 25
Thanks you Bisonte, I'll try that :mrgreen:


Top
 Profile  
Reply with quote  
 Post subject: Re: App with multiple windows
PostPosted: Wed Nov 08, 2017 5:00 pm 
Offline
Addict
Addict

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 3719
Location: Germany
And really:

Only 1 event loop

Code:
Repeat
 
  Event = WaitWindowEvent()
 
  Select EventWindow()
    Case #MainWindow
      Exit = MainWindowEvents(Event)
    Case #OtherWindow
      OtherWindowEvents(Event)
  EndSelect
 
Until Exit

Bernd


Top
 Profile  
Reply with quote  
 Post subject: Re: App with multiple windows
PostPosted: Sat Nov 11, 2017 2:36 pm 
Online
User
User

Joined: Thu Aug 10, 2017 7:35 am
Posts: 25
@infratec

Quote:
Only 1 event loop


Okay, works fine with multiple windows so far :D


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye