help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (jhandles installs.... then error) Implementation of "uicontrol" for


From: Pen-Yuan Hsing
Subject: Re: (jhandles installs.... then error) Implementation of "uicontrol" for latest Octave?
Date: Tue, 24 Aug 2010 14:04:26 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.4) Gecko/20100608 Lightning/1.0b2 Thunderbird/3.1

On 2010/08/24 13:38, Martin Helm wrote:
Am Dienstag, 24. August 2010, 18:55:02 schrieb Pen-Yuan Hsing:
% mosaic_GUI
% GUI created by VLF to implement Hanu's photo-mosaic software....

clear all;close all;

% Position the GUI in the middle of the screen
screenUnits=get(0,'Units');
set(0,'Units','pixels');
screenSize=get(0,'ScreenSize');
set(0,'Units',screenUnits);
mgui.figWidth=0.2*screenSize(3);
mgui.figHeight=0.4.*screenSize(4);
mgui.figPos=[0.01.*screenSize(3) 0.05.*screenSize(4)  ...
      mgui.figWidth                    mgui.figHeight];
figH_struct.hFig=figure('IntegerHandle','off','MenuBar','none',...

'NumberTitle','off','Units','pixels','Position',mgui.figPos,'Name','Mosaic
Controls');
num_buttons=3;

callback_str = sprintf('main');
make_push_command('SELECT&  MATCH FEATURES', 1, num_buttons,callback_str );

%figures to close: figH_struct.imFig  figH_struct.figdeet

callback_str = sprintf('render_mosaic');
make_push_command('MAKE MOSAIC', 2, num_buttons,callback_str );

callback_str = sprintf('close all;clear all');
make_push_command('CLOSE', 3, num_buttons,callback_str );


What I can quickly tell but there are possibly more things like that is that
some properties do not exist which are used in that script.

So systematically:
'units' is not implemeted in jhandles so you cannot use it (in your case this
is no problem, since you use anyway picxels as units).

So remove or comment the lines
screenUnits=get(0,'Units');
set(0,'Units','pixels');
The line
screenSize=get(0,'ScreenSize');

needs to be replaced by
screenSize=get(0,'MonitorPositions');

you can check which properties are avilable in this case by simply typing
get(0) and look what it outputs.

In
figH_struct.hFig=figure('IntegerHandle','off','MenuBar','none',...
'NumberTitle','off','Units','pixels','Position',mgui.figPos,'Name','Mosaic
Controls');

you need to remove again the 'units', 'pixels' and the 'MenuBar', 'none' (this
simply do not exist in octave now, probably in future versions).

Resulting in

      figH_struct.hFig=figure('IntegerHandle','off', ...
      'NumberTitle','off', 'Position',mgui.figPos,'Name','Mosaic Controls');


You proceed step by step this way trying to eliminate one incompatibility
after the other (there is of course still no guarantee that all this works at
the end as you want it or works at all).

Your original code may then look similar to this

% mosaic_GUI
% GUI created by VLF to implement Hanu's photo-mosaic software....

clear all;close all;

% Position the GUI in the middle of the screen
%screenUnits=get(0,'Units');
%set(0,'Units','pixels');
screenSize=get(0,'MonitorPositions');
%set(0,'Units',screenUnits);
mgui.figWidth=0.2*screenSize(3);
mgui.figHeight=0.4.*screenSize(4);
mgui.figPos=[0.01.*screenSize(3) 0.05.*screenSize(4)  ...
      mgui.figWidth                    mgui.figHeight];
      figH_struct.hFig=figure('IntegerHandle','off', ...
      'NumberTitle','off', 'Position',mgui.figPos,'Name','Mosaic Controls');
      num_buttons=3;

      callback_str = sprintf('main');
      make_push_command('SELECT&  MATCH FEATURES', 1, num_buttons,callback_str
);

      %figures to close: figH_struct.imFig  figH_struct.figdeet

      callback_str = sprintf('render_mosaic');
      make_push_command('MAKE MOSAIC', 2, num_buttons,callback_str );

      callback_str = sprintf('close all;clear all');
      make_push_command('CLOSE', 3, num_buttons,callback_str );


Be warned this is untested.
Hope that helps.

- mh

OK. I am proceeding as you suggested, and there are quite a few incompatibilities...

Since I don't want to make you go through the code with/for me, as I already took way too much of your time, is there documentation/reference for jhandles somewhere? Ideally, perhaps some sort of guide on what Matlab UI features are implemented in jhandles and Octave and what are not. This way maybe I can change my code to match jhandles' capabilities as best as possible.

Thanks!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]