Qptr WMAN simple example

Anything QL Software or Programming Related.
User avatar
NL_QL_Usr
Chuggy Microdrive
Posts: 57
Joined: Sun Jan 08, 2023 8:42 am

Qptr WMAN simple example

Post by NL_QL_Usr »

Hello everyone.
I am trying to get started with QPTR WMAN...

Is there a simple example somewhere?
I am looking for a simple managed window with only the standerd move and resize LIL

Would be super if someone has that or can show that
Thank a lot in advance


Tinyfpga
Gold Card
Posts: 252
Joined: Thu Sep 27, 2018 1:59 am

Re: Qptr WMAN simple example

Post by Tinyfpga »

Like you I have been spending a bit of time learning to program in SBASIC. My original interest was in SMS2.
SMS2 has a high resolution QPTR SBASIC programming environment built into it, (see forum post SMSQ/2 on Atari page 8)
and I still use this form of programming in SMS2 and SMSQ/E. I have experimented with QPTR and have started to
understand it a bit.

I like your one arm bandit program but it does not run correctly in my QPTR system and, in a high resolution environment, it needs
to be moveable. By single stepping through your bandit code I found the problem was that PAUSE needs to be associated
with a channel otherwise it opens a default channel that overwrites the display. (see below). I added a WMOV instruction on line 13
and elsewhere to make your program moveable and assigned #7 to all the PAUSE instructions. The problem and its solution can be seen
in the picture below.

As to QPTR programming I have attached a zip file with some QPTR code that creates a moveable, but not resizable, window.
The code is a work in progress and it does not use line numbers GOTOs, PEEKS or POKEs. It compiles without error with Qliberator and runs
perfectly on QPC2 and Q68. I have not tried to interpret the code because I don't use the interpreter.

I have just noticed that instead of the word console I have typed consule by mistake but as it is a REM it's not very important.
bandit.jpg
My code and your modified code is in a zipped SMS container file as follows.
Attachments
WIN5.zip
(484.62 KiB) Downloaded 41 times
Last edited by Tinyfpga on Wed Dec 06, 2023 11:53 pm, edited 2 times in total.


User avatar
ql_freak
Gold Card
Posts: 354
Joined: Sun Jan 18, 2015 1:29 am

Re: Qptr WMAN simple example

Post by ql_freak »

First of all, read the official manual for the Pointer Interface and the Window Manager (wman) here (thank you Dilwyn!):

https://dilwyn.qlforum.co.uk/docs/manuals/index.html#techguides then look for "QPTR MANUAL" (use the search function of your browser [CTRL-F in firefox]).

It's originally from the author of QDOS and (now) Extended Environment, Anthony Tebby. It's the same if you want to learn C (Kernighan & Ritchie) or C++ (Bjarne Stroustrup). If you don't have read their books, you never want to understand their intention.


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
User avatar
NL_QL_Usr
Chuggy Microdrive
Posts: 57
Joined: Sun Jan 08, 2023 8:42 am

Re: Qptr WMAN simple example

Post by NL_QL_Usr »

Hello Tinyfpga

This much more then I ever good have hoped for....
Thank you very much for your great example.
It will bring me up a level.
That you even used my onearm code is perfect, you seem to have understood right away what i wanted to do.
I like to make superbasic programs but wanted to be able to move them once in higher Dispmode..
Today I will try out this and report back...

Thanks


User avatar
NL_QL_Usr
Chuggy Microdrive
Posts: 57
Joined: Sun Jan 08, 2023 8:42 am

Re: Qptr WMAN simple example

Post by NL_QL_Usr »

Hi ql_freak

Youre right off course about reading the manual.
I have got my laptop next to the QL with 3 or more PDF s open :D
But the examples etc seen thus far are a lot off code to grasp

Thanks for your reaction.


Derek_Stewart
Font of All Knowledge
Posts: 3975
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Qptr WMAN simple example

Post by Derek_Stewart »

Hi,

Please look at Wolfgang Lenerz web site:
https://www.wlenerz.com/qlstuff

Where you can get the QPTR toolkit, manual, Toolkit Source code and example programmes for programming in the Extended Envoirnment, which includes PTR, WMAN programming.


Regards,

Derek
User avatar
tofro
Font of All Knowledge
Posts: 2702
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Qptr WMAN simple example

Post by tofro »

Your question might be a bit ambiguous, because "WMAN QPTR" is both a (maybe sloppy) expression that means "QL Extended environment window manager" and a specific name of the "QJump QPTR toolkit". I'm trying to answer not specifically for that toolkit.

WMAN programming has two fundamentally different approaches that can basically be found in any windowing system and you first have to decide what approach you want to take:
  1. A programmatic approach that has you build each Ui component programmatically, i.e. you place each Ui component on the screen with BASIC commands or assembly calls
  2. A "resource file" approach that allows you to more or less interactively design your Ui components and "compile" it into a binary window definition that is then later used to bring the Ui to the screen. Typically, this approach makes designing the Ui and didplaying it a bit less tedious
QDOS WMAN basically has toolkits that support (on a much more basic level than more contemporary windowing systems) both approaches. If you decide for a toolkit you want to use, you will at the same time decide for the approach this toolkit uses.

QJump QPTR toolkit follows approach (1). You can create and assemble your Ui in tiny, programmatic steps where each Ui element basically ends up in one program statement. This is the most basic way to create a WMAN Ui and can be very tedious, but you work "close to the metal" and can (and must) gain a thoough understanding of how WMAN works internally.

EasyPtr and TurboPtr chose the second approach. You create a window definition upfront using an interactive editor (EasyPtr) or a serial dialogue (TPtr), then load and use that in your program. Complex windows and dialogs become much simpler that way. Each of those packages comes with a Toolkit that allows to use these window definitions in your program later on.

I would definitly recommend approach (2) to a beginner. It hides most of the fiddly bits of WMAN from the programmer, allowing you to see results faster and easier. All of the toolkits (both for (1) and (2)) are freely available, EasyPtr is on https://www.kilgus.net/smsqe/easyptr/, the others on the QL home page.

Programming WMAN can be a fascinating activity, but none of the approaches (even those of category (2), much less (1)) are particularily easy to swallow at first. If I would have to recommend a starting point, I would really start with TurboPtr and its example programs - they really start from a very basic level. If you want really interctive design, start with EasyPtr. (The "Easy" part is probabably disputable, though...) It also has some very nice example programs and probably the best documentation of the three. Whatever you do, don't intermix the toolkits (they are not made to work with each other), but concentrate on one approach.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
NL_QL_Usr
Chuggy Microdrive
Posts: 57
Joined: Sun Jan 08, 2023 8:42 am

Re: Qptr WMAN simple example

Post by NL_QL_Usr »

Hi tofro

Thank you very much for your reply!
Its clear to me that I still have a lot to learn I still dont now about all of the different toolkits etc.
But you point me to good directions, which I will try out

My mind is boiling from all kind off ideas, and probably want to fast :D

Thanks a Lot


User avatar
NL_QL_Usr
Chuggy Microdrive
Posts: 57
Joined: Sun Jan 08, 2023 8:42 am

Re: Qptr WMAN simple example

Post by NL_QL_Usr »

Hey Derek!

Thanks I've got the website open and its looks promising....

Its great to have QL ers helping everyone out.... :)


User avatar
BSJR
Trump Card
Posts: 186
Joined: Sun Oct 18, 2015 12:53 pm
Location: Amsterdam
Contact:

Re: Qptr WMAN simple example

Post by BSJR »

NL_QL_Usr wrote: Wed Dec 06, 2023 3:20 pm Hello everyone.
I am trying to get started with QPTR WMAN...

Is there a simple example somewhere?
I am looking for a simple managed window with only the standerd move and resize LIL

Would be super if someone has that or can show that
Thank a lot in advance
The QPTR package contains some examples that run in S*Basic and are worth examining.
There was also an 11 part series of lectures about QPTR in QL-Today by Wolfgang Lenerz , explaining in more detail what was missing in the manual. (See volume 7 issue 2 to volume 9 issue 3.)
Be prepared for some late night studying.

BSJR

For QPTR: https://dilwyn.qlforum.co.uk/program/index.html
and QL-Today: https://dilwyn.qlforum.co.uk/gen/qltoday/qltoday.html


Post Reply