Re: [hatari-devel] Python UI questions

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On lauantai 26 toukokuu 2012, Matthias Arndt wrote:
> a) Which Hatari configuration file is actually used at start of the
> Python UI?

User's default Hatari config (~/.hatari/hatari.cfg).

If there isn't one, UI notifies user and then asks hatari to
save one and restarts it.  This should happen only on first
startup.


> I normally have seperate configurations, stored in different files.
> Is there a simple way to access or select them.

Select the "load config..." option from "Configuration" menu.


> b) What is the problem with starting in fullscreen?
> That should be the default ;)

Programs should NOT start in fullscreen by default, as newbie
users don't necessarily know how to turn it off.

User can select it later and save that setting if s/he so wants to.
(User then assumably knows also how to get out of fullscreen.)

But I wouldn't recommend that in general because of how SDL fullscreen
mode is implemented and because of what is needed for window embedding.
I don't remember exact details, but most likely then getting out of
fullscreen mode and getting Hatari window embedded won't work.

And anyway, if you want to run Hatari in fullscreen, what use
there's for the UI around it? :-)


> c) Is it possible to rearrange the control icons in windowed mode? I
> think it would be more natural to have them at the top like Winston or
> STEEM do.

Sure, Hatari UI is fully configurable in this respect.

Just make a copy of "hatariui" script and change the options
to whatever you like.  Only thing that script does is giving
suitable options for hatariui.py.

This is what the script runs by default:
  hatarui.py --right "about,|,run,pause,forward,|,reset,|,quit" --embed 

But you can specify whatever shortcut buttons you want, on any side of
the Hatari window.  To get them on top, change "--right" to "--top".

If you set Hatari to start in fullscreen mode, I'd recommed leaving
the --embed option out.  Then the UI menu and button panels are in
a window of their own instead of around embedd Hatari window.  


An extreme example of hatariui.py options use is at the end of the script:
-------
$path/$name.py --embed \                                                                                                                                             
--top "about,|,run,pause,|,reset,debug,|,quit" \                                                                                                                     
--left "run,pause,reset,machine,about" \                                                                                                                             
--panel 
"Keys,F1=59,F2=60,F3=61,F4=62,F5=63,F6=64,F7=65,F8=66,F9=67,F10=68,>,Macro=Test,Undo=97,Help=98,Enter=114,>,close" 
\                                         
--panel "Misc,|,forward,full,|,sound,>,shot,>,close" \                                                                                                               
--bottom "forward,full,Misc,Keys,input,display,debug,trace" \                                                                                                        
--right "forward,full,Misc,Keys,input,display,Help=98" \                                                                                                             
$* 
-------
Which embeds Hatari window, specifies two popup panels called
"Keys" & "Misc" and adds buttonbars on every side of Hatari
window, of which few have buttons for these extra panels.

If you have some text macros that you use often, just setup
a panel for them.


> d) How GTK specific is the UI part with Python?

UI programs are mostly UI code...

Of the nearly 4 thousand lines of Python in Hatari UI:
$ wc *.py
   270    999  10116 config.py
   180    363   5108 conftypes.py
   563   1622  19461 debugui.py
   936   2355  32444 dialogs.py
   813   2680  29535 hatari.py
   763   2617  29698 hatariui.py
   416   1439  14153 uihelpers.py
  3973  12250 141655 total

Only config.py, conftypes.py and hatari.py are NOT
UI related.   I.e. rest, about ~70% is Gtk specific.


> Could it be possible to port this UI to Windows?

There are certainly Python & Gtk programs for Windows.

As Hatari UI doesn't add its own Python extensions, having
Python+Gtk+PyGtk installed on Windows should be enough
to run Hatari UI:
	http://www.pygtk.org/downloads.html

HOWEVER:
* Hatari control socket is a normal Unix socket, something
  that works on Linux, BSD and Apple OSX
* Hatari currently supports embedding of its window only with X11.

I.e. to have Hatari UI control of Hatari and Hatari window embedding
working also on Windows, some Windows developer would need to contribute
support for those to Hatari first.

It may needs couple of extra code lines in Hatari UI side also.


> (Not for myself but for the tons of Windows users who
> constantly complain that Hatari has no "nice" GUI on Windows.)

They should then do something about that then.
Starting from trying Hatari UI with Gtk+Python+PyGtk.

(As Hatari developers except maybe for Nicolas, don't
have or use Windows.)


> Otherwise I'm very impressed with the advances and new features of the
> UI. E.q. last time I tried the UI it had no the GUI debugger window.

Actually, the debugger was one of the first features in Hatari UI.
It's been there since Hatari UI v0.6, which was included with
Hatari v1.3 in 2009.


	- Eero

PS. In case you're interested what the UI looked earlier, here
are some screenshots from 2008 & 2009:
	http://koti.mbnet.fi/tammat/hatari/hatari-ui.shtml#Screenshots
:-)



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/