Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tk_messageBox on Android: possible improvements

113 views
Skip to first unread message

Harald Oehlmann

unread,
Jul 1, 2021, 5:32:20 AM7/1/21
to

Dear TCL Android fans,

tk_messageBox has a couple of draw-backs on Android/AndroWish:

- the box is made for wide screen. If the screen is shown in partrait
mode, the message bos is to large on my phone. In consequence, it is
shown off-screen (partly).
- the placement algorithm of tk may put it at a position, where it is
only seen as a very small part. It is not centered on the screen.
- when you turn your phone to switch to landscape mode, it may fit but
is still off-screen.

I may start a project to implement an alternate tk_messageBox for
Android. Here are the ideas:

- make it full screen. The best is "wm attributes -fullscreen 1". Then,
we loose the window title. So, eventually add the Window title in an
extra Widget plaed at top.
- or set the "wm geometry" to cover the whole screen. This must be
changed, when the phone is turned (portrait/landscape) using a binding.
- In portrait mode, show the Icon above the message
- reconfigure the "-wrapsize" when the device is turned, to do the
wrapping differently for portrait or landscape mode
- it should work well with them "AWDark"
- scale the icons using svg. Feed-back the svg-icons to tk 8.7 and
implement icon scaling there

For now, I inspected tk tk file "messagebox.tcl". The idea is to adapt
this file.

May I ask for any additional ideas or pointers to already implemented work?

Thank you all,
Harald

fr

unread,
Jul 9, 2021, 3:01:42 AM7/9/21
to
Hello Harald,
I dealt with similar problems in https://taipu.de/profon/c.l.t
Please check it out
Roland Frank

Harald Oehlmann

unread,
Jul 28, 2021, 12:21:56 PM7/28/21
to
Dear Roland,
thank you for the pointer. There is a lot of excellent code and Android
integration.
May you point me to the code snippet where you deal with tk_messageBox
adoption to Android. I see that you call it in case of any issues (like
no permissions). But do you do any adoption to the tk_messageBox file?

I only inspected main.tcl.

Thank you,
Harald

fr

unread,
Jul 29, 2021, 3:55:35 AM7/29/21
to
tk_messageBox's appearance is defined by
option add *Dialog.msg.wrapLength [expr {int(0.8*$w)}]
with w as the width of display in current screen orientation.
Concerning layout issues and fontsize adaption the basic ideas are to be found here:
https://wiki.tcl-lang.org/page/label+text+wrapped+and+aligned+vertically
https://wiki.tcl-lang.org/page/Resizing+fonts+on+window+resize?R=0
Idea: on Android it should be possible to use Unicode symbols as icons

Roland

Harald Oehlmann

unread,
Jul 29, 2021, 4:07:21 AM7/29/21
to
Ah, great, thank you !
Yes, definitively. But it may also be good to transform the symbols to
svg. I may do that also for the main distribution of Tk 8.7, as svg is
supported there.

Thanks again,
Harald

Christian Werner

unread,
Jul 29, 2021, 4:22:01 AM7/29/21
to
And please post your patches in tickets on www.androwish.org which the will be integrated ASAP.

All the best,
Christian

Harald Oehlmann

unread,
Jul 29, 2021, 4:30:59 AM7/29/21
to
Yes, I can underline that. Roland, you have some comments in your code
"do this, otherwise crash etc". You may report all your findings to
Christian. It often takes hours for fixing it.

Thank you all,
Harald

Harald Oehlmann

unread,
Jul 30, 2021, 5:35:08 AM7/30/21
to
Am 29.07.2021 um 09:55 schrieb fr:
> option add *Dialog.msg.wrapLength [expr {int(0.8*$w)}]

Dear Roland,

The option line already cures the main problem, that the message box is
off screen.

I am initializing with:

wm attributes . -fullscreen 1
# Without update, the message box will be behind.
update
# Set message box size to fit on screen
option add *Dialog.msg.wrapLength [expr {int(0.6*[winfo screenwidth .])}]

That is already a great solution !

IMHO, something like that should go to AndroWish, but sensitive on
change on screen orientation.

Unfortunately, www.androwish.org is down for me, so I did not find
additional information for screen rotation detection etc.
Will come in future.

Thank you,
Harald

Harald Oehlmann

unread,
Jul 30, 2021, 5:45:17 AM7/30/21
to
Am 29.07.2021 um 09:55 schrieb fr:
> Concerning layout issues and fontsize adaption the basic ideas are to be found here:
> https://wiki.tcl-lang.org/page/label+text+wrapped+and+aligned+vertically
> https://wiki.tcl-lang.org/page/Resizing+fonts+on+window+resize?R=0

Here, I am mostly using the tablelist Widget with its wrapping
possibilities.
I suppose, you are aware of my presentations at ETCL to use pinch to
zoom gesture to change the font size.
I changed this a little bit (compared to the presentation), to only be
active on the tablelist widget and leave the Button Icons alone. The
Button Icons are fixed to 1 cm in height now.

I will attend the next Munich TCL user group meeting next Wednsday. Will
you also attend?

Thank you for the great ideas and discussion,
Harald

fr

unread,
Aug 13, 2021, 10:50:38 AM8/13/21
to
On Friday, July 30, 2021 at 11:45:17 AM UTC+2, Harald Oehlmann wrote:
> Am 29.07.2021 um 09:55 schrieb fr:
> > Concerning layout issues and fontsize adaption the basic ideas are to be found here:
> > https://wiki.tcl-lang.org/page/label+text+wrapped+and+aligned+vertically
> > https://wiki.tcl-lang.org/page/Resizing+fonts+on+window+resize?R=0
> Here, I am mostly using the tablelist Widget with its wrapping
> possibilities.
> I suppose, you are aware of my presentations at ETCL to use pinch to
> zoom gesture to change the font size.
I watched your presentation EuroTcl 2019-06.
> I changed this a little bit (compared to the presentation), to only be
> active on the tablelist widget and leave the Button Icons alone. The
> Button Icons are fixed to 1 cm in height now.
It is amazing how adaptable tablelist widget is. I used it an early prototype of
taipudex method http://wiki-tcl-lang.org/taipudex+lookup too.
This taipudex thing implements a virtual keyboard and uses automatic font resizing.
tksvg will certainly be integrated too.
>
> I will attend the next Munich TCL user group meeting next Wednsday. Will
> you also attend?
I plan to be there.
>
> Thank you for the great ideas and discussion,
> Harald
Roland

Harald Oehlmann

unread,
Aug 16, 2021, 2:35:03 AM8/16/21
to

Am 13.08.2021 um 16:50 schrieb fr:
>> I will attend the next Munich TCL user group meeting next Wednsday. Will
>> you also attend?
> I plan to be there.

Sorry, I just forgot it. Next is in September...
Harald
0 new messages